-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[clr-interp] Tweak GC reporting #122620
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
[clr-interp] Tweak GC reporting #122620
Conversation
The interpreter calling convention can result in double reporting of arguments passed to callee's. This works today as all of the arguments will be conservatively reported, but it also adds the problem of excess conservative reporting. This change fixes that most of that problem by only dropping reporting of conservative pointers when they point into a callee's stack space. Note that this does not fix is the scenario where an object reference is held on the IL stack across a call. In those cases the value shall still be reported conservatively. This PR also tweaks the Collect0 test to disable it under the interpreter as the C# compiler generates that particular problematic pattern for this test case.
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 addresses GC reporting issues in the CoreCLR interpreter by reducing excess conservative reporting of arguments. The main change optimizes GC stack slot reporting by detecting when a stack slot belongs to a callee's frame rather than the caller's frame, avoiding double reporting. Additionally, a test is disabled under the interpreter due to a known issue with object references held on the IL stack across calls.
Key Changes
- Modified GC stack slot reporting to skip conservatively reported slots when they point into a callee's stack space
- Added logic to detect callee frame boundaries using
InterpMethodContextFrame - Disabled
Collect0test under the interpreter due to incompatible C# compiler output patterns
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tests/GC/API/GC/Collect0.cs | Adds ActiveIssue attribute to disable test under CoreCLR interpreter |
| src/coreclr/vm/gcinfodecoder.cpp | Implements GC reporting optimization for interpreter frames by detecting and skipping slots in callee frames |
|
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
The interpreter calling convention can result in double reporting of arguments passed to callee's. This works today as all of the arguments will be conservatively reported, but it also adds the problem of excess conservative reporting. This change fixes that most of that problem by only dropping reporting of conservative pointers when they point into a callee's stack space.
Note that this does not fix is the scenario where an object reference is held on the IL stack across a call. In those cases the value shall still be reported conservatively. This PR also tweaks the Collect0 test to disable it under the interpreter as the C# compiler generates that particular problematic pattern for this test case.