-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[cdac] Implement IGCInfo for x86; consolidate decoder under GCInfo contract #129456
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
Merged
max-charlamb
merged 6 commits into
dotnet:main
from
max-charlamb:cdac-x86-gcinfo-codelength
Jun 17, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dbec1eb
[cdac] Implement IGCInfo for x86; consolidate decoder under GCInfo co…
1488f42
Address PR feedback: x86 GCInfo is partially supported, not unsupported
2389991
remove false assertion
2b97652
[cdac] Split EECodeManager pop-size from GcInfoDecoder scratch area
d46fdf5
[cdac] Fix VarargPInvoke IL stub regression test to actually exercise…
28919cd
Potential fix for pull request finding
max-charlamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
56 changes: 56 additions & 0 deletions
56
...d/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GCInfo/GCInfoX86_1.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Collections.Generic; | ||
| using Microsoft.Diagnostics.DataContractReader.Contracts.GCInfoHelpers; | ||
|
|
||
| namespace Microsoft.Diagnostics.DataContractReader.Contracts; | ||
|
|
||
| /// <summary> | ||
| /// IGCInfo implementation for x86. x86 uses the legacy bit-packed InfoHdr GC info format, | ||
| /// which is fundamentally different from the GcInfoDecoder format used by every other | ||
| /// architecture, so it cannot share <see cref="GCInfo_1{TTraits}"/>. | ||
| /// The decoder lives at <see cref="GCInfoHelpers.X86.X86GCInfo"/> and is shared with the | ||
| /// x86 stack walker. | ||
| /// </summary> | ||
| internal sealed class GCInfoX86_1 : IGCInfo | ||
| { | ||
| private readonly Target _target; | ||
|
|
||
| internal GCInfoX86_1(Target target) | ||
| { | ||
| _target = target; | ||
| } | ||
|
|
||
| IGCInfoHandle IGCInfo.DecodePlatformSpecificGCInfo(TargetPointer gcInfoAddress, uint gcVersion) | ||
| => new GCInfoHelpers.X86.X86GCInfo(_target, gcInfoAddress, gcVersion); | ||
|
|
||
| IGCInfoHandle IGCInfo.DecodeInterpreterGCInfo(TargetPointer gcInfoAddress, uint gcVersion) | ||
| => new GcInfoDecoder<InterpreterGCInfoTraits>(_target, gcInfoAddress, gcVersion); | ||
|
|
||
| uint IGCInfo.GetCodeLength(IGCInfoHandle gcInfoHandle) | ||
| => AssertCorrectHandle(gcInfoHandle).GetCodeLength(); | ||
|
|
||
| uint IGCInfo.GetStackBaseRegister(IGCInfoHandle gcInfoHandle) | ||
| => AssertCorrectHandle(gcInfoHandle).GetStackBaseRegister(); | ||
|
|
||
| uint IGCInfo.GetSizeOfStackParameterArea(IGCInfoHandle gcInfoHandle) | ||
| => AssertCorrectHandle(gcInfoHandle).GetSizeOfStackParameterArea(); | ||
|
|
||
| uint IGCInfo.GetCalleePoppedArgumentsSize(IGCInfoHandle gcInfoHandle) | ||
| => AssertCorrectHandle(gcInfoHandle).GetCalleePoppedArgumentsSize(); | ||
|
|
||
| IReadOnlyList<InterruptibleRange> IGCInfo.GetInterruptibleRanges(IGCInfoHandle gcInfoHandle) | ||
| => AssertCorrectHandle(gcInfoHandle).GetInterruptibleRanges(); | ||
|
|
||
| IReadOnlyList<LiveSlot> IGCInfo.EnumerateLiveSlots(IGCInfoHandle gcInfoHandle, uint instructionOffset, GcSlotEnumerationOptions options) | ||
| => AssertCorrectHandle(gcInfoHandle).EnumerateLiveSlots(instructionOffset, options); | ||
|
|
||
| private static IGCInfoDecoder AssertCorrectHandle(IGCInfoHandle gcInfoHandle) | ||
| { | ||
| if (gcInfoHandle is not IGCInfoDecoder handle) | ||
| throw new System.ArgumentException("Invalid GC info handle", nameof(gcInfoHandle)); | ||
|
|
||
| return handle; | ||
| } | ||
| } |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.