changeset 11877:da9cc21bd128

8164737: Remove Unsafe dependency from ProcessTools Reviewed-by: gtriantafill, dholmes
author ctornqvi
date Thu, 25 Aug 2016 08:40:53 -0400
parents dd951011f433
children 12f7e6595b9f
files test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java test/compiler/jvmci/compilerToVM/ResolveMethodTest.java test/compiler/loopopts/superword/TestVectorizationWithInvariant.java test/compiler/rtm/locking/TestRTMAbortRatio.java test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java test/compiler/rtm/locking/TestRTMLockingThreshold.java test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java test/compiler/testlibrary/rtm/XAbortProvoker.java test/compiler/unsafe/UnsafeRaw.java test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java test/gc/arguments/TestTargetSurvivorRatioFlag.java test/runtime/ErrorHandling/CreateCoredumpOnCrash.java test/runtime/ErrorHandling/ProblematicFrameTest.java test/runtime/Unsafe/AllocateInstance.java test/runtime/Unsafe/AllocateMemory.java test/runtime/Unsafe/CopyMemory.java test/runtime/Unsafe/DefineClass.java test/runtime/Unsafe/FieldOffset.java test/runtime/Unsafe/GetField.java test/runtime/Unsafe/GetPutAddress.java test/runtime/Unsafe/GetPutBoolean.java test/runtime/Unsafe/GetPutByte.java test/runtime/Unsafe/GetPutChar.java test/runtime/Unsafe/GetPutDouble.java test/runtime/Unsafe/GetPutFloat.java test/runtime/Unsafe/GetPutInt.java test/runtime/Unsafe/GetPutLong.java test/runtime/Unsafe/GetPutObject.java test/runtime/Unsafe/GetPutShort.java test/runtime/Unsafe/GetUncompressedObject.java test/runtime/Unsafe/NestedUnsafe.java test/runtime/Unsafe/PageSize.java test/runtime/Unsafe/RangeCheck.java test/runtime/Unsafe/Reallocate.java test/runtime/Unsafe/SetMemory.java test/runtime/Unsafe/ThrowException.java test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
diffstat 41 files changed, 81 insertions(+), 77 deletions(-) [+]
line wrap: on
line diff
--- a/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java	Thu Aug 25 08:40:53 2016 -0400
@@ -36,11 +36,11 @@
 package compiler.intrinsics.unsafe;
 
 import jdk.internal.misc.Unsafe;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 
 public class TestUnsafeMismatchedArrayFieldAccess {
 
-    private static final Unsafe UNSAFE = Utils.getUnsafe();
+    private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
 
     static {
         try {
--- a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java	Thu Aug 25 08:40:53 2016 -0400
@@ -45,7 +45,7 @@
 
 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.PublicMetaspaceWrapperObject;
@@ -114,7 +114,7 @@
         abstract HotSpotResolvedJavaMethod getResolvedJavaMethod();
     }
 
-    private static final Unsafe UNSAFE = Utils.getUnsafe();
+    private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
     private static final WhiteBox WB = WhiteBox.getWhiteBox();
     private static final Field METASPACE_METHOD_FIELD;
     private static final Class<?> TEST_CLASS = GetResolvedJavaMethodTest.class;
--- a/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java	Thu Aug 25 08:40:53 2016 -0400
@@ -53,7 +53,7 @@
 
 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;
@@ -154,7 +154,7 @@
         abstract HotSpotResolvedObjectType getResolvedJavaType();
     }
 
-    private static final Unsafe UNSAFE = Utils.getUnsafe();
+    private static final Unsafe UNSAFE = UnsafeHelper.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
--- a/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java	Thu Aug 25 08:40:53 2016 -0400
@@ -53,7 +53,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.internal.org.objectweb.asm.Opcodes;
 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.HotSpotResolvedObjectType;
 import jdk.vm.ci.meta.ConstantPool;
@@ -69,7 +69,7 @@
  */
 public class ResolveFieldInPoolTest {
 
-    private static final Unsafe UNSAFE = Utils.getUnsafe();
+    private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
 
     public static void main(String[] args) throws Exception {
         Map<ConstantTypes, Validator> typeTests = new HashMap<>();
--- a/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java	Thu Aug 25 08:40:53 2016 -0400
@@ -52,6 +52,7 @@
 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;
@@ -60,7 +61,7 @@
 import java.util.Set;
 
 public class ResolveMethodTest {
-    private static final Unsafe UNSAFE = Utils.getUnsafe();
+    private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
 
     public static void main(String args[]) {
         ResolveMethodTest test = new ResolveMethodTest();
--- a/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java	Thu Aug 25 08:40:53 2016 -0400
@@ -34,7 +34,7 @@
 package compiler.loopopts.superword;
 
 import jdk.internal.misc.Unsafe;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 
 public class TestVectorizationWithInvariant {
 
@@ -43,7 +43,7 @@
     private static final long CHAR_ARRAY_OFFSET;
 
     static {
-        unsafe = Utils.getUnsafe();
+        unsafe = UnsafeHelper.getUnsafe();
         BYTE_ARRAY_OFFSET = unsafe.arrayBaseOffset(byte[].class);
         CHAR_ARRAY_OFFSET = unsafe.arrayBaseOffset(char[].class);
     }
--- a/test/compiler/rtm/locking/TestRTMAbortRatio.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/rtm/locking/TestRTMAbortRatio.java	Thu Aug 25 08:40:53 2016 -0400
@@ -49,7 +49,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
 
@@ -125,7 +125,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 = Utils.getUnsafe();
+        private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
         private final Object monitor = new Object();
         // Following field have to be static in order to avoid escape analysis.
         @SuppressWarnings("UnsuedDeclaration")
--- a/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Thu Aug 25 08:40:53 2016 -0400
@@ -51,7 +51,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
 
@@ -158,7 +158,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 = Utils.getUnsafe();
+        private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
         private final Object monitor = new Object();
 
         @Override
--- a/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Thu Aug 25 08:40:53 2016 -0400
@@ -48,7 +48,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
 
@@ -133,7 +133,7 @@
     }
 
     public static class Test implements CompilableTest {
-        private static final Unsafe UNSAFE = Utils.getUnsafe();
+        private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
         private final Object monitor = new Object();
 
         @Override
--- a/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Thu Aug 25 08:40:53 2016 -0400
@@ -49,7 +49,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
 
@@ -142,7 +142,7 @@
         @SuppressWarnings("UnsuedDeclaration")
         private static int field = 0;
         private static final int TOTAL_ITERATIONS = 10000;
-        private static final Unsafe UNSAFE = Utils.getUnsafe();
+        private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
         private final Object monitor = new Object();
 
 
--- a/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Thu Aug 25 08:40:53 2016 -0400
@@ -49,7 +49,7 @@
 import jdk.internal.misc.Unsafe;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
 
@@ -113,7 +113,7 @@
 
     public static class Test implements CompilableTest {
         private static final long TOTAL_ITERATIONS = 10000L;
-        private static final Unsafe UNSAFE = Utils.getUnsafe();
+        private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
         private final Object monitor = new Object();
         // Following field have to be static in order to avoid escape analysis.
         @SuppressWarnings("UnsuedDeclaration")
--- a/test/compiler/testlibrary/rtm/XAbortProvoker.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/testlibrary/rtm/XAbortProvoker.java	Thu Aug 25 08:40:53 2016 -0400
@@ -25,7 +25,7 @@
 package compiler.testlibrary.rtm;
 
 import jdk.internal.misc.Unsafe;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 
 /**
  * Current RTM locking implementation force transaction abort
@@ -35,7 +35,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 = Utils.getUnsafe();
+    private static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
 
     public XAbortProvoker() {
         this(new Object());
--- a/test/compiler/unsafe/UnsafeRaw.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/compiler/unsafe/UnsafeRaw.java	Thu Aug 25 08:40:53 2016 -0400
@@ -35,6 +35,7 @@
 
 import jdk.internal.misc.Unsafe;
 import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 
 import java.util.Random;
 
@@ -81,7 +82,7 @@
   }
 
   public static void main(String[] args) throws Exception {
-    Unsafe unsafe = Utils.getUnsafe();
+    Unsafe unsafe = UnsafeHelper.getUnsafe();
     final int array_size = 128;
     final int element_size = 4;
     final int magic = 0x12345678;
--- a/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java	Thu Aug 25 08:40:53 2016 -0400
@@ -37,6 +37,7 @@
 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 {
@@ -133,7 +134,7 @@
      */
     public static class RatioVerifier {
 
-        private static final Unsafe unsafe = Utils.getUnsafe();
+        private static final Unsafe unsafe = UnsafeHelper.getUnsafe();
 
         // Size of byte array that will be allocated
         public static final int CHUNK_SIZE = 1024;
--- a/test/gc/arguments/TestTargetSurvivorRatioFlag.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/gc/arguments/TestTargetSurvivorRatioFlag.java	Thu Aug 25 08:40:53 2016 -0400
@@ -46,6 +46,7 @@
 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
@@ -248,7 +249,7 @@
     public static class TargetSurvivorRatioVerifier {
 
         static final WhiteBox wb = WhiteBox.getWhiteBox();
-        static final Unsafe unsafe = Utils.getUnsafe();
+        static final Unsafe unsafe = UnsafeHelper.getUnsafe();
 
         // Desired size of memory allocated at once
         public static final int CHUNK_SIZE = 1024;
--- a/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java	Thu Aug 25 08:40:53 2016 -0400
@@ -34,13 +34,13 @@
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.Platform;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.internal.misc.Unsafe;
 
 public class CreateCoredumpOnCrash {
     private static class Crasher {
         public static void main(String[] args) {
-            Utils.getUnsafe().putInt(0L, 0);
+            UnsafeHelper.getUnsafe().putInt(0L, 0);
         }
     }
 
--- a/test/runtime/ErrorHandling/ProblematicFrameTest.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/ErrorHandling/ProblematicFrameTest.java	Thu Aug 25 08:40:53 2016 -0400
@@ -35,14 +35,14 @@
 
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 
 import jdk.internal.misc.Unsafe;
 
 public class ProblematicFrameTest {
     private static class Crasher {
         public static void main(String[] args) {
-            Utils.getUnsafe().getInt(0);
+            UnsafeHelper.getUnsafe().getInt(0);
         }
     }
 
--- a/test/runtime/Unsafe/AllocateInstance.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/AllocateInstance.java	Thu Aug 25 08:40:53 2016 -0400
@@ -30,12 +30,12 @@
  * @run main AllocateInstance
  */
 
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.internal.misc.Unsafe;
 import static jdk.test.lib.Asserts.*;
 
 public class AllocateInstance {
-    static final Unsafe UNSAFE = Utils.getUnsafe();
+    static final Unsafe UNSAFE = UnsafeHelper.getUnsafe();
 
     class TestClass {
         public boolean calledConstructor = false;
--- a/test/runtime/Unsafe/AllocateMemory.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/AllocateMemory.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory
  */
 
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
 
         // Allocate a byte, write to the location and read back the value
         long address = unsafe.allocateMemory(1);
--- a/test/runtime/Unsafe/CopyMemory.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/CopyMemory.java	Thu Aug 25 08:40:53 2016 -0400
@@ -30,14 +30,14 @@
  * @run main CopyMemory
  */
 
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         long src = unsafe.allocateMemory(LENGTH);
         long dst = unsafe.allocateMemory(LENGTH);
         assertNotEquals(src, 0L);
--- a/test/runtime/Unsafe/DefineClass.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/DefineClass.java	Thu Aug 25 08:40:53 2016 -0400
@@ -34,13 +34,13 @@
 import java.security.ProtectionDomain;
 import java.io.InputStream;
 import jdk.test.lib.InMemoryJavaCompiler;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         TestClassLoader classloader = new TestClassLoader();
         ProtectionDomain pd = new ProtectionDomain(null, null);
 
--- a/test/runtime/Unsafe/FieldOffset.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/FieldOffset.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,14 +31,14 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Field[] fields = Test.class.getDeclaredFields();
 
         for (int i = 0; i < fields.length; i++) {
--- a/test/runtime/Unsafe/GetField.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetField.java	Thu Aug 25 08:40:53 2016 -0400
@@ -30,14 +30,14 @@
  * @run main GetField
  */
 
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.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");
--- a/test/runtime/Unsafe/GetPutAddress.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutAddress.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import jdk.test.lib.Platform;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         int addressSize = unsafe.addressSize();
         // Ensure the size returned from Unsafe.addressSize is correct
         assertEquals(unsafe.addressSize(), Platform.is32bit() ? 4 : 8);
--- a/test/runtime/Unsafe/GetPutBoolean.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutBoolean.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Field field = Test.class.getField("b1");
 
--- a/test/runtime/Unsafe/GetPutByte.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutByte.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Field field = Test.class.getField("b");
 
--- a/test/runtime/Unsafe/GetPutChar.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutChar.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Field field = Test.class.getField("c");
 
--- a/test/runtime/Unsafe/GetPutDouble.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutDouble.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Field field = Test.class.getField("d");
 
--- a/test/runtime/Unsafe/GetPutFloat.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutFloat.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Field field = Test.class.getField("f");
 
--- a/test/runtime/Unsafe/GetPutInt.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutInt.java	Thu Aug 25 08:40:53 2016 -0400
@@ -30,13 +30,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Field field = Test.class.getField("i");
 
--- a/test/runtime/Unsafe/GetPutLong.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutLong.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Field field = Test.class.getField("l");
 
--- a/test/runtime/Unsafe/GetPutObject.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutObject.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Object o = new Object();
         Field field = Test.class.getField("o");
--- a/test/runtime/Unsafe/GetPutShort.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetPutShort.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         Test t = new Test();
         Field field = Test.class.getField("s");
 
--- a/test/runtime/Unsafe/GetUncompressedObject.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/GetUncompressedObject.java	Thu Aug 25 08:40:53 2016 -0400
@@ -30,13 +30,13 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.internal.misc.Unsafe;
 
 public class GetUncompressedObject {
 
     public static void main(String args[]) throws Exception {
-        Unsafe unsafe = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
 
         // Allocate some memory and fill it with non-zero values.
         final int size = 32;
--- a/test/runtime/Unsafe/NestedUnsafe.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/NestedUnsafe.java	Thu Aug 25 08:40:53 2016 -0400
@@ -35,7 +35,7 @@
 import java.io.InputStream;
 import java.lang.*;
 import jdk.test.lib.InMemoryJavaCompiler;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 import jdk.internal.misc.Unsafe;
 import static jdk.test.lib.Asserts.*;
 
@@ -50,7 +50,7 @@
         " } } ");
 
     public static void main(String args[]) throws Exception {
-        Unsafe unsafe = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
 
         Class klass = unsafe.defineAnonymousClass(NestedUnsafe.class, klassbuf, new Object[0]);
         unsafe.ensureClassInitialized(klass);
--- a/test/runtime/Unsafe/PageSize.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/PageSize.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  */
 
 import java.lang.reflect.Field;
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         int pageSize = unsafe.pageSize();
 
         for (int n = 1; n != 0; n <<= 1) {
--- a/test/runtime/Unsafe/RangeCheck.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/RangeCheck.java	Thu Aug 25 08:40:53 2016 -0400
@@ -33,7 +33,7 @@
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.Platform;
-import jdk.test.lib.Utils;
+import jdk.test.lib.unsafe.UnsafeHelper;
 
 import jdk.internal.misc.Unsafe;
 
@@ -60,7 +60,7 @@
 
     public static class DummyClassWithMainRangeCheck {
         public static void main(String args[]) throws Exception {
-            Unsafe unsafe = Utils.getUnsafe();
+            Unsafe unsafe = UnsafeHelper.getUnsafe();
             unsafe.getObject(new DummyClassWithMainRangeCheck(), Short.MAX_VALUE);
         }
     }
--- a/test/runtime/Unsafe/Reallocate.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/Reallocate.java	Thu Aug 25 08:40:53 2016 -0400
@@ -31,13 +31,13 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m Reallocate
  */
 
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
 
         long address = unsafe.allocateMemory(1);
         assertNotEquals(address, 0L);
--- a/test/runtime/Unsafe/SetMemory.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/SetMemory.java	Thu Aug 25 08:40:53 2016 -0400
@@ -30,13 +30,13 @@
  * @run main SetMemory
  */
 
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         long address = unsafe.allocateMemory(1);
         assertNotEquals(address, 0L);
         unsafe.setMemory(address, 1, (byte)17);
--- a/test/runtime/Unsafe/ThrowException.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/runtime/Unsafe/ThrowException.java	Thu Aug 25 08:40:53 2016 -0400
@@ -30,13 +30,13 @@
  * @run main ThrowException
  */
 
-import jdk.test.lib.Utils;
+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 = Utils.getUnsafe();
+        Unsafe unsafe = UnsafeHelper.getUnsafe();
         try {
             unsafe.throwException(new TestException());
         } catch (Throwable t) {
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java	Thu Aug 25 14:12:09 2016 +0400
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java	Thu Aug 25 08:40:53 2016 -0400
@@ -39,7 +39,7 @@
  * Concrete subclasses should implement method {@link #process()}.
  */
 public abstract class PathHandler {
-    private static final Unsafe UNSAFE = jdk.test.lib.Utils.getUnsafe();
+    private static final Unsafe UNSAFE = jdk.test.lib.unsafe.UnsafeHelper.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