Add AsyncMethodDesc to managed type system#120858
Merged
jkotas merged 21 commits intodotnet:mainfrom Oct 20, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for async calling convention methods to the managed type system by introducing AsyncMethodDesc, a wrapper type that transforms Task/ValueTask-returning methods into their async-callconv variants. The implementation follows the pattern established by UnboxingMethodDesc for handling multiple method descriptors per method definition.
- Adds
AsyncMethodDescclass to wrap Task/ValueTask methods with async calling convention semantics - Introduces factory pattern for creating and caching async method descriptors
- Extends method signature system to support async calling convention flag
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
AsyncMethodDescFactory.cs |
Factory class for creating and caching AsyncMethodDesc instances |
ILCompiler.ReadyToRun.csproj |
Project file updates to include new AsyncMethodDesc files |
MethodDesc.cs |
Adds AsyncCallConv flag to method signature system |
AsyncMethodDesc.cs |
Core implementation of async method descriptor wrapper |
src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/AsyncMethodDescFactory.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jkotas
reviewed
Oct 17, 2025
jkotas
reviewed
Oct 17, 2025
src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/AsyncMethodDescFactory.cs
Outdated
Show resolved
Hide resolved
jkotas
approved these changes
Oct 20, 2025
jkotas
approved these changes
Oct 20, 2025
VSadov
reviewed
Oct 20, 2025
VSadov
reviewed
Oct 20, 2025
Member
|
LGTM.Thanks! |
7 tasks
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.
Adds an AsyncMethodDesc type to represent the runtime-async calling convention methods. The type was modeled after UnboxingMethodDesc, which also has multiple MethodDescs for each method def. These methods override the Signature to add the CallConvAsync flag and change the return type to void (for Task and ValueTask) or T (for Task and ValueTask).