# HG changeset patch # User Thomas Wuerthinger # Date 1381888420 -7200 # Node ID 930eb01324ecdd20f53c38fcd4038b9cf70b2c5b # Parent 97fe8342a90f211eae328d9817973f331be9eb25# Parent 39308acea2f7182f8b77c98ecaecf42990ef6aa4 Merge. diff -r 97fe8342a90f -r 930eb01324ec graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMethodSubstitutionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMethodSubstitutionTest.java Wed Oct 16 03:11:19 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMethodSubstitutionTest.java Wed Oct 16 03:53:40 2013 +0200 @@ -33,6 +33,11 @@ */ public class HotSpotMethodSubstitutionTest extends MethodSubstitutionTest { + /* + * We have to ignore this test for now because currently there is no way to read uncompressed + * pointers in a compressed world via JNI. + */ + @Ignore @Test public void testObjectSubstitutions() { test("getClass0"); @@ -54,6 +59,11 @@ return obj.hashCode(); } + /* + * We have to ignore this test for now because currently there is no way to read uncompressed + * pointers in a compressed world via JNI. + */ + @Ignore @Test public void testClassSubstitutions() { test("getModifiers"); @@ -112,6 +122,11 @@ return clazz.getComponentType(); } + /* + * We have to ignore this test for now because currently there is no way to read uncompressed + * pointers in a compressed world via JNI. + */ + @Ignore @Test public void testThreadSubstitutions() { test("currentThread"); diff -r 97fe8342a90f -r 930eb01324ec graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Wed Oct 16 03:11:19 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Wed Oct 16 03:53:40 2013 +0200 @@ -105,7 +105,7 @@ */ public static ResolvedJavaType fromMetaspaceKlass(long metaspaceKlass) { assert metaspaceKlass != 0; - Class javaClass = (Class) unsafe.getObject(null, metaspaceKlass + runtime().getConfig().classMirrorOffset); + Class javaClass = (Class) runtime().getCompilerToVM().readUnsafeUncompressedPointer(null, metaspaceKlass + runtime().getConfig().classMirrorOffset); assert javaClass != null; return fromClass(javaClass); } diff -r 97fe8342a90f -r 930eb01324ec graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Wed Oct 16 03:11:19 2013 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Wed Oct 16 03:53:40 2013 +0200 @@ -657,9 +657,7 @@ @Override @Operation(opcode = Opcode.READ) - public Object readObject(WordBase offset, LocationIdentity locationIdentity) { - return unsafe.getObject(null, add((Word) offset).unbox()); - } + public native Object readObject(WordBase offset, LocationIdentity locationIdentity); @Override @Operation(opcode = Opcode.READ) diff -r 97fe8342a90f -r 930eb01324ec src/share/vm/prims/unsafe.cpp --- a/src/share/vm/prims/unsafe.cpp Wed Oct 16 03:11:19 2013 +0200 +++ b/src/share/vm/prims/unsafe.cpp Wed Oct 16 03:53:40 2013 +0200 @@ -173,9 +173,7 @@ #define GET_OOP_FIELD(obj, offset, v) \ oop p = JNIHandles::resolve(obj); \ oop v; \ - /* Uncompression is not performed to unsafeAccess with null object. \ - * This concerns accesses to the metaspace such as the classMirrorOffset in Graal which is not compressed.*/ \ - if (UseCompressedOops GRAAL_ONLY(&& p != NULL && offset >= oopDesc::header_size())) { \ + if (UseCompressedOops) { \ narrowOop n = *(narrowOop*)index_oop_from_field_offset_long(p, offset); \ v = oopDesc::decode_heap_oop(n); \ } else { \