-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Generate calls to interface methods through resolve helper #112406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
cb9785d
Generate calls to interface methods through resolve helper
MichalStrehovsky 6bdcdb1
Expand resolver during CFG expansion
jakobbotsch 7f879d6
Revert register constraint changes
jakobbotsch 6d45447
Nit
jakobbotsch 9d0a3bd
Revert "Revert register constraint changes"
MichalStrehovsky 2f0a285
Scary hack
MichalStrehovsky 6cd6567
Universal transition
MichalStrehovsky 36fa432
Arm64 and fixes
MichalStrehovsky 312d75d
Testing
MichalStrehovsky 5249b9a
Merge branch 'main' into resolvehelper
MichalStrehovsky b370b17
Update jiteeversionguid.h
MichalStrehovsky 88eeeee
Add JIT_InterfaceLookupForSlot helper for Win x64
jkotas 1d710c4
Clear out call cookie when changing VSD call to indirect
jakobbotsch c3d49bb
Nit
jakobbotsch 66f6270
Probable fix for GC issues
jakobbotsch e6b1819
Undo accidental change
jakobbotsch 1ea2b34
Merge branch 'main' of github.com:dotnet/runtime into pr-112406
jakobbotsch bb89b87
Update JIT-EE GUID after merge
jakobbotsch 5ca6411
Run jit-format
jakobbotsch 5d66c77
Fix Jan's bug, fix tailcall test
jakobbotsch f28053d
Fix build on targets without custom calling convention for helper
jakobbotsch d866b1e
Delete unnecessary TAILJMP_RAX
jkotas a70c650
Depend on the GCInfo produced by the JIT for reporting of arg registers
jkotas bb2d70f
JIT: Simplify internal GC tracking structures
jakobbotsch 42343da
Remove check
jakobbotsch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How hard would it be to add an implementation for coreclr? Currently jit-cfg is likely to be broken by this change. It would be nice to make it work without having to make the JIT side codegen different from NAOT pattern.
Alternatively I guess it would be even more ideal if we switched the testing to a CFG-enabled outerloop NAOT run now that the support is more mature... But that's probably a bit more work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought CoreCLR doesn't even do interface dispatch in this shape? I thought #111771 tries to bring it over, but for some very limited scenarios. Are the interface codepaths even exercised under CoreCLR?
We already have a CFG run on native AOT but only on x64. It should be easy enough to add arm64 one. But we don't have any stress modes for either GC or JIT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not totally sure what the difference between CID and VSD is, but from the JIT codegen standpoint it looks identical to me.
In the worst case I would be ok with guarding the transformation in lowering under a NAOT check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkotas if I wanted to implement a CORINFO_HELP_INTERFACELOOKUP_FOR_SLOT on CoreCLR, would I need to somehow call
VirtualCallStubManager::ResolveWorker? It's not exactly clear to me where I would find the parameters to call it so wondering if there's a better way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have pushed a commit into this PR that shows what it may look like on win x64. It calls the slow resolve helper every time. If it is too slow for the test, it is possible to improve the perf by adding a NAOT-like fast path once David's PR #111771 goes in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you ❤️! I'll kick off a JIT-cfg run to see if the perf is acceptable. I think we'd basically only care if this more than quadruples the time it takes for the CI to run. These legs run very infrequently.