--- old/test/compiler/c2/Test6968348.java 2016-09-12 13:56:11.521979109 -0400 +++ new/test/compiler/c2/Test6968348.java 2016-09-12 13:56:10.942975089 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,15 +38,11 @@ import java.lang.reflect.Field; public class Test6968348 { - static Unsafe unsafe; + static Unsafe unsafe = Unsafe.getUnsafe(); static final long[] buffer = new long[4096]; static int array_long_base_offset; public static void main(String[] args) throws Exception { - Class c = Test6968348.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe"); - Field f = c.getDeclaredField("theUnsafe"); - f.setAccessible(true); - unsafe = (Unsafe)f.get(c); array_long_base_offset = unsafe.arrayBaseOffset(long[].class); for (int n = 0; n < 100000; n++) { --- old/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java 2016-09-12 13:56:13.303350195 -0400 +++ new/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java 2016-09-12 13:56:12.801516029 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,14 +50,10 @@ private static final int ALIGN_OFF = 8; private static final int UNALIGN_OFF = 5; - private static final Unsafe unsafe; + private static final Unsafe unsafe = Unsafe.getUnsafe(); private static final int BASE; static { try { - Class c = TestIntUnsafeCAS.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe"); - Field f = c.getDeclaredField("theUnsafe"); - f.setAccessible(true); - unsafe = (Unsafe)f.get(c); BASE = unsafe.arrayBaseOffset(int[].class); } catch (Exception e) { InternalError err = new InternalError(); --- old/test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java 2016-09-12 13:56:15.134958035 -0400 +++ new/test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java 2016-09-12 13:56:14.555995375 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,14 +50,10 @@ private static final int ALIGN_OFF = 8; private static final int UNALIGN_OFF = 5; - private static final Unsafe unsafe; + private static final Unsafe unsafe = Unsafe.getUnsafe(); private static final int BASE; static { try { - Class c = Unsafe.class; - Field f = c.getDeclaredField("theUnsafe"); - f.setAccessible(true); - unsafe = (Unsafe) f.get(c); BASE = unsafe.arrayBaseOffset(int[].class); } catch (Exception e) { InternalError err = new InternalError(); --- old/test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java 2016-09-12 13:56:16.923484644 -0400 +++ new/test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java 2016-09-12 13:56:16.335089073 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,14 +50,10 @@ private static final int ALIGN_OFF = 8; private static final int UNALIGN_OFF = 5; - private static final Unsafe unsafe; + private static final Unsafe unsafe = Unsafe.getUnsafe(); private static final int BASE; static { try { - Class c = TestIntUnsafeVolatile.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe"); - Field f = c.getDeclaredField("theUnsafe"); - f.setAccessible(true); - unsafe = (Unsafe)f.get(c); BASE = unsafe.arrayBaseOffset(int[].class); } catch (Exception e) { InternalError err = new InternalError(); --- old/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java 2016-09-12 13:56:18.672975743 -0400 +++ new/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java 2016-09-12 13:56:18.089975453 -0400 @@ -27,7 +27,6 @@ * @bug 8142386 * @summary Unsafe access to an array is wrongly marked as mismatched * @modules java.base/jdk.internal.misc - * @library /test/lib * * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation * compiler.intrinsics.unsafe.TestUnsafeMismatchedArrayFieldAccess @@ -36,11 +35,10 @@ package compiler.intrinsics.unsafe; import jdk.internal.misc.Unsafe; -import jdk.test.lib.unsafe.UnsafeHelper; public class TestUnsafeMismatchedArrayFieldAccess { - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); static { try { --- old/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java 2016-09-12 13:56:20.446042758 -0400 +++ new/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java 2016-09-12 13:56:19.978069543 -0400 @@ -45,7 +45,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject; @@ -114,7 +113,7 @@ abstract HotSpotResolvedJavaMethod getResolvedJavaMethod(); } - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); private static final WhiteBox WB = WhiteBox.getWhiteBox(); private static final Field METASPACE_METHOD_FIELD; private static final Class TEST_CLASS = GetResolvedJavaMethodTest.class; --- old/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 2016-09-12 13:56:22.446137449 -0400 +++ new/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 2016-09-12 13:56:21.783442862 -0400 @@ -53,7 +53,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; @@ -154,7 +153,7 @@ abstract HotSpotResolvedObjectType getResolvedJavaType(); } - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); private static final WhiteBox WB = WhiteBox.getWhiteBox(); private static final Class TEST_CLASS = GetResolvedJavaTypeTest.class; /* a compressed parameter for tested method is set to false because --- old/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java 2016-09-12 13:56:24.204322977 -0400 +++ new/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java 2016-09-12 13:56:23.622386508 -0400 @@ -53,7 +53,6 @@ import jdk.internal.misc.Unsafe; import jdk.internal.org.objectweb.asm.Opcodes; import jdk.test.lib.Asserts; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.ConstantPool; @@ -69,7 +68,7 @@ */ public class ResolveFieldInPoolTest { - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); public static void main(String[] args) throws Exception { Map typeTests = new HashMap<>(); --- old/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java 2016-09-12 13:56:25.964291082 -0400 +++ new/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java 2016-09-12 13:56:25.363062980 -0400 @@ -52,7 +52,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; import jdk.test.lib.Utils; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; @@ -61,7 +60,7 @@ import java.util.Set; public class ResolveMethodTest { - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); public static void main(String args[]) { ResolveMethodTest test = new ResolveMethodTest(); --- old/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java 2016-09-12 13:56:27.883318686 -0400 +++ new/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java 2016-09-12 13:56:27.374039255 -0400 @@ -34,7 +34,6 @@ package compiler.loopopts.superword; import jdk.internal.misc.Unsafe; -import jdk.test.lib.unsafe.UnsafeHelper; public class TestVectorizationWithInvariant { @@ -43,7 +42,7 @@ private static final long CHAR_ARRAY_OFFSET; static { - unsafe = UnsafeHelper.getUnsafe(); + unsafe = Unsafe.getUnsafe(); BYTE_ARRAY_OFFSET = unsafe.arrayBaseOffset(byte[].class); CHAR_ARRAY_OFFSET = unsafe.arrayBaseOffset(char[].class); } --- old/test/compiler/rtm/locking/TestRTMAbortRatio.java 2016-09-12 13:56:29.786318878 -0400 +++ new/test/compiler/rtm/locking/TestRTMAbortRatio.java 2016-09-12 13:56:29.200388628 -0400 @@ -49,7 +49,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; @@ -125,7 +124,7 @@ public static class Test implements CompilableTest { private static final int TOTAL_ITERATIONS = 10000; private static final int WARMUP_ITERATIONS = 1000; - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); private final Object monitor = new Object(); // Following field have to be static in order to avoid escape analysis. @SuppressWarnings("UnsuedDeclaration") --- old/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java 2016-09-12 13:56:31.571022398 -0400 +++ new/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java 2016-09-12 13:56:30.942407766 -0400 @@ -51,7 +51,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; @@ -158,7 +157,7 @@ private static int field = 0; private static final int ITERATIONS = 10000; private static final int RANGE_CHECK_AT = ITERATIONS / 2; - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); private final Object monitor = new Object(); @Override --- old/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java 2016-09-12 13:56:33.475318436 -0400 +++ new/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java 2016-09-12 13:56:32.875404262 -0400 @@ -48,7 +48,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; @@ -133,7 +132,7 @@ } public static class Test implements CompilableTest { - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); private final Object monitor = new Object(); @Override --- old/test/compiler/rtm/locking/TestRTMLockingThreshold.java 2016-09-12 13:56:35.236478851 -0400 +++ new/test/compiler/rtm/locking/TestRTMLockingThreshold.java 2016-09-12 13:56:34.748516684 -0400 @@ -49,7 +49,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; @@ -142,7 +141,7 @@ @SuppressWarnings("UnsuedDeclaration") private static int field = 0; private static final int TOTAL_ITERATIONS = 10000; - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); private final Object monitor = new Object(); --- old/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java 2016-09-12 13:56:37.118043011 -0400 +++ new/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java 2016-09-12 13:56:36.532535490 -0400 @@ -49,7 +49,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; @@ -113,7 +112,7 @@ public static class Test implements CompilableTest { private static final long TOTAL_ITERATIONS = 10000L; - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); private final Object monitor = new Object(); // Following field have to be static in order to avoid escape analysis. @SuppressWarnings("UnsuedDeclaration") --- old/test/compiler/testlibrary/rtm/XAbortProvoker.java 2016-09-12 13:56:38.967005214 -0400 +++ new/test/compiler/testlibrary/rtm/XAbortProvoker.java 2016-09-12 13:56:38.366519007 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,6 @@ package compiler.testlibrary.rtm; import jdk.internal.misc.Unsafe; -import jdk.test.lib.unsafe.UnsafeHelper; /** * Current RTM locking implementation force transaction abort @@ -35,7 +34,7 @@ // Following field have to be static in order to avoid escape analysis. @SuppressWarnings("UnsuedDeclaration") private static int field = 0; - private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); public XAbortProvoker() { this(new Object()); --- old/test/compiler/unsafe/UnsafeRaw.java 2016-09-12 13:56:40.743382906 -0400 +++ new/test/compiler/unsafe/UnsafeRaw.java 2016-09-12 13:56:40.144028901 -0400 @@ -35,7 +35,6 @@ import jdk.internal.misc.Unsafe; import jdk.test.lib.Utils; -import jdk.test.lib.unsafe.UnsafeHelper; import java.util.Random; @@ -82,7 +81,7 @@ } public static void main(String[] args) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); final int array_size = 128; final int element_size = 4; final int magic = 0x12345678; --- old/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java 2016-09-12 13:56:42.563005345 -0400 +++ new/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java 2016-09-12 13:56:42.060980405 -0400 @@ -37,7 +37,6 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; public class TestMaxMinHeapFreeRatioFlags { @@ -134,7 +133,7 @@ */ public static class RatioVerifier { - private static final Unsafe unsafe = UnsafeHelper.getUnsafe(); + private static final Unsafe unsafe = Unsafe.getUnsafe(); // Size of byte array that will be allocated public static final int CHUNK_SIZE = 1024; --- old/test/gc/arguments/TestTargetSurvivorRatioFlag.java 2016-09-12 13:56:44.441292423 -0400 +++ new/test/gc/arguments/TestTargetSurvivorRatioFlag.java 2016-09-12 13:56:43.862384255 -0400 @@ -46,7 +46,6 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; -import jdk.test.lib.unsafe.UnsafeHelper; import sun.hotspot.WhiteBox; /* In order to test that TargetSurvivorRatio affects survivor space occupancy @@ -249,7 +248,7 @@ public static class TargetSurvivorRatioVerifier { static final WhiteBox wb = WhiteBox.getWhiteBox(); - static final Unsafe unsafe = UnsafeHelper.getUnsafe(); + static final Unsafe unsafe = Unsafe.getUnsafe(); // Desired size of memory allocated at once public static final int CHUNK_SIZE = 1024; --- old/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java 2016-09-12 13:56:46.302008953 -0400 +++ new/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java 2016-09-12 13:56:45.689166931 -0400 @@ -34,13 +34,12 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; public class CreateCoredumpOnCrash { private static class Crasher { public static void main(String[] args) { - UnsafeHelper.getUnsafe().putInt(0L, 0); + Unsafe.getUnsafe().putInt(0L, 0); } } --- old/test/runtime/ErrorHandling/ProblematicFrameTest.java 2016-09-12 13:56:48.155289467 -0400 +++ new/test/runtime/ErrorHandling/ProblematicFrameTest.java 2016-09-12 13:56:47.522979589 -0400 @@ -35,14 +35,13 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; public class ProblematicFrameTest { private static class Crasher { public static void main(String[] args) { - UnsafeHelper.getUnsafe().getInt(0); + Unsafe.getUnsafe().getInt(0); } } --- old/test/runtime/Unsafe/AllocateInstance.java 2016-09-12 13:56:49.889350020 -0400 +++ new/test/runtime/Unsafe/AllocateInstance.java 2016-09-12 13:56:49.418472772 -0400 @@ -30,12 +30,11 @@ * @run main AllocateInstance */ -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class AllocateInstance { - static final Unsafe UNSAFE = UnsafeHelper.getUnsafe(); + static final Unsafe UNSAFE = Unsafe.getUnsafe(); class TestClass { public boolean calledConstructor = false; --- old/test/runtime/Unsafe/AllocateMemory.java 2016-09-12 13:56:51.808064759 -0400 +++ new/test/runtime/Unsafe/AllocateMemory.java 2016-09-12 13:56:51.167312146 -0400 @@ -31,13 +31,12 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory */ -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class AllocateMemory { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); // Allocate a byte, write to the location and read back the value long address = unsafe.allocateMemory(1); --- old/test/runtime/Unsafe/CopyMemory.java 2016-09-12 13:56:53.574453491 -0400 +++ new/test/runtime/Unsafe/CopyMemory.java 2016-09-12 13:56:52.982258036 -0400 @@ -30,14 +30,13 @@ * @run main CopyMemory */ -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class CopyMemory { final static int LENGTH = 8; public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); long src = unsafe.allocateMemory(LENGTH); long dst = unsafe.allocateMemory(LENGTH); assertNotEquals(src, 0L); --- old/test/runtime/Unsafe/DefineClass.java 2016-09-12 13:56:55.422115879 -0400 +++ new/test/runtime/Unsafe/DefineClass.java 2016-09-12 13:56:54.804360038 -0400 @@ -34,13 +34,12 @@ import java.security.ProtectionDomain; import java.io.InputStream; import jdk.test.lib.InMemoryJavaCompiler; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class DefineClass { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); TestClassLoader classloader = new TestClassLoader(); ProtectionDomain pd = new ProtectionDomain(null, null); --- old/test/runtime/Unsafe/FieldOffset.java 2016-09-12 13:56:57.233286354 -0400 +++ new/test/runtime/Unsafe/FieldOffset.java 2016-09-12 13:56:56.737105819 -0400 @@ -31,14 +31,13 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import java.lang.reflect.*; import static jdk.test.lib.Asserts.*; public class FieldOffset { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Field[] fields = Test.class.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { --- old/test/runtime/Unsafe/GetField.java 2016-09-12 13:57:00.233073657 -0400 +++ new/test/runtime/Unsafe/GetField.java 2016-09-12 13:56:58.737435142 -0400 @@ -30,14 +30,13 @@ * @run main GetField */ -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import java.lang.reflect.*; import static jdk.test.lib.Asserts.*; public class GetField { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); // Unsafe.INVALID_FIELD_OFFSET is a static final int field, // make sure getField returns the correct field Field field = Unsafe.class.getField("INVALID_FIELD_OFFSET"); --- old/test/runtime/Unsafe/GetPutAddress.java 2016-09-12 13:57:02.073265440 -0400 +++ new/test/runtime/Unsafe/GetPutAddress.java 2016-09-12 13:57:01.530004356 -0400 @@ -31,13 +31,12 @@ */ import jdk.test.lib.Platform; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutAddress { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); int addressSize = unsafe.addressSize(); // Ensure the size returned from Unsafe.addressSize is correct assertEquals(unsafe.addressSize(), Platform.is32bit() ? 4 : 8); --- old/test/runtime/Unsafe/GetPutBoolean.java 2016-09-12 13:57:04.053008631 -0400 +++ new/test/runtime/Unsafe/GetPutBoolean.java 2016-09-12 13:57:03.440152656 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutBoolean { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Field field = Test.class.getField("b1"); --- old/test/runtime/Unsafe/GetPutByte.java 2016-09-12 13:57:05.787085670 -0400 +++ new/test/runtime/Unsafe/GetPutByte.java 2016-09-12 13:57:05.187383193 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutByte { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Field field = Test.class.getField("b"); --- old/test/runtime/Unsafe/GetPutChar.java 2016-09-12 13:57:07.584351519 -0400 +++ new/test/runtime/Unsafe/GetPutChar.java 2016-09-12 13:57:07.037464680 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutChar { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Field field = Test.class.getField("c"); --- old/test/runtime/Unsafe/GetPutDouble.java 2016-09-12 13:57:09.399233070 -0400 +++ new/test/runtime/Unsafe/GetPutDouble.java 2016-09-12 13:57:08.876224758 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutDouble { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Field field = Test.class.getField("d"); --- old/test/runtime/Unsafe/GetPutFloat.java 2016-09-12 13:57:11.323317001 -0400 +++ new/test/runtime/Unsafe/GetPutFloat.java 2016-09-12 13:57:10.617375551 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutFloat { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Field field = Test.class.getField("f"); --- old/test/runtime/Unsafe/GetPutInt.java 2016-09-12 13:57:13.173039855 -0400 +++ new/test/runtime/Unsafe/GetPutInt.java 2016-09-12 13:57:12.542497872 -0400 @@ -30,13 +30,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutInt { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Field field = Test.class.getField("i"); --- old/test/runtime/Unsafe/GetPutLong.java 2016-09-12 13:57:14.927348617 -0400 +++ new/test/runtime/Unsafe/GetPutLong.java 2016-09-12 13:57:14.397469265 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutLong { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Field field = Test.class.getField("l"); --- old/test/runtime/Unsafe/GetPutObject.java 2016-09-12 13:57:16.772295399 -0400 +++ new/test/runtime/Unsafe/GetPutObject.java 2016-09-12 13:57:16.239337995 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutObject { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Object o = new Object(); Field field = Test.class.getField("o"); --- old/test/runtime/Unsafe/GetPutShort.java 2016-09-12 13:57:18.604317787 -0400 +++ new/test/runtime/Unsafe/GetPutShort.java 2016-09-12 13:57:18.011375684 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class GetPutShort { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Test t = new Test(); Field field = Test.class.getField("s"); --- old/test/runtime/Unsafe/GetUncompressedObject.java 2016-09-12 13:57:20.386351652 -0400 +++ new/test/runtime/Unsafe/GetUncompressedObject.java 2016-09-12 13:57:19.799338032 -0400 @@ -30,13 +30,12 @@ import static jdk.test.lib.Asserts.*; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; public class GetUncompressedObject { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); // Allocate some memory and fill it with non-zero values. final int size = 32; --- old/test/runtime/Unsafe/NestedUnsafe.java 2016-09-12 13:57:22.187419503 -0400 +++ new/test/runtime/Unsafe/NestedUnsafe.java 2016-09-12 13:57:21.659224804 -0400 @@ -35,7 +35,6 @@ import java.io.InputStream; import java.lang.*; import jdk.test.lib.InMemoryJavaCompiler; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; @@ -50,7 +49,7 @@ " } } "); public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); Class klass = unsafe.defineAnonymousClass(NestedUnsafe.class, klassbuf, new Object[0]); unsafe.ensureClassInitialized(klass); --- old/test/runtime/Unsafe/PageSize.java 2016-09-12 13:57:24.073319221 -0400 +++ new/test/runtime/Unsafe/PageSize.java 2016-09-12 13:57:23.507339030 -0400 @@ -31,13 +31,12 @@ */ import java.lang.reflect.Field; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class PageSize { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); int pageSize = unsafe.pageSize(); for (int n = 1; n != 0; n <<= 1) { --- old/test/runtime/Unsafe/PrimitiveHostClass.java 2016-09-12 13:57:25.939038148 -0400 +++ new/test/runtime/Unsafe/PrimitiveHostClass.java 2016-09-12 13:57:25.331065059 -0400 @@ -39,16 +39,7 @@ public class PrimitiveHostClass { - static final Unsafe U; - static { - try { - Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); - theUnsafe.setAccessible(true); - U = (Unsafe) theUnsafe.get(null); - } catch (Exception e) { - throw new AssertionError(e); - } - } + static final Unsafe U = Unsafe.getUnsafe(); public static void testVMAnonymousClass(Class hostClass) { --- old/test/runtime/Unsafe/RangeCheck.java 2016-09-12 13:57:27.786383306 -0400 +++ new/test/runtime/Unsafe/RangeCheck.java 2016-09-12 13:57:27.160335894 -0400 @@ -33,7 +33,6 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; @@ -60,7 +59,7 @@ public static class DummyClassWithMainRangeCheck { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); unsafe.getObject(new DummyClassWithMainRangeCheck(), Short.MAX_VALUE); } } --- old/test/runtime/Unsafe/Reallocate.java 2016-09-12 13:57:29.582263221 -0400 +++ new/test/runtime/Unsafe/Reallocate.java 2016-09-12 13:57:29.020383822 -0400 @@ -31,13 +31,12 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m Reallocate */ -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class Reallocate { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); long address = unsafe.allocateMemory(1); assertNotEquals(address, 0L); --- old/test/runtime/Unsafe/SetMemory.java 2016-09-12 13:57:31.405352454 -0400 +++ new/test/runtime/Unsafe/SetMemory.java 2016-09-12 13:57:30.870193509 -0400 @@ -30,13 +30,12 @@ * @run main SetMemory */ -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class SetMemory { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); long address = unsafe.allocateMemory(1); assertNotEquals(address, 0L); unsafe.setMemory(address, 1, (byte)17); --- old/test/runtime/Unsafe/ThrowException.java 2016-09-12 13:57:33.200381786 -0400 +++ new/test/runtime/Unsafe/ThrowException.java 2016-09-12 13:57:32.602350122 -0400 @@ -30,13 +30,12 @@ * @run main ThrowException */ -import jdk.test.lib.unsafe.UnsafeHelper; import jdk.internal.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class ThrowException { public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); try { unsafe.throwException(new TestException()); } catch (Throwable t) { --- old/test/runtime/contended/Basic.java 2016-09-12 13:57:35.024009821 -0400 +++ new/test/runtime/contended/Basic.java 2016-09-12 13:57:34.416990762 -0400 @@ -48,20 +48,11 @@ */ public class Basic { - private static final Unsafe U; + private static final Unsafe U = Unsafe.getUnsafe(); private static int ADDRESS_SIZE; private static int HEADER_SIZE; static { - // steal Unsafe - try { - Field unsafe = Unsafe.class.getDeclaredField("theUnsafe"); - unsafe.setAccessible(true); - U = (Unsafe) unsafe.get(null); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new IllegalStateException(e); - } - // When running with CompressedOops on 64-bit platform, the address size // reported by Unsafe is still 8, while the real reference fields are 4 bytes long. // Try to guess the reference field size with this naive trick. --- old/test/runtime/contended/DefaultValue.java 2016-09-12 13:57:36.746297396 -0400 +++ new/test/runtime/contended/DefaultValue.java 2016-09-12 13:57:36.213212968 -0400 @@ -49,20 +49,11 @@ */ public class DefaultValue { - private static final Unsafe U; + private static final Unsafe U = Unsafe.getUnsafe(); private static int ADDRESS_SIZE; private static int HEADER_SIZE; static { - // steal Unsafe - try { - Field unsafe = Unsafe.class.getDeclaredField("theUnsafe"); - unsafe.setAccessible(true); - U = (Unsafe) unsafe.get(null); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new IllegalStateException(e); - } - // When running with CompressedOops on 64-bit platform, the address size // reported by Unsafe is still 8, while the real reference fields are 4 bytes long. // Try to guess the reference field size with this naive trick. --- old/test/runtime/contended/Inheritance1.java 2016-09-12 13:57:38.655349769 -0400 +++ new/test/runtime/contended/Inheritance1.java 2016-09-12 13:57:38.049107836 -0400 @@ -49,20 +49,11 @@ */ public class Inheritance1 { - private static final Unsafe U; + private static final Unsafe U = Unsafe.getUnsafe(); private static int ADDRESS_SIZE; private static int HEADER_SIZE; static { - // steal Unsafe - try { - Field unsafe = Unsafe.class.getDeclaredField("theUnsafe"); - unsafe.setAccessible(true); - U = (Unsafe) unsafe.get(null); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new IllegalStateException(e); - } - // When running with CompressedOops on 64-bit platform, the address size // reported by Unsafe is still 8, while the real reference fields are 4 bytes long. // Try to guess the reference field size with this naive trick. --- old/test/runtime/defineAnonClass/NestedUnsafe.java 2016-09-12 13:57:40.512978670 -0400 +++ new/test/runtime/defineAnonClass/NestedUnsafe.java 2016-09-12 13:57:39.909367434 -0400 @@ -39,7 +39,6 @@ import java.lang.*; import jdk.test.lib.*; import jdk.internal.misc.Unsafe; -import jdk.test.lib.unsafe.UnsafeHelper; // Test that an anonymous class in package 'p' cannot define its own anonymous class @@ -54,7 +53,7 @@ " } } "); public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); // The anonymous class calls defineAnonymousClass creating a nested anonymous class. byte klassbuf2[] = InMemoryJavaCompiler.compile("p.TestClass2", --- old/test/runtime/defineAnonClass/NestedUnsafe2.java 2016-09-12 13:57:42.235013892 -0400 +++ new/test/runtime/defineAnonClass/NestedUnsafe2.java 2016-09-12 13:57:41.660326582 -0400 @@ -39,7 +39,6 @@ import java.lang.*; import jdk.test.lib.*; import jdk.internal.misc.Unsafe; -import jdk.test.lib.unsafe.UnsafeHelper; // Test that an anonymous class that gets put in its host's package cannot define @@ -54,7 +53,7 @@ " } } "); public static void main(String args[]) throws Exception { - Unsafe unsafe = UnsafeHelper.getUnsafe(); + Unsafe unsafe = Unsafe.getUnsafe(); // The anonymous class calls defineAnonymousClass creating a nested anonymous class. byte klassbuf2[] = InMemoryJavaCompiler.compile("TestClass2", --- old/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java 2016-09-12 13:57:43.965044603 -0400 +++ new/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java 2016-09-12 13:57:43.432324455 -0400 @@ -39,7 +39,7 @@ * Concrete subclasses should implement method {@link #process()}. */ public abstract class PathHandler { - private static final Unsafe UNSAFE = jdk.test.lib.unsafe.UnsafeHelper.getUnsafe(); + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); private static final AtomicLong CLASS_COUNT = new AtomicLong(0L); private static volatile boolean CLASSES_LIMIT_REACHED = false; private static final Pattern JAR_IN_DIR_PATTERN