Pass async flag to jit in aot tools#120772
Merged
jkotas merged 5 commits intodotnet:mainfrom Oct 17, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances ahead-of-time (AOT) compilation tools to properly handle runtime-async methods. The changes add support for detecting and flagging async methods during compilation, ensuring that AOT tools fail compilation when encountering unsupported async patterns rather than producing invalid code that fails at runtime.
- Adds
IsRuntimeAsyncproperty toMethodDescto detect methods with the AsyncMethodImplAttribute - Introduces
CORJIT_FLAG_ASYNCflag to inform the JIT when compiling async methods - Changes
getAsyncResumptionStubto throw an exception instead of returning null, causing compilation to fail early
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs | Adds async flag detection and IsRuntimeAsync property implementation for ECMA methods |
| src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs | Defines virtual IsRuntimeAsync property with default false implementation |
| src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs | Adds CORJIT_FLAG_ASYNC enumeration value |
| src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs | Sets async JIT flag when compiling async methods and throws exception in getAsyncResumptionStub |
jkotas
reviewed
Oct 15, 2025
jkotas
reviewed
Oct 15, 2025
src/coreclr/tools/Common/TypeSystem/Common/InstantiatedMethod.cs
Outdated
Show resolved
Hide resolved
jkotas
approved these changes
Oct 15, 2025
Member
|
I'd name this |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
getAsyncResumptionStubto fail a compilation when it is called.Previously, a crossgen compilation with a runtime-async method would succeed but fail at runtime. This change at least causes the compilation to fail.