Skip to content

JIT: remove getUnboxedEntry and getInstantiatedEntry - #129285

Merged
jakobbotsch merged 6 commits into
dotnet:mainfrom
hez2010:unboxing-stub-cleanup
Jun 22, 2026
Merged

JIT: remove getUnboxedEntry and getInstantiatedEntry#129285
jakobbotsch merged 6 commits into
dotnet:mainfrom
hez2010:unboxing-stub-cleanup

Conversation

@hez2010

@hez2010hez2010 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Cleanup getUnboxedEntry and getInstantiatedEntry and all their usages to make sure we can handle shared generic devirtualization in a uniform manner in the future, once we start seeing combinations of runtime lookups and unboxing stubs.

cc: @jakobbotsch

CopilotAI review requested due to automatic review settings June 11, 2026 12:33
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 11, 2026
@dotnet-policy-servicedotnet-policy-serviceBot added the community-contribution Indicates that the PR has been added by a community member label Jun 11, 2026
@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.

CopilotAI 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

Note

Copilot was unable to run its full agentic suite in this review.

This PR removes the getUnboxedEntry / getInstantiatedEntry ICorJitInfo host APIs and instead plumbs unboxed-entry information through resolveVirtualMethod, updating the JIT, CoreCLR host, and SuperPMI tooling accordingly.

Changes:

  • Populate resolvedTokenDevirtualizedUnboxedMethod during devirtualization and update JIT call/unboxing logic to consume it.
  • Remove getUnboxedEntry and getInstantiatedEntry from the public JIT/EE interface and all generated wrappers/shims.
  • Update SuperPMI recording/replay infrastructure and bump the JIT/EE versioning GUID.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/coreclr/vm/jitinterface.cppSets unboxed-entry method handle on devirtualization result.
