Remove IsCallerSPValid, standardize caller-frame validity on IsCallerContextValid, and finalize ARM AsmOffsets updates#128873
Conversation
Co-authored-by: davidwrighton <10779849+davidwrighton@users.noreply.github.com>
IsCallerSPValid and standardize caller-frame validity on IsCallerContextValid
|
Tagging subscribers to this area: @agocke |
|
@copilot, in the build there are a lot of errors that look like |
Co-authored-by: davidwrighton <10779849+davidwrighton@users.noreply.github.com>
Fixed in 87ea2d9 by updating I updated the Validated with:
|
IsCallerSPValid and standardize caller-frame validity on IsCallerContextValidIsCallerSPValid, standardize caller-frame validity on IsCallerContextValid, and update AsmOffsets
|
@copilot arm builds are still failing with errors like |
Co-authored-by: davidwrighton <10779849+davidwrighton@users.noreply.github.com>
Fixed in I corrected the ARM Release
Validation run:
|
IsCallerSPValid, standardize caller-frame validity on IsCallerContextValid, and update AsmOffsetsIsCallerSPValid, standardize caller-frame validity on IsCallerContextValid, and finalize AsmOffsets updates
|
arm builds are still failing: |
|
@copilot Fix build break above |
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Fixed in I fixed the remaining ARM Checked build break by correcting
Validated with:
|
IsCallerSPValid, standardize caller-frame validity on IsCallerContextValid, and finalize AsmOffsets updatesIsCallerSPValid, standardize caller-frame validity on IsCallerContextValid, and finalize ARM AsmOffsets updates
There was a problem hiding this comment.
Pull request overview
This PR removes the legacy REGDISPLAY_BASE::IsCallerSPValid flag and standardizes all “caller frame validity” checks and invariants on IsCallerContextValid. It also updates the managed AsmOffsets constants for 32-bit targets so the managed/native REGDISPLAY size/offset static asserts continue to match after the layout change.
Changes:
- Removed
IsCallerSPValidfromREGDISPLAY_BASEand deleted remaining writes to it across VM and debugger frame unwind/update sites. - Tightened assertions / preconditions that previously accepted either SP-valid or context-valid to require
IsCallerContextValid. - Updated
System.Private.CoreLibAsmOffsets.csconstants for ARM/X86/WASM (Debug + Release) to reflect the new nativeREGDISPLAYlayout.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/wasm/helpers.cpp | Drops IsCallerSPValid invalidation during wasm inlined call frame regdisplay updates. |
| src/coreclr/vm/stackwalk.cpp | Drops IsCallerSPValid invalidation after virtual unwind; caller validity now tracked solely via context validity. |
| src/coreclr/vm/riscv64/stubs.cpp | Removes IsCallerSPValid clearing in multiple frame UpdateRegDisplay_Impl implementations. |
| src/coreclr/vm/loongarch64/stubs.cpp | Removes IsCallerSPValid clearing in multiple frame UpdateRegDisplay_Impl implementations. |
| src/coreclr/vm/i386/cgenx86.cpp | Removes IsCallerSPValid clearing in x86 frame UpdateRegDisplay* paths. |
| src/coreclr/vm/exceptionhandling.cpp | Updates a precondition to require IsCallerContextValid (no longer allows SP-only validity). |
| src/coreclr/vm/excep.cpp | Removes IsCallerSPValid clearing in SoftwareExceptionFrame::UpdateRegDisplay_Impl. |
| src/coreclr/vm/eetwain.cpp | Switches GetCallerSp to validate via IsCallerContextValid and removes IsCallerSPValid clearing in unwind paths. |
| src/coreclr/vm/arm64/stubs.cpp | Removes IsCallerSPValid clearing in ARM64 frame UpdateRegDisplay_Impl implementations. |
| src/coreclr/vm/arm/stubs.cpp | Removes IsCallerSPValid clearing in ARM frame UpdateRegDisplay_Impl implementations. |
| src/coreclr/vm/amd64/cgenamd64.cpp | Removes IsCallerSPValid clearing in AMD64 frame UpdateRegDisplay_Impl implementations. |
| src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/AsmOffsets.cs | Updates 32-bit target REGDISPLAY size/offset constants (Debug + Release) to match the new native struct layout. |
| src/coreclr/inc/stackframe.h | Tightens CallerStackFrame::FromRegDisplay assertion to require IsCallerContextValid. |
| src/coreclr/inc/regdisp.h | Removes the IsCallerSPValid field and deletes corresponding assignments in FillRegDisplay. |
| src/coreclr/debug/ee/debugger.cpp | Removes IsCallerSPValid clearing in FuncEvalFrame::UpdateRegDisplay_Impl across architectures. |
IsCallerSPValidwas a legacy EH-era flag that could drift fromIsCallerContextValidsemantics. This change removes the legacy flag and makes caller-frame validity uniformly context-based, with explicit callouts for spots that previously tolerated divergence.