Uh oh!
There was an error while loading. Please reload this page.
Pass async flag to jit in aot tools - #120772
Conversation
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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MichalStrehovsky
commented
Oct 16, 2025
I'd name this |
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.