-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Various async fixes #122948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various async fixes #122948
Conversation
…ion context into the async context Fix issue where interpreter thunks were visible in Environment.StackTrace Fix issue where the FromStack and FromStackDMI tests were showing various thunks generated as part of async codegen. We can't hide them, so the test is disabled
|
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
There was a problem hiding this comment.
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 fixes several issues related to async/await execution context handling in the CoreCLR interpreter and adds configuration parity with the JIT compiler.
- Fixed execution context flow suppression to properly use the
DefaultFlowSuppressedsentinel value instead ofNULL - Renamed
restoreContextsMethodtorestoreContextsOnSuspensionMethodfor consistency with the JIT implementation - Added
DOTNET_JitOptimizeAwaitconfiguration support to the interpreter to match JIT behavior and allow disabling async optimizations for debugging
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/async/reflection/reflection.cs | Added ActiveIssue attributes to disable two reflection tests for CoreCLR interpreter due to known issue #122547 |
| src/coreclr/vm/interpexec.cpp | Fixed flow-suppressed execution context handling to use DefaultFlowSuppressed sentinel; renamed restoreContextsMethod field; added scoping block for threadBase GCPROTECT |
| src/coreclr/vm/corelib.h | Added DEFINE_CLASS and DEFINE_FIELD macros to expose ExecutionContext.DefaultFlowSuppressed field to native code |
| src/coreclr/interpreter/interpconfigvalues.h | Added JitOptimizeAwait configuration option (DEBUG-only) to control async/await optimizations |
| src/coreclr/interpreter/inc/interpretershared.h | Renamed restoreContextsMethod to restoreContextsOnSuspensionMethod to match updated naming convention |
| src/coreclr/interpreter/compiler.cpp | Added check for JitOptimizeAwait config to conditionally disable async peephole optimizations; updated field reference to restoreContextsOnSuspensionMethod |
| src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs | Added StackTraceHidden attributes to AsyncHelpers_ResumeInterpreterContinuation and ResumeInterpreterContinuation methods |
janvorli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Fix issues around suppressed flow
Disable tests
Add support for DOTNET_JitOptimizeAwait to match jit behavior