Convert PREPARE_SIMPLE_VIRTUAL_CALLSITE usages to use the UCO pattern#124921
Merged
jkoritzinsky merged 8 commits intodotnet:mainfrom Mar 3, 2026
Merged
Convert PREPARE_SIMPLE_VIRTUAL_CALLSITE usages to use the UCO pattern#124921jkoritzinsky merged 8 commits intodotnet:mainfrom
jkoritzinsky merged 8 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @agocke |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR converts the remaining PREPARE_SIMPLE_VIRTUAL_CALLSITE usages in dynamicmethod.cpp to use the more efficient UnmanagedCallersOnly (UCO) pattern, and removes the now-unused PREPARE_SIMPLE_VIRTUAL_CALLSITE macro from callhelpers.h. This is part of the larger effort tracked in issue #123864 to replace MethodDescCallSite/CallDescrWorker infrastructure with UnmanagedCallersOnly reverse P/Invoke calls for better performance when invoking managed code from native code.
Changes:
- Converted 5 call sites in
LCGMethodResolverto useUnmanagedCallersOnlyCallerpattern - Added corresponding
[UnmanagedCallersOnly]wrapper methods inRuntimeHandles.cs - Updated method signatures in
metasig.handcorelib.hfrom instance methods (IM_*) to static methods with pointer parameters (SM_Ptr*) - Removed the deprecated
PREPARE_SIMPLE_VIRTUAL_CALLSITEandPREPARE_SIMPLE_VIRTUAL_CALLSITE_USING_SLOTmacros
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/metasig.h | Added 3 new method signature definitions for the converted methods: ResolveToken, ResolveSignature, and GetEHInfo |
| src/coreclr/vm/corelib.h | Updated 4 method definitions from instance methods to static methods with pointer parameters |
| src/coreclr/vm/callhelpers.h | Removed deprecated PREPARE_SIMPLE_VIRTUAL_CALLSITE macros (56 lines) and fixed trailing whitespace |
| src/coreclr/vm/dynamicmethod.cpp | Converted 5 call sites (ResolveToken, ResolveSignature x2, GetRawEHInfo, GetEHInfo) to use UnmanagedCallersOnlyCaller with explicit GC protection |
| src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs | Added 4 new [UnmanagedCallersOnly] wrapper methods with exception out-parameters |
jkotas
reviewed
Feb 27, 2026
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Feb 27, 2026
This was referenced Mar 3, 2026
jkotas
approved these changes
Mar 3, 2026
AaronRobinsonMSFT
approved these changes
Mar 3, 2026
Member
Author
|
/ba-g wbt failures |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Contributes to #123864.
Also remove
PREPARE_SIMPLE_VIRTUAL_CALLSITEnow that it is unused.