Use CodeRangeMapRangeList for callcounting stubs and remove unneeded StubManagers#126521
Merged
rcj1 merged 4 commits intodotnet:mainfrom Apr 9, 2026
Merged
Use CodeRangeMapRangeList for callcounting stubs and remove unneeded StubManagers#126521rcj1 merged 4 commits intodotnet:mainfrom
rcj1 merged 4 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates call-counting stubs to be tracked via CodeRangeMapRangeList so the stub kind can be identified directly from the RangeSectionMap (including via cDAC), avoiding iteration over call-counting stub allocators. It also aligns call-counting stub enumeration behavior with other CodeRangeMapRangeList users by no longer explicitly EnumMem-enumerating the stub heap bytes.
Changes:
- Add a new stub kind (
STUB_CODE_BLOCK_CALLCOUNTING) and route RangeSection-based stub identification/tracing toCallCountingStubManager. - Switch call-counting stub allocation tracking from
RangeListtoCodeRangeMapRangeList. - Adjust includes/forward-decls to break prior header dependencies and support the new range list type.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/stubmgr.cpp | Recognizes call-counting stubs via RangeSectionStubManager and forwards tracing/name lookups accordingly. |
| src/coreclr/vm/loaderallocator.hpp | Removes direct include of callcounting.h; adds forward decl/DPTR for CallCountingManager. |
| src/coreclr/vm/common.h | Adds callcounting.h include to preserve transitive visibility of call-counting types. |
| src/coreclr/vm/codeman.h | Introduces STUB_CODE_BLOCK_CALLCOUNTING and string mapping for RangeSection-reported stub kinds. |
| src/coreclr/vm/callcounting.h | Switches allocator tracking to CodeRangeMapRangeList; adjusts visibility for RangeSection forwarding. |
| src/coreclr/vm/callcounting.cpp | Initializes CodeRangeMapRangeList for call-counting stub heaps; removes old stub-range checks and DAC heap range enumeration. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
|
Tagging subscribers to this area: @agocke |
jkotas
reviewed
Apr 3, 2026
jkotas
reviewed
Apr 4, 2026
This was referenced Apr 4, 2026
jkotas
reviewed
Apr 6, 2026
jkotas
reviewed
Apr 6, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In order to figure out if a specific address is a callcounting stub, we currently have to iterate through the call counting stub allocators to figure out which one, if any, owns the address. If we switch call counting stubs to use CodeRangeMapRangeList, the type of the code can easily be looked up from the cDAC in the RangeSectionMap.
Removed EnumMem of the call counting stub heap. We now have the same enumeration as other CodeRangeMapRangeList users. That is, the RangeSection metadata allows lookup of the code type etc, but the actual bytes of the stubs are not explicitly included in a heap dump.
Relevant for
runtime/src/coreclr/debug/daccess/daccess.cpp
Line 5441 in 1d27484