Skip to content

Commit

Permalink
Merge pull request dotnet#4279 from swaroop-sridhar/GC
Browse files Browse the repository at this point in the history
GCInfo: Fix ARM64 GCInfo decoding
  • Loading branch information
swaroop-sridhar committed Apr 12, 2016
2 parents a1eedcb + b6502aa commit ae2d2f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gcinfo/gcinfodumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ PORTABILITY_ASSERT("GcInfoDumper::EnumerateStateChanges is not implemented on th

#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
UINT32 safePointOffset = offset;
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_)
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
safePointOffset++;
#endif
if(safePointDecoder.IsSafePoint(safePointOffset))
Expand Down
10 changes: 8 additions & 2 deletions src/vm/gcinfodecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ bool GcInfoDecoder::IsSafePoint(UINT32 codeOffset)
if(m_NumSafePoints == 0)
return false;

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

#if defined(_TARGET_ARM_)
#if defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
// Safepoints are encoded with a -1 adjustment
// but normalizing them masks off the low order bit
// Thus only bother looking if the address is odd
Expand Down Expand Up @@ -440,6 +440,12 @@ void GcInfoDecoder::EnumerateSafePoints(EnumerateSafePointsCallback *pCallback,
{
UINT32 normOffset = (UINT32)m_Reader.Read(numBitsPerOffset);
UINT32 offset = DENORMALIZE_CODE_OFFSET(normOffset) + 2;

#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
// Safepoints are encoded with a -1 adjustment
offset--;
#endif

pCallback(offset, hCallback);
}
}
Expand Down

0 comments on commit ae2d2f3

Please sign in to comment.