Repository navigation
Bring x86, ARM and WASM EH helpers to x64/arm64 plan - #137256
Conversation
|
Azure Pipelines: Successfully started running 6 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
cc @jkotas |
|
Tagging subscribers to this area: @agocke |
With this change, all architectures call funclets through CallEHFunclet and CallEHFilterFunclet, and the architecture conditions around the funclet helpers are removed. - ARM: funclets now save only LR. CallEHFunclet and CallEHFilterFunclet live in runtime/arm/EHHelpers.S and are shared by CoreCLR and NativeAOT. They save r4-r11, lr and d8-d15 with an SP based frame, since r7 and r11 are set to the parent's values before calling the funclet. - x86: funclets already did not save any registers, so only the helpers change. They live in runtime/i386/EHHelpers.asm and are shared by CoreCLR and NativeAOT. CoreCLR calls them with __fastcall and NativeAOT with the managed calling convention, which passes the stack arguments in reverse order, so the stack argument offsets come from the per-runtime AsmMacros_Shared.inc. - WASM: NativeAOT implements CallEHFunclet, CallEHFilterFunclet and RhpResumeAfterCatch on top of the existing funclet call bridges, and CoreCLR implements CallEHFunclet and CallEHFilterFunclet over its bridges, which removes the WASM specific path in EECodeManager::CallFunclet. - NativeAOT pops the ExInfos in arch-neutral code and resumes after a catch through RhpResumeAfterCatch on all architectures. Contributes to dotnet#114893 Co-authored-by: Cursor <[email protected]>
6f4ff93 to
dfa8705
Compare
Anything left in that issue after this gets merged? |
There was a problem hiding this comment.
🔵 Needs a closer look
Coupled funclet ABI, unwind-layout, and GC-sensitive catch-resumption changes require ARM, x86, and WASM EH/GC-stress validation across CoreCLR and NativeAOT that this static-only review could not perform.
No open issues 🎉
What changed in this PR
This PR aligns x86, ARM, and WASM exception-handling funclet calls with the shared helper model used by x64 and ARM64. It contributes to #114893 by simplifying ARM funclet frames and consolidating runtime-specific helper code.
Changes:
- Share x86 and ARM funclet invocation helpers between CoreCLR and NativeAOT, and adapt WASM bridges to the same interface.
- Move ARM callee-saved register preservation into runtime helpers, simplifying JIT-generated funclet prologs and epilogs.
- Unify NativeAOT exception-record cleanup and catch resumption, updating stack unwinding and build integration.
| File | Description |
|---|---|
src/coreclr/vm/wasm/helpers.cpp |
Wraps WASM bridges in common funclet helpers. |
src/coreclr/vm/i386/ehhelpers.asm |
Removes superseded CoreCLR-only x86 helpers. |
src/coreclr/vm/i386/AsmMacros_Shared.inc |
Defines CoreCLR x86 argument offsets and register loads. |
src/coreclr/vm/eetwain.cpp |
Uses common funclet calls across architectures. |
src/coreclr/vm/CMakeLists.txt |
Includes shared x86 and ARM helpers. |
src/coreclr/vm/arm/ehhelpers.S |
Removes migrated ARM funclet helpers. |
src/coreclr/vm/arm/AsmMacros_Shared.h |
Adds ARM register loads from CoreCLR contexts. |
src/coreclr/vm/arm/asmconstants.h |
Defines and validates the floating-point context offset. |
src/coreclr/runtime/i386/EHHelpers.asm |
Adds shared x86 funclet invocation helpers. |
src/coreclr/runtime/arm/EHHelpers.S |
Adds shared ARM helpers with register preservation. |
src/coreclr/nativeaot/Runtime/wasm/ExceptionHandling.cpp |
Adopts common helpers and separate catch resumption. |
src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp |
Updates helper recognition and x86/ARM frame unwinding. |
src/coreclr/nativeaot/Runtime/i386/ExceptionHandling.asm |
Replaces x86 invocation helpers with catch resumption. |
src/coreclr/nativeaot/Runtime/i386/AsmMacros_Shared.inc |
Adds NativeAOT x86 argument offsets and register access. |
src/coreclr/nativeaot/Runtime/CMakeLists.txt |
Extends shared helper inclusion to x86 and ARM. |
src/coreclr/nativeaot/Runtime/arm/ExceptionHandling.S |
Replaces ARM invocation helpers with catch resumption. |
src/coreclr/nativeaot/Runtime/arm/AsmMacros_Shared.h |
Adds ARM register-display load and store macros. |
src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InternalCalls.cs |
Unifies managed helper declarations across architectures. |
src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs |
Unifies funclet dispatch, exception cleanup, and resumption. |
src/coreclr/jit/codegenarm.cpp |
Simplifies ARM funclet frames, prologs, and epilogs. |
src/coreclr/jit/codegen.h |
Shares the funclet frame descriptor with ARM. |
Review effort: Balanced
|
Nothing left: both ARM64 items went away with #137168, and this PR removes the remaining PSPSym padding from the ARM32 funclet frame, so I changed it to "Fixes". |
Co-authored-by: Cursor <[email protected]>
|
/ba-g filled #137423 on the test failure |
With this change, all architectures call funclets through CallEHFunclet and CallEHFilterFunclet, and
the architecture conditions around the funclet helpers are removed.
runtime/arm/EHHelpers.S and are shared by CoreCLR and NativeAOT. They save r4-r11, lr and d8-d15
with an SP based frame, since r7 and r11 are set to the parent's values before calling the funclet.
runtime/i386/EHHelpers.asm and are shared by CoreCLR and NativeAOT. CoreCLR calls them with
__fastcall and NativeAOT with the managed calling convention, which passes the stack arguments in
reverse order, so the stack argument offsets come from the per-runtime AsmMacros_Shared.inc.
the existing funclet call bridges, and CoreCLR implements CallEHFunclet and CallEHFilterFunclet
over its bridges, which removes the WASM specific path in EECodeManager::CallFunclet.
RhpResumeAfterCatch on all architectures.
Fixes #114893