Skip to content

Conversation

@jakobbotsch
Copy link
Member

The continuation type returned to the JIT by getContinuationType is more or less opaque. The only thing we need to do with that handle is embed it in the code stream.

Teach SPMI to fake up a class handle instead of missing contexts when the continuation layout is not found. This is going to be a common scenario for async changes because any change resulting in new live state around an async call ends up requiring a different continuation type.

The continuation type returned to the JIT by getContinuationType is more
or less opaque. The only thing we need to do with that handle is embed
it in the code stream.

Teach SPMI to fake up a class handle instead of missing contexts when
the continuation layout is not found. This is going to be a common
scenario for async changes because any change resulting in new live
state around an async call ends up requiring a different continuation
type.
Copilot AI review requested due to automatic review settings January 23, 2026 10:02
@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 23, 2026
@jakobbotsch jakobbotsch added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 23, 2026
@dotnet-policy-service
Copy link
Contributor

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

@jakobbotsch
Copy link
Member Author

PTAL @dotnet/jit-contrib

I was surprised to see no diffs in #123500, but on a closer look it made perfect sense since the change causes us to require much smaller continuations, which ended up missing in getContinuationType.

@jakobbotsch jakobbotsch requested a review from a team January 23, 2026 10:03
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 SuperPMI replay to tolerate getContinuationType mismatches by returning a synthetic continuation type handle when the recorded continuation layout can’t be found, avoiding unnecessary “missing context” failures during async-related diffs.

Changes:

  • Introduces a pseudo continuation CORINFO_CLASS_HANDLE value for replay-time misses.
  • Adds special handling in repEmbedClassHandle for the pseudo handle to keep embedding behavior consistent.
  • Changes repGetContinuationType to fall back to the pseudo handle when the recorded key is not present.

@jakobbotsch jakobbotsch merged commit fc7d401 into dotnet:main Jan 23, 2026
104 checks passed
@jakobbotsch jakobbotsch deleted the spmi-tolerate-missing-continuation-layouts branch January 23, 2026 14:23
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.

2 participants