Skip to content

Add AsyncMethodDesc to managed type system#120858

Merged
jkotas merged 21 commits intodotnet:mainfrom
jtschuster:AsyncMethodDesc
Oct 20, 2025
Merged

Add AsyncMethodDesc to managed type system#120858
jkotas merged 21 commits intodotnet:mainfrom
jtschuster:AsyncMethodDesc

Conversation

@jtschuster
Copy link
Member

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).

@jtschuster jtschuster added this to the 11.0.0 milestone Oct 17, 2025
@jtschuster jtschuster self-assigned this Oct 17, 2025
Copilot AI review requested due to automatic review settings October 17, 2025 21:36
Copy link
Contributor

Copilot AI left a 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 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 AsyncMethodDesc class 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

@jtschuster jtschuster requested a review from eduardo-vp October 17, 2025 21:50
@jkotas jkotas merged commit 8c362f7 into dotnet:main Oct 20, 2025
93 of 95 checks passed
@github-project-automation github-project-automation bot moved this to Done in AppModel Oct 20, 2025
@VSadov
Copy link
Member

VSadov commented Oct 20, 2025

LGTM.Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants