Skip to content
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

R2RDump: normalize GC info totalInterruptibleLength #112003

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -525,16 +525,21 @@ private Dictionary<int, List<BaseGcTransition>> GetTransitions(byte[] image, ref
int totalInterruptibleLength = 0;
if (NumInterruptibleRanges == 0)
{
totalInterruptibleLength = CodeLength;
totalInterruptibleLength = _gcInfoTypes.NormalizeCodeLength(CodeLength);
}
else
{
foreach (InterruptibleRange range in InterruptibleRanges)
{
totalInterruptibleLength += (int)(range.StopOffset - range.StartOffset);
uint normStart = _gcInfoTypes.NormalizeCodeOffset(range.StartOffset);
uint normStop = _gcInfoTypes.NormalizeCodeOffset(range.StopOffset);
totalInterruptibleLength += (int)(normStop - normStart);
}
}

if (SlotTable.NumTracked == 0)
return new Dictionary<int, List<BaseGcTransition>>();

int numChunks = (totalInterruptibleLength + _gcInfoTypes.NUM_NORM_CODE_OFFSETS_PER_CHUNK - 1) / _gcInfoTypes.NUM_NORM_CODE_OFFSETS_PER_CHUNK;
int numBitsPerPointer = (int)NativeReader.DecodeVarLengthUnsigned(image, _gcInfoTypes.POINTER_SIZE_ENCBASE, ref bitOffset);
if (numBitsPerPointer == 0)
Expand Down Expand Up @@ -629,6 +634,7 @@ private uint GetNumCouldBeLiveSlots(byte[] image, ref int bitOffset)
fSkip = !fSkip;
fReport = !fReport;
}
Debug.Assert(readSlots == numTracked);
}
else
{
Expand All @@ -642,6 +648,7 @@ private uint GetNumCouldBeLiveSlots(byte[] image, ref int bitOffset)
numCouldBeLiveSlots++;
}
}
Debug.Assert(numCouldBeLiveSlots > 0);
return numCouldBeLiveSlots;
}

Expand Down
Loading