Skip to content

Conversation

@AndyAyersMS
Copy link
Member

In such cases we won't have set up a stack pointer.

In such cases we won't have set up a stack pointer.
Copilot AI review requested due to automatic review settings January 24, 2026 00:26
@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 Jan 24, 2026
@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the WASM JIT codegen to avoid homing parameters when no locals or arguments require stack-based storage, i.e., when no stack pointer register has been set up.

Changes:

  • Add a guard in CodeGen::genHomeRegisterParams that checks GetStackPointerReg() and skips parameter homing when it is REG_NA.
  • Assert that the frame pointer is not used in this frameless case and emit a JITDUMP message for debugging.

@AndyAyersMS
Copy link
Member Author

@dotnet/jit-contrib PTAL
@SingleAccretion let me know if you think we should handle this some other way.

Fixes codegen for methods with no (user) arguments, like

    public static int Zero() => 0;

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.

2 participants