JIT: Unify to instParamLookup and improve GVM test coverage#126947
JIT: Unify to instParamLookup and improve GVM test coverage#126947hez2010 wants to merge 41 commits into
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
Refactors CoreCLR devirtualization metadata to use a unified instParamLookup and expands JIT test coverage for generic virtual method (GVM) scenarios to support follow-on GVM devirtualization work.
Changes:
- Add a new GVM-focused runtime lookup/delegate test to broaden devirtualization coverage.
- Replace
CORINFO_DEVIRTUALIZATION_INFOad-hoc flags withinstParamLookup, and update JIT devirtualization logic to consume it. - Update SuperPMI and the managed JitInterface type definitions/serialization to match the new
CORINFO_DEVIRTUALIZATION_INFOshape (plus bump the JIT/EE versioning GUID).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/JIT/Generics/VirtualMethods/generic_virtual_methods.cs | Adds additional GVM/runtime-lookup-related test coverage. |
| src/coreclr/vm/jitinterface.cpp | Initializes/produces instParamLookup for devirtualization results (replacing older flags). |
| src/coreclr/jit/importercalls.cpp | Plumbs instParamLookup through devirtualization + guarded devirtualization candidate tracking and inserts instantiation args when required. |
| src/coreclr/jit/morph.cpp | Simplifies lookup-tree helpers to take CORINFO_LOOKUP directly. |
| src/coreclr/jit/compiler.h | Updates declarations for the new lookup-tree helper signatures and GDV candidate plumbing. |
| src/coreclr/inc/corinfo.h | Updates CORINFO_DEVIRTUALIZATION_INFO to carry instParamLookup instead of legacy flags; documents “no lookup needed” sentinel. |
| src/coreclr/inc/jiteeversionguid.h | Bumps the JIT/EE version GUID for the interface change. |
| src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs | Mirrors the CORINFO_DEVIRTUALIZATION_INFO layout change in managed definitions. |
| src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs | Updates managed resolveVirtualMethod implementation to populate instParamLookup and method-context behavior. |
| src/coreclr/tools/superpmi/superpmi-shared/agnostic.h | Updates SuperPMI record structs to include instParamLookup. |
| src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp | Records/restores/dumps instParamLookup in SuperPMI method contexts. |
|
Test failure seems unrelated. |
|
Ping @jakobbotsch This is a refactor only change which is the prerequisites of the upcoming GVM devirt work, please take a look when you get some time. |
75dec5b to
4da609f
Compare
4da609f to
42d5011
Compare
|
Test failures seem unrelated? |
|
It seems there are diffs. Can you take a look at why? I was hoping this could be a zero diff change with all diffs coming as follow-ups. |
I think it's because this branch is a bit stale? We merged a devirtualization improvement several hours ago but didn't sync that to this branch yet. |
|
Previously we only check However, the original "array is inexact" guard was added to workaround a bug in #116771 (comment). But with this PR, we now have the correct instantiating stub in For comparison, for this tree previously we end up with and now we have We no longer have the issue on incorrect inst param now. So I would recommend removing this invalid guard. (already done in eaca574). But that's say, to keep this PR zero diff, we will need to introduce the |
aba164b to
d02eec1
Compare
|
Now it's zero diff as expected. |
Extracted from #123323. This PR is the first step in splitting the shared GVM devirtualization work.
It does two things:
CORINFO_DEVIRTUALIZATION_INFOwith a singleinstParamLookupContributes to #112596
/cc: @jakobbotsch