JIT: Allow inlining of JIT-inserted AsyncHelpers.TransparentAwait#130482
Open
jakobbotsch wants to merge 1 commit into
Open
JIT: Allow inlining of JIT-inserted AsyncHelpers.TransparentAwait#130482jakobbotsch wants to merge 1 commit into
AsyncHelpers.TransparentAwait#130482jakobbotsch wants to merge 1 commit into
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the JIT↔EE async-support contract so the EE can also return an inlining context for the JIT-synthesized AsyncHelpers.TransparentAwait call, enabling the JIT to treat that synthesized call as an inline candidate (and to materialize the GT_RET_EXPR placeholder as needed).
Changes:
- Extend
ICorStaticInfo::getAwaitReturnCallto additionally return aCORINFO_CONTEXT_HANDLEsuitable for inlining, and bump the JIT-EE version GUID accordingly. - Update CoreCLR VM, JIT importer, interpreter, NativeAOT managed JIT interface, and SuperPMI plumbing to pass/record/replay the new out parameter.
- In the JIT importer, mark the synthesized await call as an inline candidate and, when applicable, append it as its own statement and replace it with a
GT_RET_EXPRplaceholder for the inliner.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/jitinterface.cpp | Implements the new getAwaitReturnCall signature and returns an inlining context handle alongside the await helper method. |
| src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp | Updates SuperPMI’s ICorJitInfo shim to forward the new out parameter. |
| src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp | Forwards the new contextHandle parameter through the simple shim. |
| src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp | Forwards and records the updated call signature in the counter shim. |
| src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp | Records/replays getAwaitReturnCall including the returned contextHandle. |
| src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h | Updates SuperPMI MethodContext record/replay signatures for getAwaitReturnCall. |
| src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp | Persists the returned contextHandle in MethodContext capture and restores it on replay. |
| src/coreclr/tools/superpmi/superpmi-shared/agnostic.h | Extends the agnostic record payload to include contextHandle. |
| src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt | Teaches thunk generation about CORINFO_CONTEXT_HANDLE* marshalling. |
| src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs | Updates NativeAOT managed JIT interface implementation to return an inlining context handle. |
| src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs | Updates generated interop delegates/wrappers for the new signature. |
| src/coreclr/tools/aot/jitinterface/jitinterface_generated.h | Updates the AOT JIT interface wrapper vtable thunk signature and forwarding. |
| src/coreclr/jit/importer.cpp | Uses returned contextHandle to mark synthesized TransparentAwait as inline-candidate and set up GT_RET_EXPR when applicable. |
| src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp | Updates the JIT-side wrapper to pass/receive the new contextHandle parameter. |
| src/coreclr/interpreter/compiler.cpp | Updates interpreter call sites to pass the new out contextHandle parameter. |
| src/coreclr/inc/jiteeversionguid.h | Bumps the JIT-EE interface version GUID due to the signature change. |
| src/coreclr/inc/icorjitinfoimpl_generated.h | Updates the EE-side interface implementation declaration to match the new signature. |
| src/coreclr/inc/corinfo.h | Updates the ICorStaticInfo interface contract and documents the new contextHandle semantics. |
This was referenced Jul 10, 2026
Open
Member
Author
|
cc @dotnet/jit-contrib PTAL @EgorBo |
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.
Fix #129896
Example:
Inner loop before:
After: