Uh oh!
There was an error while loading. Please reload this page.
[cDAC] Compute MethodDesc size directly to support more heap dump scenarios - #124772
Conversation
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR modifies how MethodDesc sizes are computed in the cDAC RuntimeTypeSystem contract to support heap dumps. Previously, the code read from the runtime's s_ClassificationSizeTable global, which is not available in heap dumps. The new implementation computes the MethodDesc size directly from data descriptor type sizes, mirroring the runtime's size table logic but using only metadata that's available in heap dumps.
Changes:
- Replaced runtime table lookup with data-descriptor-based size computation for MethodDesc instances
- Added AsyncMethodData data type for computing optional slot sizes
- Changed TypeHierarchy test debuggee to use heap dumps instead of full dumps for verification
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| RuntimeTypeSystem_1.cs | Reimplemented ComputeSize method to calculate MethodDesc size from data descriptor sizes instead of reading s_ClassificationSizeTable |
| Constants.cs | Removed MethodDescSizeTable global constant that's no longer needed |
| DataType.cs | Added AsyncMethodData enum value for the async method data slot |
| datadescriptor.inc | Added AsyncMethodData data descriptor and removed MethodDescSizeTable global |
| MockDescriptors.MethodDescriptors.cs | Updated mock tests to remove dummy MethodDescSizeTable and add AsyncMethodData type info |
| RuntimeTypeSystemDumpTests.cs | Removed DumpType override to use default "heap" dumps |
| TypeHierarchy.csproj | Changed dump type from "Full" to "Heap" |
| RuntimeTypeSystem.md | Updated documentation to reflect new size computation approach and removed MethodDescSizeTable global |
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.
- Use DataType.CLRToCOMCallMethodDesc for ComInterop classification - Use DataType.NonVtableSlot instead of target.PointerSize - Use DataType.NativeCodeSlot instead of target.PointerSize - Fix error message typo: AsyncMethodDescData -> AsyncMethodData Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
…narios (dotnet#124772) Modifies how MethodDesc sizes are computed. Instead of using the runtime `s_ClassificationSizeTable` which is not present in heap dumps, RuntimeTypeSystem now computes the MethodDesc size from datadescriptors. Modified DumpTests to run on heap dumps for verification.
Modifies how MethodDesc sizes are computed. Instead of using the runtime
s_ClassificationSizeTablewhich is not present in heap dumps, RuntimeTypeSystem now computes the MethodDesc size from datadescriptors.Modified DumpTests to run on heap dumps for verification.