Repository navigation
Replies: 5 comments 5 replies
|
I see the point. 🤖 Generated with Claude Code |
|
Right. Thank you for agreeing and providing a reasonable "excuse". And then when I say "picking names is hard" what I'm really referring to is, is that the name ex_cxx is actually easy, but it is also concievable for LLVM and gcc backends to use the same approach, without necessarily any C++-ness to it. Maybe gnat uses it, maybe GNU Pascal uses it. I do think there might might might be room to add another form and name. Might. However, these are all probably the same thing, and the runtimes can coexist. The main problems are really:
If I can manage to write my own Github pipelines and/or bootstrap AMD64_NT from ex_frame to ex_stack, that'll shut me up. :) |
|
Agreed various runtime contortions are just avoiding a proper bootstrap...and in the fullness of time, bootstrapping has been done repeatedly, and somewhat convoluted runtimes mostly have not. Though dynamic dispatch is a tried and true method in general also. And, this idea of a less ideal BOOT mode, I am torn on anyway. So far BOOT modes are not actually really compromised. In gcc there is sometimes a sorta "boot" mode where they don't optimize (slightly buggy bootstrap tools). Or don't enable their "building with gcc" code paths (i.e. stick to standard C/C++ until gcc is available). |
|
On 11/22/26 16:47, Antony Hosking wrote:
I see the point. |ex_cxx| would describe it more accurately: it's C++ exception handling, and MSIR's LLVM lowering uses the same C++ personality routine. But the name is now in the m3core directory names, |M3_USE_STACK_WALKER|, the platform configs, the docs and the bootstrap trees. Renaming it means churn in every config, and a bootstrap round, for no change in behaviour. I'd rather leave the names alone and add a comment in |runtime/m3makefile| saying what each one actually is: ex_frame is a setjmp/longjmp chain of handler frames, and ex_stack is C++ table-driven unwinding. That gives most of the benefit for none of the cost.
I am happy for the naming to remain unchanged, but would like more description of the differences
in one appropriate place. Neither the names themselves nor the short descriptions I have seen in
the past have been much help to me. Both systems entail a stack, frames, and walker code, so
those terms don't help. As best I am able to infer without fine-toothed code vetting, I think
something like the following would be in order, if, in fact, it's actually accurate:
ex_frame uses a stack separate from the usual stack of activation records. Its frames relate only
to exception handling. They are maintained by Modula3 RTS procedures, invoked by compiler-inserted
calls at prolog and epilog locations. They incur runtime computation at every procedure entry and
exit, whether an exception gets raised or not. The walker is part of CM3RTS and executes to
properly carry out raises.
ex_stack uses a target-specific walker provided by its OS, that manages to do its work entirely
off the regular activation record stack. I guess the compiler has to insert something to support
this, but not with execution overhead when no exception propagates outside a procedure.
Do I have it right?
… 🤖 Generated with Claude Code <https://claude.com/claude-code>
—
Reply to this email directly, view it on GitHub <#1311?email_source=notifications&email_token=ABSVZNAE7RIZWYCN5KFY4PD52NUJ3A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOJYGIYDKNRYUZZGKYLTN5XKU43VMJZWG4TJMJSWJJLFOZSW45FMMZXW65DFOJPWG3DJMNVQ#discussioncomment-19820568>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABSVZNBNGTYEPPFC43RFFKD52NUJ3AVCNFSNUABGKJSXA33TNF2G64TZHM4TKOBTHE4DMO2ENFZWG5LTONUW63R3GEYTGNZUGA2TRILWAI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
|
My only small complaint, long version:
It is really just "C++ compiler does whatever it does. We don't need to know, or care much, but we care in that it usually works pretty well and efficiently". In particular, NT/x86 is slow in two ways. Some platforms use Setjmp/Longjmp. But either way, we get it out of our hands, and far more efficient on most systems, however they chose. We shouldn't state much about how C++ works, just that we are reusing it. "implementataion details". |
Uh oh!
There was an error while loading. Please reload this page.
I couldn't help having this terrible thought:
NT/x86 C++ and OS exception support, also uses a thread local linked list, but much more optimized than ex_frame.
VMS/VAX is probably similarly inefficient. I'd love to know. And Ultrix/MIPS?
You know, in the history of exception handling, the thread local linked list was invented and spread a while, before other forms came in.
So that made me think of names like ex_cxx, ex_libunwind.
GCC/LLVM native support would probably be called ex_libunwind.
Or just ignore this. ex_slow and ex_fast?
All reactions