Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ae2d2f3

Browse files
Merge pull request #4279 from swaroop-sridhar/GC
GCInfo: Fix ARM64 GCInfo decoding
2 parents a1eedcb + b6502aa commit ae2d2f3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/gcinfo/gcinfodumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ PORTABILITY_ASSERT("GcInfoDumper::EnumerateStateChanges is not implemented on th
667667

668668
#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
669669
UINT32 safePointOffset = offset;
670-
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_)
670+
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
671671
safePointOffset++;
672672
#endif
673673
if(safePointDecoder.IsSafePoint(safePointOffset))

src/vm/gcinfodecoder.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ bool GcInfoDecoder::IsSafePoint(UINT32 codeOffset)
374374
if(m_NumSafePoints == 0)
375375
return false;
376376

377-
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_)
377+
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
378378
// Safepoints are encoded with a -1 adjustment
379379
codeOffset--;
380380
#endif
@@ -394,7 +394,7 @@ UINT32 GcInfoDecoder::FindSafePoint(UINT32 breakOffset)
394394
const UINT32 numBitsPerOffset = CeilOfLog2(NORMALIZE_CODE_OFFSET(m_CodeLength));
395395
UINT32 result = m_NumSafePoints;
396396

397-
#if defined(_TARGET_ARM_)
397+
#if defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
398398
// Safepoints are encoded with a -1 adjustment
399399
// but normalizing them masks off the low order bit
400400
// Thus only bother looking if the address is odd
@@ -440,6 +440,12 @@ void GcInfoDecoder::EnumerateSafePoints(EnumerateSafePointsCallback *pCallback,
440440
{
441441
UINT32 normOffset = (UINT32)m_Reader.Read(numBitsPerOffset);
442442
UINT32 offset = DENORMALIZE_CODE_OFFSET(normOffset) + 2;
443+
444+
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
445+
// Safepoints are encoded with a -1 adjustment
446+
offset--;
447+
#endif
448+
443449
pCallback(offset, hCallback);
444450
}
445451
}

0 commit comments

Comments
 (0)