src/coreclr/inc/corinfo.hRemoves APIs and documents new unboxed resolved-token behavior.
src/coreclr/jit/importercalls.cppSwitches unboxed-entry transformation logic to use resolved token + signature inspection.
src/coreclr/jit/indirectcalltransformer.cppUses unboxed method handle from resolved token for GDV inline demotion logic.
src/coreclr/jit/inline.hRemoves separate unboxed-entry handle storage; relies on resolved token.
src/coreclr/inc/jiteeversionguid.hBumps interface GUID for breaking API change.
src/coreclr/tools/superpmi/**Removes the two API calls from interception/record/replay and related packet definitions.
src/coreclr/tools/aot/jitinterface/jitinterface_generated.hRemoves callbacks/wrapper methods for the deleted APIs.
src/coreclr/tools/Common/JitInterface/*Updates thunk generator inputs and managed interop to drop deleted APIs.

Comment threadsrc/coreclr/vm/jitinterface.cpp
Comment threadsrc/coreclr/jit/importercalls.cpp Outdated
Comment threadsrc/coreclr/tools/superpmi/superpmi-shared/methodcontext.h
@hez2010

Copy link
Copy Markdown
ContributorAuthor

@jakobbotsch CI seems passing, but I guess this will need a pri1 test run to exercise more coverages.

@hez2010

Copy link
Copy Markdown
ContributorAuthor

It seems that spmi gets skipped due to jit-ee interface changes. Trigger a MihuBot to check if it's zero diff.

@MihuBot

CopilotAI review requested due to automatic review settings June 13, 2026 04:06
@hez2010

Copy link
Copy Markdown
ContributorAuthor

@MihuBot

CopilotAI 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 23 out of 23 changed files in this pull request and generated 3 comments.

Comment threadsrc/coreclr/vm/jitinterface.cpp
Comment threadsrc/coreclr/tools/superpmi/superpmi-shared/methodcontext.h
Comment threadsrc/coreclr/tools/superpmi/superpmi-shared/methodcontext.h
@hez2010

Copy link
Copy Markdown
ContributorAuthor

Zero diff as expected.

@hez2010

Copy link
Copy Markdown
ContributorAuthor

Ping.

@jakobbotsch

jakobbotsch commented Jun 19, 2026

Copy link
Copy Markdown
Member

so that we no longer need a round-trip between the JIT and EE

I wouldn't say that is the motivation. The main motivation is to make sure we can handle shared generic devirtualization in a uniform manner in the future, once we start seeing combinations of runtime lookups and unboxing stubs.

In general we do not care that much for some extra JIT-EE queries, especially not when it is a result of some real optimization happening.

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

LGTM. Thanks!

@jakobbotsch

Copy link
Copy Markdown
Member

/azp run runtime-coreclr outerloop, runtime-coreclr crossgen2, runtime-coreclr crossgen2 outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@hez2010

Copy link
Copy Markdown
ContributorAuthor

so that we no longer need a round-trip between the JIT and EE

I wouldn't say that is the motivation. The main motivation is to make sure we can handle shared generic devirtualization in a uniform manner in the future, once we start seeing combinations of runtime lookups and unboxing stubs.

In general we do not care that much for some extra JIT-EE queries, especially not when it is a result of some real optimization happening.

I've updated the PR description to reflect it.

CopilotAI review requested due to automatic review settings June 19, 2026 15:40
@hez2010

hez2010 commented Jun 19, 2026

Copy link
Copy Markdown
ContributorAuthor

Updated the branch to unblock build. @jakobbotsch can you rerun the pri1 tests?

CopilotAI 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 23 out of 23 changed files in this pull request and generated no new comments.

@jakobbotsch

Copy link
Copy Markdown
Member

/azp run runtime-coreclr outerloop, runtime-coreclr crossgen2, runtime-coreclr crossgen2 outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@jakobbotsch

Copy link
Copy Markdown
Member

/azp run runtime-coreclr outerloop, runtime-coreclr crossgen2, runtime-coreclr crossgen2 outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@hez2010

Copy link
Copy Markdown
ContributorAuthor

All test failures seem to be known.

@jakobbotsch

Copy link
Copy Markdown
Member

Can you double check the failure in Test crossgen2-comparison build windows x64 Release for runtime-coreclr crossgen2 outerloop? It looks like running crossgen2 fails on an assembly:

2026-06-20T09:31:31.1171284Z [226:236]: D:\a\_work\1\s\artifacts\bin\crossgen2_inbuild\x64\Release\crossgen2.dll System.Windows.Extensions.dll return code=1 args'D:\a\_work\1\s\dotnet.cmd D:\a\_work\1\s\artifacts\bin\crossgen2_inbuild\x64\Release\crossgen2.dll -r "D:\a\_work\1\s\artifacts\tests\coreclr\windows.x64.Release\Tests\CrossCompileRoot\dlls\*.dll" -O --determinism-stress 6 --map --out D:\a\_work\1\s\artifacts\tests\coreclr\windows.x64.Release\Tests\CrossCompileRoot\log\System.Windows.Extensions.ni.dll --targetos windows --targetarch x64 D:\a\_work\1\s\artifacts\tests\coreclr\windows.x64.Release\Tests\CrossCompileRoot\dlls\System.Windows.Extensions.dll' stdout 'D:\a\_work\1\s\.dotnet

@hez2010

Copy link
Copy Markdown
ContributorAuthor

Can you double check the failure in Test crossgen2-comparison build windows x64 Release for runtime-coreclr crossgen2 outerloop? It looks like running crossgen2 fails on an assembly:

2026-06-20T09:31:31.1171284Z [226:236]: D:\a\_work\1\s\artifacts\bin\crossgen2_inbuild\x64\Release\crossgen2.dll System.Windows.Extensions.dll return code=1 args'D:\a\_work\1\s\dotnet.cmd D:\a\_work\1\s\artifacts\bin\crossgen2_inbuild\x64\Release\crossgen2.dll -r "D:\a\_work\1\s\artifacts\tests\coreclr\windows.x64.Release\Tests\CrossCompileRoot\dlls\*.dll" -O --determinism-stress 6 --map --out D:\a\_work\1\s\artifacts\tests\coreclr\windows.x64.Release\Tests\CrossCompileRoot\log\System.Windows.Extensions.ni.dll --targetos windows --targetarch x64 D:\a\_work\1\s\artifacts\tests\coreclr\windows.x64.Release\Tests\CrossCompileRoot\dlls\System.Windows.Extensions.dll' stdout 'D:\a\_work\1\s\.dotnet

I'm not able to reproduce this build failure in my local environment. I downloaded the artifacts produced by the CI and run crossgen2 with

-r D:\source\repos\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root\*.dll -O --determinism-stress 6 --map --out D:\source\repos\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root\log\System.Windows.Extensions.ni.dll --targetos windows --targetarch x64 D:\source\repos\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root\System.Windows.Extensions.dll

and it produced the assembly normally:

Emitting R2R PE file: D:\source\repos\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root\log\System.Windows.Extensions.ni.dll
Emitting map file: D:\source\repos\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root\log\System.Windows.Extensions.ni.map

It seems to be a CI lagging?

@jakobbotsch

Copy link
Copy Markdown
Member

I will rerun the job, I looked for a while but I could not find any failures similar to that one.

@jakobbotsch

Copy link
Copy Markdown
Member

That test succeeded in a rerun. The other failures are #126819 (crossgen2), #122345 (outerloop), #129046 (crossgen2 outerloop)

@jakobbotsch

Copy link
Copy Markdown
Member

/ba-g Failures are known or already fixed

@jakobbotsch
jakobbotsch merged commit 1a76761 into dotnet:mainJun 22, 2026
232 of 245 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 23, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
Cleanup `getUnboxedEntry` and `getInstantiatedEntry` and all their
usages to make sure we can handle shared generic devirtualization in a
uniform manner in the future, once we start seeing combinations of
runtime lookups and unboxing stubs.
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 24, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@hez2010@jakobbotsch