Details
Description
Hashcode is calculated as int,little-endian mode will treat hashcode value as @0x1c171e1d00000000, so the Allocator:public static Address alignAllocation(Address region, int alignment, int offset, int knownAlignment, boolean fillAlignmentGap) can't find the start of object ref. JavaHeader:public static ObjectReference getObjectFromStartAddress(Address start), can't find alignment correctly.
============
[<0x0000000070606990>0x0000000061d5d1f0,0x0000000000001b20,0x0000000070598658,0x0000000000000000,@0x1c171e1d00000000]
=================
diff --git a/MMTk/src/org/mmtk/utility/alloc/Allocator.java b/MMTk/src/org/mmtk/utility/alloc/Allocator.java index 404ed86..bd94f5e 100644 --- a/MMTk/src/org/mmtk/utility/alloc/Allocator.java +++ b/MMTk/src/org/mmtk/utility/alloc/Allocator.java @@ -93,10 +93,10 @@ import org.vmmagic.pragma.*; return region; } } else { - while (delta.toInt() >= (BYTES_IN_WORD)) { - region.store(Word.fromIntSignExtend(ALIGNMENT_VALUE)); - region = region.plus(BYTES_IN_WORD); - delta = delta.minus(BYTES_IN_WORD); + while (delta.toInt() >= (BYTES_IN_INT)) { + region.store(ALIGNMENT_VALUE); + region = region.plus(BYTES_IN_INT); + delta = delta.minus(BYTES_IN_INT); } } }
Daniel, could you take a look and see if this patch should be applied?