Skip to content

Conversation

@jtschuster
Copy link
Member

Moves StubHelpers.AsyncCallContinuation to AsyncHelpers so StubHelpers.cs doesn't need to be added to nativeaot.

Thought it would be good to have separate commits for this and the rest of #121456

@jtschuster jtschuster self-assigned this Nov 7, 2025
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 7, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

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 moves the AsyncCallContinuation intrinsic from StubHelpers to AsyncHelpers, consolidating async-related functionality in a single location.

  • The intrinsic method is relocated from System.StubHelpers to System.Runtime.CompilerServices.AsyncHelpers
  • Corresponding updates made across VM metadata definitions, JIT intrinsic lists, and JIT importer logic
  • Documentation updated to reflect the new location

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/vm/corelib.h Moved method definition from STUBHELPERS to ASYNC_HELPERS class
src/coreclr/jit/namedintrinsiclist.h Moved intrinsic enum from StubHelpers section to AsyncHelpers section
src/coreclr/jit/importercalls.cpp Updated intrinsic references and lookup logic to use AsyncHelpers
src/coreclr/jit/gentree.cpp Updated comment to reference AsyncHelpers instead of StubHelpers
src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs Removed AsyncCallContinuation method
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs Added AsyncCallContinuation method

Copy link
Member

@VSadov VSadov left a comment

Choose a reason for hiding this comment

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

LGTM!

…Services/AsyncHelpers.CoreCLR.cs

Co-authored-by: Vladimir Sadov <vsadov@microsoft.com>
DEFINE_METHOD(ASYNC_HELPERS, RESTORE_CONTEXTS, RestoreContexts, NoSig)
DEFINE_METHOD(ASYNC_HELPERS, CAPTURE_CONTEXTS, CaptureContexts, NoSig)
DEFINE_METHOD(ASYNC_HELPERS, RESTORE_CONTEXTS, RestoreContexts, NoSig)
DEFINE_METHOD(ASYNC_HELPERS, ASYNC_CALL_CONTINUATION, AsyncCallContinuation, SM_RetContinuation)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
DEFINE_METHOD(ASYNC_HELPERS, ASYNC_CALL_CONTINUATION, AsyncCallContinuation, SM_RetContinuation)
DEFINE_METHOD(ASYNC_HELPERS, ASYNC_CALL_CONTINUATION, AsyncCallContinuation, NoSig)

So that it looks like the other methods.

The signature is only required to disambiguate overloads. Also, delete RetContinuation from metasig.h

// This is the "magic" method on wich other "Await" methods are built.
// Calling this from an Async method returns the continuation to the caller thus
// explicitly initiates suspension.
[Intrinsic]
Copy link
Member

Choose a reason for hiding this comment

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

There is a typo (wich -> which) a few lines above

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks!

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

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants