-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Pass async flag to jit in aot tools #120772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
IsRuntimeAsync
property toMethodDesc
to detect methods with the AsyncMethodImplAttribute
- Introduces
CORJIT_FLAG_ASYNC
flag to inform the JIT when compiling async methods - Changes
getAsyncResumptionStub
to 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 |
src/coreclr/tools/Common/TypeSystem/Common/InstantiatedMethod.cs
Outdated
Show resolved
Hide resolved
I'd name this |
getAsyncResumptionStub
to 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.