Skip to content

[Wasm RyuJIT] Implement SP/FP delta computation - #132236

Open
adamperlin wants to merge 2 commits into
dotnet:mainfrom
adamperlin:adamperlin/wasm-sp-fp-delta
Open

[Wasm RyuJIT] Implement SP/FP delta computation#132236
adamperlin wants to merge 2 commits into
dotnet:mainfrom
adamperlin:adamperlin/wasm-sp-fp-delta

Conversation

@adamperlin

Copy link
Copy Markdown
Contributor

These are currently unused but fairly simple to implement on Wasm to get rid of the NYIs.

Copilot AI lite review requested due to automatic review settings August 12, 2026 22:19
@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 Aug 12, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 6 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Implements Wasm RyuJIT stack-pointer/frame-pointer delta helpers to replace prior NYI stubs, enabling callers that compute frame-relative offsets (e.g., for unwind/stack layout logic) to function without hitting Wasm-specific NYIs.

Changes:

  • Implemented CodeGenInterface::genCallerSPtoInitialSPdelta() for Wasm based on the fixed linear-memory frame size.
  • Implemented CodeGenInterface::genCallerSPtoFPdelta() for Wasm using existing delta relationships and added basic sign assertions.
  • Removed NYI_WASM(...) stubs for the above helpers and for genSPtoFPdelta() (kept as 0 per Wasm frame model).
Suppressed comments (1)

src/coreclr/jit/codegenwasm.cpp:4495

  • Local variable name callerSPToInitialSPDelta is inconsistent with the established callerSPtoInitialSPdelta naming used across other backends. Renaming improves consistency and makes grepping/comparison across targets easier.
    int callerSPToInitialSPDelta = -genTotalFrameSize();
    assert(callerSPToInitialSPDelta <= 0);
    return callerSPToInitialSPDelta;

Comment thread src/coreclr/jit/codegenwasm.cpp Outdated
Copilot AI review requested due to automatic review settings August 13, 2026 00:13
@adamperlin
adamperlin force-pushed the adamperlin/wasm-sp-fp-delta branch from 1f4b7e0 to 9d7ac0f Compare August 13, 2026 00:13

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Align local variable naming and expression ordering with the other codegen backends.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3012b73e-652d-434c-9490-80cac47167fa
Copilot AI review requested due to automatic review settings August 13, 2026 17:45
@adamperlin
adamperlin marked this pull request as ready for review August 13, 2026 17:51
@adamperlin adamperlin added the arch-wasm WebAssembly architecture label Aug 13, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 6 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@adamperlin
adamperlin requested a review from AndyAyersMS August 13, 2026 17:51
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@AndyAyersMS AndyAyersMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We shouldn't be calling these so does it make sense to implement them?

@adamperlin

Copy link
Copy Markdown
Contributor Author

We shouldn't be calling these so does it make sense to implement them?

If we don't think we'll ever need them, can we mark them as unreached?

@AndyAyersMS

Copy link
Copy Markdown
Member

We shouldn't be calling these so does it make sense to implement them?

If we don't think we'll ever need them, can we mark them as unreached?

I think so, yes. Just make sure the compiler is ok with it.

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

Labels

arch-wasm WebAssembly architecture 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