Mercurial > hg > graal-compiler
changeset 12436:39308acea2f7
revert Unsafe.getObject hack to read uncompressed pointers
author | twisti |
---|---|
date | Tue, 15 Oct 2013 18:04:13 -0700 |
parents | 43e004461248 |
children | c991f8291f1b 930eb01324ec |
files | graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMethodSubstitutionTest.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java src/share/vm/prims/unsafe.cpp |
diffstat | 4 files changed, 18 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMethodSubstitutionTest.java Wed Oct 16 01:12:47 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMethodSubstitutionTest.java Tue Oct 15 18:04:13 2013 -0700 @@ -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");
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Wed Oct 16 01:12:47 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Tue Oct 15 18:04:13 2013 -0700 @@ -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); }
--- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Wed Oct 16 01:12:47 2013 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Tue Oct 15 18:04:13 2013 -0700 @@ -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)
--- a/src/share/vm/prims/unsafe.cpp Wed Oct 16 01:12:47 2013 +0200 +++ b/src/share/vm/prims/unsafe.cpp Tue Oct 15 18:04:13 2013 -0700 @@ -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 { \