wasm: report the generic context to the GC stack walk#130000
Conversation
Spill the generic context to its GC slot in the prolog, and populate the frame pointer in TransitionFrame::UpdateRegDisplay so the stack walk can locate it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@davidwrighton PTAL Fixes a few more Pri-1 test failures. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR updates CoreCLR’s WASM stack-walking/GC reporting path so the generic context (“rgctx generics context arg” / sometimes this) can be found reliably during GC stack walks by (1) spilling it into the dedicated GC-reportable frame slot in the prolog and (2) ensuring the regdisplay has enough frame information to locate FP-based frame slots.
Changes:
- Add a WASM-specific
CodeGen::genReportGenericContextArgimplementation to spill the generic context intolvaCachedGenericContextArgOffset()during prolog generation. - Enable
genReportGenericContextArgduring prolog generation on WASM by removing the previousTARGET_WASMexclusion in the shared prolog code. - Populate
InterpreterFPinTransitionFrame::UpdateRegDisplay_Implby recovering it from the stack pointer.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/vm/wasm/helpers.cpp | Sets InterpreterFP in TransitionFrame::UpdateRegDisplay_Impl using GetWasmFramePointerFromStackPointer, so FP-based GC slots can be located during stack walks. |
| src/coreclr/jit/codegenwasm.cpp | Implements CodeGen::genReportGenericContextArg for WASM to spill the generic context into its GC-reportable frame slot in the prolog. |
| src/coreclr/jit/codegencommon.cpp | Calls genReportGenericContextArg unconditionally (including WASM) during prolog generation. |
davidwrighton
left a comment
There was a problem hiding this comment.
This needs more VM side work/testing, and various mixed interpreter/not interpreter scenarios.
The TransitionFrame fp fix will go in a separate change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@davidwrighton revised to just jit changes now |
Spill the generic context to its GC slot in the prolog, and populate the frame pointer in TransitionFrame::UpdateRegDisplay so the stack walk can locate it.