Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Consolidates async calling convention detection logic into a single MethodDesc extension method, removing the need for MethodSignatureFlags.AsyncCall flag.

Changes:

  • Added IsAsyncCall extension method on MethodDesc that unifies detection logic: returns true for async variants and async intrinsics that don't return Task/ValueTask
  • Removed MethodSignatureFlags.AsyncCall enum value and MethodSignature.IsAsyncCall property
  • Updated call sites in CorInfoImpl.cs to use the new extension method for CORINFO_CALLCONV_ASYNCCALL and CORJIT_FLAG_ASYNC
  • Simplified AsyncMethodVariant to no longer set the AsyncCall flag in signature

Rationale:

Async calling convention is now determined at the MethodDesc level (similar to hidden parameters in generic calling conventions) rather than being stored in signature flags. This properly handles both async variants (which have the flag set by signature transformation) and async intrinsics (which have IsAsync metadata but don't return Task/ValueTask).

// Before: Logic scattered across multiple locations
if (method.IsAsync && !method.Signature.ReturnsTaskOrValueTask())
    sig->callConv |= CorInfoCallConv.CORINFO_CALLCONV_ASYNCCALL;

// After: Unified in extension method
if (method.IsAsyncCall())
    sig->callConv |= CorInfoCallConv.CORINFO_CALLCONV_ASYNCCALL;

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 6, 2025 21:56
…ethod

Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot AI changed the title [WIP] Report CALLCONV_ASYNCCALL and FLAG_ASYNC on AsyncExplicitImpl methods Refactor async calling convention detection to use MethodDesc extension method Nov 6, 2025
Copilot finished work on behalf of MichalStrehovsky November 6, 2025 22:02
Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it complies, looks good.

@MichalStrehovsky
Copy link
Member

/ba-g looks like the runtime pipeline doesn't run for PRs into developer branches. Going to merge so it runs in my PR.

@MichalStrehovsky MichalStrehovsky marked this pull request as ready for review November 6, 2025 22:10
@MichalStrehovsky MichalStrehovsky merged commit 142bd45 into MichalStrehovsky-patch-1 Nov 6, 2025
13 of 14 checks passed
@MichalStrehovsky MichalStrehovsky deleted the copilot/sub-pr-121403 branch November 6, 2025 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants