Description
.NET 9 shipped with new exception handling, based on the NativeAOT model, and a NativeAOT runtime support for win-x86 platform. It left us in a position where CoreCLR on win-x86 is the only platform remaining that uses the non-funclet exception model, and also the only platform that didn't get the new exception handling. @jkotas did some initial work updating CoreCLR to use funclets and new exception handling on x86. Based on this initial work I updated the prototype in #113576 to successfully pass the CoreCLR Pri0 and Libraries tests.
The ultimate goal would be to remove all non-funclet code from JIT and VM in order to simplify the code base. It may be aligned with a removal of the legacy exception handling as a part of a huge cleanup. That will, however, require commitment from all the stakeholders and solid plan on how to make the feature reach the product.
Until such plan and commitment happens I propose to upstream the relevant changes from the prototype to the point that enabling it will be flipping a compile time switch.
I'll use this issue in the next couple of weeks to post observations based on the prototype.
Implementation check list (incomplete):
- Add win-x86 code paths for
FEATURE_EH_FUNCLET
builds to the runtime (Add support for building runtime with FEATURE_EH_FUNCLETS on win-x86 #114157) - Check whether we need to update exception handler registrations around
VSD_ResolveWorker
to mirrorThePreStub
(Ref: Add support for building runtime with FEATURE_EH_FUNCLETS on win-x86 #114157) - Investigate and document performance issues
- Fix diagnostic issues and possibly implement no-GC regions (New exception handling on win-x86 #113985 (comment))
- Fix setjmp/longjmp compatibility in new EH on x86
- Update documentation