Skip to content

Add AsyncMethodDesc to managed type system - #120858

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

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

Conversation

@jtschuster

Copy link
Copy Markdown
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).

@jtschusterjtschuster added this to the 11.0.0 milestone Oct 17, 2025
@jtschusterjtschuster self-assigned this Oct 17, 2025
CopilotAI review requested due to automatic review settings October 17, 2025 21:36

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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.

FileDescription
AsyncMethodDescFactory.csFactory class for creating and caching AsyncMethodDesc instances
ILCompiler.ReadyToRun.csprojProject file updates to include new AsyncMethodDesc files
MethodDesc.csAdds AsyncCallConv flag to method signature system
AsyncMethodDesc.csCore implementation of async method descriptor wrapper

Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/AsyncMethodDesc.cs Outdated
Comment threadsrc/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs Outdated
@jkotas
jkotas merged commit 8c362f7 into dotnet:mainOct 20, 2025
93 of 95 checks passed
Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
@VSadov

VSadov commented Oct 20, 2025

Copy link
Copy Markdown
Member

LGTM.Thanks!

Sign up for freeto 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.

5 participants

@jtschuster@VSadov@jkoritzinsky@jkotas