changeset 40907:af3969007060

Merge
author amurillo
date Thu, 01 Sep 2016 14:09:01 -0700
parents 0338471d9019 fe00019e9c58
children 65befc5d3ed1
files hotspot/test/runtime/Unsafe/NestedUnsafe.java
diffstat 50 files changed, 304 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Thu Sep 01 14:09:01 2016 -0700
@@ -24,6 +24,7 @@
 
 package sun.jvm.hotspot.gc.g1;
 
+import java.io.PrintStream;
 import java.util.Iterator;
 import java.util.Observable;
 import java.util.Observer;
@@ -125,6 +126,15 @@
         return CollectedHeapName.G1_COLLECTED_HEAP;
     }
 
+    @Override
+    public void printOn(PrintStream tty) {
+        MemRegion mr = reservedRegion();
+
+        tty.print("garbage-first heap");
+        tty.print(" [" + mr.start() + ", " + mr.end() + "]");
+        tty.println(" region size " + (HeapRegion.grainBytes() / 1024) + "K");
+    }
+
     public G1CollectedHeap(Address addr) {
         super(addr);
     }
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Sep 01 14:09:01 2016 -0700
@@ -5402,6 +5402,17 @@
   debug_only(ik->verify();)
 }
 
+static bool relax_format_check_for(ClassLoaderData* loader_data) {
+  bool trusted = (loader_data->is_the_null_class_loader_data() ||
+                  SystemDictionary::is_platform_class_loader(loader_data->class_loader()));
+  bool need_verify =
+    // verifyAll
+    (BytecodeVerificationLocal && BytecodeVerificationRemote) ||
+    // verifyRemote
+    (!BytecodeVerificationLocal && BytecodeVerificationRemote && !trusted);
+  return !need_verify;
+}
+
 ClassFileParser::ClassFileParser(ClassFileStream* stream,
                                  Symbol* name,
                                  ClassLoaderData* loader_data,
@@ -5490,7 +5501,7 @@
 
   // Check if verification needs to be relaxed for this class file
   // Do not restrict it to jdk1.0 or jdk1.1 to maintain backward compatibility (4982376)
-  _relax_verify = Verifier::relax_verify_for(_loader_data->class_loader());
+  _relax_verify = relax_format_check_for(_loader_data);
 
   parse_stream(stream, CHECK);
 
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Thu Sep 01 14:09:01 2016 -0700
@@ -88,7 +88,7 @@
     BytecodeVerificationLocal : BytecodeVerificationRemote;
 }
 
