Use new JIT helpers for instantiating and continuation thunks#121952
Use new JIT helpers for instantiating and continuation thunks#121952MichalStrehovsky merged 3 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Can you change this code to runtime/src/coreclr/jit/lower.cpp Lines 5881 to 5887 in bf17d45 Also the part in the comment above about NAOT can be removed. |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the AOT compiler's approach to handling instantiation and continuation thunks by leveraging new JIT helper intrinsics introduced in #121799. Instead of using custom fake method signatures to explicitly pass hidden parameters (generic context and continuation), the code now uses JIT intrinsics (SetNextCallGenericContext and SetNextCallAsyncContinuation) to communicate this information.
Key changes:
- Removed architecture-specific (x86 vs non-x86) parameter ordering logic that is no longer needed with the new intrinsics
- Deleted three custom MethodDesc wrapper classes:
ValueTypeInstanceMethodWithHiddenParameter,DefaultInterfaceMethodImplementationWithHiddenParameter, andExplicitContinuationAsyncMethod - Simplified IL emission in thunks by removing fake method references and using direct calls with intrinsics
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| RyuJitNodeFactory.cs | Removed method entrypoint mapping logic for special thunks since they no longer use fake methods |
| ILScanNodeFactory.cs | Same removal as RyuJitNodeFactory.cs for the scanner path |
| ILImporter.Scanner.cs | Simplified instantiation parameter dependency tracking by removing special case for unboxing thunks |
| CompilerTypeSystemContext.Sorting.cs | Removed sorting implementations for deleted wrapper method types |
| CompilerTypeSystemContext.InterfaceThunks.cs | Replaced fake method calls with SetNextCallGenericContext intrinsic; deleted DefaultInterfaceMethodImplementationWithHiddenParameter class and removed x86-specific parameter ordering |
| CompilerTypeSystemContext.BoxedTypes.cs | Replaced fake method calls with SetNextCallGenericContext intrinsic; deleted ValueTypeInstanceMethodWithHiddenParameter class and updated documentation; removed x86-specific parameter ordering |
| AsyncResumptionStub.cs | Replaced ExplicitContinuationAsyncMethod with direct calls using SetNextCallGenericContext and SetNextCallAsyncContinuation intrinsics; deleted ExplicitContinuationAsyncMethod class and removed x86-specific parameter ordering |
| AsyncResumptionStub.Sorting.cs | Removed sorting implementation for deleted ExplicitContinuationAsyncMethod |
| CorInfoImpl.cs | Removed special handling for unboxing thunk hidden parameters since they're now managed by the JIT |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Removed comments about marking calls as async for NativeAOT and added an assertion to ensure the call is async.
|
/ba-g osx brownout |
Takes advantage of the new functionality added in #121799.
Cc @dotnet/ilc-contrib @jakobbotsch