Skip to content

Implement getAsyncInfo in ILCompiler - #120859

Merged
jkotas merged 5 commits into
dotnet:mainfrom
jtschuster:GetAsyncInfoR2R
Oct 21, 2025
Merged

Implement getAsyncInfo in ILCompiler#120859
jkotas merged 5 commits into
dotnet:mainfrom
jtschuster:GetAsyncInfoR2R

Conversation

@jtschuster

Copy link
Copy Markdown
Member

Updates the definition of CORINFO_ASYNC_INFO to match CoreCLRs definition, and adds an implementation for the getAsyncInfo jit callback in ReadyToRun.

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 implements the getAsyncInfo callback in the ILCompiler's JIT interface to support async method compilation in ReadyToRun scenarios. The implementation aligns with CoreCLR's definition by expanding the CORINFO_ASYNC_INFO structure and providing concrete field and method handle lookups.

Key Changes:

  • Extended CORINFO_ASYNC_INFO structure with additional fields for async state management
  • Implemented the getAsyncInfo method to populate async continuation and context management handles
  • Added support for execution context capture/restore operations in async workflows

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csExtended CORINFO_ASYNC_INFO structure with new fields for Resume, State, Flags, execution context methods, and continuation context handling
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csImplemented getAsyncInfo method to populate async info structure with handles for Continuation class fields and AsyncHelpers methods

Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jkotas

Copy link
Copy Markdown
Member

This will change a bit after #120411

cc @jakobbotsch

Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Outdated
@VSadov

Copy link
Copy Markdown
Member

Yes, the shape of the info will change with "flat continuations".

Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Outdated
@jakobbotsch

Copy link
Copy Markdown
Member

I merged #120411 so as pointed out above the shape of CORINFO_ASYNC_INFO changed a bit.

@jakobbotschjakobbotsch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs to be adapted to #120411

@jkotas
jkotas enabled auto-merge (squash) October 20, 2025 23:26
@jkotas
jkotas merged commit e5ae1f6 into dotnet:mainOct 21, 2025
93 of 95 checks passed
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Nov 20, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@jtschuster@jkotas@VSadov@jakobbotsch@MichalStrehovsky