Uh oh!
There was an error while loading. Please reload this page.
Make ETW rundown operate more effectively with JIT - #116354
Conversation
Rename some locals removing critical section notion and replace with lock. Rework the CodeHeapIterator. Rename members to more accurately reflect their purpose. Generally move to more canonical C++. EECodeGenManager now has a iterator counter. This is used to track the number of outstanding iterators and can be used to defer deletes. Adds are still valid since the iterator will only operate on the state at the time the iterator was created.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jkotas
left a comment
There was a problem hiding this comment.
Test failures look related:
20:03:09.305 Running test: tracing/runtimeeventsource/nativeruntimeeventsource/nativeruntimeeventsource.cmd
ASSERT FAILED
Expression: codeLength > 0
Location: line 1866 in /Users/runner/work/1/s/src/coreclr/vm/eetwain.cpp
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Narrow contract
Yep. I'm trying to root it out on macOS. I tried on Windows and did find a contract violation that I needed to fix. I pushed up that fix and will see where we are. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
possible due to MethodDesc iteration. Rework how DynamicMethodDesc and LCGMethodResolver destruction works. This was needed due to Crst lock inversion. Remove CrstIbcProfile
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.
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.
Rework allocation order for recording of code pointer.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull Request Overview
This pull request modernizes the code heap management in the CLR's ETW integration to improve JIT rundown operations. The PR simplifies the EECodeGenManager API surface, reworks the CodeHeapIterator to be more robust, and ensures all methods emit unwind information for better ETW stack tracing.
Key changes include:
- Refactored ETW rundown and JIT manager interfaces for better code heap iteration
- Improved dynamic method destruction workflow with deferred cleanup
- Enhanced thread safety for code heap operations during iteration
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/threads.h | Removes finalizer-related methods from Thread class |
| src/coreclr/vm/threads.cpp | Removes finalizer work methods moved to FinalizerThread |
| src/coreclr/vm/finalizerthread.h | Adds delayed dynamic method destruction support |
| src/coreclr/vm/finalizerthread.cpp | Implements delayed dynamic method cleanup functionality |
| src/coreclr/vm/runtimehandles.cpp | Updates dynamic method destruction to use delayed cleanup |
| src/coreclr/vm/codeman.h | Modernizes CodeHeapIterator and UnwindInfoTable APIs |
| src/coreclr/vm/codeman.cpp | Major refactoring of code heap management and iteration |
| src/coreclr/vm/dynamicmethod.h | Restructures LCGMethodResolver for better lifecycle management |
| src/coreclr/vm/dynamicmethod.cpp | Implements staged destruction with iterator-safe cleanup |
| src/coreclr/vm/jitinterface.h | Removes obsolete BackoutJitData methods |
| src/coreclr/vm/jitinterface.cpp | Simplifies JIT compilation error handling |
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.
Fixes#102858
Make the
EECodeGenManagerAPI surface narrower.Rename some locals removing critical section notion and replace with lock.
Rework the
CodeHeapIterator.Rename members to more accurately reflect their purpose. Generally move to more canonical C++.
EECodeGenManagernow has an iterator counter. This is used to track the number of outstanding iterators and can be used to defer deletes. Adds are still valid since the iterator will only operate on the state at the time the iterator was created.Always emit UnwindInfo for methods. This was previously only enabled when the Runtime provider was enabled and a rundown triggered.