Skip to content

m3core runtime: describe what ex_frame and ex_stack actually are - #1354

Merged
hosking merged 1 commit into
masterfrom
ex-schemes-doc
Nov 23, 2026
Merged

hosking merged 1 commit into
masterfrom
ex-schemes-doc

Conversation

@hosking

@hosking hosking commented Nov 23, 2026

Copy link
Copy Markdown
Member

Comments only. As promised in #1311: Rodney pointed out that the names ex_frame and ex_stack say little, since both schemes have frames, a stack and a walker. This describes each one at the top of m3-libs/m3core/src/runtime/m3makefile, where the choice between them is made:

  • ex_frame:
    • where its frames live (locals in the activation record, linked in a per-thread list);
    • which constructs push them (TRY EXCEPT, TRY FINALLY, LOCK, and a procedure with a restrictive RAISES clause);
    • how RTExFrame.Raise walks them in two passes;
    • what it costs.
  • ex_stack:
    • C++ try/catch or invoke/landingpad, with compiler-generated unwind tables;
    • RAISE as a C++ throw, walked by the C++ runtime's unwinder over the ordinary stack;
    • RTExStack deciding matches at each landing pad;
    • what it costs.

The older notes further down the file, which covered some of the same ground, are folded in. Jay's point that 32-bit Windows C++ EH is itself frame-based is kept. The file's existing mixed CRLF/LF line endings are left as they were.

🤖 Generated with Claude Code

The names say little (both have frames, a stack and a walker), as
Rodney pointed out in discussion #1311.  Describe each scheme where the
choice between them is made: where the frames live, which constructs
push them, how a raise walks them, what ex_stack hands to the C++
unwinder, and what each costs.  Fold in the older notes further down
the file.  Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hosking
hosking merged commit 10dd9f5 into master Nov 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant