Skip to content

Conversation

@jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Jan 31, 2026

This function should JIT the method that has the user IL. For runtime async functions reflection exposes the Task-returning variant which is normally a thunk, so treat these transparently.

This function should JIT the method that has the user IL.
@jakobbotsch jakobbotsch requested review from Copilot and jkotas January 31, 2026 13:36
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 31, 2026
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

Updates CoreCLR’s ReflectionInvocation_PrepareMethod path to avoid JIT-preparing runtime async thunk methods, and instead prepare the associated variant that owns the user IL.

Changes:

  • Detect async thunk MethodDescs in PrepareMethodHelper.
  • Redirect preparation to the async variant via GetAsyncVariant() prior to prestub/JIT.

@jakobbotsch jakobbotsch changed the title Avoid async thunks in RuntimeHelpers.PrepareMethod Look through async thunks in RuntimeHelpers.PrepareMethod Jan 31, 2026
Copilot AI review requested due to automatic review settings January 31, 2026 17:40
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

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

@jakobbotsch jakobbotsch merged commit 77341dd into dotnet:main Feb 1, 2026
103 of 107 checks passed
@jakobbotsch jakobbotsch deleted the jit-async-method branch February 1, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants