< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java

Print this page

        

*** 119,131 **** public static boolean unsafeCompareAndSetDouble() { Container container = new Container(); return unsafe.compareAndSetDouble(container, doubleOffset, 0.125, 0.25); } ! public static boolean unsafeCompareAndSetObject() { Container container = new Container(); ! return unsafe.compareAndSetObject(container, objectOffset, dummyValue, newDummyValue); } public static boolean unsafeCompareAndExchangeBoolean() { Container container = new Container(); return unsafe.compareAndExchangeBoolean(container, booleanOffset, false, true); --- 119,131 ---- public static boolean unsafeCompareAndSetDouble() { Container container = new Container(); return unsafe.compareAndSetDouble(container, doubleOffset, 0.125, 0.25); } ! public static boolean unsafeCompareAndSetReference() { Container container = new Container(); ! return unsafe.compareAndSetReference(container, objectOffset, dummyValue, newDummyValue); } public static boolean unsafeCompareAndExchangeBoolean() { Container container = new Container(); return unsafe.compareAndExchangeBoolean(container, booleanOffset, false, true);
*** 164,176 **** public static double unsafeCompareAndExchangeDouble() { Container container = new Container(); return unsafe.compareAndExchangeDouble(container, doubleOffset, 0.125, 0.25); } ! public static Object unsafeCompareAndExchangeObject() { Container container = new Container(); ! return unsafe.compareAndExchangeObject(container, objectOffset, dummyValue, newDummyValue); } @Test public void testCompareAndSet() { TargetDescription target = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getTarget(); --- 164,176 ---- public static double unsafeCompareAndExchangeDouble() { Container container = new Container(); return unsafe.compareAndExchangeDouble(container, doubleOffset, 0.125, 0.25); } ! public static Object unsafeCompareAndExchangeReference() { Container container = new Container(); ! return unsafe.compareAndExchangeReference(container, objectOffset, dummyValue, newDummyValue); } @Test public void testCompareAndSet() { TargetDescription target = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getTarget();
*** 181,219 **** testGraph("unsafeCompareAndSetShort"); testGraph("unsafeCompareAndSetInt"); testGraph("unsafeCompareAndSetLong"); testGraph("unsafeCompareAndSetFloat"); testGraph("unsafeCompareAndSetDouble"); ! testGraph("unsafeCompareAndSetObject"); testGraph("unsafeCompareAndExchangeBoolean"); testGraph("unsafeCompareAndExchangeByte"); testGraph("unsafeCompareAndExchangeChar"); testGraph("unsafeCompareAndExchangeShort"); testGraph("unsafeCompareAndExchangeInt"); testGraph("unsafeCompareAndExchangeLong"); testGraph("unsafeCompareAndExchangeFloat"); testGraph("unsafeCompareAndExchangeDouble"); ! testGraph("unsafeCompareAndExchangeObject"); } test("unsafeCompareAndSetBoolean"); test("unsafeCompareAndSetByte"); test("unsafeCompareAndSetChar"); test("unsafeCompareAndSetShort"); test("unsafeCompareAndSetInt"); test("unsafeCompareAndSetLong"); test("unsafeCompareAndSetFloat"); test("unsafeCompareAndSetDouble"); ! test("unsafeCompareAndSetObject"); test("unsafeCompareAndExchangeBoolean"); test("unsafeCompareAndExchangeByte"); test("unsafeCompareAndExchangeChar"); test("unsafeCompareAndExchangeShort"); test("unsafeCompareAndExchangeInt"); test("unsafeCompareAndExchangeLong"); test("unsafeCompareAndExchangeFloat"); test("unsafeCompareAndExchangeDouble"); ! test("unsafeCompareAndExchangeObject"); } public static int unsafeGetAndAddByte() { Container container = new Container(); return unsafe.getAndAddByte(container, byteOffset, (byte) 2); --- 181,219 ---- testGraph("unsafeCompareAndSetShort"); testGraph("unsafeCompareAndSetInt"); testGraph("unsafeCompareAndSetLong"); testGraph("unsafeCompareAndSetFloat"); testGraph("unsafeCompareAndSetDouble"); ! testGraph("unsafeCompareAndSetReference"); testGraph("unsafeCompareAndExchangeBoolean"); testGraph("unsafeCompareAndExchangeByte"); testGraph("unsafeCompareAndExchangeChar"); testGraph("unsafeCompareAndExchangeShort"); testGraph("unsafeCompareAndExchangeInt"); testGraph("unsafeCompareAndExchangeLong"); testGraph("unsafeCompareAndExchangeFloat"); testGraph("unsafeCompareAndExchangeDouble"); ! testGraph("unsafeCompareAndExchangeReference"); } test("unsafeCompareAndSetBoolean"); test("unsafeCompareAndSetByte"); test("unsafeCompareAndSetChar"); test("unsafeCompareAndSetShort"); test("unsafeCompareAndSetInt"); test("unsafeCompareAndSetLong"); test("unsafeCompareAndSetFloat"); test("unsafeCompareAndSetDouble"); ! test("unsafeCompareAndSetReference"); test("unsafeCompareAndExchangeBoolean"); test("unsafeCompareAndExchangeByte"); test("unsafeCompareAndExchangeChar"); test("unsafeCompareAndExchangeShort"); test("unsafeCompareAndExchangeInt"); test("unsafeCompareAndExchangeLong"); test("unsafeCompareAndExchangeFloat"); test("unsafeCompareAndExchangeDouble"); ! test("unsafeCompareAndExchangeReference"); } public static int unsafeGetAndAddByte() { Container container = new Container(); return unsafe.getAndAddByte(container, byteOffset, (byte) 2);
*** 286,300 **** public static long unsafeGetAndSetLong() { Container container = new Container(); return unsafe.getAndSetLong(container, longOffset, 0x12345678abL); } ! public static Object unsafeGetAndSetObject() { Container container = new Container(); container.objectField = null; Container other = new Container(); ! return unsafe.getAndSetObject(container, objectOffset, other); } @Test public void testGetAndSet() { TargetDescription target = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getTarget(); --- 286,300 ---- public static long unsafeGetAndSetLong() { Container container = new Container(); return unsafe.getAndSetLong(container, longOffset, 0x12345678abL); } ! public static Object unsafeGetAndSetReference() { Container container = new Container(); container.objectField = null; Container other = new Container(); ! return unsafe.getAndSetReference(container, objectOffset, other); } @Test public void testGetAndSet() { TargetDescription target = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getTarget();
*** 305,323 **** testGraph("unsafeGetAndSetShort"); } if (target.arch instanceof AMD64 || target.arch instanceof AArch64) { testGraph("unsafeGetAndSetInt"); testGraph("unsafeGetAndSetLong"); ! testGraph("unsafeGetAndSetObject"); } test("unsafeGetAndSetBoolean"); test("unsafeGetAndSetByte"); test("unsafeGetAndSetChar"); test("unsafeGetAndSetShort"); test("unsafeGetAndSetInt"); test("unsafeGetAndSetLong"); ! test("unsafeGetAndSetObject"); } public static void fieldInstance() { JdkInternalMiscUnsafeAccessTestBoolean.testFieldInstance(); } --- 305,323 ---- testGraph("unsafeGetAndSetShort"); } if (target.arch instanceof AMD64 || target.arch instanceof AArch64) { testGraph("unsafeGetAndSetInt"); testGraph("unsafeGetAndSetLong"); ! testGraph("unsafeGetAndSetReference"); } test("unsafeGetAndSetBoolean"); test("unsafeGetAndSetByte"); test("unsafeGetAndSetChar"); test("unsafeGetAndSetShort"); test("unsafeGetAndSetInt"); test("unsafeGetAndSetLong"); ! test("unsafeGetAndSetReference"); } public static void fieldInstance() { JdkInternalMiscUnsafeAccessTestBoolean.testFieldInstance(); }
*** 560,573 **** Container container = new Container(); unsafe.putDouble(container, doubleOffset, 1.23456789); return unsafe.getDouble(container, doubleOffset); } ! public static Object unsafeGetPutObject() { Container container = new Container(); ! unsafe.putObject(container, objectOffset, "Hello there"); ! return unsafe.getObject(container, objectOffset); } public static boolean unsafeGetPutBooleanOpaque() { Container container = new Container(); unsafe.putBooleanOpaque(container, booleanOffset, true); --- 560,573 ---- Container container = new Container(); unsafe.putDouble(container, doubleOffset, 1.23456789); return unsafe.getDouble(container, doubleOffset); } ! public static Object unsafeGetPutReference() { Container container = new Container(); ! unsafe.putReference(container, objectOffset, "Hello there"); ! return unsafe.getReference(container, objectOffset); } public static boolean unsafeGetPutBooleanOpaque() { Container container = new Container(); unsafe.putBooleanOpaque(container, booleanOffset, true);
*** 614,627 **** Container container = new Container(); unsafe.putDoubleOpaque(container, doubleOffset, 1.23456789); return unsafe.getDoubleOpaque(container, doubleOffset); } ! public static Object unsafeGetPutObjectOpaque() { Container container = new Container(); ! unsafe.putObjectOpaque(container, objectOffset, "Hello there"); ! return unsafe.getObjectOpaque(container, objectOffset); } public static boolean unsafeGetPutBooleanRA() { Container container = new Container(); unsafe.putBooleanRelease(container, booleanOffset, true); --- 614,627 ---- Container container = new Container(); unsafe.putDoubleOpaque(container, doubleOffset, 1.23456789); return unsafe.getDoubleOpaque(container, doubleOffset); } ! public static Object unsafeGetPutReferenceOpaque() { Container container = new Container(); ! unsafe.putReferenceOpaque(container, objectOffset, "Hello there"); ! return unsafe.getReferenceOpaque(container, objectOffset); } public static boolean unsafeGetPutBooleanRA() { Container container = new Container(); unsafe.putBooleanRelease(container, booleanOffset, true);
*** 668,681 **** Container container = new Container(); unsafe.putDoubleRelease(container, doubleOffset, 1.23456789); return unsafe.getDoubleAcquire(container, doubleOffset); } ! public static Object unsafeGetPutObjectRA() { Container container = new Container(); ! unsafe.putObjectRelease(container, objectOffset, "Hello there"); ! return unsafe.getObjectAcquire(container, objectOffset); } public static boolean unsafeGetPutBooleanVolatile() { Container container = new Container(); unsafe.putBooleanVolatile(container, booleanOffset, true); --- 668,681 ---- Container container = new Container(); unsafe.putDoubleRelease(container, doubleOffset, 1.23456789); return unsafe.getDoubleAcquire(container, doubleOffset); } ! public static Object unsafeGetPutReferenceRA() { Container container = new Container(); ! unsafe.putReferenceRelease(container, objectOffset, "Hello there"); ! return unsafe.getReferenceAcquire(container, objectOffset); } public static boolean unsafeGetPutBooleanVolatile() { Container container = new Container(); unsafe.putBooleanVolatile(container, booleanOffset, true);
*** 722,735 **** Container container = new Container(); unsafe.putDoubleVolatile(container, doubleOffset, 1.23456789); return unsafe.getDoubleVolatile(container, doubleOffset); } ! public static Object unsafeGetPutObjectVolatile() { Container container = new Container(); ! unsafe.putObjectVolatile(container, objectOffset, "Hello there"); ! return unsafe.getObjectVolatile(container, objectOffset); } @Test public void testUnsafeGetPutPlain() { testGraph("unsafeGetPutBoolean"); --- 722,735 ---- Container container = new Container(); unsafe.putDoubleVolatile(container, doubleOffset, 1.23456789); return unsafe.getDoubleVolatile(container, doubleOffset); } ! public static Object unsafeGetPutReferenceVolatile() { Container container = new Container(); ! unsafe.putReferenceVolatile(container, objectOffset, "Hello there"); ! return unsafe.getReferenceVolatile(container, objectOffset); } @Test public void testUnsafeGetPutPlain() { testGraph("unsafeGetPutBoolean");
*** 784,804 **** testGraph("unsafeGetPutCharRA"); testGraph("unsafeGetPutIntRA"); testGraph("unsafeGetPutLongRA"); testGraph("unsafeGetPutFloatRA"); testGraph("unsafeGetPutDoubleRA"); ! testGraph("unsafeGetPutObjectRA"); test("unsafeGetPutBooleanRA"); test("unsafeGetPutByteRA"); test("unsafeGetPutShortRA"); test("unsafeGetPutCharRA"); test("unsafeGetPutIntRA"); test("unsafeGetPutLongRA"); test("unsafeGetPutFloatRA"); test("unsafeGetPutDoubleRA"); ! test("unsafeGetPutObjectRA"); } @Test public void testUnsafeGetPutVolatile() { testGraph("unsafeGetPutBooleanVolatile"); --- 784,804 ---- testGraph("unsafeGetPutCharRA"); testGraph("unsafeGetPutIntRA"); testGraph("unsafeGetPutLongRA"); testGraph("unsafeGetPutFloatRA"); testGraph("unsafeGetPutDoubleRA"); ! testGraph("unsafeGetPutReferenceRA"); test("unsafeGetPutBooleanRA"); test("unsafeGetPutByteRA"); test("unsafeGetPutShortRA"); test("unsafeGetPutCharRA"); test("unsafeGetPutIntRA"); test("unsafeGetPutLongRA"); test("unsafeGetPutFloatRA"); test("unsafeGetPutDoubleRA"); ! test("unsafeGetPutReferenceRA"); } @Test public void testUnsafeGetPutVolatile() { testGraph("unsafeGetPutBooleanVolatile");
*** 807,824 **** testGraph("unsafeGetPutCharVolatile"); testGraph("unsafeGetPutIntVolatile"); testGraph("unsafeGetPutLongVolatile"); testGraph("unsafeGetPutFloatVolatile"); testGraph("unsafeGetPutDoubleVolatile"); ! testGraph("unsafeGetPutObjectVolatile"); test("unsafeGetPutBooleanVolatile"); test("unsafeGetPutByteVolatile"); test("unsafeGetPutShortVolatile"); test("unsafeGetPutCharVolatile"); test("unsafeGetPutIntVolatile"); test("unsafeGetPutLongVolatile"); test("unsafeGetPutFloatVolatile"); test("unsafeGetPutDoubleVolatile"); ! test("unsafeGetPutObjectVolatile"); } } --- 807,824 ---- testGraph("unsafeGetPutCharVolatile"); testGraph("unsafeGetPutIntVolatile"); testGraph("unsafeGetPutLongVolatile"); testGraph("unsafeGetPutFloatVolatile"); testGraph("unsafeGetPutDoubleVolatile"); ! testGraph("unsafeGetPutReferenceVolatile"); test("unsafeGetPutBooleanVolatile"); test("unsafeGetPutByteVolatile"); test("unsafeGetPutShortVolatile"); test("unsafeGetPutCharVolatile"); test("unsafeGetPutIntVolatile"); test("unsafeGetPutLongVolatile"); test("unsafeGetPutFloatVolatile"); test("unsafeGetPutDoubleVolatile"); ! test("unsafeGetPutReferenceVolatile"); } }
< prev index next >