Mercurial > hg > truffle
changeset 10746:257e2455270e
Merge
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Mon, 15 Jul 2013 10:59:14 +0200 |
parents | cbaf26740df8 (diff) ff6eb563a2e2 (current diff) |
children | 3811d04d933e |
files | |
diffstat | 5 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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)); }
--- 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(); }
--- 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); } }
--- 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); }
--- 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());