Skip to content

[RyuJIT] Always insert r2r indirection cell at the end of the args list#125670

Draft
kg wants to merge 2 commits intodotnet:mainfrom
kg:wasm-callsigs-3-alternate
Draft

[RyuJIT] Always insert r2r indirection cell at the end of the args list#125670
kg wants to merge 2 commits intodotnet:mainfrom
kg:wasm-callsigs-3-alternate

Conversation

@kg
Copy link
Member

@kg kg commented Mar 17, 2026

#125669 but universal. Wasm needs the indirection cell at the end of the arguments list, and on other arches it shouldn't matter where we put it. Opening draft PR to generate diffs on CI.

@kg kg added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 17, 2026
Copilot AI review requested due to automatic review settings March 17, 2026 19:25
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
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 CoreCLR JIT call argument construction so the ReadyToRun (R2R) indirection cell argument is always appended at the end of the call argument list. This ensures correct argument ordering for Wasm’s managed calling convention (portable entry point as the last argument) while remaining behavior-neutral on other targets where the indirection cell is passed via a dedicated register.

Changes:

  • Change R2R indirection cell insertion from InsertAfterThisOrFirst to PushBack so it becomes the last argument.
  • Clarify the FEATURE_READYTORUN preprocessor block end comment.

You can also share your feedback on Copilot code review. Take the survey.

@jakobbotsch
Copy link
Member

Diffs look good (positive even). But it seems LA64 and RISCV64 have some problem with this change. cc @dotnet/samsung @shushanhf, any idea why this would matter for RISCV64/LA64?

@shushanhf
Copy link
Contributor

Diffs look good (positive even). But it seems LA64 and RISCV64 have some problem with this change. cc @dotnet/samsung @shushanhf, any idea why this would matter for RISCV64/LA64?

OK, we will test it on LA64. Thanks!

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.

4 participants