# HG changeset patch # User Christos Kotselidis # Date 1373878754 -7200 # Node ID 257e2455270eca88273aac3e01538f380e03ada9 # Parent cbaf26740df8f337802e467c55c30ddf352fb99f# Parent ff6eb563a2e27811da09193885226d4e3039e641 Merge diff -r ff6eb563a2e2 -r 257e2455270e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Sat Jul 13 17:21:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Mon Jul 15 10:59:14 2013 +0200 @@ -1168,7 +1168,11 @@ return Constant.forInt(base == null ? unsafe.getInt(displacement) : unsafe.getInt(base, displacement)); case Long: if (displacement == config().hubOffset && this.getGraalRuntime().getRuntime().config.useCompressedKlassPointers) { - return Constant.forLong(this.getGraalRuntime().getCompilerToVM().readUnsafeKlassPointer(base)); + if (base == null) { + throw new GraalInternalError("Base of object must not be null"); + } else { + return Constant.forLong(this.getGraalRuntime().getCompilerToVM().readUnsafeKlassPointer(base)); + } } else { return Constant.forLong(base == null ? unsafe.getLong(displacement) : unsafe.getLong(base, displacement)); } diff -r ff6eb563a2e2 -r 257e2455270e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Sat Jul 13 17:21:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Mon Jul 15 10:59:14 2013 +0200 @@ -351,7 +351,7 @@ } @Fold - public static int headerSize() { + public static int instanceHeaderSize() { return config().useCompressedKlassPointers ? (2 * wordSize()) - 4 : 2 * wordSize(); } diff -r ff6eb563a2e2 -r 257e2455270e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Sat Jul 13 17:21:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Mon Jul 15 10:59:14 2013 +0200 @@ -203,12 +203,12 @@ if (size <= MAX_UNROLLED_OBJECT_ZEROING_SIZE) { new_seqInit.inc(); explodeLoop(); - for (int offset = headerSize(); offset < size; offset += wordSize()) { + for (int offset = instanceHeaderSize(); offset < size; offset += wordSize()) { memory.writeWord(offset, Word.zero(), ANY_LOCATION); } } else { new_loopInit.inc(); - for (int offset = headerSize(); offset < size; offset += wordSize()) { + for (int offset = instanceHeaderSize(); offset < size; offset += wordSize()) { memory.writeWord(offset, Word.zero(), ANY_LOCATION); } } diff -r ff6eb563a2e2 -r 257e2455270e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java Sat Jul 13 17:21:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java Mon Jul 15 10:59:14 2013 +0200 @@ -57,7 +57,7 @@ Object result = NewObjectSnippets.allocateInstance(instanceSize, hub, prototypeMarkWord, useG1GC()); Pointer memory = Word.fromObject(result); - for (int offset = headerSize(); offset < instanceSize; offset += wordSize()) { + for (int offset = instanceHeaderSize(); offset < instanceSize; offset += wordSize()) { memory.writeWord(offset, Word.fromObject(src).readWord(offset, ANY_LOCATION), ANY_LOCATION); } diff -r ff6eb563a2e2 -r 257e2455270e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Sat Jul 13 17:21:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Mon Jul 15 10:59:14 2013 +0200 @@ -94,7 +94,7 @@ if (memory.notEqual(0)) { Word prototypeMarkWord = hub.readWord(prototypeMarkWordOffset(), PROTOTYPE_MARK_WORD_LOCATION); initializeObjectHeader(memory, prototypeMarkWord, hub); - for (int offset = headerSize(); offset < sizeInBytes; offset += wordSize()) { + for (int offset = instanceHeaderSize(); offset < sizeInBytes; offset += wordSize()) { memory.writeWord(offset, Word.zero(), ANY_LOCATION); } return verifyObject(memory.toObject());