You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid Wasm unwindable-frame identity for call-free funclets #134597
CoreCLR's Wasm JIT stores each unwindable frame's function identity in the shadow-stack frame. Funclets that make no calls currently receive the same identity prolog even though they cannot have a callee that needs to walk through that frame.
In a recent retail System.Private.CoreLib.wasm measurement, 162 call-free funclets had this prolog. The function-index immediate also prevents otherwise identical funclet bodies from being folded: 58 funclets formed 21 identical groups after normalizing only that immediate.
Proposed change
Teach the JIT to omit unwindable-frame identity for funclets that make no calls, while retaining it for:
Root functions.
Funclets containing direct or indirect calls.
Any funclet for which GC, EH, resume, or stack-walking behavior requires the identity.
The decision should use JIT IR/control-flow information rather than scanning emitted Wasm bytes.
Validation
Build CoreCLR browser/Wasm in Release.
Verify leaf funclets omit the tableBase + functionIndex store.
Verify calling funclets and root methods retain it.
Run focused Wasm startup/tests and compare CoreLib Code-section size.
Problem
CoreCLR's Wasm JIT stores each unwindable frame's function identity in the shadow-stack frame. Funclets that make no calls currently receive the same identity prolog even though they cannot have a callee that needs to walk through that frame.
In a recent retail
System.Private.CoreLib.wasmmeasurement, 162 call-free funclets had this prolog. The function-index immediate also prevents otherwise identical funclet bodies from being folded: 58 funclets formed 21 identical groups after normalizing only that immediate.Proposed change
Teach the JIT to omit unwindable-frame identity for funclets that make no calls, while retaining it for:
The decision should use JIT IR/control-flow information rather than scanning emitted Wasm bytes.
Validation
tableBase + functionIndexstore.Note
This issue was generated with GitHub Copilot.