Skip to content

Fix runtime async context restore after EnC remap - #131722

Closed
tommcdon wants to merge 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/fix-runtime-async-enc
Closed

Fix runtime async context restore after EnC remap#131722
tommcdon wants to merge 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/fix-runtime-async-enc

Conversation

@tommcdon

@tommcdon tommcdon commented Aug 3, 2026

Copy link
Copy Markdown
Member

Use the continuation argument for root-method context restoration so Edit-and-Continue remaps do not depend on a synthesized resumed indicator that is not preserved in the remapped frame.

Use the continuation argument for root-method context restoration so Edit-and-Continue remaps do not depend on a synthesized resumed indicator that is not preserved in the remapped frame.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tommcdon tommcdon added this to the 11.0.0 milestone Aug 3, 2026
@tommcdon
tommcdon requested a review from jakobbotsch August 3, 2026 01:43
@tommcdon tommcdon self-assigned this Aug 3, 2026
Copilot AI review requested due to automatic review settings August 3, 2026 01:43
@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 Aug 3, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI 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 updates how the JIT determines whether an async method is “resumed” when emitting the method-level RestoreContexts calls. For non-inlined (root) methods it now computes resumed from the async continuation argument (continuation != null) instead of reading the synthesized lvaResumedIndicator local, while preserving the existing local-based approach for inlinees (which don’t have a continuation argument).

Changes:

  • In SaveAsyncContexts(), compute the resumed argument for the fault-path RestoreContexts call from lvaAsyncContinuationArg for root methods, and keep using lvaResumedIndicator for inlinees.
  • In CreateReturnBB(), apply the same root-vs-inlinee resumed computation for the normal return-path RestoreContexts call.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 3, 2026 03:16

Copilot AI 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

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

@jakobbotsch

Copy link
Copy Markdown
Member

Not sure this will be quite sufficient. I opened #131731 to handle it in the same way as other transition-preserved state. Can you test with that?

@tommcdon

tommcdon commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Superceded by #131731

@tommcdon tommcdon closed this Aug 3, 2026
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.

3 participants