-bool Verifier::relax_verify_for(oop loader) {
+bool Verifier::relax_access_for(oop loader) {
   bool trusted = java_lang_ClassLoader::is_trusted_loader(loader);
   bool need_verify =
     // verifyAll
--- a/hotspot/src/share/vm/classfile/verifier.hpp	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.hpp	Thu Sep 01 14:09:01 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -58,8 +58,8 @@
   // -Xverify:all/none override this value
   static bool should_verify_for(oop class_loader, bool should_verify_class);
 
-  // Relax certain verifier checks to enable some broken 1.1 apps to run on 1.2.
-  static bool relax_verify_for(oop class_loader);
+  // Relax certain access checks to enable some broken 1.1 apps to run on 1.2.
+  static bool relax_access_for(oop class_loader);
 
   // Print output for class+resolve
   static void trace_class_resolution(Klass* resolve_class, InstanceKlass* verify_class);
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Thu Sep 01 14:09:01 2016 -0700
@@ -446,7 +446,7 @@
     (accessor_ik->major_version() < Verifier::STRICTER_ACCESS_CTRL_CHECK_VERSION &&
     accessee_ik->major_version() < Verifier::STRICTER_ACCESS_CTRL_CHECK_VERSION)) {
     return classloader_only &&
-      Verifier::relax_verify_for(accessor_ik->class_loader()) &&
+      Verifier::relax_access_for(accessor_ik->class_loader()) &&
       accessor_ik->protection_domain() == accessee_ik->protection_domain() &&
       accessor_ik->class_loader() == accessee_ik->class_loader();
   }
--- a/hotspot/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/testlibrary/rtm/XAbortProvoker.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/testlibrary/rtm/XAbortProvoker.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/compiler/unsafe/UnsafeRaw.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/compiler/unsafe/UnsafeRaw.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/gc/arguments/TestAlignmentToUseLargePages.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/gc/arguments/TestAlignmentToUseLargePages.java	Thu Sep 01 14:09:01 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, 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
@@ -29,16 +29,16 @@
  * @key gc
  * @key regression
  * @requires vm.gc=="null"
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseParallelGC -XX:-UseParallelOldGC -XX:+UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseParallelGC -XX:-UseParallelOldGC -XX:-UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:-UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseSerialGC -XX:+UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseSerialGC -XX:-UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseConcMarkSweepGC -XX:+UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseConcMarkSweepGC -XX:-UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseG1GC -XX:+UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms7M -Xmx9M -XX:+UseG1GC -XX:-UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseParallelGC -XX:-UseParallelOldGC -XX:+UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseParallelGC -XX:-UseParallelOldGC -XX:-UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:-UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseSerialGC -XX:+UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseSerialGC -XX:-UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseConcMarkSweepGC -XX:+UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseConcMarkSweepGC -XX:-UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:+UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:-UseLargePages TestAlignmentToUseLargePages
  */
 
 public class TestAlignmentToUseLargePages {
--- a/hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/gc/cms/TestBubbleUpRef.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/gc/cms/TestBubbleUpRef.java	Thu Sep 01 14:09:01 2016 -0700
@@ -35,7 +35,7 @@
  *          stays nearly full.
  * @run main/othervm
  *  -XX:+UseConcMarkSweepGC -XX:-CMSYield -XX:-CMSPrecleanRefLists1
- *  -XX:CMSInitiatingOccupancyFraction=0 -Xmx8m TestBubbleUpRef 16000 50 10000
+ *  -XX:CMSInitiatingOccupancyFraction=0 -Xmx80m TestBubbleUpRef 16000 50 10000
  */
 
 /**
@@ -53,7 +53,7 @@
  * Do it again.
  *
  * Use the following VM options
- *     -Xmx8m -XX:-CMSYield [-XX:+UseConcMarkSweepGC] -XX:-CMSPrecleanRefLists1
+ *     -Xmx80m -XX:-CMSYield [-XX:+UseConcMarkSweepGC] -XX:-CMSPrecleanRefLists1
  *      -XX:CMSInitiatingOccupancyFraction=0
  *
  * Use parameter:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/ClassFile/BadHelloWorld.jcod	Thu Sep 01 14:09:01 2016 -0700
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file fuzzes the class name #15 to have a leading 'L' and ending ';'.
+ */
+
+class BadHelloWorld {
+  0xCAFEBABE;
+  0; // minor version
+  52; // version
+  [31] { // Constant Pool
+    ; // first element is empty
+    Utf8 "BadHelloWorld"; // #1     at 0x0A
+    class #1; // #2     at 0x1A
+    Utf8 "java/lang/Object"; // #3     at 0x1D
+    class #3; // #4     at 0x30
+    Utf8 "<init>"; // #5     at 0x33
+    Utf8 "()V"; // #6     at 0x3C
+    NameAndType #5 #6; // #7     at 0x42
+    Method #4 #7; // #8     at 0x47
+    Utf8 "toString"; // #9     at 0x4C
+    Utf8 "()Ljava/lang/String;"; // #10     at 0x57
+    Utf8 "Hello, world!"; // #11     at 0x6E
+    String #11; // #12     at 0x7E
+    Utf8 "main"; // #13     at 0x81
+    Utf8 "([Ljava/lang/String;)V"; // #14     at 0x88
+    Utf8 "LBadHelloWorld;"; // #15     at 0xA1
+    class #15; // #16     at 0xB3
+    Method #16 #7; // #17     at 0xB6
+    Utf8 "java/lang/System"; // #18     at 0xBB
+    class #18; // #19     at 0xCE
+    Utf8 "out"; // #20     at 0xD1
+    Utf8 "Ljava/io/PrintStream;"; // #21     at 0xD7
+    NameAndType #20 #21; // #22     at 0xEF
+    Field #19 #22; // #23     at 0xF4
+    Utf8 "java/io/PrintStream"; // #24     at 0xF9
+    class #24; // #25     at 0x010F
+    Utf8 "println"; // #26     at 0x0112
+    Utf8 "(Ljava/lang/Object;)V"; // #27     at 0x011C
+    NameAndType #26 #27; // #28     at 0x0134
+    Method #25 #28; // #29     at 0x0139
+    Utf8 "Code"; // #30     at 0x013E
+  } // Constant Pool
+
+  0x0021; // access
+  #2;// this_cpx
+  #4;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [0] { // fields
+  } // fields
+
+  [3] { // methods
+    { // Member at 0x0151
+      0x0001; // access
+      #5; // name_cpx
+      #6; // sig_cpx
+      [1] { // Attributes
+        Attr(#30, 17) { // Code at 0x0159
+          1; // max_stack
+          1; // max_locals
+          Bytes[5]{
+            0x2AB70008B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [0] { // Attributes
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x0170
+      0x0001; // access
+      #9; // name_cpx
+      #10; // sig_cpx
+      [1] { // Attributes
+        Attr(#30, 15) { // Code at 0x0178
+          1; // max_stack
+          1; // max_locals
+          Bytes[3]{
+            0x120CB0;
+          };
+          [0] { // Traps
+          } // end Traps
+          [0] { // Attributes
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x018D
+      0x0089; // access
+      #13; // name_cpx
+      #14; // sig_cpx
+      [1] { // Attributes
+        Attr(#30, 28) { // Code at 0x0195
+          2; // max_stack
+          2; // max_locals
+          Bytes[16]{
+            0xBB001059B700114C;
+            0xB200172BB6001DB1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [0] { // Attributes
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+  } // methods
+
+  [0] { // Attributes
+  } // Attributes
+} // end class BadHelloWorld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/ClassFile/FormatCheckingTest.java	Thu Sep 01 14:09:01 2016 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8148854
+ * @summary Ensure class name loaded by app class loader is format checked by default
+ * @library /test/lib
+ * @compile BadHelloWorld.jcod
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @run main FormatCheckingTest
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+
+public class FormatCheckingTest {
+    public static void main(String args[]) throws Throwable {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("BadHelloWorld");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain("java.lang.ClassFormatError: Illegal class name");
+        output.shouldHaveExitValue(1);
+    }
+}
--- a/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/AllocateInstance.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/AllocateInstance.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/AllocateMemory.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/AllocateMemory.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/CopyMemory.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/CopyMemory.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/DefineClass.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/DefineClass.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/FieldOffset.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/FieldOffset.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetField.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetField.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutAddress.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutAddress.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutBoolean.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutBoolean.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutByte.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutByte.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutChar.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutChar.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutDouble.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutDouble.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutFloat.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutFloat.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutInt.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutInt.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutLong.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutLong.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutObject.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutObject.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetPutShort.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutShort.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/GetUncompressedObject.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/GetUncompressedObject.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/NestedUnsafe.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/NestedUnsafe.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/PageSize.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/PageSize.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/RangeCheck.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/RangeCheck.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/Reallocate.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/Reallocate.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/SetMemory.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/SetMemory.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/runtime/Unsafe/ThrowException.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/runtime/Unsafe/ThrowException.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java	Wed Aug 31 09:22:53 2016 -0700
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java	Thu Sep 01 14:09:01 2016 -0700
@@ -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