Skip to content

JIT/wasm: keep EH frame slots at the bottom after frame alignment#129917

Open
AndyAyersMS wants to merge 1 commit into
dotnet:mainfrom
AndyAyersMS:wasm-eh-frame-slot-align
Open

JIT/wasm: keep EH frame slots at the bottom after frame alignment#129917
AndyAyersMS wants to merge 1 commit into
dotnet:mainfrom
AndyAyersMS:wasm-eh-frame-slot-align

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

#129815's alignment padding displaced the fixed-offset wasm EH slots and broke EH dispatch. Shift them down past the pad.

dotnet#129815's alignment padding displaced the fixed-offset wasm EH slots and
broke EH dispatch. Shift them down past the pad.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 27, 2026 00:20
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 27, 2026
@AndyAyersMS

Copy link
Copy Markdown
Member Author

@davidwrighton ptal
fyi @dotnet/wasm-contrib

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This change updates the WASM-specific frame-alignment logic in Compiler::lvaAlignFrame() to preserve the fixed-at-frame-bottom placement of the WASM EH-related frame slots even when alignment padding is added.

Changes:

  • Compute the WASM alignment padding (pad) without immediately mutating compLclFrameSize.
  • When padding is applied, shift the WASM EH slot locals (lvaWasmFunctionIndex, lvaWasmVirtualIP, lvaWasmResumeIP) down by pad so their effective final FP-relative offsets remain unchanged.
  • Keep the existing invariant that the resulting local frame size is STACK_ALIGN-aligned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants