Skip to content

Fix virtual vtable call lowering without fixed registers - #136203

Merged
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:fix-virtual-vtable-call-lowering
Oct 22, 2026
Merged

MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:fix-virtual-vtable-call-lowering

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Was running into Assertion failed 'thisArgNode->OperIs(GT_PUTARG_REG)' in 'StackTraces+TestLineNumbers:MethodWithMeta data()' during 'Lowering nodeinfo' (IL size 144; hash 0xc83021f1; MinOpts).

I assume ReadyToRun doesn't do virtual calls like this? Native AOT also only hits this on MinOpts.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 814af5e0-f67c-48c6-b408-8c375a899e57
@MichalStrehovsky
MichalStrehovsky requested review from adamperlin and a balanced review from Copilot October 21, 2026 06:24
@MichalStrehovsky MichalStrehovsky added arch-wasm WebAssembly architecture area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Oct 21, 2026
@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.

@azure-pipelines

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

@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.

🔵 Needs a closer look

The affected WebAssembly NativeAOT MinOpts path needs build and runtime validation, which was not performed here.

No open issues 🎉

What changed in this PR

Updates JIT virtual vtable call lowering to handle targets without fixed registers while preserving the existing fixed-register path.

Changes:

  • Retains the CallArg to access its argument node directly.
  • Selects the appropriate this pointer use for temporary-local replacement.
File Description
src/​coreclr/​jit/​lower.cpp Handles virtual-call arguments without requiring GT_PUTARG_REG on targets without fixed registers.

Review effort: Balanced

@adamperlin adamperlin 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.

This looks good to me. Yes, ReadyToRun doesn't do virtual calls like this and uses virtual stub dispatch at the moment, so it makes sense that we hadn't hit fixed this assert yet. I believe we'd only expect to see this in MinOpts on other targets too!

@MichalStrehovsky
MichalStrehovsky merged commit d588e30 into dotnet:main Oct 22, 2026
145 of 147 checks passed
@MichalStrehovsky
MichalStrehovsky deleted the fix-virtual-vtable-call-lowering branch October 22, 2026 21:48
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 23, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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