Uh oh!
There was an error while loading. Please reload this page.
[clr-interp] Runtime async support - #121862
Conversation
…ling for CallStub so we fail cleanly where we haven't implemented it yet
…nerator. Its ... almost there.
There was a problem hiding this comment.
Pull Request Overview
This PR adds runtime async support to the CLR interpreter, enabling async/await functionality in interpreted code. The implementation wraps async method bodies in try/finally blocks for context management, adds specialized opcodes for suspend/resume operations, and introduces a non-traditional calling convention for passing continuation objects via a dedicated InterpreterFrame field.
Key changes:
- Added async continuation handling with specialized interpreter opcodes
- Modified call stubs across multiple architectures to support continuation return values
- Adjusted test workloads to be more suitable for interpreter performance characteristics
Reviewed Changes
Copilot reviewed 54 out of 54 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/async/*.csproj | Added TestLibrary project references for interpreter detection |
| src/tests/async/*.cs | Reduced Fibonacci test parameters when running under interpreter |
| src/tests/async/Directory.Build.targets | SHOULD NOT MERGE: Deleted file enables async tests by default |
| src/coreclr/inc/clrconfigvalues.h | SHOULD NOT MERGE: Changed RuntimeAsync default to 1 |
| src/coreclr/vm//asmhelpers. | Updated assembly helpers to pass continuation return parameter |
| src/coreclr/vm/*/asmconstants.h | Updated CallStubHeader offset for new HasContinuationRet field |
| src/coreclr/vm/callstubgenerator.* | Added HasContinuationRet support and continuation parameter handling |
| src/coreclr/vm/interpexec.* | Added AsyncHelpers_ResumeInterpreterContinuation and continuation opcodes |
| src/coreclr/vm/frames.* | Added continuation field and GC scanning to InterpreterFrame |
| src/coreclr/vm/object.h | Defined ContinuationObject class structure |
| src/coreclr/vm/jitinterface.* | Added getAsyncResumptionStub implementation for interpreter |
| src/coreclr/vm/prestub.cpp | Added continuation return value population logic |
| src/coreclr/interpreter/. | Major compiler changes for async support including interval maps and suspend/resume logic |
| src/coreclr/System.Private.CoreLib/* | Added QCall for ResumeInterpreterContinuation |
Comments suppressed due to low confidence (1)
src/tests/async/Directory.Build.targets:1
- The deletion of this entire file enables async tests to build and run by default. However, the PR description explicitly states "NOTE: THIS PR has a few changes to enable RuntimeAsync by default, and build the async tests... those should not be merged". This file deletion should not be included in the final merge.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Tagging subscribers to this area: @dotnet/interop-contrib |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…dd some tests affected by the changes. The logic is now much simpler.
…ORINFO_AsyncResumeInfo so it can be shared with the interpreter.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jakobbotsch
commented
Dec 3, 2025
This looks great to me. |
Update docs based on feedback Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
…ighton/runtime into RuntimeAsync_Interpreter
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
agocke
commented
Dec 4, 2025
Github bug -- all comments are resolved |
Uh oh!
There was an error while loading. Please reload this page.
This PR adds runtime async support to the interpreter
Notable changes:
TODO before merge
1. Remove the changes to enable RuntimeAsync by default.2. Add documentation about how the interpreter async abi works3. Add documentation about what a code generator needs to do to make runtime async work4. I'm pretty sure IL peep handling has a bug handling any of the 2 byte opcodes. This needs to be tested.