Merge
diff --git a/.mx.jvmci/mx_jvmci.py b/.mx.jvmci/mx_jvmci.py
index ede9029..daa27f5 100644
--- a/.mx.jvmci/mx_jvmci.py
+++ b/.mx.jvmci/mx_jvmci.py
@@ -64,7 +64,7 @@
 _jdkDebugLevels = ['release', 'fastdebug', 'slowdebug']
 
 # TODO: add client once/if it can be built on 64-bit platforms
-_jdkJvmVariants = ['server']
+_jdkJvmVariants = ['server', 'client']
 
 """
 Translation table from mx_jvmci:8 --vmbuild values to mx_jvmci:9 --jdk-debug-level values.
diff --git a/make/gensrc/GensrcAdlc.gmk b/make/gensrc/GensrcAdlc.gmk
index a33d42d..abe6fd4 100644
--- a/make/gensrc/GensrcAdlc.gmk
+++ b/make/gensrc/GensrcAdlc.gmk
@@ -51,6 +51,9 @@
     ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS
   endif
 
+  # Set the C++ standard if supported
+  ADLC_CFLAGS += $(CXXSTD_CXXFLAG)
+  
   # NOTE: The old build didn't set -DASSERT for windows but it doesn't seem to
   # hurt.
   ADLC_CFLAGS += -DASSERT
@@ -153,10 +156,10 @@
 	$(call MakeDir, $(@D))
 	$(call ExecuteWithLog, $(ADLC_SUPPORT_DIR)/adlc_run, \
 	    $(FIXPATH) $(ADLC_TOOL) $(ADLCFLAGS) $(SINGLE_AD_SRCFILE) \
-	        -c$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU).cpp \
-	        -h$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU).hpp \
-	        -a$(ADLC_SUPPORT_DIR)/dfa_$(HOTSPOT_TARGET_CPU).cpp \
-	        -v$(ADLC_SUPPORT_DIR)/adGlobals_$(HOTSPOT_TARGET_CPU).hpp)
+	        -c$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
+	        -h$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
+	        -a$(ADLC_SUPPORT_DIR)/dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
+	        -v$(ADLC_SUPPORT_DIR)/adGlobals_$(HOTSPOT_TARGET_CPU_ARCH).hpp)
 	$(TOUCH) $@
 
   ##############################################################################
@@ -164,17 +167,17 @@
   # and postprocess them by fixing dummy #line directives.
 
   ADLC_GENERATED_FILES := $(addprefix $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/, \
-      ad_$(HOTSPOT_TARGET_CPU).cpp \
-      ad_$(HOTSPOT_TARGET_CPU).hpp \
-      ad_$(HOTSPOT_TARGET_CPU)_clone.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_expand.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_format.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_gen.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_misc.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_peephole.cpp \
-      ad_$(HOTSPOT_TARGET_CPU)_pipeline.cpp \
-      adGlobals_$(HOTSPOT_TARGET_CPU).hpp \
-      dfa_$(HOTSPOT_TARGET_CPU).cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_clone.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_expand.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_format.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_gen.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_misc.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_peephole.cpp \
+      ad_$(HOTSPOT_TARGET_CPU_ARCH)_pipeline.cpp \
+      adGlobals_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
+      dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
   )
 
   $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/%: $(ADLC_RUN_MARKER)
diff --git a/make/lib/CompileGtest.gmk b/make/lib/CompileGtest.gmk
index 2a052a1..803413b 100644
--- a/make/lib/CompileGtest.gmk
+++ b/make/lib/CompileGtest.gmk
@@ -104,7 +104,7 @@
         -I$(GTEST_FRAMEWORK_SRC)/include, \
     CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
-    LDFLAGS := $(LDFLAGS_TESTEXE), \
+    LDFLAGS := $(LDFLAGS_JDKEXE), \
     LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_solaris := -library=stlport4, \
     LIBS_unix := -ljvm, \
diff --git a/make/lib/CompileJvm.gmk b/make/lib/CompileJvm.gmk
index b6404cf..65d58e4 100644
--- a/make/lib/CompileJvm.gmk
+++ b/make/lib/CompileJvm.gmk
@@ -60,12 +60,15 @@
     -I$(HOTSPOT_TOPDIR)/src/share/vm/prims \
     #
 
+# INCLUDE_SUFFIX_* is only meant for including the proper
+# platform files. Don't use it to guard code. Use the value of
+# HOTSPOT_TARGET_CPU_DEFINE etc. instead.
+# Remaining TARGET_ARCH_* is needed to distinguish closed and open
+# 64-bit ARM ports (also called AARCH64).
 JVM_CFLAGS_TARGET_DEFINES += \
-    -DTARGET_OS_FAMILY_$(HOTSPOT_TARGET_OS) \
-    -DTARGET_ARCH_MODEL_$(HOTSPOT_TARGET_CPU) \
     -DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
-    -DTARGET_OS_ARCH_MODEL_$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU) \
-    -DTARGET_OS_ARCH_$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH) \
+    -DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \
+    -DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \
     -DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \
     -D$(HOTSPOT_TARGET_CPU_DEFINE) \
     -DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \
diff --git a/make/test/JtregNative.gmk b/make/test/JtregNative.gmk
index e89506b..efb108a 100644
--- a/make/test/JtregNative.gmk
+++ b/make/test/JtregNative.gmk
@@ -53,6 +53,8 @@
     $(HOTSPOT_TOPDIR)/test/compiler/native \
     $(HOTSPOT_TOPDIR)/test/serviceability/jvmti/GetNamedModule \
     $(HOTSPOT_TOPDIR)/test/testlibrary/jvmti \
+    $(HOTSPOT_TOPDIR)/test/compiler/jvmci/jdk.vm.ci.code.test \
+    $(HOTSPOT_TOPDIR)/test/serviceability/jvmti/GetModulesInfo \
     #
 
 # Add conditional directories here when needed.
@@ -62,12 +64,26 @@
     $(HOTSPOT_TOPDIR)/test/runtime/ThreadSignalMask
 endif
 
+ifeq ($(OPENJDK_TARGET_OS), linux)
+BUILD_HOTSPOT_JTREG_NATIVE_SRC += \
+    $(HOTSPOT_TOPDIR)/test/runtime/execstack \
+    $(HOTSPOT_TOPDIR)/test/runtime/jsig \
+    $(HOTSPOT_TOPDIR)/test/runtime/StackGuardPages
+endif
+
 ifeq ($(TOOLCHAIN_TYPE), solstudio)
     BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_liboverflow := -lc
     BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libSimpleClassFileLoadHook := -lc
     BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libGetNamedModuleTest := -lc
 endif
 
+ifeq ($(OPENJDK_TARGET_OS), linux)
+    BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libtest-rw := -z noexecstack
+    BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libtest-rwx := -z execstack
+    BUILD_HOTSPOT_JTREG_EXECUTABLES_LDFLAGS_exeinvoke := -ljvm -lpthread
+    BUILD_TEST_invoke_exeinvoke.c_OPTIMIZATION := NONE
+endif
+
 BUILD_HOTSPOT_JTREG_OUTPUT_DIR := $(BUILD_OUTPUT)/support/test/hotspot/jtreg/native
 
 BUILD_HOTSPOT_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/hotspot/jtreg
diff --git a/src/cpu/aarch64/vm/aarch64.ad b/src/cpu/aarch64/vm/aarch64.ad
index 89fac8f..50c6d33 100644
--- a/src/cpu/aarch64/vm/aarch64.ad
+++ b/src/cpu/aarch64/vm/aarch64.ad
@@ -1942,12 +1942,35 @@
 
   bool is_CAS(int opcode)
   {
-    return (opcode == Op_CompareAndSwapI ||
-	    opcode == Op_CompareAndSwapL ||
-	    opcode == Op_CompareAndSwapN ||
-	    opcode == Op_CompareAndSwapP);
+    switch(opcode) {
+      // We handle these
+    case Op_CompareAndSwapI:
+    case Op_CompareAndSwapL:
+    case Op_CompareAndSwapP:
+    case Op_CompareAndSwapN:
+ // case Op_CompareAndSwapB:
+ // case Op_CompareAndSwapS:
+      return true;
+      // These are TBD
+    case Op_WeakCompareAndSwapB:
+    case Op_WeakCompareAndSwapS:
+    case Op_WeakCompareAndSwapI:
+    case Op_WeakCompareAndSwapL:
+    case Op_WeakCompareAndSwapP:
+    case Op_WeakCompareAndSwapN:
+    case Op_CompareAndExchangeB:
+    case Op_CompareAndExchangeS:
+    case Op_CompareAndExchangeI:
+    case Op_CompareAndExchangeL:
+    case Op_CompareAndExchangeP:
+    case Op_CompareAndExchangeN:
+      return false;
+    default:
+      return false;
+    }
   }
 
+
   // leading_to_trailing
   //
   //graph traversal helper which detects the normal case Mem feed from
@@ -3330,9 +3353,6 @@
 const bool Matcher::match_rule_supported(int opcode) {
 
   switch (opcode) {
-  case Op_StrComp:
-    if (CompactStrings)  return false;
-    break;
   default:
     break;
   }
@@ -4241,14 +4261,16 @@
     MacroAssembler _masm(&cbuf);
     guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
     __ cmpxchg($mem$$base$$Register, $oldval$$Register, $newval$$Register,
-               Assembler::xword, /*acquire*/ false, /*release*/ true);
+               Assembler::xword, /*acquire*/ false, /*release*/ true,
+               /*weak*/ false, noreg);
   %}
 
   enc_class aarch64_enc_cmpxchgw(memory mem, iRegINoSp oldval, iRegINoSp newval) %{
     MacroAssembler _masm(&cbuf);
     guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
     __ cmpxchg($mem$$base$$Register, $oldval$$Register, $newval$$Register,
-               Assembler::word, /*acquire*/ false, /*release*/ true);
+               Assembler::word, /*acquire*/ false, /*release*/ true,
+               /*weak*/ false, noreg);
   %}
 
 
@@ -4260,14 +4282,16 @@
     MacroAssembler _masm(&cbuf);
     guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
     __ cmpxchg($mem$$base$$Register, $oldval$$Register, $newval$$Register,
-               Assembler::xword, /*acquire*/ true, /*release*/ true);
+               Assembler::xword, /*acquire*/ true, /*release*/ true,
+               /*weak*/ false, noreg);
   %}
 
   enc_class aarch64_enc_cmpxchgw_acq(memory mem, iRegINoSp oldval, iRegINoSp newval) %{
     MacroAssembler _masm(&cbuf);
     guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
     __ cmpxchg($mem$$base$$Register, $oldval$$Register, $newval$$Register,
-               Assembler::word, /*acquire*/ true, /*release*/ true);
+               Assembler::word, /*acquire*/ true, /*release*/ true,
+               /*weak*/ false, noreg);
   %}
 
 
@@ -5806,6 +5830,7 @@
 %{
   constraint(ALLOC_IN_RC(no_special_reg));
   match(RegL);
+  match(iRegL_R0);
   format %{ %}
   interface(REG_INTER);
 %}
@@ -5927,6 +5952,39 @@
   interface(REG_INTER);
 %}
 
+// Long 64 bit Register R0 only
+operand iRegL_R0()
+%{
+  constraint(ALLOC_IN_RC(r0_reg));
+  match(RegL);
+  match(iRegLNoSp);
+  op_cost(0);
+  format %{ %}
+  interface(REG_INTER);
+%}
+
+// Long 64 bit Register R2 only
+operand iRegL_R2()
+%{
+  constraint(ALLOC_IN_RC(r2_reg));
+  match(RegL);
+  match(iRegLNoSp);
+  op_cost(0);
+  format %{ %}
+  interface(REG_INTER);
+%}
+
+// Long 64 bit Register R3 only
+operand iRegL_R3()
+%{
+  constraint(ALLOC_IN_RC(r3_reg));
+  match(RegL);
+  match(iRegLNoSp);
+  op_cost(0);
+  format %{ %}
+  interface(REG_INTER);
+%}
+
 // Long 64 bit Register R11 only
 operand iRegL_R11()
 %{
@@ -5983,7 +6041,7 @@
 %}
 
 
-// Register R2 only
+// Register R4 only
 operand iRegI_R4()
 %{
   constraint(ALLOC_IN_RC(int_r4_reg));
@@ -6007,6 +6065,33 @@
   interface(REG_INTER);
 %}
 
+operand iRegN_R0()
+%{
+  constraint(ALLOC_IN_RC(r0_reg));
+  match(iRegN);
+  op_cost(0);
+  format %{ %}
+  interface(REG_INTER);
+%}
+
+operand iRegN_R2()
+%{
+  constraint(ALLOC_IN_RC(r2_reg));
+  match(iRegN);
+  op_cost(0);
+  format %{ %}
+  interface(REG_INTER);
+%}
+
+operand iRegN_R3()
+%{
+  constraint(ALLOC_IN_RC(r3_reg));
+  match(iRegN);
+  op_cost(0);
+  format %{ %}
+  interface(REG_INTER);
+%}
+
 // Integer 64 bit Register not Special
 operand iRegNNoSp()
 %{
@@ -9393,12 +9478,12 @@
   ins_pipe(pipe_slow);
 %}
 
-// XXX No flag versions for CompareAndSwap{I,L,P,N} because matcher
-// can't match them
-
 // standard CompareAndSwapX when we are using barriers
 // these have higher priority than the rules selected by a predicate
 
+// XXX No flag versions for CompareAndSwap{I,L,P,N} because matcher
+// can't match them
+
 instruct compareAndSwapI(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval, rFlagsReg cr) %{
 
   match(Set res (CompareAndSwapI mem (Binary oldval newval)));
@@ -9550,6 +9635,216 @@
 %}
 
 
+// ---------------------------------------------------------------------
+// Sundry CAS operations.  Note that release is always true,
+// regardless of the memory ordering of the CAS.  This is because we
+// need the volatile case to be sequentially consistent but there is
+// no trailing StoreLoad barrier emitted by C2.  Unfortunately we
+// can't check the type of memory ordering here, so we always emit a
+// STLXR.
+
+// This section is generated from aarch64_ad_cas.m4
+
+
+instruct compareAndExchangeB(iRegI_R0 res, indirect mem, iRegI_R2 oldval, iRegI_R3 newval, rFlagsReg cr) %{
+  match(Set res (CompareAndExchangeB mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ uxtbw(rscratch2, $oldval$$Register);
+    __ cmpxchg($mem$$Register, rscratch2, $newval$$Register,
+               Assembler::byte, /*acquire*/ false, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+    __ sxtbw($res$$Register, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndExchangeS(iRegI_R0 res, indirect mem, iRegI_R2 oldval, iRegI_R3 newval, rFlagsReg cr) %{
+  match(Set res (CompareAndExchangeS mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ uxthw(rscratch2, $oldval$$Register);
+    __ cmpxchg($mem$$Register, rscratch2, $newval$$Register,
+               Assembler::halfword, /*acquire*/ false, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+    __ sxthw($res$$Register, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndExchangeI(iRegI_R0 res, indirect mem, iRegI_R2 oldval, iRegI_R3 newval, rFlagsReg cr) %{
+  match(Set res (CompareAndExchangeI mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::word, /*acquire*/ false, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndExchangeL(iRegL_R0 res, indirect mem, iRegL_R2 oldval, iRegL_R3 newval, rFlagsReg cr) %{
+  match(Set res (CompareAndExchangeL mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (long, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::xword, /*acquire*/ false, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndExchangeN(iRegN_R0 res, indirect mem, iRegN_R2 oldval, iRegN_R3 newval, rFlagsReg cr) %{
+  match(Set res (CompareAndExchangeN mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::word, /*acquire*/ false, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndExchangeP(iRegP_R0 res, indirect mem, iRegP_R2 oldval, iRegP_R3 newval, rFlagsReg cr) %{
+  match(Set res (CompareAndExchangeP mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::xword, /*acquire*/ false, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapB(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  match(Set res (WeakCompareAndSwapB mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval"
+    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+  ins_encode %{
+    __ uxtbw(rscratch2, $oldval$$Register);
+    __ cmpxchg($mem$$Register, rscratch2, $newval$$Register,
+               Assembler::byte, /*acquire*/ false, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapS(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  match(Set res (WeakCompareAndSwapS mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval"
+    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+  ins_encode %{
+    __ uxthw(rscratch2, $oldval$$Register);
+    __ cmpxchg($mem$$Register, rscratch2, $newval$$Register,
+               Assembler::halfword, /*acquire*/ false, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapI(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  match(Set res (WeakCompareAndSwapI mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval"
+    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::word, /*acquire*/ false, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapL(iRegINoSp res, indirect mem, iRegL oldval, iRegL newval, rFlagsReg cr) %{
+  match(Set res (WeakCompareAndSwapL mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (long, weak) if $mem == $oldval then $mem <-- $newval"
+    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::xword, /*acquire*/ false, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapN(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{
+  match(Set res (WeakCompareAndSwapN mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval"
+    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::word, /*acquire*/ false, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{
+  match(Set res (WeakCompareAndSwapP mem (Binary oldval newval)));
+  ins_cost(2 * VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval"
+    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::xword, /*acquire*/ false, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+// ---------------------------------------------------------------------
+
 instruct get_and_setI(indirect mem, iRegINoSp newv, iRegI prev) %{
   match(Set prev (GetAndSetI mem newv));
   format %{ "atomic_xchgw  $prev, $newv, [$mem]" %}
@@ -14988,11 +15283,61 @@
   format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result   # KILL $tmp1" %}
   ins_encode %{
     // Count is in 8-bit bytes; non-Compact chars are 16 bits.
-    __ asrw($cnt1$$Register, $cnt1$$Register, 1);
-    __ asrw($cnt2$$Register, $cnt2$$Register, 1);
     __ string_compare($str1$$Register, $str2$$Register,
                       $cnt1$$Register, $cnt2$$Register, $result$$Register,
-                      $tmp1$$Register);
+                      $tmp1$$Register,
+                      fnoreg, fnoreg, StrIntrinsicNode::UU);
+  %}
+  ins_pipe(pipe_class_memory);
+%}
+
+instruct string_compareL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2,
+                        iRegI_R0 result, iRegP_R10 tmp1, rFlagsReg cr)
+%{
+  predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL);
+  match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
+  effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
+
+  format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result   # KILL $tmp1" %}
+  ins_encode %{
+    __ string_compare($str1$$Register, $str2$$Register,
+                      $cnt1$$Register, $cnt2$$Register, $result$$Register,
+                      $tmp1$$Register,
+                      fnoreg, fnoreg, StrIntrinsicNode::LL);
+  %}
+  ins_pipe(pipe_class_memory);
+%}
+
+instruct string_compareUL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2,
+                        iRegI_R0 result, vRegD vtmp1, vRegD vtmp2, iRegP_R10 tmp1, rFlagsReg cr)
+%{
+  predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL);
+  match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
+  effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, TEMP vtmp1, TEMP vtmp2, KILL cr);
+
+  format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result   # KILL $tmp1" %}
+  ins_encode %{
+    __ string_compare($str1$$Register, $str2$$Register,
+                      $cnt1$$Register, $cnt2$$Register, $result$$Register,
+                      $tmp1$$Register,
+                      $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, StrIntrinsicNode::UL);
+  %}
+  ins_pipe(pipe_class_memory);
+%}
+
+instruct string_compareLU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2,
+                        iRegI_R0 result, vRegD vtmp1, vRegD vtmp2, iRegP_R10 tmp1, rFlagsReg cr)
+%{
+  predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU);
+  match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
+  effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, TEMP vtmp1, TEMP vtmp2, KILL cr);
+
+  format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result   # KILL $tmp1" %}
+  ins_encode %{
+    __ string_compare($str1$$Register, $str2$$Register,
+                      $cnt1$$Register, $cnt2$$Register, $result$$Register,
+                      $tmp1$$Register,
+                      $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, StrIntrinsicNode::LU);
   %}
   ins_pipe(pipe_class_memory);
 %}
diff --git a/src/cpu/aarch64/vm/bytes_aarch64.hpp b/src/cpu/aarch64/vm/bytes_aarch64.hpp
index e2a4965..fc7890e 100644
--- a/src/cpu/aarch64/vm/bytes_aarch64.hpp
+++ b/src/cpu/aarch64/vm/bytes_aarch64.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -67,9 +67,6 @@
 
 
 // The following header contains the implementations of swap_u2, swap_u4, and swap_u8[_base]
-
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "bytes_linux_aarch64.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(bytes)
 
 #endif // CPU_AARCH64_VM_BYTES_AARCH64_HPP
diff --git a/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
index e34c6fa..a2d1631 100644
--- a/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
+++ b/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
@@ -1556,13 +1556,13 @@
 }
 
 void LIR_Assembler::casw(Register addr, Register newval, Register cmpval) {
-  __ cmpxchg(addr, cmpval, newval, Assembler::word, /* acquire*/ true, /* release*/ true, rscratch1);
+  __ cmpxchg(addr, cmpval, newval, Assembler::word, /* acquire*/ true, /* release*/ true, /* weak*/ false, rscratch1);
   __ cset(rscratch1, Assembler::NE);
   __ membar(__ AnyAny);
 }
 
 void LIR_Assembler::casl(Register addr, Register newval, Register cmpval) {
-  __ cmpxchg(addr, cmpval, newval, Assembler::xword, /* acquire*/ true, /* release*/ true, rscratch1);
+  __ cmpxchg(addr, cmpval, newval, Assembler::xword, /* acquire*/ true, /* release*/ true, /* weak*/ false, rscratch1);
   __ cset(rscratch1, Assembler::NE);
   __ membar(__ AnyAny);
 }
diff --git a/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp
index 4690e75..e66f6ff 100644
--- a/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp
+++ b/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp
@@ -808,7 +808,6 @@
   } else {
     a = new LIR_Address(obj.result(),
                         offset.result(),
-                        LIR_Address::times_1,
                         0,
                         as_BasicType(type));
   }
@@ -1002,7 +1001,6 @@
 
       LIR_Address* a = new LIR_Address(base_op,
                                        index,
-                                       LIR_Address::times_1,
                                        offset,
                                        T_BYTE);
       BasicTypeList signature(3);
diff --git a/src/cpu/aarch64/vm/c1_LIR_aarch64.cpp b/src/cpu/aarch64/vm/c1_LIR_aarch64.cpp
new file mode 100644
index 0000000..ce75dc5
--- /dev/null
+++ b/src/cpu/aarch64/vm/c1_LIR_aarch64.cpp
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "asm/register.hpp"
+#include "c1/c1_LIR.hpp"
+
+FloatRegister LIR_OprDesc::as_float_reg() const {
+  return as_FloatRegister(fpu_regnr());
+}
+
+FloatRegister LIR_OprDesc::as_double_reg() const {
+  return as_FloatRegister(fpu_regnrLo());
+}
+
+// Reg2 unused.
+LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) {
+  assert(as_FloatRegister(reg2) == fnoreg, "Not used on this platform");
+  return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
+                             (reg1 << LIR_OprDesc::reg2_shift) |
+                             LIR_OprDesc::double_type          |
+                             LIR_OprDesc::fpu_register         |
+                             LIR_OprDesc::double_size);
+}
+
+#ifndef PRODUCT
+void LIR_Address::verify() const {
+  assert(base()->is_cpu_register(), "wrong base operand");
+  assert(index()->is_illegal() || index()->is_double_cpu() || index()->is_single_cpu(), "wrong index operand");
+  assert(base()->type() == T_OBJECT || base()->type() == T_LONG || base()->type() == T_METADATA,
+         "wrong type for addresses");
+}
+#endif // PRODUCT
diff --git a/src/cpu/aarch64/vm/cas.m4 b/src/cpu/aarch64/vm/cas.m4
new file mode 100644
index 0000000..eb276df
--- /dev/null
+++ b/src/cpu/aarch64/vm/cas.m4
@@ -0,0 +1,109 @@
+// Sundry CAS operations.  Note that release is always true,
+// regardless of the memory ordering of the CAS.  This is because we
+// need the volatile case to be sequentially consistent but there is
+// no trailing StoreLoad barrier emitted by C2.  Unfortunately we
+// can't check the type of memory ordering here, so we always emit a
+// STLXR.
+
+define(`CAS_INSN',
+`
+instruct compareAndExchange$1$5(iReg$2_R0 res, indirect mem, iReg$2_R2 oldval, iReg$2_R3 newval, rFlagsReg cr) %{
+  match(Set res (CompareAndExchange$1 mem (Binary oldval newval)));
+  ifelse($5,Acq,'  predicate(needs_acquiring_load_exclusive(n));
+  ins_cost(VOLATILE_REF_COST);`,'  ins_cost(2 * VOLATILE_REF_COST);`)
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# ($3, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::$4, /*acquire*/ ifelse($5,Acq,true,false), /*release*/ true,
+               /*weak*/ false, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}')dnl
+define(`CAS_INSN4',
+`
+instruct compareAndExchange$1$7(iReg$2_R0 res, indirect mem, iReg$2_R2 oldval, iReg$2_R3 newval, rFlagsReg cr) %{
+  match(Set res (CompareAndExchange$1 mem (Binary oldval newval)));
+  ifelse($7,Acq,'  predicate(needs_acquiring_load_exclusive(n));
+  ins_cost(VOLATILE_REF_COST);`,'  ins_cost(2 * VOLATILE_REF_COST);`)
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# ($3, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ $5(rscratch2, $oldval$$Register);
+    __ cmpxchg($mem$$Register, rscratch2, $newval$$Register,
+               Assembler::$4, /*acquire*/ ifelse($5,Acq,true,false), /*release*/ true,
+               /*weak*/ false, $res$$Register);
+    __ $6($res$$Register, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}')dnl
+CAS_INSN4(B,I,byte,byte,uxtbw,sxtbw)
+CAS_INSN4(S,I,short,halfword,uxthw,sxthw)
+CAS_INSN(I,I,int,word)
+CAS_INSN(L,L,long,xword)
+CAS_INSN(N,N,narrow oop,word)
+CAS_INSN(P,P,ptr,xword)
+dnl
+dnl CAS_INSN4(B,I,byte,byte,uxtbw,sxtbw,Acq)
+dnl CAS_INSN4(S,I,short,halfword,uxthw,sxthw,Acq)
+dnl CAS_INSN(I,I,int,word,Acq)
+dnl CAS_INSN(L,L,long,xword,Acq)
+dnl CAS_INSN(N,N,narrow oop,word,Acq)
+dnl CAS_INSN(P,P,ptr,xword,Acq)
+dnl
+define(`CAS_INSN2',
+`
+instruct weakCompareAndSwap$1$6(iRegINoSp res, indirect mem, iReg$2 oldval, iReg$2 newval, rFlagsReg cr) %{
+  match(Set res (WeakCompareAndSwap$1 mem (Binary oldval newval)));
+  ifelse($6,Acq,'  predicate(needs_acquiring_load_exclusive(n));
+  ins_cost(VOLATILE_REF_COST);`,'  ins_cost(2 * VOLATILE_REF_COST);`)
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# ($3, weak) if $mem == $oldval then $mem <-- $newval"
+    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+  ins_encode %{
+    __ uxt$5(rscratch2, $oldval$$Register);
+    __ cmpxchg($mem$$Register, rscratch2, $newval$$Register,
+               Assembler::$4, /*acquire*/ ifelse($6,Acq,true,false), /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}')dnl
+define(`CAS_INSN3',
+`
+instruct weakCompareAndSwap$1$5(iRegINoSp res, indirect mem, iReg$2 oldval, iReg$2 newval, rFlagsReg cr) %{
+  match(Set res (WeakCompareAndSwap$1 mem (Binary oldval newval)));
+  ifelse($5,Acq,'  predicate(needs_acquiring_load_exclusive(n));
+  ins_cost(VOLATILE_REF_COST);`,'  ins_cost(2 * VOLATILE_REF_COST);`)
+  effect(KILL cr);
+  format %{
+    "cmpxchg $res = $mem, $oldval, $newval\t# ($3, weak) if $mem == $oldval then $mem <-- $newval"
+    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::$4, /*acquire*/ ifelse($5,Acq,true,false), /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}')dnl
+CAS_INSN2(B,I,byte,byte,bw)
+CAS_INSN2(S,I,short,halfword,hw)
+CAS_INSN3(I,I,int,word)
+CAS_INSN3(L,L,long,xword)
+CAS_INSN3(N,N,narrow oop,word)
+CAS_INSN3(P,P,ptr,xword)
+dnl CAS_INSN2(B,I,byte,byte,bw,Acq)
+dnl CAS_INSN2(S,I,short,halfword,hw,Acq)
+dnl CAS_INSN3(I,I,int,word,Acq)
+dnl CAS_INSN3(L,L,long,xword,Acq)
+dnl CAS_INSN3(N,N,narrow oop,word,Acq)
+dnl CAS_INSN3(P,P,ptr,xword,Acq)
+dnl
diff --git a/src/cpu/aarch64/vm/copy_aarch64.hpp b/src/cpu/aarch64/vm/copy_aarch64.hpp
index 7977b6e..2b7a36a 100644
--- a/src/cpu/aarch64/vm/copy_aarch64.hpp
+++ b/src/cpu/aarch64/vm/copy_aarch64.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -29,9 +29,7 @@
 // Inline functions for memory copy and fill.
 
 // Contains inline asm implementations
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "copy_linux_aarch64.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(copy)
 
 
 static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
diff --git a/src/cpu/aarch64/vm/globals_aarch64.hpp b/src/cpu/aarch64/vm/globals_aarch64.hpp
index 604b8cd..6fb7e5f 100644
--- a/src/cpu/aarch64/vm/globals_aarch64.hpp
+++ b/src/cpu/aarch64/vm/globals_aarch64.hpp
@@ -70,11 +70,7 @@
 
 define_pd_global(uintx, TypeProfileLevel, 111);
 
-// No performance work done here yet.
-define_pd_global(bool, CompactStrings, false);
-
-// avoid biased locking while we are bootstrapping the aarch64 build
-define_pd_global(bool, UseBiasedLocking, false);
+define_pd_global(bool, CompactStrings, true);
 
 // Clear short arrays bigger than one word in an arch-specific way
 define_pd_global(intx, InitArrayShortSize, BytesPerLong);
@@ -118,6 +114,7 @@
 // Don't attempt to use Neon on builtin sim until builtin sim supports it
 #define UseCRC32 false
 #define UseSIMDForMemoryOps    false
+#define AvoidUnalignedAcesses false
 
 #else
 #define UseBuiltinSim           false
@@ -144,6 +141,8 @@
           "Use CRC32 instructions for CRC32 computation")               \
   product(bool, UseSIMDForMemoryOps, false,                             \
           "Use SIMD instructions in generated memory move code")        \
+  product(bool, AvoidUnalignedAccesses, false,                          \
+          "Avoid generating unaligned memory accesses")                 \
   product(bool, UseLSE, false,                                          \
           "Use LSE instructions")                                       \
   product(bool, UseBlockZeroing, true,                                  \
diff --git a/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
index f8e4c85..6e686f5 100644
--- a/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
+++ b/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
@@ -36,6 +36,7 @@
 #include "oops/klass.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "opto/compile.hpp"
+#include "opto/intrinsicnode.hpp"
 #include "opto/node.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/icache.hpp"
@@ -565,11 +566,6 @@
   br(Assembler::EQ, done);
 }
 
-
-// added to make this compile
-
-REGISTER_DEFINITION(Register, noreg);
-
 static void pass_arg0(MacroAssembler* masm, Register arg) {
   if (c_rarg0 != arg ) {
     masm->mov(c_rarg0, arg);
@@ -2145,30 +2141,40 @@
     b(*fail);
 }
 
-// A generic CAS; success or failure is in the EQ flag.
+// A generic CAS; success or failure is in the EQ flag.  A weak CAS
+// doesn't retry and may fail spuriously.  If the oldval is wanted,
+// Pass a register for the result, otherwise pass noreg.
+
+// Clobbers rscratch1
 void MacroAssembler::cmpxchg(Register addr, Register expected,
                              Register new_val,
                              enum operand_size size,
                              bool acquire, bool release,
-                             Register tmp) {
+                             bool weak,
+                             Register result) {
+  if (result == noreg)  result = rscratch1;
   if (UseLSE) {
-    mov(tmp, expected);
-    lse_cas(tmp, new_val, addr, size, acquire, release, /*not_pair*/ true);
-    cmp(tmp, expected);
+    mov(result, expected);
+    lse_cas(result, new_val, addr, size, acquire, release, /*not_pair*/ true);
+    cmp(result, expected);
   } else {
     BLOCK_COMMENT("cmpxchg {");
     Label retry_load, done;
     if ((VM_Version::features() & VM_Version::CPU_STXR_PREFETCH))
       prfm(Address(addr), PSTL1STRM);
     bind(retry_load);
-    load_exclusive(tmp, addr, size, acquire);
+    load_exclusive(result, addr, size, acquire);
     if (size == xword)
-      cmp(tmp, expected);
+      cmp(result, expected);
     else
-      cmpw(tmp, expected);
+      cmpw(result, expected);
     br(Assembler::NE, done);
-    store_exclusive(tmp, new_val, addr, size, release);
-    cbnzw(tmp, retry_load);
+    store_exclusive(rscratch1, new_val, addr, size, release);
+    if (weak) {
+      cmpw(rscratch1, 0u);  // If the store fails, return NE to our caller.
+    } else {
+      cbnzw(rscratch1, retry_load);
+    }
     bind(done);
     BLOCK_COMMENT("} cmpxchg");
   }
@@ -4500,21 +4506,49 @@
   BIND(DONE);
 }
 
+typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr);
+typedef void (MacroAssembler::* uxt_insn)(Register Rd, Register Rn);
+
 // Compare strings.
 void MacroAssembler::string_compare(Register str1, Register str2,
                                     Register cnt1, Register cnt2, Register result,
-                                    Register tmp1) {
+                                    Register tmp1,
+                                    FloatRegister vtmp, FloatRegister vtmpZ, int ae) {
   Label LENGTH_DIFF, DONE, SHORT_LOOP, SHORT_STRING,
     NEXT_WORD, DIFFERENCE;
 
+  bool isLL = ae == StrIntrinsicNode::LL;
+  bool isLU = ae == StrIntrinsicNode::LU;
+  bool isUL = ae == StrIntrinsicNode::UL;
+
+  bool str1_isL = isLL || isLU;
+  bool str2_isL = isLL || isUL;
+
+  int str1_chr_shift = str1_isL ? 0 : 1;
+  int str2_chr_shift = str2_isL ? 0 : 1;
+  int str1_chr_size = str1_isL ? 1 : 2;
+  int str2_chr_size = str2_isL ? 1 : 2;
+
+  chr_insn str1_load_chr = str1_isL ? (chr_insn)&MacroAssembler::ldrb :
+                                      (chr_insn)&MacroAssembler::ldrh;
+  chr_insn str2_load_chr = str2_isL ? (chr_insn)&MacroAssembler::ldrb :
+                                      (chr_insn)&MacroAssembler::ldrh;
+  uxt_insn ext_chr = isLL ? (uxt_insn)&MacroAssembler::uxtbw :
+                            (uxt_insn)&MacroAssembler::uxthw;
+
   BLOCK_COMMENT("string_compare {");
 
+  // Bizzarely, the counts are passed in bytes, regardless of whether they
+  // are L or U strings, however the result is always in characters.
+  if (!str1_isL) asrw(cnt1, cnt1, 1);
+  if (!str2_isL) asrw(cnt2, cnt2, 1);
+
   // Compute the minimum of the string lengths and save the difference.
   subsw(tmp1, cnt1, cnt2);
   cselw(cnt2, cnt1, cnt2, Assembler::LE); // min
 
   // A very short string
-  cmpw(cnt2, 4);
+  cmpw(cnt2, isLL ? 8:4);
   br(Assembler::LT, SHORT_STRING);
 
   // Check if the strings start at the same location.
@@ -4523,20 +4557,37 @@
 
   // Compare longwords
   {
-    subw(cnt2, cnt2, 4); // The last longword is a special case
+    subw(cnt2, cnt2, isLL ? 8:4); // The last longword is a special case
 
     // Move both string pointers to the last longword of their
     // strings, negate the remaining count, and convert it to bytes.
-    lea(str1, Address(str1, cnt2, Address::uxtw(1)));
-    lea(str2, Address(str2, cnt2, Address::uxtw(1)));
-    sub(cnt2, zr, cnt2, LSL, 1);
+    lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift)));
+    lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift)));
+    if (isLU || isUL) {
+      sub(cnt1, zr, cnt2, LSL, str1_chr_shift);
+      eor(vtmpZ, T16B, vtmpZ, vtmpZ);
+    }
+    sub(cnt2, zr, cnt2, LSL, str2_chr_shift);
 
     // Loop, loading longwords and comparing them into rscratch2.
     bind(NEXT_WORD);
-    ldr(result, Address(str1, cnt2));
-    ldr(cnt1, Address(str2, cnt2));
-    adds(cnt2, cnt2, wordSize);
-    eor(rscratch2, result, cnt1);
+    if (isLU) {
+      ldrs(vtmp, Address(str1, cnt1));
+      zip1(vtmp, T8B, vtmp, vtmpZ);
+      umov(result, vtmp, D, 0);
+    } else {
+      ldr(result, Address(str1, isUL ? cnt1:cnt2));
+    }
+    if (isUL) {
+      ldrs(vtmp, Address(str2, cnt2));
+      zip1(vtmp, T8B, vtmp, vtmpZ);
+      umov(rscratch1, vtmp, D, 0);
+    } else {
+      ldr(rscratch1, Address(str2, cnt2));
+    }
+    adds(cnt2, cnt2, isUL ? 4:8);
+    if (isLU || isUL) add(cnt1, cnt1, isLU ? 4:8);
+    eor(rscratch2, result, rscratch1);
     cbnz(rscratch2, DIFFERENCE);
     br(Assembler::LT, NEXT_WORD);
 
@@ -4544,9 +4595,21 @@
     // same longword twice, but that's still faster than another
     // conditional branch.
 
-    ldr(result, Address(str1));
-    ldr(cnt1, Address(str2));
-    eor(rscratch2, result, cnt1);
+    if (isLU) {
+      ldrs(vtmp, Address(str1));
+      zip1(vtmp, T8B, vtmp, vtmpZ);
+      umov(result, vtmp, D, 0);
+    } else {
+      ldr(result, Address(str1));
+    }
+    if (isUL) {
+      ldrs(vtmp, Address(str2));
+      zip1(vtmp, T8B, vtmp, vtmpZ);
+      umov(rscratch1, vtmp, D, 0);
+    } else {
+      ldr(rscratch1, Address(str2));
+    }
+    eor(rscratch2, result, rscratch1);
     cbz(rscratch2, LENGTH_DIFF);
 
     // Find the first different characters in the longwords and
@@ -4554,12 +4617,12 @@
     bind(DIFFERENCE);
     rev(rscratch2, rscratch2);
     clz(rscratch2, rscratch2);
-    andr(rscratch2, rscratch2, -16);
+    andr(rscratch2, rscratch2, isLL ? -8 : -16);
     lsrv(result, result, rscratch2);
-    uxthw(result, result);
-    lsrv(cnt1, cnt1, rscratch2);
-    uxthw(cnt1, cnt1);
-    subw(result, result, cnt1);
+    (this->*ext_chr)(result, result);
+    lsrv(rscratch1, rscratch1, rscratch2);
+    (this->*ext_chr)(rscratch1, rscratch1);
+    subw(result, result, rscratch1);
     b(DONE);
   }
 
@@ -4568,8 +4631,8 @@
   cbz(cnt2, LENGTH_DIFF);
 
   bind(SHORT_LOOP);
-  load_unsigned_short(result, Address(post(str1, 2)));
-  load_unsigned_short(cnt1, Address(post(str2, 2)));
+  (this->*str1_load_chr)(result, Address(post(str1, str1_chr_size)));
+  (this->*str2_load_chr)(cnt1, Address(post(str2, str2_chr_size)));
   subw(result, result, cnt1);
   cbnz(result, DONE);
   sub(cnt2, cnt2, 1);
@@ -4853,7 +4916,7 @@
   // alignment.
   if (!is_large || !(BlockZeroingLowLimit >= zva_length * 2)) {
     int low_limit = MAX2(zva_length * 2, (int)BlockZeroingLowLimit);
-    cmp(cnt, low_limit >> 3);
+    subs(tmp, cnt, low_limit >> 3);
     br(Assembler::LT, small);
   }
 
diff --git a/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
index 2a9d0a9..51a47b7 100644
--- a/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
+++ b/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
@@ -995,10 +995,11 @@
   }
 
   // A generic CAS; success or failure is in the EQ flag.
+  // Clobbers rscratch1
   void cmpxchg(Register addr, Register expected, Register new_val,
                enum operand_size size,
-               bool acquire, bool release,
-               Register tmp = rscratch1);
+               bool acquire, bool release, bool weak,
+               Register result);
 
   // Calls
 
@@ -1198,7 +1199,8 @@
 
   void string_compare(Register str1, Register str2,
                       Register cnt1, Register cnt2, Register result,
-                      Register tmp1);
+                      Register tmp1,
+                      FloatRegister vtmp, FloatRegister vtmpZ, int ae);
 
   void arrays_equals(Register a1, Register a2,
                      Register result, Register cnt1,
diff --git a/src/cpu/aarch64/vm/register_definitions_aarch64.cpp b/src/cpu/aarch64/vm/register_definitions_aarch64.cpp
index 2c67be1..5411d06 100644
--- a/src/cpu/aarch64/vm/register_definitions_aarch64.cpp
+++ b/src/cpu/aarch64/vm/register_definitions_aarch64.cpp
@@ -29,6 +29,8 @@
 #include "register_aarch64.hpp"
 # include "interp_masm_aarch64.hpp"
 
+REGISTER_DEFINITION(Register, noreg);
+
 REGISTER_DEFINITION(Register, r0);
 REGISTER_DEFINITION(Register, r1);
 REGISTER_DEFINITION(Register, r2);
@@ -62,6 +64,8 @@
 REGISTER_DEFINITION(Register, r30);
 REGISTER_DEFINITION(Register, sp);
 
+REGISTER_DEFINITION(FloatRegister, fnoreg);
+
 REGISTER_DEFINITION(FloatRegister, v0);
 REGISTER_DEFINITION(FloatRegister, v1);
 REGISTER_DEFINITION(FloatRegister, v2);
diff --git a/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
index b93e9b1..13071f5 100644
--- a/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
+++ b/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
@@ -801,6 +801,12 @@
     StubCodeMark mark(this, "StubRoutines", stub_name);
     __ align(CodeEntryAlignment);
     __ bind(start);
+
+    Label unaligned_copy_long;
+    if (AvoidUnalignedAccesses) {
+      __ tbnz(d, 3, unaligned_copy_long);
+    }
+
     if (direction == copy_forwards) {
       __ sub(s, s, bias);
       __ sub(d, d, bias);
@@ -901,6 +907,198 @@
     }
 
     __ ret(lr);
+
+    if (AvoidUnalignedAccesses) {
+      Label drain, again;
+      // Register order for storing. Order is different for backward copy.
+
+      __ bind(unaligned_copy_long);
+
+      // source address is even aligned, target odd aligned
+      //
+      // when forward copying word pairs we read long pairs at offsets
+      // {0, 2, 4, 6} (in long words). when backwards copying we read
+      // long pairs at offsets {-2, -4, -6, -8}. We adjust the source
+      // address by -2 in the forwards case so we can compute the
+      // source offsets for both as {2, 4, 6, 8} * unit where unit = 1
+      // or -1.
+      //
+      // when forward copying we need to store 1 word, 3 pairs and
+      // then 1 word at offsets {0, 1, 3, 5, 7}. Rather thna use a
+      // zero offset We adjust the destination by -1 which means we
+      // have to use offsets { 1, 2, 4, 6, 8} * unit for the stores.
+      //
+      // When backwards copyng we need to store 1 word, 3 pairs and
+      // then 1 word at offsets {-1, -3, -5, -7, -8} i.e. we use
+      // offsets {1, 3, 5, 7, 8} * unit.
+
+      if (direction == copy_forwards) {
+        __ sub(s, s, 16);
+        __ sub(d, d, 8);
+      }
+
+      // Fill 8 registers
+      //
+      // for forwards copy s was offset by -16 from the original input
+      // value of s so the register contents are at these offsets
+      // relative to the 64 bit block addressed by that original input
+      // and so on for each successive 64 byte block when s is updated
+      //
+      // t0 at offset 0,  t1 at offset 8
+      // t2 at offset 16, t3 at offset 24
+      // t4 at offset 32, t5 at offset 40
+      // t6 at offset 48, t7 at offset 56
+
+      // for backwards copy s was not offset so the register contents
+      // are at these offsets into the preceding 64 byte block
+      // relative to that original input and so on for each successive
+      // preceding 64 byte block when s is updated. this explains the
+      // slightly counter-intuitive looking pattern of register usage
+      // in the stp instructions for backwards copy.
+      //
+      // t0 at offset -16, t1 at offset -8
+      // t2 at offset -32, t3 at offset -24
+      // t4 at offset -48, t5 at offset -40
+      // t6 at offset -64, t7 at offset -56
+
+      __ ldp(t0, t1, Address(s, 2 * unit));
+      __ ldp(t2, t3, Address(s, 4 * unit));
+      __ ldp(t4, t5, Address(s, 6 * unit));
+      __ ldp(t6, t7, Address(__ pre(s, 8 * unit)));
+
+      __ subs(count, count, 16);
+      __ br(Assembler::LO, drain);
+
+      int prefetch = PrefetchCopyIntervalInBytes;
+      bool use_stride = false;
+      if (direction == copy_backwards) {
+         use_stride = prefetch > 256;
+         prefetch = -prefetch;
+         if (use_stride) __ mov(stride, prefetch);
+      }
+
+      __ bind(again);
+
+      if (PrefetchCopyIntervalInBytes > 0)
+        __ prfm(use_stride ? Address(s, stride) : Address(s, prefetch), PLDL1KEEP);
+
+      if (direction == copy_forwards) {
+       // allowing for the offset of -8 the store instructions place
+       // registers into the target 64 bit block at the following
+       // offsets
+       //
+       // t0 at offset 0
+       // t1 at offset 8,  t2 at offset 16
+       // t3 at offset 24, t4 at offset 32
+       // t5 at offset 40, t6 at offset 48
+       // t7 at offset 56
+
+        __ str(t0, Address(d, 1 * unit));
+        __ stp(t1, t2, Address(d, 2 * unit));
+        __ ldp(t0, t1, Address(s, 2 * unit));
+        __ stp(t3, t4, Address(d, 4 * unit));
+        __ ldp(t2, t3, Address(s, 4 * unit));
+        __ stp(t5, t6, Address(d, 6 * unit));
+        __ ldp(t4, t5, Address(s, 6 * unit));
+        __ str(t7, Address(__ pre(d, 8 * unit)));
+        __ ldp(t6, t7, Address(__ pre(s, 8 * unit)));
+      } else {
+       // d was not offset when we started so the registers are
+       // written into the 64 bit block preceding d with the following
+       // offsets
+       //
+       // t1 at offset -8
+       // t3 at offset -24, t0 at offset -16
+       // t5 at offset -48, t2 at offset -32
+       // t7 at offset -56, t4 at offset -48
+       //                   t6 at offset -64
+       //
+       // note that this matches the offsets previously noted for the
+       // loads
+
+        __ str(t1, Address(d, 1 * unit));
+        __ stp(t3, t0, Address(d, 3 * unit));
+        __ ldp(t0, t1, Address(s, 2 * unit));
+        __ stp(t5, t2, Address(d, 5 * unit));
+        __ ldp(t2, t3, Address(s, 4 * unit));
+        __ stp(t7, t4, Address(d, 7 * unit));
+        __ ldp(t4, t5, Address(s, 6 * unit));
+        __ str(t6, Address(__ pre(d, 8 * unit)));
+        __ ldp(t6, t7, Address(__ pre(s, 8 * unit)));
+      }
+
+      __ subs(count, count, 8);
+      __ br(Assembler::HS, again);
+
+      // Drain
+      //
+      // this uses the same pattern of offsets and register arguments
+      // as above
+      __ bind(drain);
+      if (direction == copy_forwards) {
+        __ str(t0, Address(d, 1 * unit));
+        __ stp(t1, t2, Address(d, 2 * unit));
+        __ stp(t3, t4, Address(d, 4 * unit));
+        __ stp(t5, t6, Address(d, 6 * unit));
+        __ str(t7, Address(__ pre(d, 8 * unit)));
+      } else {
+        __ str(t1, Address(d, 1 * unit));
+        __ stp(t3, t0, Address(d, 3 * unit));
+        __ stp(t5, t2, Address(d, 5 * unit));
+        __ stp(t7, t4, Address(d, 7 * unit));
+        __ str(t6, Address(__ pre(d, 8 * unit)));
+      }
+      // now we need to copy any remaining part block which may
+      // include a 4 word block subblock and/or a 2 word subblock.
+      // bits 2 and 1 in the count are the tell-tale for whetehr we
+      // have each such subblock
+      {
+        Label L1, L2;
+        __ tbz(count, exact_log2(4), L1);
+       // this is the same as above but copying only 4 longs hence
+       // with ony one intervening stp between the str instructions
+       // but note that the offsets and registers still follow the
+       // same pattern
+        __ ldp(t0, t1, Address(s, 2 * unit));
+        __ ldp(t2, t3, Address(__ pre(s, 4 * unit)));
+        if (direction == copy_forwards) {
+          __ str(t0, Address(d, 1 * unit));
+          __ stp(t1, t2, Address(d, 2 * unit));
+          __ str(t3, Address(__ pre(d, 4 * unit)));
+        } else {
+          __ str(t1, Address(d, 1 * unit));
+          __ stp(t3, t0, Address(d, 3 * unit));
+          __ str(t2, Address(__ pre(d, 4 * unit)));
+        }
+        __ bind(L1);
+
+        __ tbz(count, 1, L2);
+       // this is the same as above but copying only 2 longs hence
+       // there is no intervening stp between the str instructions
+       // but note that the offset and register patterns are still
+       // the same
+        __ ldp(t0, t1, Address(__ pre(s, 2 * unit)));
+        if (direction == copy_forwards) {
+          __ str(t0, Address(d, 1 * unit));
+          __ str(t1, Address(__ pre(d, 2 * unit)));
+        } else {
+          __ str(t1, Address(d, 1 * unit));
+          __ str(t0, Address(__ pre(d, 2 * unit)));
+        }
+        __ bind(L2);
+
+       // for forwards copy we need to re-adjust the offsets we
+       // applied so that s and d are follow the last words written
+
+       if (direction == copy_forwards) {
+         __ add(s, s, 16);
+         __ add(d, d, 8);
+       }
+
+      }
+
+      __ ret(lr);
+      }
   }
 
   // Small copy: less than 16 bytes.
@@ -1024,11 +1222,9 @@
     // (96 bytes if SIMD because we do 32 byes per instruction)
     __ bind(copy80);
     if (UseSIMDForMemoryOps) {
-      __ ldpq(v0, v1, Address(s, 0));
-      __ ldpq(v2, v3, Address(s, 32));
+      __ ld4(v0, v1, v2, v3, __ T16B, Address(s, 0));
       __ ldpq(v4, v5, Address(send, -32));
-      __ stpq(v0, v1, Address(d, 0));
-      __ stpq(v2, v3, Address(d, 32));
+      __ st4(v0, v1, v2, v3, __ T16B, Address(d, 0));
       __ stpq(v4, v5, Address(dend, -32));
     } else {
       __ ldp(t0, t1, Address(s, 0));
@@ -2150,8 +2346,9 @@
     __ subw(count, count, cnt_words, Assembler::LSL, 3 - shift);
     if (UseBlockZeroing) {
       Label non_block_zeroing, rest;
+      Register tmp = rscratch1;
       // count >= BlockZeroingLowLimit && value == 0
-      __ cmp(cnt_words, BlockZeroingLowLimit >> 3);
+      __ subs(tmp, cnt_words, BlockZeroingLowLimit >> 3);
       __ ccmp(value, 0 /* comparing value */, 0 /* NZCV */, Assembler::GE);
       __ br(Assembler::NE, non_block_zeroing);
       __ mov(bz_base, to);
diff --git a/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
index 4c54f8e..293024c 100644
--- a/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
+++ b/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
@@ -437,6 +437,21 @@
   __ restore_locals();
   __ restore_constant_pool_cache();
   __ get_method(rmethod);
+  __ get_dispatch();
+
+  // Calculate stack limit
+  __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
+  __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
+  __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
+  __ ldr(rscratch2,
+         Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
+  __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
+  __ andr(sp, rscratch1, -16);
+
+  // Restore expression stack pointer
+  __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
+  // NULL last_sp until next java call
+  __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 
 #if INCLUDE_JVMCI
   // Check if we need to take lock at entry of synchronized method.
@@ -463,22 +478,6 @@
     __ bind(L);
   }
 
-  __ get_dispatch();
-
-  // Calculate stack limit
-  __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
-  __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
-  __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
-  __ ldr(rscratch2,
-         Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
-  __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
-  __ andr(sp, rscratch1, -16);
-
-  // Restore expression stack pointer
-  __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
-  // NULL last_sp until next java call
-  __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
-
   __ dispatch_next(state, step);
   return entry;
 }
diff --git a/src/cpu/aarch64/vm/templateTable_aarch64.cpp b/src/cpu/aarch64/vm/templateTable_aarch64.cpp
index 68827fc..3fd9dbe 100644
--- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp
+++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp
@@ -2434,7 +2434,7 @@
   __ ldrsb(r0, field);
   __ push(ztos);
   // Rewrite bytecode to be faster
-  if (!is_static) {
+  if (rc == may_rewrite) {
     // use btos rewriting, no truncating to t/f bit is needed for getfield.
     patch_bytecode(Bytecodes::_fast_bgetfield, bc, r1);
   }
@@ -2670,7 +2670,7 @@
     if (!is_static) pop_and_check_object(obj);
     __ andw(r0, r0, 0x1);
     __ strb(r0, field);
-    if (!is_static) {
+    if (rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_zputfield, bc, r1, true, byte_no);
     }
     __ b(Done);
diff --git a/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/src/cpu/aarch64/vm/vm_version_aarch64.cpp
index 070fcbd..f147016 100644
--- a/src/cpu/aarch64/vm/vm_version_aarch64.cpp
+++ b/src/cpu/aarch64/vm/vm_version_aarch64.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2015, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -29,10 +29,10 @@
 #include "memory/resourceArea.hpp"
 #include "runtime/java.hpp"
 #include "runtime/stubCodeGenerator.hpp"
+#include "utilities/macros.hpp"
 #include "vm_version_aarch64.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
+
+#include OS_HEADER_INLINE(os)
 
 #ifndef BUILTIN_SIM
 #include <sys/auxv.h>
@@ -175,7 +175,15 @@
   }
 
   // Enable vendor specific features
-  if (_cpu == CPU_CAVIUM && _variant == 0) _features |= CPU_DMB_ATOMICS;
+  if (_cpu == CPU_CAVIUM) {
+    if (_variant == 0) _features |= CPU_DMB_ATOMICS;
+    if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) {
+      FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true);
+    }
+    if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) {
+      FLAG_SET_DEFAULT(UseSIMDForMemoryOps, (_variant > 0));
+    }
+  }
   if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) _features |= CPU_A53MAC;
   if (_cpu == CPU_ARM && (_model == 0xd07 || _model2 == 0xd07)) _features |= CPU_STXR_PREFETCH;
   // If an olde style /proc/cpuinfo (cpu_lines == 1) then if _model is an A57 (0xd07)
diff --git a/src/cpu/ppc/vm/bytes_ppc.hpp b/src/cpu/ppc/vm/bytes_ppc.hpp
index be005cb..b75b0f0 100644
--- a/src/cpu/ppc/vm/bytes_ppc.hpp
+++ b/src/cpu/ppc/vm/bytes_ppc.hpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2013 SAP SE. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -274,8 +274,6 @@
 #endif // VM_LITTLE_ENDIAN
 };
 
-#if defined(TARGET_OS_ARCH_linux_ppc)
-#include "bytes_linux_ppc.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(bytes)
 
 #endif // CPU_PPC_VM_BYTES_PPC_HPP
diff --git a/src/cpu/ppc/vm/c1_LIR_ppc.cpp b/src/cpu/ppc/vm/c1_LIR_ppc.cpp
new file mode 100644
index 0000000..ef9b083
--- /dev/null
+++ b/src/cpu/ppc/vm/c1_LIR_ppc.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016 SAP SE. 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "asm/register.hpp"
+#include "c1/c1_LIR.hpp"
+
+FloatRegister LIR_OprDesc::as_float_reg() const {
+  return as_FloatRegister(fpu_regnr());
+}
+
+FloatRegister LIR_OprDesc::as_double_reg() const {
+  return as_FloatRegister(fpu_regnrLo());
+}
+
+// Reg2 unused.
+LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) {
+  assert(!as_FloatRegister(reg2)->is_valid(), "Not used on this platform");
+  return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
+                             (reg1 << LIR_OprDesc::reg2_shift) |
+                             LIR_OprDesc::double_type          |
+                             LIR_OprDesc::fpu_register         |
+                             LIR_OprDesc::double_size);
+}
+
+#ifndef PRODUCT
+void LIR_Address::verify() const {
+  assert(scale() == times_1, "Scaled addressing mode not available on PPC and should not be used");
+  assert(disp() == 0 || index()->is_illegal(), "can't have both");
+#ifdef _LP64
+  assert(base()->is_cpu_register(), "wrong base operand");
+  assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
+  assert(base()->type() == T_OBJECT || base()->type() == T_LONG || base()->type() == T_METADATA,
+         "wrong type for addresses");
+#else
+  assert(base()->is_single_cpu(), "wrong base operand");
+  assert(index()->is_illegal() || index()->is_single_cpu(), "wrong index operand");
+  assert(base()->type() == T_OBJECT || base()->type() == T_INT || base()->type() == T_METADATA,
+         "wrong type for addresses");
+#endif
+}
+#endif // PRODUCT
diff --git a/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
index 941a65f..5e36654 100644
--- a/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
+++ b/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
@@ -47,7 +47,7 @@
 // The expected size in bytes of a cache line, used to pad data structures.
 #define DEFAULT_CACHE_LINE_SIZE 128
 
-#if defined(COMPILER2) && (defined(AIX) || defined(linux))
+#if defined(COMPILER2) && (defined(AIX) || defined(LINUX))
 // Include Transactional Memory lock eliding optimization
 #define INCLUDE_RTM_OPT 1
 #endif
diff --git a/src/cpu/ppc/vm/interp_masm_ppc_64.hpp b/src/cpu/ppc/vm/interp_masm_ppc.hpp
similarity index 98%
rename from src/cpu/ppc/vm/interp_masm_ppc_64.hpp
rename to src/cpu/ppc/vm/interp_masm_ppc.hpp
index 3da602d..d2085ea 100644
--- a/src/cpu/ppc/vm/interp_masm_ppc_64.hpp
+++ b/src/cpu/ppc/vm/interp_masm_ppc.hpp
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
-#define CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
+#ifndef CPU_PPC_VM_INTERP_MASM_PPC_HPP
+#define CPU_PPC_VM_INTERP_MASM_PPC_HPP
 
 #include "asm/macroAssembler.hpp"
 #include "interpreter/invocationCounter.hpp"
@@ -263,4 +263,4 @@
                           NotifyMethodExitMode mode, bool check_exceptions);
 };
 
-#endif // CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
+#endif // CPU_PPC_VM_INTERP_MASM_PPC_HPP
diff --git a/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
index 2a8eddf..70544e9 100644
--- a/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
+++ b/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
@@ -26,7 +26,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.inline.hpp"
-#include "interp_masm_ppc_64.hpp"
+#include "interp_masm_ppc.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/sharedRuntime.hpp"
diff --git a/src/cpu/ppc/vm/ppc_64.ad b/src/cpu/ppc/vm/ppc_64.ad
deleted file mode 100644
index 712f18f..0000000
--- a/src/cpu/ppc/vm/ppc_64.ad
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
-// Copyright (c) 2012, 2013 SAP SE. 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.
-//
-//
diff --git a/src/cpu/ppc/vm/register_ppc.hpp b/src/cpu/ppc/vm/register_ppc.hpp
index fffd7dc..e73dc18 100644
--- a/src/cpu/ppc/vm/register_ppc.hpp
+++ b/src/cpu/ppc/vm/register_ppc.hpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -76,7 +76,7 @@
 typedef RegisterImpl* Register;
 
 inline Register as_Register(int encoding) {
-  assert(encoding >= 0 && encoding < 32, "bad register encoding");
+  assert(encoding >= -1 && encoding < 32, "bad register encoding");
   return (Register)(intptr_t)encoding;
 }
 
@@ -91,7 +91,7 @@
   inline friend Register as_Register(int encoding);
 
   // accessors
-  int encoding()  const { assert(is_valid(), "invalid register"); return value(); }
+  int encoding() const { assert(is_valid(), "invalid register"); return value(); }
   inline VMReg as_VMReg();
   Register successor() const { return as_Register(encoding() + 1); }
 
@@ -247,7 +247,7 @@
 typedef FloatRegisterImpl* FloatRegister;
 
 inline FloatRegister as_FloatRegister(int encoding) {
-  assert(encoding >= 0 && encoding < 32, "bad float register encoding");
+  assert(encoding >= -1 && encoding < 32, "bad float register encoding");
   return (FloatRegister)(intptr_t)encoding;
 }
 
@@ -267,7 +267,7 @@
   FloatRegister successor() const { return as_FloatRegister(encoding() + 1); }
 
   // testers
-  bool is_valid()       const { return (0  <=  value()       &&  value()       < number_of_registers); }
+  bool is_valid() const { return (0 <= value() && value() < number_of_registers); }
 
   const char* name() const;
 };
diff --git a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
index 38c83d3..609420a 100644
--- a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
+++ b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
@@ -40,7 +40,7 @@
 #include "c1/c1_Runtime1.hpp"
 #endif
 #ifdef COMPILER2
-#include "adfiles/ad_ppc_64.hpp"
+#include "opto/ad.hpp"
 #include "opto/runtime.hpp"
 #endif
 
diff --git a/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp b/src/cpu/ppc/vm/stubRoutines_ppc.hpp
similarity index 87%
rename from src/cpu/ppc/vm/stubRoutines_ppc_64.hpp
rename to src/cpu/ppc/vm/stubRoutines_ppc.hpp
index a005677..b04c99c 100644
--- a/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp
+++ b/src/cpu/ppc/vm/stubRoutines_ppc.hpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef CPU_PPC_VM_STUBROUTINES_PPC_64_HPP
-#define CPU_PPC_VM_STUBROUTINES_PPC_64_HPP
+#ifndef CPU_PPC_VM_STUBROUTINES_PPC_HPP
+#define CPU_PPC_VM_STUBROUTINES_PPC_HPP
 
 // This file holds the platform specific parts of the StubRoutines
 // definition. See stubRoutines.hpp for a description on how to
@@ -61,4 +61,4 @@
 
 };
 
-#endif // CPU_PPC_VM_STUBROUTINES_PPC_64_HPP
+#endif // CPU_PPC_VM_STUBROUTINES_PPC_HPP
diff --git a/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
index 591db70..c37887f 100644
--- a/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
+++ b/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
@@ -881,10 +881,6 @@
   BLOCK_COMMENT("} stack_overflow_check_with_compare");
 }
 
-void TemplateInterpreterGenerator::unlock_method(bool check_exceptions) {
-  __ unlock_object(R26_monitor, check_exceptions);
-}
-
 // Lock the current method, interpreter register window must be set up!
 void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratch1, Register Rscratch2, bool flags_preloaded) {
   const Register Robj_to_lock = Rscratch2;
@@ -1566,7 +1562,7 @@
   if (synchronized) {
     // Don't check for exceptions since we're still in the i2n frame. Do that
     // manually afterwards.
-    unlock_method(false);
+    __ unlock_object(R26_monitor, false); // Can also unlock methods.
   }
 
   // Reset active handles after returning from native.
@@ -1609,7 +1605,7 @@
   if (synchronized) {
     // Don't check for exceptions since we're still in the i2n frame. Do that
     // manually afterwards.
-    unlock_method(false);
+    __ unlock_object(R26_monitor, false); // Can also unlock methods.
   }
   BIND(exception_return_sync_check_already_unlocked);
 
diff --git a/src/cpu/ppc/vm/templateTable_ppc_64.hpp b/src/cpu/ppc/vm/templateTable_ppc.hpp
similarity index 86%
rename from src/cpu/ppc/vm/templateTable_ppc_64.hpp
rename to src/cpu/ppc/vm/templateTable_ppc.hpp
index 943f12a..05ce690 100644
--- a/src/cpu/ppc/vm/templateTable_ppc_64.hpp
+++ b/src/cpu/ppc/vm/templateTable_ppc.hpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013, 2014 SAP SE. All rights reserved.
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016 SAP SE. 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
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef CPU_PPC_VM_TEMPLATETABLE_PPC_64_HPP
-#define CPU_PPC_VM_TEMPLATETABLE_PPC_64_HPP
+#ifndef CPU_PPC_VM_TEMPLATETABLE_PPC_HPP
+#define CPU_PPC_VM_TEMPLATETABLE_PPC_HPP
 
   static void prepare_invoke(int byte_no, Register Rmethod, Register Rret_addr, Register Rindex, Register Rrecv, Register Rflags, Register Rscratch);
   static void invokevfinal_helper(Register Rmethod, Register Rflags, Register Rscratch1, Register Rscratch2);
@@ -35,4 +35,4 @@
   static void branch_conditional(ConditionRegister crx, TemplateTable::Condition cc, Label& L, bool invert = false);
   static void if_cmp_common(Register Rfirst, Register Rsecond, Register Rscratch1, Register Rscratch2, Condition cc, bool is_jint, bool cmp0);
 
-#endif // CPU_PPC_VM_TEMPLATETABLE_PPC_64_HPP
+#endif // CPU_PPC_VM_TEMPLATETABLE_PPC_HPP
diff --git a/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/src/cpu/ppc/vm/templateTable_ppc_64.cpp
index e27601c..37934b4 100644
--- a/src/cpu/ppc/vm/templateTable_ppc_64.cpp
+++ b/src/cpu/ppc/vm/templateTable_ppc_64.cpp
@@ -1668,9 +1668,13 @@
         __ lwz(Rscratch3, in_bytes(MethodData::backedge_mask_offset()), Rmdo);
         __ addi(Rscratch2, Rscratch2, increment);
         __ stw(Rscratch2, mdo_bc_offs, Rmdo);
-        __ and_(Rscratch3, Rscratch2, Rscratch3);
-        __ bne(CCR0, Lforward);
-        __ b(Loverflow);
+        if (UseOnStackReplacement) {
+          __ and_(Rscratch3, Rscratch2, Rscratch3);
+          __ bne(CCR0, Lforward);
+          __ b(Loverflow);
+        } else {
+          __ b(Lforward);
+        }
       }
 
       // If there's no MDO, increment counter in method.
@@ -1680,9 +1684,12 @@
       __ lwz(Rscratch3, in_bytes(MethodCounters::backedge_mask_offset()), R4_counters);
       __ addi(Rscratch2, Rscratch2, increment);
       __ stw(Rscratch2, mo_bc_offs, R4_counters);
-      __ and_(Rscratch3, Rscratch2, Rscratch3);
-      __ bne(CCR0, Lforward);
-
+      if (UseOnStackReplacement) {
+        __ and_(Rscratch3, Rscratch2, Rscratch3);
+        __ bne(CCR0, Lforward);
+      } else {
+        __ b(Lforward);
+      }
       __ bind(Loverflow);
 
       // Notify point for loop, pass branch bytecode.
diff --git a/src/cpu/ppc/vm/vm_version_ppc.cpp b/src/cpu/ppc/vm/vm_version_ppc.cpp
index 3b0800d..d83c3cd 100644
--- a/src/cpu/ppc/vm/vm_version_ppc.cpp
+++ b/src/cpu/ppc/vm/vm_version_ppc.cpp
@@ -278,7 +278,7 @@
       os_too_old = false;
     }
 #endif
-#ifdef linux
+#ifdef LINUX
     // At least Linux kernel 4.2, as the problematic behavior of syscalls
     // being called in the middle of a transaction has been addressed.
     // Please, refer to commit b4b56f9ecab40f3b4ef53e130c9f6663be491894
diff --git a/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp b/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp
index 9345db6..d2f6117 100644
--- a/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp
+++ b/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -26,7 +26,7 @@
 #include "precompiled.hpp"
 #include "asm/macroAssembler.inline.hpp"
 #include "code/vtableStubs.hpp"
-#include "interp_masm_ppc_64.hpp"
+#include "interp_masm_ppc.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klassVtable.hpp"
@@ -243,7 +243,7 @@
 }
 
 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
-  if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) {
+  if (DebugVtables || CountCompiledCalls || VerifyOops) {
     return 1000;
   } else {
     int decode_klass_size = MacroAssembler::instr_size_for_decode_klass_not_null();
diff --git a/src/cpu/sparc/vm/c1_LIR_sparc.cpp b/src/cpu/sparc/vm/c1_LIR_sparc.cpp
new file mode 100644
index 0000000..e946776
--- /dev/null
+++ b/src/cpu/sparc/vm/c1_LIR_sparc.cpp
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "asm/register.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIR.hpp"
+
+FloatRegister LIR_OprDesc::as_float_reg() const {
+  return FrameMap::nr2floatreg(fpu_regnr());
+}
+
+FloatRegister LIR_OprDesc::as_double_reg() const {
+  return FrameMap::nr2floatreg(fpu_regnrHi());
+}
+
+LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) {
+  assert(as_FloatRegister(reg2) != fnoreg, "Sparc holds double in two regs.");
+  return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
+                             (reg2 << LIR_OprDesc::reg2_shift) |
+                             LIR_OprDesc::double_type          |
+                             LIR_OprDesc::fpu_register         |
+                             LIR_OprDesc::double_size);
+}
+
+#ifndef PRODUCT
+void LIR_Address::verify() const {
+  assert(scale() == times_1, "Scaled addressing mode not available on SPARC and should not be used");
+  assert(disp() == 0 || index()->is_illegal(), "can't have both");
+#ifdef _LP64
+  assert(base()->is_cpu_register(), "wrong base operand");
+  assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
+  assert(base()->type() == T_OBJECT || base()->type() == T_LONG || base()->type() == T_METADATA,
+         "wrong type for addresses");
+#else
+  assert(base()->is_single_cpu(), "wrong base operand");
+  assert(index()->is_illegal() || index()->is_single_cpu(), "wrong index operand");
+  assert(base()->type() == T_OBJECT || base()->type() == T_INT || base()->type() == T_METADATA,
+         "wrong type for addresses");
+#endif
+}
+#endif // PRODUCT
diff --git a/src/cpu/sparc/vm/compiledIC_sparc.cpp b/src/cpu/sparc/vm/compiledIC_sparc.cpp
index 3536718..4602434 100644
--- a/src/cpu/sparc/vm/compiledIC_sparc.cpp
+++ b/src/cpu/sparc/vm/compiledIC_sparc.cpp
@@ -77,8 +77,7 @@
   // This doesn't need to be accurate but it must be larger or equal to
   // the real size of the stub.
   return (NativeMovConstReg::instruction_size +  // sethi/setlo;
-          NativeJump::instruction_size + // sethi; jmp; nop
-          (TraceJumps ? 20 * BytesPerInstWord : 0) );
+          NativeJump::instruction_size); // sethi; jmp; nop
 }
 
 // Relocation entries for call stub, compiled java to interpreter.
diff --git a/src/cpu/sparc/vm/globalDefinitions_sparc.hpp b/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
index ddda080..ba6d99c 100644
--- a/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
+++ b/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
@@ -32,7 +32,7 @@
 
 // Indicates whether the C calling conventions require that
 // 32-bit integer argument values are extended to 64 bits.
-const bool CCallingConventionRequiresIntsAsLongs = false;
+const bool CCallingConventionRequiresIntsAsLongs = true;
 
 #define SUPPORTS_NATIVE_CX8
 
diff --git a/src/cpu/sparc/vm/icBuffer_sparc.cpp b/src/cpu/sparc/vm/icBuffer_sparc.cpp
index 641da12..d6942f6 100644
--- a/src/cpu/sparc/vm/icBuffer_sparc.cpp
+++ b/src/cpu/sparc/vm/icBuffer_sparc.cpp
@@ -33,12 +33,10 @@
 
 int InlineCacheBuffer::ic_stub_code_size() {
 #ifdef _LP64
-  if (TraceJumps) return 600 * wordSize;
   return (NativeMovConstReg::instruction_size +  // sethi;add
           NativeJump::instruction_size +          // sethi; jmp; delay slot
           (1*BytesPerInstWord) + 1);            // flush + 1 extra byte
 #else
-  if (TraceJumps) return 300 * wordSize;
   return (2+2+ 1) * wordSize + 1; // set/jump_to/nop + 1 byte so that code_end can be set in CodeBuffer
 #endif
 }
diff --git a/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/src/cpu/sparc/vm/macroAssembler_sparc.cpp
index 5fe78ad..e006540 100644
--- a/src/cpu/sparc/vm/macroAssembler_sparc.cpp
+++ b/src/cpu/sparc/vm/macroAssembler_sparc.cpp
@@ -184,72 +184,10 @@
 
 void MacroAssembler::jmp2(Register r1, Register r2, const char* file, int line ) {
   assert_not_delayed();
-  // This can only be traceable if r1 & r2 are visible after a window save
-  if (TraceJumps) {
-#ifndef PRODUCT
-    save_frame(0);
-    verify_thread();
-    ld(G2_thread, in_bytes(JavaThread::jmp_ring_index_offset()), O0);
-    add(G2_thread, in_bytes(JavaThread::jmp_ring_offset()), O1);
-    sll(O0, exact_log2(4*sizeof(intptr_t)), O2);
-    add(O2, O1, O1);
-
-    add(r1->after_save(), r2->after_save(), O2);
-    set((intptr_t)file, O3);
-    set(line, O4);
-    Label L;
-    // get nearby pc, store jmp target
-    call(L, relocInfo::none);  // No relocation for call to pc+0x8
-    delayed()->st(O2, O1, 0);
-    bind(L);
-
-    // store nearby pc
-    st(O7, O1, sizeof(intptr_t));
-    // store file
-    st(O3, O1, 2*sizeof(intptr_t));
-    // store line
-    st(O4, O1, 3*sizeof(intptr_t));
-    add(O0, 1, O0);
-    and3(O0, JavaThread::jump_ring_buffer_size  - 1, O0);
-    st(O0, G2_thread, in_bytes(JavaThread::jmp_ring_index_offset()));
-    restore();
-#endif /* PRODUCT */
-  }
   jmpl(r1, r2, G0);
 }
 void MacroAssembler::jmp(Register r1, int offset, const char* file, int line ) {
   assert_not_delayed();
-  // This can only be traceable if r1 is visible after a window save
-  if (TraceJumps) {
-#ifndef PRODUCT
-    save_frame(0);
-    verify_thread();
-    ld(G2_thread, in_bytes(JavaThread::jmp_ring_index_offset()), O0);
-    add(G2_thread, in_bytes(JavaThread::jmp_ring_offset()), O1);
-    sll(O0, exact_log2(4*sizeof(intptr_t)), O2);
-    add(O2, O1, O1);
-
-    add(r1->after_save(), offset, O2);
-    set((intptr_t)file, O3);
-    set(line, O4);
-    Label L;
-    // get nearby pc, store jmp target
-    call(L, relocInfo::none);  // No relocation for call to pc+0x8
-    delayed()->st(O2, O1, 0);
-    bind(L);
-
-    // store nearby pc
-    st(O7, O1, sizeof(intptr_t));
-    // store file
-    st(O3, O1, 2*sizeof(intptr_t));
-    // store line
-    st(O4, O1, 3*sizeof(intptr_t));
-    add(O0, 1, O0);
-    and3(O0, JavaThread::jump_ring_buffer_size  - 1, O0);
-    st(O0, G2_thread, in_bytes(JavaThread::jmp_ring_index_offset()));
-    restore();
-#endif /* PRODUCT */
-  }
   jmp(r1, offset);
 }
 
@@ -260,44 +198,7 @@
   // variable length instruction streams.
   patchable_sethi(addrlit, temp);
   Address a(temp, addrlit.low10() + offset);  // Add the offset to the displacement.
-  if (TraceJumps) {
-#ifndef PRODUCT
-    // Must do the add here so relocation can find the remainder of the
-    // value to be relocated.
-    add(a.base(), a.disp(), a.base(), addrlit.rspec(offset));
-    save_frame(0);
-    verify_thread();
-    ld(G2_thread, in_bytes(JavaThread::jmp_ring_index_offset()), O0);
-    add(G2_thread, in_bytes(JavaThread::jmp_ring_offset()), O1);
-    sll(O0, exact_log2(4*sizeof(intptr_t)), O2);
-    add(O2, O1, O1);
-
-    set((intptr_t)file, O3);
-    set(line, O4);
-    Label L;
-
-    // get nearby pc, store jmp target
-    call(L, relocInfo::none);  // No relocation for call to pc+0x8
-    delayed()->st(a.base()->after_save(), O1, 0);
-    bind(L);
-
-    // store nearby pc
-    st(O7, O1, sizeof(intptr_t));
-    // store file
-    st(O3, O1, 2*sizeof(intptr_t));
-    // store line
-    st(O4, O1, 3*sizeof(intptr_t));
-    add(O0, 1, O0);
-    and3(O0, JavaThread::jump_ring_buffer_size  - 1, O0);
-    st(O0, G2_thread, in_bytes(JavaThread::jmp_ring_index_offset()));
-    restore();
-    jmpl(a.base(), G0, d);
-#else
-    jmpl(a.base(), a.disp(), d);
-#endif /* PRODUCT */
-  } else {
-    jmpl(a.base(), a.disp(), d);
-  }
+  jmpl(a.base(), a.disp(), d);
 }
 
 void MacroAssembler::jump(const AddressLiteral& addrlit, Register temp, int offset, const char* file, int line) {
diff --git a/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/src/cpu/sparc/vm/macroAssembler_sparc.hpp
index d94de09..a401859 100644
--- a/src/cpu/sparc/vm/macroAssembler_sparc.hpp
+++ b/src/cpu/sparc/vm/macroAssembler_sparc.hpp
@@ -703,8 +703,8 @@
 
   inline void tst( Register s );
 
-  inline void ret(  bool trace = TraceJumps );
-  inline void retl( bool trace = TraceJumps );
+  inline void ret(  bool trace = false );
+  inline void retl( bool trace = false );
 
   // Required platform-specific helpers for Label::patch_instructions.
   // They _shadow_ the declarations in AbstractAssembler, which are undefined.
diff --git a/src/cpu/sparc/vm/nativeInst_sparc.cpp b/src/cpu/sparc/vm/nativeInst_sparc.cpp
index d175508..103c712 100644
--- a/src/cpu/sparc/vm/nativeInst_sparc.cpp
+++ b/src/cpu/sparc/vm/nativeInst_sparc.cpp
@@ -760,8 +760,7 @@
   Register rd = inv_rd(i0);
 #ifndef _LP64
   if (!(is_op2(i0, Assembler::sethi_op2) && rd != G0 &&
-        (is_op3(i1, Assembler::jmpl_op3, Assembler::arith_op) ||
-        (TraceJumps && is_op3(i1, Assembler::add_op3, Assembler::arith_op))) &&
+        (is_op3(i1, Assembler::jmpl_op3, Assembler::arith_op)) &&
         inv_immed(i1) && (unsigned)get_simm13(i1) < (1 << 10) &&
         rd == inv_rs1(i1))) {
     fatal("not a jump_to instruction");
diff --git a/src/cpu/sparc/vm/register_definitions_sparc.cpp b/src/cpu/sparc/vm/register_definitions_sparc.cpp
index a27dc43..8fd22e2 100644
--- a/src/cpu/sparc/vm/register_definitions_sparc.cpp
+++ b/src/cpu/sparc/vm/register_definitions_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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,9 @@
 // make sure the defines don't screw up the declarations later on in this file
 #define DONT_USE_REGISTER_DEFINES
 
-#include "precompiled.hpp"
+// Note: precompiled headers can not be used in this file because of the above
+//       definition
+
 #include "asm/assembler.hpp"
 #include "asm/register.hpp"
 #include "interp_masm_sparc.hpp"
diff --git a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
index a587b55..aa54e3b 100644
--- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
+++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
@@ -3368,9 +3368,7 @@
   // setup code generation tools
   // Measured 8/7/03 at 896 in 32bit debug build (no VerifyThread)
   // Measured 8/7/03 at 1080 in 32bit debug build (VerifyThread)
-  // even larger with TraceJumps
-  int pad = TraceJumps ? 512 : 0;
-  CodeBuffer buffer("handler_blob", 1600 + pad, 512);
+  CodeBuffer buffer("handler_blob", 1600, 512);
   MacroAssembler* masm                = new MacroAssembler(&buffer);
   int             frame_size_words;
   OopMapSet *oop_maps = new OopMapSet();
@@ -3462,9 +3460,7 @@
   // setup code generation tools
   // Measured 8/7/03 at 896 in 32bit debug build (no VerifyThread)
   // Measured 8/7/03 at 1080 in 32bit debug build (VerifyThread)
-  // even larger with TraceJumps
-  int pad = TraceJumps ? 512 : 0;
-  CodeBuffer buffer(name, 1600 + pad, 512);
+  CodeBuffer buffer(name, 1600, 512);
   MacroAssembler* masm                = new MacroAssembler(&buffer);
   int             frame_size_words;
   OopMapSet *oop_maps = new OopMapSet();
diff --git a/src/cpu/sparc/vm/sparc.ad b/src/cpu/sparc/vm/sparc.ad
index 653da26..f0a897f 100644
--- a/src/cpu/sparc/vm/sparc.ad
+++ b/src/cpu/sparc/vm/sparc.ad
@@ -501,16 +501,10 @@
   static int emit_deopt_handler(CodeBuffer& cbuf);
 
   static uint size_exception_handler() {
-    if (TraceJumps) {
-      return (400); // just a guess
-    }
     return ( NativeJump::instruction_size ); // sethi;jmp;nop
   }
 
   static uint size_deopt_handler() {
-    if (TraceJumps) {
-      return (400); // just a guess
-    }
     return ( 4+  NativeJump::instruction_size ); // save;sethi;jmp;restore
   }
 };
@@ -720,7 +714,7 @@
   return offset;
 }
 
-static inline jdouble replicate_immI(int con, int count, int width) {
+static inline jlong replicate_immI(int con, int count, int width) {
   // Load a constant replicated "count" times with width "width"
   assert(count*width == 8 && width <= 4, "sanity");
   int bit_width = width * 8;
@@ -729,17 +723,15 @@
   for (int i = 0; i < count - 1; i++) {
     val |= (val << bit_width);
   }
-  jdouble dval = *((jdouble*) &val);  // coerce to double type
-  return dval;
+  return val;
 }
 
-static inline jdouble replicate_immF(float con) {
+static inline jlong replicate_immF(float con) {
   // Replicate float con 2 times and pack into vector.
   int val = *((int*)&con);
   jlong lval = val;
   lval = (lval << 32) | (lval & 0xFFFFFFFFl);
-  jdouble dval = *((jdouble*) &lval);  // coerce to double type
-  return dval;
+  return lval;
 }
 
 // Standard Sparc opcode form2 field breakdown
@@ -2661,8 +2653,7 @@
 
       // Emit stub for static call.
       address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
-      // Stub does not fit into scratch buffer if TraceJumps is enabled
-      if (stub == NULL && !(TraceJumps && Compile::current()->in_scratch_emit_size())) {
+      if (stub == NULL) {
         ciEnv::current()->record_failure("CodeCache is full");
         return;
       }
diff --git a/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp b/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp
index 7df0e98..d8973ed 100644
--- a/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp
+++ b/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp
@@ -1560,13 +1560,7 @@
     __ bind(ok);
   }
 #endif
-  if (TraceJumps) {
-    // Move target to register that is recordable
-    __ mov(Lscratch, G3_scratch);
-    __ JMP(G3_scratch, 0);
-  } else {
-    __ jmp(Lscratch, 0);
-  }
+  __ jmp(Lscratch, 0);
   __ delayed()->nop();
 
 
diff --git a/src/cpu/sparc/vm/templateTable_sparc.cpp b/src/cpu/sparc/vm/templateTable_sparc.cpp
index 2976383..44bee0c 100644
--- a/src/cpu/sparc/vm/templateTable_sparc.cpp
+++ b/src/cpu/sparc/vm/templateTable_sparc.cpp
@@ -1636,7 +1636,7 @@
                                                  in_bytes(InvocationCounter::counter_offset()));
         Address mask(G4_scratch, in_bytes(MethodData::backedge_mask_offset()));
         __ increment_mask_and_jump(mdo_backedge_counter, increment, mask, G3_scratch, O0,
-                                   Assembler::notZero, &Lforward);
+                                   (UseOnStackReplacement ? Assembler::notZero : Assembler::always), &Lforward);
         __ ba_short(Loverflow);
       }
 
@@ -1647,7 +1647,7 @@
               in_bytes(InvocationCounter::counter_offset()));
       Address mask(G3_method_counters, in_bytes(MethodCounters::backedge_mask_offset()));
       __ increment_mask_and_jump(backedge_counter, increment, mask, G4_scratch, O0,
-                                 Assembler::notZero, &Lforward);
+                                 (UseOnStackReplacement ? Assembler::notZero : Assembler::always), &Lforward);
       __ bind(Loverflow);
 
       // notify point for loop, pass branch bytecode
diff --git a/src/cpu/sparc/vm/vtableStubs_sparc.cpp b/src/cpu/sparc/vm/vtableStubs_sparc.cpp
index 4e717ee..9e825aa 100644
--- a/src/cpu/sparc/vm/vtableStubs_sparc.cpp
+++ b/src/cpu/sparc/vm/vtableStubs_sparc.cpp
@@ -221,7 +221,7 @@
 
 
 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
-  if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) return 1000;
+  if (DebugVtables || CountCompiledCalls || VerifyOops) return 1000;
   else {
     const int slop = 2*BytesPerInstWord; // sethi;add  (needed for long offsets)
     if (is_vtable_stub) {
diff --git a/src/cpu/x86/vm/bytes_x86.hpp b/src/cpu/x86/vm/bytes_x86.hpp
index 9f939a3..eb5ab17 100644
--- a/src/cpu/x86/vm/bytes_x86.hpp
+++ b/src/cpu/x86/vm/bytes_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -26,6 +26,7 @@
 #define CPU_X86_VM_BYTES_X86_HPP
 
 #include "memory/allocation.hpp"
+#include "utilities/macros.hpp"
 
 class Bytes: AllStatic {
  private:
@@ -70,20 +71,7 @@
   static inline u8   swap_u8(u8 x);
 };
 
-
 // The following header contains the implementations of swap_u2, swap_u4, and swap_u8[_base]
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "bytes_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "bytes_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "bytes_windows_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "bytes_bsd_x86.inline.hpp"
-#endif
-
+#include OS_CPU_HEADER_INLINE(bytes)
 
 #endif // CPU_X86_VM_BYTES_X86_HPP
diff --git a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
index 26488c9..43e98a7 100644
--- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
+++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
@@ -761,7 +761,6 @@
   } else {
     a = new LIR_Address(obj.result(),
                         offset.result(),
-                        LIR_Address::times_1,
                         0,
                         as_BasicType(type));
   }
@@ -1081,7 +1080,6 @@
 
       LIR_Address* a = new LIR_Address(base_op,
                                        index,
-                                       LIR_Address::times_1,
                                        offset,
                                        T_BYTE);
       BasicTypeList signature(3);
@@ -1157,13 +1155,11 @@
 
   LIR_Address* addr_a = new LIR_Address(result_a,
                                         result_aOffset,
-                                        LIR_Address::times_1,
                                         constant_aOffset,
                                         T_BYTE);
 
   LIR_Address* addr_b = new LIR_Address(result_b,
                                         result_bOffset,
-                                        LIR_Address::times_1,
                                         constant_bOffset,
                                         T_BYTE);
 
diff --git a/src/cpu/x86/vm/c1_LIR_x86.cpp b/src/cpu/x86/vm/c1_LIR_x86.cpp
new file mode 100644
index 0000000..92277ee
--- /dev/null
+++ b/src/cpu/x86/vm/c1_LIR_x86.cpp
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "asm/register.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIR.hpp"
+
+
+FloatRegister LIR_OprDesc::as_float_reg() const {
+  ShouldNotReachHere();
+  return fnoreg;
+}
+
+FloatRegister LIR_OprDesc::as_double_reg() const {
+  ShouldNotReachHere();
+  return fnoreg;
+}
+
+XMMRegister LIR_OprDesc::as_xmm_float_reg() const {
+  return FrameMap::nr2xmmreg(xmm_regnr());
+}
+
+XMMRegister LIR_OprDesc::as_xmm_double_reg() const {
+  assert(xmm_regnrLo() == xmm_regnrHi(), "assumed in calculation");
+  return FrameMap::nr2xmmreg(xmm_regnrLo());
+}
+
+// Reg2 unused.
+LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) {
+  assert(as_FloatRegister(reg2) == fnoreg, "Not used on this platform");
+  return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
+                             (reg1 << LIR_OprDesc::reg2_shift) |
+                             LIR_OprDesc::double_type          |
+                             LIR_OprDesc::fpu_register         |
+                             LIR_OprDesc::double_size);
+}
+
+#ifndef PRODUCT
+void LIR_Address::verify() const {
+#ifdef _LP64
+  assert(base()->is_cpu_register(), "wrong base operand");
+  assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
+  assert(base()->type() == T_OBJECT || base()->type() == T_LONG || base()->type() == T_METADATA,
+         "wrong type for addresses");
+#else
+  assert(base()->is_single_cpu(), "wrong base operand");
+  assert(index()->is_illegal() || index()->is_single_cpu(), "wrong index operand");
+  assert(base()->type() == T_OBJECT || base()->type() == T_INT || base()->type() == T_METADATA,
+         "wrong type for addresses");
+#endif
+}
+#endif // PRODUCT
diff --git a/src/cpu/x86/vm/copy_x86.hpp b/src/cpu/x86/vm/copy_x86.hpp
index d5c6d5e..e07b64e 100644
--- a/src/cpu/x86/vm/copy_x86.hpp
+++ b/src/cpu/x86/vm/copy_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -28,19 +28,7 @@
 // Inline functions for memory copy and fill.
 
 // Contains inline asm implementations
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "copy_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "copy_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "copy_windows_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "copy_bsd_x86.inline.hpp"
-#endif
-
+#include OS_CPU_HEADER_INLINE(copy)
 
 static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
 #ifdef AMD64
diff --git a/src/cpu/x86/vm/globalDefinitions_x86.hpp b/src/cpu/x86/vm/globalDefinitions_x86.hpp
index 40f3d2f..681dcc8 100644
--- a/src/cpu/x86/vm/globalDefinitions_x86.hpp
+++ b/src/cpu/x86/vm/globalDefinitions_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -56,7 +56,7 @@
   #endif
 #endif
 
-#if defined(COMPILER2) && !defined(JAVASE_EMBEDDED)
+#if defined(COMPILER2)
 // Include Restricted Transactional Memory lock eliding optimization
 #define INCLUDE_RTM_OPT 1
 #endif
diff --git a/test/compiler/native/libTestDirtyInt.c b/src/cpu/x86/vm/macroAssembler_x86.inline.hpp
similarity index 83%
copy from test/compiler/native/libTestDirtyInt.c
copy to src/cpu/x86/vm/macroAssembler_x86.inline.hpp
index b688a36..d23bdb4 100644
--- a/test/compiler/native/libTestDirtyInt.c
+++ b/src/cpu/x86/vm/macroAssembler_x86.inline.hpp
@@ -19,15 +19,12 @@
  * 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.
+ *
  */
 
-#include "jni.h"
-#include <stdio.h>
+#ifndef CPU_X86_VM_MACROASSEMBLER_X86_INLINE_HPP
+#define CPU_X86_VM_MACROASSEMBLER_X86_INLINE_HPP
 
-static int array = 0x42;
+// Still empty.
 
-JNIEXPORT jint JNICALL Java_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v)
-{
-  int* ptr = &array + v + 4;
-  return *ptr;
-}
+#endif // CPU_X86_VM_MACROASSEMBLER_X86_INLINE_HPP
diff --git a/src/cpu/x86/vm/macroAssembler_x86_tan.cpp b/src/cpu/x86/vm/macroAssembler_x86_tan.cpp
index 18fe151..1097991 100644
--- a/src/cpu/x86/vm/macroAssembler_x86_tan.cpp
+++ b/src/cpu/x86/vm/macroAssembler_x86_tan.cpp
@@ -1060,7 +1060,7 @@
 
   bind(B1_4);
   addq(rsp, 16);
-
+  pop(rbx);
 }
 #else
 // The 32 bit code is at most SSE2 compliant
diff --git a/src/cpu/x86/vm/register_definitions_x86.cpp b/src/cpu/x86/vm/register_definitions_x86.cpp
index 6c0ca8e..e63d711 100644
--- a/src/cpu/x86/vm/register_definitions_x86.cpp
+++ b/src/cpu/x86/vm/register_definitions_x86.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -26,9 +26,7 @@
 #include "asm/assembler.hpp"
 #include "asm/register.hpp"
 #include "register_x86.hpp"
-#ifdef TARGET_ARCH_x86
-# include "interp_masm_x86.hpp"
-#endif
+#include "interp_masm_x86.hpp"
 
 REGISTER_DEFINITION(Register, noreg);
 REGISTER_DEFINITION(Register, rax);
@@ -50,6 +48,8 @@
 REGISTER_DEFINITION(Register, r15);
 #endif // AMD64
 
+REGISTER_DEFINITION(FloatRegister, fnoreg);
+
 REGISTER_DEFINITION(XMMRegister, xnoreg);
 REGISTER_DEFINITION(XMMRegister, xmm0 );
 REGISTER_DEFINITION(XMMRegister, xmm1 );
diff --git a/src/cpu/x86/vm/register_x86.hpp b/src/cpu/x86/vm/register_x86.hpp
index 1d1c6ee..f5c4496 100644
--- a/src/cpu/x86/vm/register_x86.hpp
+++ b/src/cpu/x86/vm/register_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -124,6 +124,8 @@
 
 };
 
+CONSTANT_REGISTER_DECLARATION(FloatRegister, fnoreg, (-1));
+
 // Use XMMRegister as shortcut
 class XMMRegisterImpl;
 typedef XMMRegisterImpl* XMMRegister;
diff --git a/src/cpu/x86/vm/stubRoutines_x86.hpp b/src/cpu/x86/vm/stubRoutines_x86.hpp
index eeceb01..3caac41 100644
--- a/src/cpu/x86/vm/stubRoutines_x86.hpp
+++ b/src/cpu/x86/vm/stubRoutines_x86.hpp
@@ -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
@@ -29,6 +29,83 @@
 // definition. See stubRoutines.hpp for a description on how to
 // extend it.
 
+static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
+
+enum platform_dependent_constants {
+  code_size1 = 20000 LP64_ONLY(+10000),         // simply increase if too small (assembler will crash if too small)
+  code_size2 = 33800 LP64_ONLY(+1200)           // simply increase if too small (assembler will crash if too small)
+};
+
+class x86 {
+ friend class StubGenerator;
+ friend class VMStructs;
+
+#ifdef _LP64
+ private:
+  static address _get_previous_fp_entry;
+  static address _get_previous_sp_entry;
+
+  static address _f2i_fixup;
+  static address _f2l_fixup;
+  static address _d2i_fixup;
+  static address _d2l_fixup;
+
+  static address _float_sign_mask;
+  static address _float_sign_flip;
+  static address _double_sign_mask;
+  static address _double_sign_flip;
+
+ public:
+
+  static address get_previous_fp_entry() {
+    return _get_previous_fp_entry;
+  }
+
+  static address get_previous_sp_entry() {
+    return _get_previous_sp_entry;
+  }
+
+  static address f2i_fixup() {
+    return _f2i_fixup;
+  }
+
+  static address f2l_fixup() {
+    return _f2l_fixup;
+  }
+
+  static address d2i_fixup() {
+    return _d2i_fixup;
+  }
+
+  static address d2l_fixup() {
+    return _d2l_fixup;
+  }
+
+  static address float_sign_mask() {
+    return _float_sign_mask;
+  }
+
+  static address float_sign_flip() {
+    return _float_sign_flip;
+  }
+
+  static address double_sign_mask() {
+    return _double_sign_mask;
+  }
+
+  static address double_sign_flip() {
+    return _double_sign_flip;
+  }
+#else // !LP64
+
+ private:
+  static address _verify_fpu_cntrl_wrd_entry;
+
+ public:
+  static address verify_fpu_cntrl_wrd_entry() { return _verify_fpu_cntrl_wrd_entry; }
+
+#endif // !LP64
+
  private:
   static address _verify_mxcsr_entry;
   // shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers
@@ -138,4 +215,6 @@
   static address _Pi4x4_addr()      { return _Pi4x4_adr; }
   static address _ones_addr()      { return _ones_adr; }
 
-#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP
+};
+
+#endif // CPU_X86_VM_STUBROUTINES_X86_HPP
diff --git a/src/cpu/x86/vm/stubRoutines_x86_32.hpp b/src/cpu/x86/vm/stubRoutines_x86_32.hpp
deleted file mode 100644
index 17f76e8..0000000
--- a/src/cpu/x86/vm/stubRoutines_x86_32.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, 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.
- *
- */
-
-#ifndef CPU_X86_VM_STUBROUTINES_X86_32_HPP
-#define CPU_X86_VM_STUBROUTINES_X86_32_HPP
-
-// This file holds the platform specific parts of the StubRoutines
-// definition. See stubRoutines.hpp for a description on how to
-// extend it.
-
-enum platform_dependent_constants {
-  code_size1 =  20000,           // simply increase if too small (assembler will crash if too small)
-  code_size2 = 33800            // simply increase if too small (assembler will crash if too small)
-};
-
-class x86 {
- friend class StubGenerator;
- friend class VMStructs;
-
- private:
-  static address _verify_fpu_cntrl_wrd_entry;
-
- public:
-  static address verify_fpu_cntrl_wrd_entry()                { return _verify_fpu_cntrl_wrd_entry; }
-
-# include "stubRoutines_x86.hpp"
-
-};
-
-  static bool    returns_to_call_stub(address return_pc)     { return return_pc == _call_stub_return_address; }
-
-#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP
diff --git a/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/src/cpu/x86/vm/stubRoutines_x86_64.hpp
deleted file mode 100644
index b4750ff..0000000
--- a/src/cpu/x86/vm/stubRoutines_x86_64.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, 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.
- *
- */
-
-#ifndef CPU_X86_VM_STUBROUTINES_X86_64_HPP
-#define CPU_X86_VM_STUBROUTINES_X86_64_HPP
-
-// This file holds the platform specific parts of the StubRoutines
-// definition. See stubRoutines.hpp for a description on how to
-// extend it.
-
-static bool    returns_to_call_stub(address return_pc)   { return return_pc == _call_stub_return_address; }
-
-enum platform_dependent_constants {
-  code_size1 = 30000,          // simply increase if too small (assembler will crash if too small)
-  code_size2 = 35000           // simply increase if too small (assembler will crash if too small)
-};
-
-class x86 {
- friend class StubGenerator;
-
- private:
-  static address _get_previous_fp_entry;
-  static address _get_previous_sp_entry;
-
-  static address _f2i_fixup;
-  static address _f2l_fixup;
-  static address _d2i_fixup;
-  static address _d2l_fixup;
-
-  static address _float_sign_mask;
-  static address _float_sign_flip;
-  static address _double_sign_mask;
-  static address _double_sign_flip;
-
- public:
-
-  static address get_previous_fp_entry()
-  {
-    return _get_previous_fp_entry;
-  }
-
-  static address get_previous_sp_entry()
-  {
-    return _get_previous_sp_entry;
-  }
-
-  static address f2i_fixup()
-  {
-    return _f2i_fixup;
-  }
-
-  static address f2l_fixup()
-  {
-    return _f2l_fixup;
-  }
-
-  static address d2i_fixup()
-  {
-    return _d2i_fixup;
-  }
-
-  static address d2l_fixup()
-  {
-    return _d2l_fixup;
-  }
-
-  static address float_sign_mask()
-  {
-    return _float_sign_mask;
-  }
-
-  static address float_sign_flip()
-  {
-    return _float_sign_flip;
-  }
-
-  static address double_sign_mask()
-  {
-    return _double_sign_mask;
-  }
-
-  static address double_sign_flip()
-  {
-    return _double_sign_flip;
-  }
-
-# include "stubRoutines_x86.hpp"
-
-};
-
-#endif // CPU_X86_VM_STUBROUTINES_X86_64_HPP
diff --git a/src/cpu/x86/vm/x86.ad b/src/cpu/x86/vm/x86.ad
index 17abe70..b12c979 100644
--- a/src/cpu/x86/vm/x86.ad
+++ b/src/cpu/x86/vm/x86.ad
@@ -2131,7 +2131,7 @@
   return size+offset_size;
 }
 
-static inline jfloat replicate4_imm(int con, int width) {
+static inline jint replicate4_imm(int con, int width) {
   // Load a constant of "width" (in bytes) and replicate it to fill 32bit.
   assert(width == 1 || width == 2, "only byte or short types here");
   int bit_width = width * 8;
@@ -2141,11 +2141,10 @@
     val |= (val << bit_width);
     bit_width <<= 1;
   }
-  jfloat fval = *((jfloat*) &val);  // coerce to float type
-  return fval;
+  return val;
 }
 
-static inline jdouble replicate8_imm(int con, int width) {
+static inline jlong replicate8_imm(int con, int width) {
   // Load a constant of "width" (in bytes) and replicate it to fill 64bit.
   assert(width == 1 || width == 2 || width == 4, "only byte, short or int types here");
   int bit_width = width * 8;
@@ -2155,8 +2154,7 @@
     val |= (val << bit_width);
     bit_width <<= 1;
   }
-  jdouble dval = *((jdouble*) &val);  // coerce to double type
-  return dval;
+  return val;
 }
 
 #ifndef PRODUCT
diff --git a/src/cpu/zero/vm/bytes_zero.hpp b/src/cpu/zero/vm/bytes_zero.hpp
index be2e09a..186f09d 100644
--- a/src/cpu/zero/vm/bytes_zero.hpp
+++ b/src/cpu/zero/vm/bytes_zero.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -165,12 +165,8 @@
 #ifdef VM_LITTLE_ENDIAN
 // The following header contains the implementations of swap_u2,
 // swap_u4, and swap_u8
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "bytes_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "bytes_bsd_zero.inline.hpp"
-#endif
+
+#include OS_CPU_HEADER_INLINE(bytes)
 
 #endif // VM_LITTLE_ENDIAN
 
diff --git a/test/compiler/native/libTestDirtyInt.c b/src/cpu/zero/vm/macroAssembler_zero.hpp
similarity index 83%
copy from test/compiler/native/libTestDirtyInt.c
copy to src/cpu/zero/vm/macroAssembler_zero.hpp
index b688a36..3477989 100644
--- a/test/compiler/native/libTestDirtyInt.c
+++ b/src/cpu/zero/vm/macroAssembler_zero.hpp
@@ -19,15 +19,12 @@
  * 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.
+ *
  */
 
-#include "jni.h"
-#include <stdio.h>
+#ifndef CPU_ZERO_VM_MACROASSEMBLER_ZERO_HPP
+#define CPU_ZERO_VM_MACROASSEMBLER_ZERO_HPP
 
-static int array = 0x42;
+// Needed for includes in shared files.
 
-JNIEXPORT jint JNICALL Java_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v)
-{
-  int* ptr = &array + v + 4;
-  return *ptr;
-}
+#endif // CPU_ZERO_VM_MACROASSEMBLER_ZERO_HPP
diff --git a/test/compiler/native/libTestDirtyInt.c b/src/cpu/zero/vm/macroAssembler_zero.inline.hpp
similarity index 83%
copy from test/compiler/native/libTestDirtyInt.c
copy to src/cpu/zero/vm/macroAssembler_zero.inline.hpp
index b688a36..47ce5e5 100644
--- a/test/compiler/native/libTestDirtyInt.c
+++ b/src/cpu/zero/vm/macroAssembler_zero.inline.hpp
@@ -19,15 +19,12 @@
  * 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.
+ *
  */
 
-#include "jni.h"
-#include <stdio.h>
+#ifndef CPU_ZERO_VM_MACROASSEMBLER_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_MACROASSEMBLER_ZERO_INLINE_HPP
 
-static int array = 0x42;
+// Needed for includes in shared files.
 
-JNIEXPORT jint JNICALL Java_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v)
-{
-  int* ptr = &array + v + 4;
-  return *ptr;
-}
+#endif // CPU_ZERO_VM_MACROASSEMBLER_ZERO_INLINE_HPP
diff --git a/src/jdk.hotspot.agent/doc/ReadMe-JavaScript.text b/src/jdk.hotspot.agent/doc/ReadMe-JavaScript.text
deleted file mode 100644
index 432aaa4..0000000
--- a/src/jdk.hotspot.agent/doc/ReadMe-JavaScript.text
+++ /dev/null
@@ -1,38 +0,0 @@
-The HotSpot Serviceability Agent (SA) is a debugger for hotspot core
-dumps and hung processes. There is a read-only JDI (Java Debugger
-Interface) implementation on top of SA. This is part of JDK product and
-the classes are in $JDK/tools/sa-jdi.jar.
-
-In addition, there are few serviceability tools in $JDK/bin, namely,
-jstack (java stack trace tool), jmap (heap tool), jinfo (Java config
-tool) and jsadebugd. The classes for these are also in sa-jdi.jar
-file. sa-jdi.jar file is built along with hotspot (libjvm.so) on Solaris
-and Linux platforms. On Windows platform, SA-JDI is not included and
-serviceability tools do not use SA.
-
-Apart from these, HotSpot SA consists of a number of tools that are
-*not* included in JDK product bits.
-
-The sources and makefile for all-of-SA (including non-productized stuff)
-are under $HOTSPOT_WS/agent directory. The makefile $HOTSPOT/agent/make
-directory and shell scripts (and batch files) are used to build and run
-SA non-product tools. There is also documentation of SA under
-$HOTSPOT/agent/doc directory.
-
-To build complete SA, you need to have Rhino Mozilla jar (js.jar)
-version 1.5R5 under $HOTSPOT/agent/src/share/lib directory. Rhino is
-JavaScript interpreter written in Java. Rhino is used to implement SA
-features such as
-
-* SA command line debugger's JavaScript interface
- - refer to $HOTSPOT/agent/doc/clhsdb.html
- - refer to $HOTSPOT/agent/doc/jsdb.html
-* SA simple object query language (SOQL) 
- - language to query Java heap. 
-
-Rhino's "js.jar" is not included in hotspot source bundles. You need to
-download it from http://www.mozilla.org/rhino/download.html.
- 
-Without js.jar, $HOTSPOT/agent/make/Makefile will fail to build. But,
-note that sa-jdi.jar containing the productized portions of SA will
-still be built when you build hotspot JVM. 
diff --git a/src/jdk.hotspot.agent/share/classes/module-info.java b/src/jdk.hotspot.agent/share/classes/module-info.java
index 65b804d..dbf9587 100644
--- a/src/jdk.hotspot.agent/share/classes/module-info.java
+++ b/src/jdk.hotspot.agent/share/classes/module-info.java
@@ -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
@@ -28,12 +28,8 @@
     requires java.desktop;
     requires java.rmi;
     requires java.scripting;
-    requires jdk.jdi;
 
     // RMI needs to serialize types in this package
     exports sun.jvm.hotspot.debugger.remote to java.rmi;
-    provides com.sun.jdi.connect.Connector with sun.jvm.hotspot.jdi.SACoreAttachingConnector;
-    provides com.sun.jdi.connect.Connector with sun.jvm.hotspot.jdi.SADebugServerAttachingConnector;
-    provides com.sun.jdi.connect.Connector with sun.jvm.hotspot.jdi.SAPIDAttachingConnector;
 
 }
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java
index 83c8605..8513c10 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -36,6 +36,7 @@
 
     private static boolean launcherHelp() {
         System.out.println("    clhsdb       \tcommand line debugger");
+        System.out.println("    debugd       \tdebug server");
         System.out.println("    hsdb         \tui debugger");
         System.out.println("    jstack --help\tto get more information");
         System.out.println("    jmap   --help\tto get more information");
@@ -54,6 +55,21 @@
         return false;
     }
 
+    private static boolean debugdHelp() {
+        // [options] <pid> [server-id]
+        // [options] <executable> <core> [server-id]
+        java.io.PrintStream out = System.out;
+        out.print(" [option] <pid> [server-id]");
+        out.println("\t\t(to connect to a live java process)");
+        out.print("   or  [option] <executable> <core> [server-id]");
+        out.println("\t\t(to connect to a core file produced by <executable>)");
+        out.print("\t\tserver-id is an optional unique id for this debug server, needed ");
+        out.println("\t\tif multiple debug servers are run on the same machine");
+        out.println("where option includes:");
+        out.println("   -h | -help\tto print this help message");
+        return false;
+    }
+
     private static boolean jinfoHelp() {
         // --flags -> -flags
         // --sysprops -> -sysprops
@@ -106,6 +122,9 @@
         if (toolName.equals("jsnap")) {
             return jsnapHelp();
         }
+        if (toolName.equals("debugd")) {
+            return debugdHelp();
+        }
         if (toolName.equals("hsdb") || toolName.equals("clhsdb")) {
             return commonHelp();
         }
@@ -377,13 +396,28 @@
         JSnap.main(newArgs.toArray(new String[newArgs.size()]));
     }
 
+    private static void runDEBUGD(String[] oldArgs) {
+        if ((oldArgs.length < 1) || (oldArgs.length > 3)) {
+            debugdHelp();
+        }
+
+        // By default SA agent classes prefer Windows process debugger
+        // to windbg debugger. SA expects special properties to be set
+        // to choose other debuggers. We will set those here before
+        // attaching to SA agent.
+        System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true");
+
+        // delegate to the actual SA debug server.
+        sun.jvm.hotspot.DebugServer.main(oldArgs);
+    }
+
     public static void main(String[] args) {
         // Provide a help
         if (args.length == 0) {
             launcherHelp();
             return;
         }
-        // No arguments imply help for jstack, jmap, jinfo but launch clhsdb and hsdb
+        // No arguments imply help for debugd, jstack, jmap, jinfo but launch clhsdb and hsdb
         if (args.length == 1 && !args[0].equals("clhsdb") && !args[0].equals("hsdb")) {
             toolHelp(args[0]);
             return;
@@ -431,6 +465,11 @@
                 return;
             }
 
+            if (args[0].equals("debugd")) {
+                runDEBUGD(oldArgs);
+                return;
+            }
+
             throw new SAGetoptException("Unknown tool: " + args[0]);
         } catch (SAGetoptException e) {
             System.err.println(e.getMessage());
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java
deleted file mode 100644
index a3a46e9..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.Array;
-import sun.jvm.hotspot.runtime.BasicType;
-import sun.jvm.hotspot.utilities.Assert;
-
-public class ArrayReferenceImpl extends ObjectReferenceImpl
-    implements ArrayReference
-{
-    private int length;
-    ArrayReferenceImpl(VirtualMachine aVm, sun.jvm.hotspot.oops.Array aRef) {
-        super(aVm, aRef);
-        length = (int) aRef.getLength();
-    }
-
-    ArrayTypeImpl arrayType() {
-        return (ArrayTypeImpl)type();
-    }
-
-    /**
-     * Return array length.
-     */
-    public int length() {
-        return length;
-    }
-
-    public Value getValue(int index) {
-        List list = getValues(index, 1);
-        return (Value)list.get(0);
-    }
-
-    public List getValues() {
-        return getValues(0, -1);
-    }
-
-    /**
-     * Validate that the range to set/get is valid.
-     * length of -1 (meaning rest of array) has been converted
-     * before entry.
-     */
-    private void validateArrayAccess(int index, int len) {
-        // because length can be computed from index,
-        // index must be tested first for correct error message
-        if ((index < 0) || (index > length())) {
-            throw new IndexOutOfBoundsException(
-                        "Invalid array index: " + index);
-        }
-        if (len < 0) {
-            throw new IndexOutOfBoundsException(
-                        "Invalid array range length: " + len);
-        }
-        if (index + len > length()) {
-            throw new IndexOutOfBoundsException(
-                        "Invalid array range: " +
-                        index + " to " + (index + len - 1));
-        }
-    }
-
-    public List getValues(int index, int len) {
-        if (len == -1) { // -1 means the rest of the array
-           len = length() - index;
-        }
-        validateArrayAccess(index, len);
-        List vals = new ArrayList();
-        if (len == 0) {
-            return vals;
-        }
-
-        sun.jvm.hotspot.oops.TypeArray typeArray = null;
-        sun.jvm.hotspot.oops.ObjArray objArray = null;
-        if (ref() instanceof sun.jvm.hotspot.oops.TypeArray) {
-            typeArray = (sun.jvm.hotspot.oops.TypeArray)ref();
-        } else if (ref() instanceof sun.jvm.hotspot.oops.ObjArray) {
-            objArray = (sun.jvm.hotspot.oops.ObjArray)ref();
-        } else {
-            throw new RuntimeException("should not reach here");
-        }
-
-        char c = arrayType().componentSignature().charAt(0);
-        BasicType variableType = BasicType.charToBasicType(c);
-
-        final int limit = index + len;
-        for (int ii = index; ii < limit; ii++) {
-            ValueImpl valueImpl;
-            if (variableType == BasicType.T_BOOLEAN) {
-                valueImpl = (BooleanValueImpl) vm.mirrorOf(typeArray.getBooleanAt(ii));
-            } else if (variableType == BasicType.T_CHAR) {
-                valueImpl = (CharValueImpl) vm.mirrorOf(typeArray.getCharAt(ii));
-            } else if (variableType == BasicType.T_FLOAT) {
-                valueImpl = (FloatValueImpl) vm.mirrorOf(typeArray.getFloatAt(ii));
-            } else if (variableType == BasicType.T_DOUBLE) {
-                valueImpl =  (DoubleValueImpl) vm.mirrorOf(typeArray.getDoubleAt(ii));
-            } else if (variableType == BasicType.T_BYTE) {
-                valueImpl =  (ByteValueImpl) vm.mirrorOf(typeArray.getByteAt(ii));
-            } else if (variableType == BasicType.T_SHORT) {
-                valueImpl =  (ShortValueImpl) vm.mirrorOf(typeArray.getShortAt(ii));
-            } else if (variableType == BasicType.T_INT) {
-                valueImpl =  (IntegerValueImpl) vm.mirrorOf(typeArray.getIntAt(ii));
-            } else if (variableType == BasicType.T_LONG) {
-                valueImpl =  (LongValueImpl) vm.mirrorOf(typeArray.getLongAt(ii));
-            } else if (variableType == BasicType.T_OBJECT) {
-                // we may have an [Ljava/lang/Object; - i.e., Object[] with the
-                // elements themselves may be arrays because every array is an Object.
-                valueImpl = (ObjectReferenceImpl) vm.objectMirror(objArray.getObjAt(ii));
-            } else if (variableType == BasicType.T_ARRAY) {
-                valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array) objArray.getObjAt(ii));
-            } else {
-                throw new RuntimeException("should not reach here");
-            }
-            vals.add (valueImpl);
-        }
-        return vals;
-    }
-
-    public void setValue(int index, Value value)
-            throws InvalidTypeException,
-                   ClassNotLoadedException {
-        vm.throwNotReadOnlyException("ArrayReference.setValue(...)");
-    }
-
-    public void setValues(List values)
-            throws InvalidTypeException,
-                   ClassNotLoadedException {
-        setValues(0, values, 0, -1);
-    }
-
-    public void setValues(int index, List values,
-                          int srcIndex, int length)
-            throws InvalidTypeException,
-                   ClassNotLoadedException {
-
-        vm.throwNotReadOnlyException("ArrayReference.setValue(...)");
-
-    }
-
-    public String toString() {
-        return "instance of " + arrayType().componentTypeName() +
-               "[" + length() + "] (id=" + uniqueID() + ")";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java
deleted file mode 100644
index 102cc79..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import sun.jvm.hotspot.oops.ArrayKlass;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.InstanceKlass;
-import sun.jvm.hotspot.oops.Klass;
-import sun.jvm.hotspot.oops.ObjArrayKlass;
-import sun.jvm.hotspot.oops.Symbol;
-import sun.jvm.hotspot.oops.TypeArrayKlass;
-
-import com.sun.jdi.ArrayReference;
-import com.sun.jdi.ArrayType;
-import com.sun.jdi.ClassLoaderReference;
-import com.sun.jdi.ClassNotLoadedException;
-import com.sun.jdi.InterfaceType;
-import com.sun.jdi.Method;
-import com.sun.jdi.PrimitiveType;
-import com.sun.jdi.ReferenceType;
-import com.sun.jdi.Type;
-import com.sun.jdi.VirtualMachine;
-
-public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
-  protected ArrayTypeImpl(VirtualMachine aVm, ArrayKlass aRef) {
-        super(aVm, aRef);
-    }
-
-    public ArrayReference newInstance(int length) {
-        vm.throwNotReadOnlyException("ArrayType.newInstance(int)");
-        return null;
-    }
-
-    public String componentSignature() {
-        return signature().substring(1); // Just skip the leading '['
-    }
-
-    public String componentTypeName() {
-        JNITypeParser parser = new JNITypeParser(componentSignature());
-        return parser.typeName();
-    }
-
-    public ClassLoaderReference classLoader() {
-        if (ref() instanceof TypeArrayKlass) {
-            // primitive array klasses are loaded by bootstrap loader
-            return null;
-        } else {
-            Klass bottomKlass = ((ObjArrayKlass)ref()).getBottomKlass();
-            if (bottomKlass instanceof TypeArrayKlass) {
-                // multidimensional primitive array klasses are loaded by bootstrap loader
-                return null;
-            } else {
-                // class loader of any other obj array klass is same as the loader
-                // that loaded the bottom InstanceKlass
-                Instance xx = (Instance)(((InstanceKlass) bottomKlass).getClassLoader());
-                return vm.classLoaderMirror(xx);
-            }
-        }
-    }
-
-    @Override
-    void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> handledInterfaces) {
-        // arrays don't have methods
-    }
-
-    List getAllMethods() {
-        // arrays don't have methods
-        // JLS says arrays have methods of java.lang.Object. But
-        // JVMDI-JDI returns zero size list. We do the same here
-        // for consistency.
-        return new ArrayList(0);
-    }
-
-    /*
-     * Find the type object, if any, of a component type of this array.
-     * The component type does not have to be immediate; e.g. this method
-     * can be used to find the component Foo of Foo[][].
-     */
-    public Type componentType() throws ClassNotLoadedException {
-        ArrayKlass k = (ArrayKlass) ref();
-        if (k instanceof ObjArrayKlass) {
-            Klass elementKlass = ((ObjArrayKlass)k).getElementKlass();
-            if (elementKlass == null) {
-                throw new ClassNotLoadedException(componentSignature());
-            } else {
-                return vm.referenceType(elementKlass);
-            }
-        } else {
-            // It's a primitive type
-            return vm.primitiveTypeMirror(signature().charAt(1));
-        }
-    }
-
-    static boolean isComponentAssignable(Type destination, Type source) {
-        if (source instanceof PrimitiveType) {
-            // Assignment of primitive arrays requires identical
-            // component types.
-            return source.equals(destination);
-        } else {
-           if (destination instanceof PrimitiveType) {
-                return false;
-            }
-
-            ReferenceTypeImpl refSource = (ReferenceTypeImpl)source;
-            ReferenceTypeImpl refDestination = (ReferenceTypeImpl)destination;
-            // Assignment of object arrays requires availability
-            // of widening conversion of component types
-            return refSource.isAssignableTo(refDestination);
-        }
-    }
-
-
-    /*
-    * Return true if an instance of the  given reference type
-    * can be assigned to a variable of this type
-    */
-    boolean isAssignableTo(ReferenceType destType) {
-        if (destType instanceof ArrayType) {
-            try {
-                Type destComponentType = ((ArrayType)destType).componentType();
-                return isComponentAssignable(destComponentType, componentType());
-            } catch (ClassNotLoadedException e) {
-                // One or both component types has not yet been
-                // loaded => can't assign
-                return false;
-            }
-        } else {
-            Symbol typeName = ((ReferenceTypeImpl)destType).typeNameAsSymbol();
-            if (destType instanceof InterfaceType) {
-                // Every array type implements java.io.Serializable and
-                // java.lang.Cloneable. fixme in JVMDI-JDI, includes only
-                // Cloneable but not Serializable.
-                return typeName.equals(vm.javaLangCloneable()) ||
-                       typeName.equals(vm.javaIoSerializable());
-            } else {
-                // Only valid ClassType assignee is Object
-                return typeName.equals(vm.javaLangObject());
-            }
-        }
-    }
-
-    List inheritedTypes() {
-        // arrays are derived from java.lang.Object and
-        // B[] is derived from A[] if B is derived from A.
-        // But JVMDI-JDI returns zero sized list and we do the
-        // same for consistency.
-        return new ArrayList(0);
-    }
-
-    int getModifiers() {
-        /*
-         * For object arrays, the return values for Interface
-         * Accessible.isPrivate(), Accessible.isProtected(),
-         * etc... are the same as would be returned for the
-         * component type.  Fetch the modifier bits from the
-         * component type and use those.
-         *
-         * For primitive arrays, the modifiers are always
-         *   VMModifiers.FINAL | VMModifiers.PUBLIC
-         *
-         * Reference com.sun.jdi.Accessible.java.
-         */
-        try {
-            Type t = componentType();
-            if (t instanceof PrimitiveType) {
-                return VMModifiers.FINAL | VMModifiers.PUBLIC;
-            } else {
-                ReferenceType rt = (ReferenceType)t;
-                return rt.modifiers();
-            }
-        } catch (ClassNotLoadedException cnle) {
-            cnle.printStackTrace();
-        }
-        return -1;
-    }
-
-    public String toString() {
-       return "array class " + name() + " (" + loaderString() + ")";
-    }
-
-    /*
-     * Save a pointless trip over the wire for these methods
-     * which have undefined results for arrays.
-     */
-    public boolean isPrepared() { return true; }
-    public boolean isVerified() { return true; }
-    public boolean isInitialized() { return true; }
-    public boolean failedToInitialize() { return false; }
-    public boolean isAbstract() { return false; }
-
-    /*
-     * Defined always to be true for arrays
-     */
-    public boolean isFinal() { return true; }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java
deleted file mode 100644
index a7834a9..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-class BaseLineInfo implements LineInfo {
-    private final int lineNumber;
-    private final ReferenceTypeImpl declaringType;
-
-    BaseLineInfo(int lineNumber,
-                 ReferenceTypeImpl declaringType) {
-        this.lineNumber = lineNumber;
-        this.declaringType = declaringType;
-    }
-
-    public String liStratum() {
-        return SDE.BASE_STRATUM_NAME;
-    }
-
-    public int liLineNumber() {
-        return lineNumber;
-    }
-
-    public String liSourceName()
-                            throws AbsentInformationException {
-        return declaringType.baseSourceName();
-    }
-
-    public String liSourcePath()
-                            throws AbsentInformationException {
-        return declaringType.baseSourcePath();
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java
deleted file mode 100644
index 1ea8bda..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class BooleanTypeImpl extends PrimitiveTypeImpl implements BooleanType {
-    BooleanTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-    public String signature() {
-        return "Z";
-    }
-
-    PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException {
-        return vm.mirrorOf(((PrimitiveValueImpl)value).checkedBooleanValue());
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java
deleted file mode 100644
index d61b5e7..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class BooleanValueImpl extends PrimitiveValueImpl
-                              implements BooleanValue {
-    private boolean value;
-
-    BooleanValueImpl(VirtualMachine aVm,boolean aValue) {
-        super(aVm);
-
-        value = aValue;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof BooleanValue)) {
-            return (value == ((BooleanValue)obj).value())
-                   && super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return intValue();
-    }
-
-    public Type type() {
-        return vm.theBooleanType();
-    }
-
-    public boolean value() {
-        return value;
-    }
-
-    public boolean booleanValue() {
-        return value;
-    }
-
-    public byte byteValue() {
-        return(byte)((value)?1:0);
-    }
-
-    public char charValue() {
-        return(char)((value)?1:0);
-    }
-
-    public short shortValue() {
-        return(short)((value)?1:0);
-    }
-
-    public int intValue() {
-        return(int)((value)?1:0);
-    }
-
-    public long longValue() {
-        return(long)((value)?1:0);
-    }
-
-    public float floatValue() {
-        return(float)((value)?1.0:0.0);
-    }
-
-    public double doubleValue() {
-        return(double)((value)?1.0:0.0);
-    }
-
-    public String toString() {
-        return "" + value;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java
deleted file mode 100644
index 6ac45f3..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class ByteTypeImpl extends PrimitiveTypeImpl implements ByteType {
-    ByteTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-
-    public String signature() {
-        return "B";
-    }
-
-    PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException {
-        return vm.mirrorOf(((PrimitiveValueImpl)value).checkedByteValue());
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java
deleted file mode 100644
index e34933e..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class ByteValueImpl extends PrimitiveValueImpl
-                           implements ByteValue {
-    private byte value;
-
-    ByteValueImpl(VirtualMachine aVm,byte aValue) {
-        super(aVm);
-
-        value = aValue;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof ByteValue)) {
-            return (value == ((ByteValue)obj).value())
-                   && super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return intValue();
-    }
-
-    public int compareTo(ByteValue byteVal) {
-        return value() - byteVal.value();
-    }
-
-    public Type type() {
-        return vm.theByteType();
-    }
-
-    public byte value() {
-        return value;
-    }
-
-    public boolean booleanValue() {
-        return(value == 0)?false:true;
-    }
-
-    public byte byteValue() {
-        return value;
-    }
-
-    public char charValue() {
-        return(char)value;
-    }
-
-    public short shortValue() {
-        return(short)value;
-    }
-
-    public int intValue() {
-        return(int)value;
-    }
-
-    public long longValue() {
-        return(long)value;
-    }
-
-    public float floatValue() {
-        return(float)value;
-    }
-
-    public double doubleValue() {
-        return(double)value;
-    }
-
-    char checkedCharValue() throws InvalidTypeException {
-        if ((value > Character.MAX_VALUE) || (value < Character.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to char");
-        } else {
-            return super.checkedCharValue();
-        }
-    }
-
-    public String toString() {
-        return "" + value;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java
deleted file mode 100644
index aa86a06..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class CharTypeImpl extends PrimitiveTypeImpl implements CharType {
-    CharTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-
-    public String signature() {
-        return "C";
-    }
-
-    PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException {
-        return vm.mirrorOf(((PrimitiveValueImpl)value).checkedCharValue());
-    }
-
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java
deleted file mode 100644
index 588b63f..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class CharValueImpl extends PrimitiveValueImpl
-                           implements CharValue {
-    private char value;
-
-    CharValueImpl(VirtualMachine aVm,char aValue) {
-        super(aVm);
-
-        value = aValue;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof CharValue)) {
-            return (value == ((CharValue)obj).value()) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return intValue();
-    }
-
-    public int compareTo(CharValue charVal) {
-        return value() - charVal.value();
-    }
-
-    public Type type() {
-        return vm.theCharType();
-    }
-
-    public char value() {
-        return value;
-    }
-
-    public boolean booleanValue() {
-        return(value == 0)?false:true;
-    }
-
-    public byte byteValue() {
-        return(byte)value;
-    }
-
-    public char charValue() {
-        return(char)value;
-    }
-
-    public short shortValue() {
-        return(short)value;
-    }
-
-    public int intValue() {
-        return(int)value;
-    }
-
-    public long longValue() {
-        return(long)value;
-    }
-
-    public float floatValue() {
-        return(float)value;
-    }
-
-    public double doubleValue() {
-        return(double)value;
-    }
-
-    public String toString() {
-        return "" + value;
-    }
-
-    byte checkedByteValue() throws InvalidTypeException {
-        // Note: since char is unsigned, don't check against MIN_VALUE
-        if (value > Byte.MAX_VALUE) {
-            throw new InvalidTypeException("Can't convert " + value + " to byte");
-        } else {
-            return super.checkedByteValue();
-        }
-    }
-
-    short checkedShortValue() throws InvalidTypeException {
-        // Note: since char is unsigned, don't check against MIN_VALUE
-        if (value > Short.MAX_VALUE) {
-            throw new InvalidTypeException("Can't convert " + value + " to short");
-        } else {
-            return super.checkedShortValue();
-        }
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java
deleted file mode 100644
index ff9627a..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import sun.jvm.hotspot.oops.Oop;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.Klass;
-import sun.jvm.hotspot.memory.SystemDictionary;
-import sun.jvm.hotspot.memory.Universe;
-import sun.jvm.hotspot.runtime.VM;
-
-import com.sun.jdi.*;
-import java.util.*;
-
-public class ClassLoaderReferenceImpl
-    extends ObjectReferenceImpl
-    implements ClassLoaderReference
-{
-     // because we work on process snapshot or core we can
-     // cache visibleClasses & definedClasses always (i.e., no suspension)
-     private List visibleClassesCache;
-     private List definedClassesCache;
-
-     ClassLoaderReferenceImpl(VirtualMachine aVm, Instance oRef) {
-         super(aVm, oRef);
-     }
-
-     protected String description() {
-         return "ClassLoaderReference " + uniqueID();
-     }
-
-     public List definedClasses() {
-         if (definedClassesCache == null) {
-             definedClassesCache = new ArrayList();
-             Iterator iter = vm.allClasses().iterator();
-             while (iter.hasNext()) {
-                 ReferenceType type = (ReferenceType)iter.next();
-                 if (equals(type.classLoader())) {  /* thanks OTI */
-                     definedClassesCache.add(type);
-                 }
-             }
-         }
-         return definedClassesCache;
-     }
-
-     private SystemDictionary getSystemDictionary() {
-         return vm.saSystemDictionary();
-     }
-
-     private Universe getUniverse() {
-         return vm.saUniverse();
-     }
-
-     public List visibleClasses() {
-         if (visibleClassesCache != null)
-            return visibleClassesCache;
-
-         visibleClassesCache = new ArrayList();
-
-         // refer to getClassLoaderClasses in jvmtiGetLoadedClasses.cpp
-         //  a. SystemDictionary::classes_do doesn't include arrays of primitive types (any dimensions)
-         SystemDictionary sysDict = getSystemDictionary();
-         sysDict.classesDo(
-                           new SystemDictionary.ClassAndLoaderVisitor() {
-                                public void visit(Klass k, Oop loader) {
-                                    if (ref().equals(loader)) {
-                                        for (Klass l = k; l != null; l = l.arrayKlassOrNull()) {
-                                            visibleClassesCache.add(vm.referenceType(l));
-                                        }
-                                    }
-                                }
-                           }
-                           );
-
-         // b. multi dimensional arrays of primitive types
-         sysDict.primArrayClassesDo(
-                                    new SystemDictionary.ClassAndLoaderVisitor() {
-                                         public void visit(Klass k, Oop loader) {
-                                             if (ref().equals(loader)) {
-                                                 visibleClassesCache.add(vm.referenceType(k));
-                                             }
-                                         }
-                                     }
-                                     );
-
-         // c. single dimensional primitive array klasses from Universe
-         // these are not added to SystemDictionary
-         getUniverse().basicTypeClassesDo(
-                            new SystemDictionary.ClassVisitor() {
-                                public void visit(Klass k) {
-                                    visibleClassesCache.add(vm.referenceType(k));
-                                }
-                            }
-                            );
-
-         return visibleClassesCache;
-     }
-
-     Type findType(String signature) throws ClassNotLoadedException {
-         List types = visibleClasses();
-         Iterator iter = types.iterator();
-         while (iter.hasNext()) {
-             ReferenceType type = (ReferenceType)iter.next();
-             if (type.signature().equals(signature)) {
-                 return type;
-             }
-         }
-         JNITypeParser parser = new JNITypeParser(signature);
-         throw new ClassNotLoadedException(parser.typeName(),
-                                          "Class " + parser.typeName() + " not loaded");
-     }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java
deleted file mode 100644
index 41d926a..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.Klass;
-import sun.jvm.hotspot.oops.java_lang_Class;
-
-public class ClassObjectReferenceImpl extends ObjectReferenceImpl
-                                      implements ClassObjectReference {
-    private ReferenceType reflectedType;
-
-    ClassObjectReferenceImpl(VirtualMachine vm, Instance oRef) {
-        super(vm, oRef);
-    }
-
-    public ReferenceType reflectedType() {
-        if (reflectedType == null) {
-            Klass k = java_lang_Class.asKlass(ref());
-            reflectedType = vm.referenceType(k);
-        }
-        return reflectedType;
-    }
-
-    public String toString() {
-        return "instance of " + referenceType().name() +
-               "(reflected class=" + reflectedType().name() + ", " + "id=" +
-               uniqueID() + ")";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java
deleted file mode 100644
index 50a710e..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 2002, 2007, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import java.lang.ref.SoftReference;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import sun.jvm.hotspot.oops.InstanceKlass;
-
-import com.sun.jdi.ClassNotLoadedException;
-import com.sun.jdi.ClassType;
-import com.sun.jdi.Field;
-import com.sun.jdi.IncompatibleThreadStateException;
-import com.sun.jdi.InterfaceType;
-import com.sun.jdi.InvalidTypeException;
-import com.sun.jdi.InvocationException;
-import com.sun.jdi.Method;
-import com.sun.jdi.ObjectReference;
-import com.sun.jdi.ReferenceType;
-import com.sun.jdi.ThreadReference;
-import com.sun.jdi.Value;
-import com.sun.jdi.VirtualMachine;
-
-public class ClassTypeImpl extends ReferenceTypeImpl
-    implements ClassType
-{
-    private SoftReference interfacesCache    = null;
-    private SoftReference allInterfacesCache = null;
-    private SoftReference subclassesCache    = null;
-
-    protected ClassTypeImpl(VirtualMachine aVm, InstanceKlass aRef) {
-        super(aVm, aRef);
-    }
-
-    public ClassType superclass() {
-        InstanceKlass kk = (InstanceKlass)ref().getSuper();
-        if (kk == null) {
-            return null;
-        }
-        return (ClassType) vm.referenceType(kk);
-    }
-
-    public List interfaces()  {
-        List interfaces = (interfacesCache != null)? (List) interfacesCache.get() : null;
-        if (interfaces == null) {
-            checkPrepared();
-            interfaces = Collections.unmodifiableList(getInterfaces());
-            interfacesCache = new SoftReference(interfaces);
-        }
-        return interfaces;
-    }
-
-    void addInterfaces(List list) {
-        List immediate = interfaces();
-
-        HashSet hashList = new HashSet(list);
-        hashList.addAll(immediate);
-        list.clear();
-        list.addAll(hashList);
-
-        Iterator iter = immediate.iterator();
-        while (iter.hasNext()) {
-            InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
-            interfaze.addSuperinterfaces(list);
-        }
-
-        ClassTypeImpl superclass = (ClassTypeImpl)superclass();
-        if (superclass != null) {
-            superclass.addInterfaces(list);
-        }
-    }
-
-    public List allInterfaces()  {
-        List allinterfaces = (allInterfacesCache != null)? (List) allInterfacesCache.get() : null;
-        if (allinterfaces == null) {
-            checkPrepared();
-            allinterfaces = new ArrayList();
-            addInterfaces(allinterfaces);
-            allinterfaces = Collections.unmodifiableList(allinterfaces);
-            allInterfacesCache = new SoftReference(allinterfaces);
-        }
-        return allinterfaces;
-    }
-
-    public List subclasses() {
-        List subclasses = (subclassesCache != null)? (List) subclassesCache.get() : null;
-        if (subclasses == null) {
-            List all = vm.allClasses();
-            subclasses = new ArrayList(0);
-            Iterator iter = all.iterator();
-            while (iter.hasNext()) {
-                ReferenceType refType = (ReferenceType)iter.next();
-                if (refType instanceof ClassType) {
-                    ClassType clazz = (ClassType)refType;
-                    ClassType superclass = clazz.superclass();
-                    if ((superclass != null) && superclass.equals(this)) {
-                        subclasses.add(refType);
-                    }
-                }
-            }
-            subclasses = Collections.unmodifiableList(subclasses);
-            subclassesCache = new SoftReference(subclasses);
-        }
-        return subclasses;
-    }
-
-    public Method concreteMethodByName(String name, String signature)  {
-       checkPrepared();
-       List methods = visibleMethods();
-       Method method = null;
-       Iterator iter = methods.iterator();
-       while (iter.hasNext()) {
-           Method candidate = (Method)iter.next();
-           if (candidate.name().equals(name) &&
-               candidate.signature().equals(signature) &&
-               !candidate.isAbstract()) {
-
-               method = candidate;
-               break;
-           }
-       }
-       return method;
-   }
-
-   List getAllMethods() {
-        ArrayList list = new ArrayList(methods());
-        ClassType clazz = superclass();
-        while (clazz != null) {
-            list.addAll(clazz.methods());
-            clazz = clazz.superclass();
-        }
-        /*
-         * Avoid duplicate checking on each method by iterating through
-         * duplicate-free allInterfaces() rather than recursing
-         */
-        Iterator iter = allInterfaces().iterator();
-        while (iter.hasNext()) {
-            InterfaceType interfaze = (InterfaceType)iter.next();
-            list.addAll(interfaze.methods());
-        }
-        return list;
-    }
-
-    List inheritedTypes() {
-        List inherited = new ArrayList(interfaces());
-        if (superclass() != null) {
-            inherited.add(0, superclass()); /* insert at front */
-        }
-        return inherited;
-    }
-
-    public boolean isEnum() {
-        ClassTypeImpl superclass = (ClassTypeImpl) superclass();
-        if (superclass != null) {
-            return superclass.typeNameAsSymbol().equals(vm.javaLangEnum());
-        } else {
-            return false;
-        }
-    }
-
-    public void setValue(Field field, Value value)
-        throws InvalidTypeException, ClassNotLoadedException {
-        vm.throwNotReadOnlyException("ClassType.setValue(...)");
-    }
-
-
-    public Value invokeMethod(ThreadReference threadIntf, Method methodIntf,
-                              List arguments, int options)
-                                   throws InvalidTypeException,
-                                          ClassNotLoadedException,
-                                          IncompatibleThreadStateException,
-                                          InvocationException {
-        vm.throwNotReadOnlyException("ClassType.invokeMethod(...)");
-        return null;
-    }
-
-    public ObjectReference newInstance(ThreadReference threadIntf,
-                                       Method methodIntf,
-                                       List arguments, int options)
-                                   throws InvalidTypeException,
-                                          ClassNotLoadedException,
-                                          IncompatibleThreadStateException,
-                                          InvocationException {
-        vm.throwNotReadOnlyException("ClassType.newInstance(...)");
-        return null;
-    }
-
-    @Override
-    void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces) {
-        /*
-         * Add methods from
-         * parent types first, so that the methods in this class will
-         * overwrite them in the hash table
-         */
-
-        Iterator<InterfaceType> iter = interfaces().iterator();
-        while (iter.hasNext()) {
-            InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
-            if (!seenInterfaces.contains(interfaze)) {
-                interfaze.addVisibleMethods(methodMap, seenInterfaces);
-                seenInterfaces.add(interfaze);
-            }
-        }
-
-        ClassTypeImpl clazz = (ClassTypeImpl)superclass();
-        if (clazz != null) {
-            clazz.addVisibleMethods(methodMap, seenInterfaces);
-        }
-
-        addToMethodMap(methodMap, methods());
-    }
-
-    boolean isAssignableTo(ReferenceType type) {
-        ClassTypeImpl superclazz = (ClassTypeImpl)superclass();
-        if (this.equals(type)) {
-            return true;
-        } else if ((superclazz != null) && superclazz.isAssignableTo(type)) {
-            return true;
-        } else {
-            List interfaces = interfaces();
-            Iterator iter = interfaces.iterator();
-            while (iter.hasNext()) {
-                InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
-                if (interfaze.isAssignableTo(type)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-    }
-
-    public String toString() {
-       return "class " + name() + "(" + loaderString() + ")";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java
deleted file mode 100644
index d4288f4..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-import sun.jvm.hotspot.oops.Symbol;
-import sun.jvm.hotspot.oops.LocalVariableTableElement;
-import sun.jvm.hotspot.oops.LineNumberTableElement;
-import java.util.List;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.lang.ref.SoftReference;
-import java.util.Collections;
-
-public class ConcreteMethodImpl extends MethodImpl {
-
-    /*
-     * A subset of the line number info that is softly cached
-     */
-    static private class SoftLocationXRefs {
-        final String stratumID;   // The stratum of this information
-        final Map lineMapper;     // Maps line number to location(s)
-        final List lineLocations; // List of locations ordered by code index
-
-        /*
-         * Note: these do not necessarily correspond to
-         * the line numbers of the first and last elements
-         * in the lineLocations list. Use these only for bounds
-         * checking and with lineMapper.
-         */
-        final int lowestLine;
-        final int highestLine;
-
-        SoftLocationXRefs(String stratumID, Map lineMapper, List lineLocations,
-                     int lowestLine, int highestLine) {
-            this.stratumID = stratumID;
-            this.lineMapper = Collections.unmodifiableMap(lineMapper);
-            this.lineLocations =
-                Collections.unmodifiableList(lineLocations);
-            this.lowestLine = lowestLine;
-            this.highestLine = highestLine;
-        }
-    }
-
-    private SoftReference softBaseLocationXRefsRef;
-    private SoftReference softOtherLocationXRefsRef;
-    private SoftReference variablesRef = null;
-    private int firstIndex = -1;
-    private int lastIndex = -1;
-    private Location location;
-    private SoftReference bytecodesRef = null;
-
-    ConcreteMethodImpl(VirtualMachine vm, ReferenceTypeImpl declaringType,
-               sun.jvm.hotspot.oops.Method saMethod ) {
-        super(vm, declaringType, saMethod);
-    }
-
-    int argSlotCount() throws AbsentInformationException {
-        return (int) saMethod.getSizeOfParameters();
-    }
-
-    private SoftLocationXRefs getLocations(SDE.Stratum stratum) {
-        if (stratum.isJava()) {
-            return getBaseLocations();
-        }
-        String stratumID = stratum.id();
-        SoftLocationXRefs info =
-            (softOtherLocationXRefsRef == null) ? null :
-               (SoftLocationXRefs)softOtherLocationXRefsRef.get();
-        if (info != null && info.stratumID.equals(stratumID)) {
-            return info;
-        }
-
-        List lineLocations = new ArrayList();
-        Map lineMapper = new HashMap();
-        int lowestLine = -1;
-        int highestLine = -1;
-        SDE.LineStratum lastLineStratum = null;
-        SDE.Stratum baseStratum =
-            declaringType.stratum(SDE.BASE_STRATUM_NAME);
-        Iterator it = getBaseLocations().lineLocations.iterator();
-        while(it.hasNext()) {
-            LocationImpl loc = (LocationImpl)it.next();
-            int baseLineNumber = loc.lineNumber(baseStratum);
-            SDE.LineStratum lineStratum =
-                  stratum.lineStratum(declaringType,
-                                      baseLineNumber);
-
-            if (lineStratum == null) {
-                // location not mapped in this stratum
-                continue;
-            }
-
-            int lineNumber = lineStratum.lineNumber();
-
-            // remove unmapped and dup lines
-            if ((lineNumber != -1) &&
-                          (!lineStratum.equals(lastLineStratum))) {
-                lastLineStratum = lineStratum;
-                // Remember the largest/smallest line number
-                if (lineNumber > highestLine) {
-                    highestLine = lineNumber;
-                }
-                if ((lineNumber < lowestLine) || (lowestLine == -1)) {
-                    lowestLine = lineNumber;
-                }
-
-                loc.addStratumLineInfo(
-                new StratumLineInfo(stratumID,
-                                      lineNumber,
-                                      lineStratum.sourceName(),
-                                      lineStratum.sourcePath()));
-
-                // Add to the location list
-                lineLocations.add(loc);
-
-                // Add to the line -> locations map
-                Integer key = new Integer(lineNumber);
-                List mappedLocs = (List)lineMapper.get(key);
-                if (mappedLocs == null) {
-                    mappedLocs = new ArrayList(1);
-                    lineMapper.put(key, mappedLocs);
-                }
-                mappedLocs.add(loc);
-            }
-        }
-
-        info = new SoftLocationXRefs(stratumID,
-                                lineMapper, lineLocations,
-                                lowestLine, highestLine);
-        softOtherLocationXRefsRef = new SoftReference(info);
-        return info;
-    }
-
-    private SoftLocationXRefs getBaseLocations() {
-        SoftLocationXRefs info = (softBaseLocationXRefsRef == null) ? null :
-                                     (SoftLocationXRefs)softBaseLocationXRefsRef.get();
-        if (info != null) {
-            return info;
-        }
-
-        byte[] codeBuf = bytecodes();
-        firstIndex = 0;
-        lastIndex = codeBuf.length - 1;
-        // This is odd; what is the Location of a Method?
-        // A StackFrame can have a location, but a Method?
-        // I guess it must be the Location for bci 0.
-        location = new LocationImpl(virtualMachine(), this, 0);
-
-        boolean hasLineInfo = saMethod.hasLineNumberTable();
-        LineNumberTableElement[] lntab = null;
-        int count;
-
-        if (hasLineInfo) {
-            lntab = saMethod.getLineNumberTable();
-            count = lntab.length;
-        } else {
-            count = 0;
-        }
-
-        List lineLocations = new ArrayList(count);
-        Map lineMapper = new HashMap();
-        int lowestLine = -1;
-        int highestLine = -1;
-        for (int i = 0; i < count; i++) {
-            long bci = lntab[i].getStartBCI();
-            int lineNumber = lntab[i].getLineNumber();
-
-            /*
-             * Some compilers will point multiple consecutive
-             * lines at the same location. We need to choose
-             * one of them so that we can consistently map back
-             * and forth between line and location. So we choose
-             * to record only the last line entry at a particular
-             * location.
-             */
-            if ((i + 1 == count) || (bci != lntab[i+1].getStartBCI())) {
-                // Remember the largest/smallest line number
-                if (lineNumber > highestLine) {
-                    highestLine = lineNumber;
-                }
-                if ((lineNumber < lowestLine) || (lowestLine == -1)) {
-                    lowestLine = lineNumber;
-                }
-                LocationImpl loc =
-                    new LocationImpl(virtualMachine(), this, bci);
-                loc.addBaseLineInfo(
-                    new BaseLineInfo(lineNumber, declaringType));
-
-                // Add to the location list
-                lineLocations.add(loc);
-
-                // Add to the line -> locations map
-                Integer key = new Integer(lineNumber);
-                List mappedLocs = (List)lineMapper.get(key);
-                if (mappedLocs == null) {
-                    mappedLocs = new ArrayList(1);
-                    lineMapper.put(key, mappedLocs);
-                }
-                mappedLocs.add(loc);
-            }
-        }
-
-        info = new SoftLocationXRefs(SDE.BASE_STRATUM_NAME,
-                                lineMapper, lineLocations,
-                                lowestLine, highestLine);
-        softBaseLocationXRefsRef = new SoftReference(info);
-        return info;
-    }
-
-    List sourceNameFilter(List list,
-                          SDE.Stratum stratum,
-                          String sourceName)
-                            throws AbsentInformationException {
-        if (sourceName == null) {
-            return list;
-        } else {
-            /* needs sourceName filteration */
-            List locs = new ArrayList();
-            Iterator it = list.iterator();
-            while (it.hasNext()) {
-                LocationImpl loc = (LocationImpl)it.next();
-                if (loc.sourceName(stratum).equals(sourceName)) {
-                    locs.add(loc);
-                }
-            }
-            return locs;
-        }
-    }
-
-    public List allLineLocations(SDE.Stratum stratum, String sourceName)
-        throws AbsentInformationException {
-        List lineLocations = getLocations(stratum).lineLocations;
-
-        if (lineLocations.size() == 0) {
-            throw new AbsentInformationException();
-        }
-
-        return Collections.unmodifiableList(
-          sourceNameFilter(lineLocations, stratum, sourceName));
-    }
-
-    public List locationsOfLine(SDE.Stratum stratum, String sourceName,
-                         int lineNumber) throws AbsentInformationException {
-        SoftLocationXRefs info = getLocations(stratum);
-
-        if (info.lineLocations.size() == 0) {
-            throw new AbsentInformationException();
-        }
-
-        /*
-         * Find the locations which match the line number
-         * passed in.
-         */
-        List list = (List)info.lineMapper.get(
-                                  new Integer(lineNumber));
-
-        if (list == null) {
-            list = new ArrayList(0);
-        }
-        return Collections.unmodifiableList(
-          sourceNameFilter(list, stratum, sourceName));
-    }
-
-    LineInfo codeIndexToLineInfo(SDE.Stratum stratum,
-                                 long codeIndex) {
-        if (firstIndex == -1) {
-            getBaseLocations();
-        }
-
-        /*
-         * Check for invalid code index.
-         */
-        if (codeIndex < firstIndex || codeIndex > lastIndex) {
-            throw new InternalError(
-                    "Location with invalid code index");
-        }
-
-        List lineLocations = getLocations(stratum).lineLocations;
-
-        /*
-         * Check for absent line numbers.
-         */
-        if (lineLocations.size() == 0) {
-            return super.codeIndexToLineInfo(stratum, codeIndex);
-        }
-
-        Iterator iter = lineLocations.iterator();
-        /*
-         * Treat code before the beginning of the first line table
-         * entry as part of the first line.  javac will generate
-         * code like this for some local classes. This "prolog"
-         * code contains assignments from locals in the enclosing
-         * scope to synthetic fields in the local class.  Same for
-         * other language prolog code.
-         */
-        LocationImpl bestMatch = (LocationImpl)iter.next();
-        while (iter.hasNext()) {
-            LocationImpl current = (LocationImpl)iter.next();
-            if (current.codeIndex() > codeIndex) {
-                break;
-            }
-            bestMatch = current;
-        }
-        return bestMatch.getLineInfo(stratum);
-    }
-
-    public Location locationOfCodeIndex(long codeIndex) {
-        if (firstIndex == -1) {
-            getBaseLocations();
-        }
-
-        /*
-         * Check for invalid code index.
-         */
-        if (codeIndex < firstIndex || codeIndex > lastIndex) {
-            return null;
-        }
-
-        return new LocationImpl(virtualMachine(), this, codeIndex);
-    }
-
-    public List variables() throws AbsentInformationException {
-        return getVariables();
-    }
-
-    public List variablesByName(String name) throws AbsentInformationException {
-        List variables = getVariables();
-
-        List retList = new ArrayList(2);
-        Iterator iter = variables.iterator();
-        while(iter.hasNext()) {
-            LocalVariable variable = (LocalVariable)iter.next();
-            if (variable.name().equals(name)) {
-                retList.add(variable);
-            }
-        }
-        return retList;
-    }
-
-    public List arguments() throws AbsentInformationException {
-        if (argumentTypeNames().size() == 0) {
-            return new ArrayList(0);
-        }
-        List variables = getVariables();
-        List retList = new ArrayList(variables.size());
-        Iterator iter = variables.iterator();
-        while(iter.hasNext()) {
-            LocalVariable variable = (LocalVariable)iter.next();
-            if (variable.isArgument()) {
-                retList.add(variable);
-            }
-        }
-        return retList;
-    }
-
-    public byte[] bytecodes() {
-        byte[] bytecodes = (bytecodesRef == null) ? null :
-                                     (byte[])bytecodesRef.get();
-        if (bytecodes == null) {
-            bytecodes = saMethod.getByteCode();
-            bytecodesRef = new SoftReference(bytecodes);
-        }
-        /*
-         * Arrays are always modifiable, so it is a little unsafe
-         * to return the cached bytecodes directly; instead, we
-         * make a clone at the cost of using more memory.
-         */
-        return (byte[])bytecodes.clone();
-    }
-
-    public Location location() {
-        if (location == null) {
-            getBaseLocations();
-        }
-        return location;
-    }
-
-    private List getVariables() throws AbsentInformationException {
-        List variables = (variablesRef == null) ? null :
-                                     (List)variablesRef.get();
-        if (variables != null) {
-            return variables;
-        }
-
-        // if there are no locals, there won't be a LVT
-        if (saMethod.getMaxLocals() == 0) {
-           variables = Collections.unmodifiableList(new ArrayList(0));
-           variablesRef = new SoftReference(variables);
-           return variables;
-        }
-
-        if (! saMethod.hasLocalVariableTable()) {
-            throw new AbsentInformationException();
-        }
-        //Build up the JDI view of local variable table.
-        LocalVariableTableElement[] locals = saMethod.getLocalVariableTable();
-        int localCount = locals.length;
-        variables = new ArrayList(localCount);
-        for (int ii = 0; ii < localCount; ii++) {
-            String name =
-                saMethod.getConstants().getSymbolAt(locals[ii].getNameCPIndex()).asString();
-            /*
-             * Skip "this$*", "this+*", "this" entries because they are never real
-             * variables from the JLS perspective. "this+*" is new with 1.5.
-             * Instead of using '+', we check for java letter or digit to avoid
-             * depending on javac's current choice of '+'.
-             */
-            boolean isInternalName = name.startsWith("this") &&
-                  (name.length() == 4 || name.charAt(4)=='$' || !Character.isJavaIdentifierPart(name.charAt(4)));
-            if (! isInternalName) {
-                int slot = locals[ii].getSlot();
-                long codeIndex = locals[ii].getStartBCI();
-                int length = locals[ii].getLength();
-                Location scopeStart = new LocationImpl(virtualMachine(),
-                                                       this, codeIndex);
-                Location scopeEnd =
-                    new LocationImpl(virtualMachine(), this,
-                                     codeIndex + length - 1);
-                String signature =
-                    saMethod.getConstants().getSymbolAt(locals[ii].getDescriptorCPIndex()).asString();
-
-                int genericSigIndex = locals[ii].getSignatureCPIndex();
-                String genericSignature = null;
-                if (genericSigIndex != 0) {
-                    genericSignature = saMethod.getConstants().getSymbolAt(genericSigIndex).asString();
-                }
-
-                LocalVariable variable =
-                    new LocalVariableImpl(virtualMachine(), this,
-                                          slot, scopeStart, scopeEnd,
-                                          name, signature, genericSignature);
-                // Add to the variable list
-                variables.add(variable);
-            }
-        }
-
-        variables = Collections.unmodifiableList(variables);
-        variablesRef = new SoftReference(variables);
-        return variables;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java
deleted file mode 100644
index 0cffde9..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/*
- * Copyright (c) 2002, 2012, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.connect.*;
-import com.sun.jdi.InternalException;
-
-import java.io.*;
-import java.lang.ref.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-abstract class ConnectorImpl implements Connector {
-    Map defaultArguments = new LinkedHashMap();
-
-    // Used by BooleanArgument
-    static String trueString = null;
-    static String falseString;
-
-
-    /**  This is not public in VirtualMachineManagerImpl
-    ThreadGroup mainGroupForJDI() {
-        return ((VirtualMachineManagerImpl)manager).mainGroupForJDI();
-    }
-    ***/
-
-    // multiple debuggee support for SA/JDI
-    private static List freeVMClasses; // List<SoftReference<Class>>
-    private static ClassLoader myLoader;
-    // debug mode for SA/JDI connectors
-    static final protected boolean DEBUG;
-    static {
-        myLoader = ConnectorImpl.class.getClassLoader();
-        freeVMClasses = new ArrayList(0);
-        DEBUG = System.getProperty("sun.jvm.hotspot.jdi.ConnectorImpl.DEBUG") != null;
-    }
-
-    // add a new free VirtualMachineImpl class
-    private static synchronized void addFreeVMImplClass(Class clazz) {
-        if (DEBUG) {
-            System.out.println("adding free VirtualMachineImpl class");
-        }
-        freeVMClasses.add(new SoftReference(clazz));
-    }
-
-    // returns null if we don't have anything free
-    private static synchronized Class getFreeVMImplClass() {
-        while (!freeVMClasses.isEmpty()) {
-              SoftReference ref = (SoftReference) freeVMClasses.remove(0);
-              Object o = ref.get();
-              if (o != null) {
-                  if (DEBUG) {
-                      System.out.println("re-using loaded VirtualMachineImpl");
-                  }
-                  return (Class) o;
-              }
-        }
-        return null;
-    }
-
-    private static Class getVMImplClassFrom(ClassLoader cl)
-                               throws ClassNotFoundException {
-        return Class.forName("sun.jvm.hotspot.jdi.VirtualMachineImpl", true, cl);
-    }
-
-    /* SA has not been designed to support multiple debuggee VMs
-     * at-a-time.  But, JDI supports multiple debuggee VMs.  We
-     * support multiple debuggee VMs in SA/JDI, by creating a new
-     * class loader instance (refer to comment in SAJDIClassLoader
-     * for details). But, to avoid excessive class loading (and
-     * thereby resulting in larger footprint), we re-use 'dispose'd
-     * VirtualMachineImpl classes.
-     */
-    protected static Class loadVirtualMachineImplClass()
-                               throws ClassNotFoundException {
-        Class vmImplClass = getFreeVMImplClass();
-        if (vmImplClass == null) {
-            ClassLoader cl = new SAJDIClassLoader(myLoader);
-            vmImplClass = getVMImplClassFrom(cl);
-        }
-        return vmImplClass;
-    }
-
-    /* We look for System property sun.jvm.hotspot.jdi.<vm version>.
-     * This property should have the value of JDK HOME directory for
-     * the given <vm version>.
-     */
-    private static String getSAClassPathForVM(String vmVersion) {
-        final String prefix = "sun.jvm.hotspot.jdi.";
-        // look for exact match of VM version
-        String jvmHome = System.getProperty(prefix + vmVersion);
-        if (DEBUG) {
-            System.out.println("looking for System property " + prefix + vmVersion);
-        }
-
-        if (jvmHome == null) {
-            // omit chars after first '-' in VM version and try
-            // for example, in '1.5.0-b55' we take '1.5.0'
-            int index = vmVersion.indexOf('-');
-            if (index != -1) {
-                vmVersion = vmVersion.substring(0, index);
-                if (DEBUG) {
-                    System.out.println("looking for System property " + prefix + vmVersion);
-                }
-                jvmHome = System.getProperty(prefix + vmVersion);
-            }
-
-            if (jvmHome == null) {
-                // System property is not set
-                if (DEBUG) {
-                    System.out.println("can't locate JDK home for " + vmVersion);
-                }
-                return null;
-            }
-        }
-
-        if (DEBUG) {
-            System.out.println("JDK home for " + vmVersion + " is " + jvmHome);
-        }
-
-        // sa-jdi is in $JDK_HOME/lib directory
-        StringBuffer buf = new StringBuffer();
-        buf.append(jvmHome);
-        buf.append(File.separatorChar);
-        buf.append("lib");
-        buf.append(File.separatorChar);
-        buf.append("sa-jdi.jar");
-        return buf.toString();
-    }
-
-    /* This method loads VirtualMachineImpl class by a ClassLoader
-     * configured with sa-jdi.jar path of given 'vmVersion'. This is
-     * used for cross VM version debugging. Refer to comments in
-     * SAJDIClassLoader as well.
-     */
-    protected static Class loadVirtualMachineImplClass(String vmVersion)
-            throws ClassNotFoundException {
-        if (DEBUG) {
-            System.out.println("attemping to load sa-jdi.jar for version " + vmVersion);
-        }
-        String classPath = getSAClassPathForVM(vmVersion);
-        if (classPath != null) {
-            ClassLoader cl = new SAJDIClassLoader(myLoader, classPath);
-            return getVMImplClassFrom(cl);
-        } else {
-            return null;
-        }
-    }
-
-    /* Is the given throwable an instanceof VMVersionMismatchException?
-     * Note that we can't do instanceof check because the exception
-     * class might have been loaded by a different class loader.
-     */
-    private static boolean isVMVersionMismatch(Throwable throwable) {
-        String className = throwable.getClass().getName();
-        return className.equals("sun.jvm.hotspot.runtime.VMVersionMismatchException");
-    }
-
-    /* gets target VM version from the given VMVersionMismatchException.
-     * Note that we need to reflectively call the method because of we may
-     * have got this from different classloader's namespace */
-    private static String getVMVersion(Throwable throwable)
-        throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-        // assert isVMVersionMismatch(throwable), "not a VMVersionMismatch"
-        Class expClass = throwable.getClass();
-        Method targetVersionMethod = expClass.getMethod("getTargetVersion", new Class[0]);
-        return (String) targetVersionMethod.invoke(throwable);
-    }
-
-    /** If the causal chain has a sun.jvm.hotspot.runtime.VMVersionMismatchException,
-        attempt to load VirtualMachineImpl class for target VM version. */
-    protected static Class handleVMVersionMismatch(InvocationTargetException ite) {
-        Throwable cause = ite.getCause();
-        if (DEBUG) {
-            System.out.println("checking for version mismatch...");
-        }
-        while (cause != null) {
-            try {
-                if (isVMVersionMismatch(cause)) {
-                    if (DEBUG) {
-                        System.out.println("Triggering cross VM version support...");
-                    }
-                    return loadVirtualMachineImplClass(getVMVersion(cause));
-                }
-            } catch (Exception exp) {
-                if (DEBUG) {
-                    System.out.println("failed to load VirtualMachineImpl class");
-                    exp.printStackTrace();
-                }
-                return null;
-            }
-            cause = cause.getCause();
-        }
-        return null;
-    }
-
-    protected void checkNativeLink(SecurityManager sm, String os) {
-        if (os.equals("SunOS") || os.equals("Linux") || os.contains("OS X")) {
-            // link "saproc" - SA native library on SunOS, Linux, and Mac OS X
-            sm.checkLink("saproc");
-        } else if (os.startsWith("Windows")) {
-            // link "sawindbg" - SA native library on Windows.
-            sm.checkLink("sawindbg");
-        } else {
-           throw new RuntimeException(os + " is not yet supported");
-        }
-    }
-
-    // we set an observer to detect VirtualMachineImpl.dispose call
-    // and on dispose we add corresponding VirtualMachineImpl.class to
-    // free VirtualMachimeImpl Class list.
-    protected static void setVMDisposeObserver(final Object vm) {
-        try {
-            Method setDisposeObserverMethod = vm.getClass().getDeclaredMethod("setDisposeObserver",
-                                                         new Class[] { java.util.Observer.class });
-            setDisposeObserverMethod.setAccessible(true);
-            setDisposeObserverMethod.invoke(vm,
-                                         new Object[] {
-                                             new Observer() {
-                                                 public void update(Observable o, Object data) {
-                                                     if (DEBUG) {
-                                                         System.out.println("got VM.dispose notification");
-                                                     }
-                                                     addFreeVMImplClass(vm.getClass());
-                                                 }
-                                             }
-                                         });
-        } catch (Exception exp) {
-            if (DEBUG) {
-               System.out.println("setVMDisposeObserver() got an exception:");
-               exp.printStackTrace();
-            }
-        }
-    }
-
-    public Map defaultArguments() {
-        Map defaults = new LinkedHashMap();
-        Collection values = defaultArguments.values();
-
-        Iterator iter = values.iterator();
-        while (iter.hasNext()) {
-            ArgumentImpl argument = (ArgumentImpl)iter.next();
-            defaults.put(argument.name(), argument.clone());
-        }
-        return defaults;
-    }
-
-    void addStringArgument(String name, String label, String description,
-                           String defaultValue, boolean mustSpecify) {
-        defaultArguments.put(name,
-                             new StringArgumentImpl(name, label,
-                                                    description,
-                                                    defaultValue,
-                                                    mustSpecify));
-    }
-
-    void addBooleanArgument(String name, String label, String description,
-                            boolean defaultValue, boolean mustSpecify) {
-        defaultArguments.put(name,
-                             new BooleanArgumentImpl(name, label,
-                                                     description,
-                                                     defaultValue,
-                                                     mustSpecify));
-    }
-
-    void addIntegerArgument(String name, String label, String description,
-                            String defaultValue, boolean mustSpecify,
-                            int min, int max) {
-        defaultArguments.put(name,
-                             new IntegerArgumentImpl(name, label,
-                                                     description,
-                                                     defaultValue,
-                                                     mustSpecify,
-                                                     min, max));
-    }
-
-    void addSelectedArgument(String name, String label, String description,
-                             String defaultValue, boolean mustSpecify,
-                             List list) {
-        defaultArguments.put(name,
-                             new SelectedArgumentImpl(name, label,
-                                                      description,
-                                                      defaultValue,
-                                                      mustSpecify, list));
-    }
-
-    ArgumentImpl argument(String name, Map arguments)
-                throws IllegalConnectorArgumentsException {
-
-        ArgumentImpl argument = (ArgumentImpl)arguments.get(name);
-        if (argument == null) {
-            throw new IllegalConnectorArgumentsException(
-                         "Argument missing", name);
-        }
-        String value = argument.value();
-        if (value == null || value.length() == 0) {
-            if (argument.mustSpecify()) {
-            throw new IllegalConnectorArgumentsException(
-                         "Argument unspecified", name);
-            }
-        } else if(!argument.isValid(value)) {
-            throw new IllegalConnectorArgumentsException(
-                         "Argument invalid", name);
-        }
-
-        return argument;
-    }
-
-    String getString(String key) {
-        //fixme jjh; needs i18n
-        // this is not public return ((VirtualMachineManagerImpl)manager).getString(key);
-        return key;
-    }
-
-    public String toString() {
-        String string = name() + " (defaults: ";
-        Iterator iter = defaultArguments().values().iterator();
-        boolean first = true;
-        while (iter.hasNext()) {
-            ArgumentImpl argument = (ArgumentImpl)iter.next();
-            if (!first) {
-                string += ", ";
-            }
-            string += argument.toString();
-            first = false;
-        }
-        return string  + ")";
-    }
-
-    abstract class ArgumentImpl implements Connector.Argument, Cloneable, Serializable {
-        private String name;
-        private String label;
-        private String description;
-        private String value;
-        private boolean mustSpecify;
-
-        ArgumentImpl(String name, String label, String description,
-                     String value,
-                     boolean mustSpecify) {
-            this.name = name;
-            this.label = label;
-            this.description = description;
-            this.value = value;
-            this.mustSpecify = mustSpecify;
-        }
-
-        public abstract boolean isValid(String value);
-
-        public String name() {
-            return name;
-        }
-
-        public String label() {
-            return label;
-        }
-
-        public String description() {
-            return description;
-        }
-
-        public String value() {
-            return value;
-        }
-
-        public void setValue(String value) {
-            if (value == null) {
-                throw new NullPointerException("Can't set null value");
-            }
-            this.value = value;
-        }
-
-        public boolean mustSpecify() {
-            return mustSpecify;
-        }
-
-        public boolean equals(Object obj) {
-            if ((obj != null) && (obj instanceof Connector.Argument)) {
-                Connector.Argument other = (Connector.Argument)obj;
-                return (name().equals(other.name())) &&
-                       (description().equals(other.description())) &&
-                       (mustSpecify() == other.mustSpecify()) &&
-                       (value().equals(other.value()));
-            } else {
-                return false;
-            }
-        }
-
-        public int hashCode() {
-            return description().hashCode();
-        }
-
-        public Object clone() {
-            try {
-                return super.clone();
-            } catch (CloneNotSupportedException e) {
-                // Object should always support clone
-                throw (InternalException) new InternalException().initCause(e);
-            }
-        }
-
-        public String toString() {
-            return name() + "=" + value();
-        }
-    }
-
-    class BooleanArgumentImpl extends ConnectorImpl.ArgumentImpl
-                              implements Connector.BooleanArgument {
-
-        BooleanArgumentImpl(String name, String label, String description,
-                            boolean value,
-                            boolean mustSpecify) {
-            super(name, label, description, null, mustSpecify);
-            if(trueString == null) {
-                trueString = getString("true");
-                falseString = getString("false");
-            }
-            setValue(value);
-        }
-
-        /**
-         * Sets the value of the argument.
-         */
-        public void setValue(boolean value) {
-            setValue(stringValueOf(value));
-        }
-
-        /**
-         * Performs basic sanity check of argument.
-         * @return <code>true</code> if value is a string
-         * representation of a boolean value.
-         * @see #stringValueOf(boolean)
-         */
-        public boolean isValid(String value) {
-            return value.equals(trueString) || value.equals(falseString);
-        }
-
-        /**
-         * Return the string representation of the <code>value</code>
-         * parameter.
-         * Does not set or examine the value or the argument.
-         * @return the localized String representation of the
-         * boolean value.
-         */
-        public String stringValueOf(boolean value) {
-            return value? trueString : falseString;
-        }
-
-        /**
-         * Return the value of the argument as a boolean.  Since
-         * the argument may not have been set or may have an invalid
-         * value {@link #isValid(String)} should be called on
-         * {@link #value()} to check its validity.  If it is invalid
-         * the boolean returned by this method is undefined.
-         * @return the value of the argument as a boolean.
-         */
-        public boolean booleanValue() {
-            return value().equals(trueString);
-        }
-    }
-
-    class IntegerArgumentImpl extends ConnectorImpl.ArgumentImpl
-                              implements Connector.IntegerArgument {
-
-        private final int min;
-        private final int max;
-
-        IntegerArgumentImpl(String name, String label, String description,
-                            String value,
-                            boolean mustSpecify, int min, int max) {
-            super(name, label, description, value, mustSpecify);
-            this.min = min;
-            this.max = max;
-        }
-
-        /**
-         * Sets the value of the argument.
-         * The value should be checked with {@link #isValid(int)}
-         * before setting it; invalid values will throw an exception
-         * when the connection is established - for example,
-         * on {@link LaunchingConnector#launch}
-         */
-        public void setValue(int value) {
-            setValue(stringValueOf(value));
-        }
-
-        /**
-         * Performs basic sanity check of argument.
-         * @return <code>true</code> if value represents an int that is
-         * <code>{@link #min()} &lt;= value &lt;= {@link #max()}</code>
-         */
-        public boolean isValid(String value) {
-            if (value == null) {
-                return false;
-            }
-            try {
-                return isValid(Integer.decode(value).intValue());
-            } catch(NumberFormatException exc) {
-                return false;
-            }
-        }
-
-        /**
-         * Performs basic sanity check of argument.
-         * @return <code>true</code> if
-         * <code>{@link #min()} &lt;= value  &lt;= {@link #max()}</code>
-         */
-        public boolean isValid(int value) {
-            return min <= value && value <= max;
-        }
-
-        /**
-         * Return the string representation of the <code>value</code>
-         * parameter.
-         * Does not set or examine the value or the argument.
-         * @return the String representation of the
-         * int value.
-         */
-        public String stringValueOf(int value) {
-            // *** Should this be internationalized????
-            // *** Even Brian Beck was unsure if an Arabic programmer
-            // *** would expect port numbers in Arabic numerals,
-            // *** so punt for now.
-            return ""+value;
-        }
-
-        /**
-         * Return the value of the argument as a int.  Since
-         * the argument may not have been set or may have an invalid
-         * value {@link #isValid(String)} should be called on
-         * {@link #value()} to check its validity.  If it is invalid
-         * the int returned by this method is undefined.
-         * @return the value of the argument as a int.
-         */
-        public int intValue() {
-            if (value() == null) {
-                return 0;
-            }
-            try {
-                return Integer.decode(value()).intValue();
-            } catch(NumberFormatException exc) {
-                return 0;
-            }
-        }
-
-        /**
-         * The upper bound for the value.
-         * @return the maximum allowed value for this argument.
-         */
-        public int max() {
-            return max;
-        }
-
-        /**
-         * The lower bound for the value.
-         * @return the minimum allowed value for this argument.
-         */
-        public int min() {
-            return min;
-        }
-    }
-
-    class StringArgumentImpl extends ConnectorImpl.ArgumentImpl
-                              implements Connector.StringArgument {
-
-        StringArgumentImpl(String name, String label, String description,
-                           String value,
-                           boolean mustSpecify) {
-            super(name, label, description, value, mustSpecify);
-        }
-
-        /**
-         * Performs basic sanity check of argument.
-         * @return <code>true</code> always
-         */
-        public boolean isValid(String value) {
-            return true;
-        }
-    }
-
-    class SelectedArgumentImpl extends ConnectorImpl.ArgumentImpl
-                              implements Connector.SelectedArgument {
-
-        private final List choices;
-
-        SelectedArgumentImpl(String name, String label, String description,
-                             String value,
-                             boolean mustSpecify, List choices) {
-            super(name, label, description, value, mustSpecify);
-            this.choices = Collections.unmodifiableList(
-                                           new ArrayList(choices));
-        }
-
-        /**
-         * Return the possible values for the argument
-         * @return {@link List} of {@link String}
-         */
-        public List choices() {
-            return choices;
-        }
-
-        /**
-         * Performs basic sanity check of argument.
-         * @return <code>true</code> if value is one of {@link #choices()}.
-         */
-        public boolean isValid(String value) {
-            return choices.contains(value);
-        }
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java
deleted file mode 100644
index dfe72a4..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class DoubleTypeImpl extends PrimitiveTypeImpl implements DoubleType {
-    DoubleTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-
-    public String signature() {
-        return "D";
-    }
-
-    PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException {
-        return vm.mirrorOf(((PrimitiveValueImpl)value).checkedDoubleValue());
-    }
-
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java
deleted file mode 100644
index d9f914b..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class DoubleValueImpl extends PrimitiveValueImpl
-                             implements DoubleValue {
-    private double value;
-
-    DoubleValueImpl(VirtualMachine aVm,double aValue) {
-        super(aVm);
-
-        value = aValue;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof DoubleValue)) {
-            return (value == ((DoubleValue)obj).value()) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int compareTo(DoubleValue doubleVal) {
-        double other = doubleVal.value();
-        if (value() < other) {
-            return -1;
-        } else if (value() == other) {
-            return 0;
-        } else {
-            return 1;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return intValue();
-    }
-
-    public Type type() {
-        return vm.theDoubleType();
-    }
-
-    public double value() {
-        return value;
-    }
-
-    public boolean booleanValue() {
-        return(value == 0.0)?false:true;
-    }
-
-    public byte byteValue() {
-        return(byte)value;
-    }
-
-    public char charValue() {
-        return(char)value;
-    }
-
-    public short shortValue() {
-        return(short)value;
-    }
-
-    public int intValue() {
-        return(int)value;
-    }
-
-    public long longValue() {
-        return(long)value;
-    }
-
-    public float floatValue() {
-        return(float)value;
-    }
-
-    public double doubleValue() {
-        return(double)value;
-    }
-
-    byte checkedByteValue() throws InvalidTypeException {
-        if ((value > Byte.MAX_VALUE) || (value < Byte.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to byte");
-        } else {
-            return super.checkedByteValue();
-        }
-    }
-
-    char checkedCharValue() throws InvalidTypeException {
-        if ((value > Character.MAX_VALUE) || (value < Character.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to char");
-        } else {
-            return super.checkedCharValue();
-        }
-    }
-
-    short checkedShortValue() throws InvalidTypeException {
-        if ((value > Short.MAX_VALUE) || (value < Short.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to short");
-        } else {
-            return super.checkedShortValue();
-        }
-    }
-
-    int checkedIntValue() throws InvalidTypeException {
-        if ((value > Integer.MAX_VALUE) || (value < Integer.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to int");
-        } else {
-            return super.checkedIntValue();
-        }
-    }
-
-    long checkedLongValue() throws InvalidTypeException {
-        long longValue = (long)value;
-        if (longValue != value) {
-            throw new InvalidTypeException("Can't convert " + value + " to long");
-        } else {
-            return super.checkedLongValue();
-        }
-    }
-
-    float checkedFloatValue() throws InvalidTypeException {
-        float floatValue = (float)value;
-        if (floatValue != value) {
-            throw new InvalidTypeException("Can't convert " + value + " to float");
-        } else {
-            return super.checkedFloatValue();
-        }
-    }
-
-    public String toString() {
-        return "" + value;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java
deleted file mode 100644
index 2721f60..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-import sun.jvm.hotspot.oops.Oop;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.Array;
-import sun.jvm.hotspot.oops.InstanceKlass;
-import sun.jvm.hotspot.oops.Symbol;
-import sun.jvm.hotspot.oops.FieldIdentifier;
-
-import java.util.List;
-import java.util.Iterator;
-import java.util.ArrayList;
-import java.util.Comparator;
-
-public class FieldImpl extends TypeComponentImpl implements Field {
-    private JNITypeParser signatureParser;
-    private sun.jvm.hotspot.oops.Field saField;
-
-    FieldImpl( VirtualMachine vm, ReferenceTypeImpl declaringType,
-               sun.jvm.hotspot.oops.Field saField) {
-        super(vm, declaringType);
-        this.saField = saField;
-        getParser();
-    }
-
-    private void getParser() {
-        if (signatureParser == null) {
-            Symbol sig1 = saField.getSignature();
-            signature = sig1.asString();
-            signatureParser = new JNITypeParser(signature);
-        }
-    }
-
-    sun.jvm.hotspot.oops.Field ref() {
-        return saField;
-    }
-
-    // get the value of static field
-    ValueImpl getValue() {
-        return getValue(saField.getFieldHolder().getJavaMirror());
-    }
-
-    // get the value of this Field from a specific Oop
-    ValueImpl getValue(Oop target) {
-        ValueImpl valueImpl;
-        sun.jvm.hotspot.oops.Field saField = (sun.jvm.hotspot.oops.Field) ref();
-        sun.jvm.hotspot.oops.FieldType ft = saField.getFieldType();
-        if (ft.isArray()) {
-            sun.jvm.hotspot.oops.OopField of = (sun.jvm.hotspot.oops.OopField)saField;
-            valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array)of.getValue(target));
-        } else if (ft.isObject()) {
-            sun.jvm.hotspot.oops.OopField of = (sun.jvm.hotspot.oops.OopField)saField;
-            valueImpl = (ObjectReferenceImpl) vm.objectMirror(of.getValue(target));
-        } else if (ft.isByte()) {
-            sun.jvm.hotspot.oops.ByteField bf = (sun.jvm.hotspot.oops.ByteField)saField;
-            valueImpl = (ByteValueImpl) vm.mirrorOf(bf.getValue(target));
-        } else if (ft.isChar()) {
-            sun.jvm.hotspot.oops.CharField cf = (sun.jvm.hotspot.oops.CharField)saField;
-            valueImpl = (CharValueImpl) vm.mirrorOf(cf.getValue(target));
-        } else if (ft.isDouble()) {
-            sun.jvm.hotspot.oops.DoubleField df = (sun.jvm.hotspot.oops.DoubleField)saField;
-            valueImpl = (DoubleValueImpl) vm.mirrorOf(df.getValue(target));
-        } else if (ft.isFloat()) {
-            sun.jvm.hotspot.oops.FloatField ff = (sun.jvm.hotspot.oops.FloatField)saField;
-            valueImpl = (FloatValueImpl) vm.mirrorOf(ff.getValue(target));
-        } else if (ft.isInt()) {
-            sun.jvm.hotspot.oops.IntField iif = (sun.jvm.hotspot.oops.IntField)saField;
-            valueImpl = (IntegerValueImpl) vm.mirrorOf(iif.getValue(target));
-        } else if (ft.isLong()) {
-            sun.jvm.hotspot.oops.LongField lf = (sun.jvm.hotspot.oops.LongField)saField;
-            valueImpl = (LongValueImpl) vm.mirrorOf(lf.getValue(target));
-        } else if (ft.isShort()) {
-            sun.jvm.hotspot.oops.ShortField sf = (sun.jvm.hotspot.oops.ShortField)saField;
-            valueImpl = (ShortValueImpl) vm.mirrorOf(sf.getValue(target));
-        } else if (ft.isBoolean()) {
-            sun.jvm.hotspot.oops.BooleanField bf = (sun.jvm.hotspot.oops.BooleanField)saField;
-            valueImpl = (BooleanValueImpl) vm.mirrorOf(bf.getValue(target));
-        } else {
-            throw new RuntimeException("Should not reach here");
-        }
-        return valueImpl;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof FieldImpl)) {
-            FieldImpl other = (FieldImpl)obj;
-            return (declaringType().equals(other.declaringType())) &&
-                (ref().equals(other.ref())) &&
-                super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public boolean isTransient() {
-        return saField.isTransient();
-    }
-
-    public boolean isVolatile() {
-        return saField.isVolatile();
-    }
-
-    public boolean isEnumConstant() {
-        return saField.isEnumConstant();
-    }
-
-    public Type type() throws ClassNotLoadedException {
-        // So, we do it just like JDI does by searching the enclosing type.
-        return findType(signature());
-    }
-
-    public String typeName() { //fixme jjh: jpda version creates redundant JNITypeParsers
-        getParser();
-        return signatureParser.typeName();
-    }
-
-    public String genericSignature() {
-        Symbol genSig = saField.getGenericSignature();
-        return (genSig != null)? genSig.asString() : null;
-    }
-
-    // From interface Comparable
-    public int compareTo(Field field) {
-        ReferenceTypeImpl declaringType = (ReferenceTypeImpl)declaringType();
-        int rc = declaringType.compareTo(field.declaringType());
-        if (rc == 0) {
-            rc = declaringType.indexOf(this) -
-                declaringType.indexOf(field);
-        }
-        return rc;
-    }
-
-    // from interface Mirror
-    public String toString() {
-        StringBuffer buf = new StringBuffer();
-
-        buf.append(declaringType().name());
-        buf.append('.');
-        buf.append(name());
-        return buf.toString();
-    }
-
-    public String name() {
-        FieldIdentifier myName =  saField.getID();
-        return myName.getName();
-    }
-
-    // From interface Accessible
-    public int modifiers() {
-        return saField.getAccessFlagsObj().getStandardFlags();
-    }
-
-    public boolean isPackagePrivate() {
-        return saField.isPackagePrivate();
-    }
-
-    public boolean isPrivate() {
-        return saField.isPrivate();
-    }
-
-    public boolean isProtected() {
-        return saField.isProtected();
-    }
-
-    public boolean isPublic() {
-        return saField.isPublic();
-    }
-
-    public boolean isStatic() {
-        return saField.isStatic();
-    }
-
-    public boolean isFinal() {
-        return saField.isFinal();
-    }
-
-    public boolean isSynthetic() {
-        return saField.isSynthetic();
-    }
-
-    public int hashCode() {
-        return saField.hashCode();
-    }
-
-
-    private Type findType(String signature) throws ClassNotLoadedException {
-        ReferenceTypeImpl enclosing = (ReferenceTypeImpl)declaringType();
-        return enclosing.findType(signature);
-    }
-
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java
deleted file mode 100644
index bf1b33e..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class FloatTypeImpl extends PrimitiveTypeImpl implements FloatType {
-    FloatTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-
-    public String signature() {
-        return "F";
-    }
-
-    PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException {
-        return vm.mirrorOf(((PrimitiveValueImpl)value).checkedFloatValue());
-    }
-
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java
deleted file mode 100644
index e7bec5b..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class FloatValueImpl extends PrimitiveValueImpl
-                            implements FloatValue {
-    private float value;
-
-    FloatValueImpl(VirtualMachine aVm,float aValue) {
-        super(aVm);
-
-        value = aValue;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof FloatValue)) {
-            return (value == ((FloatValue)obj).value()) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return intValue();
-    }
-
-    public int compareTo(FloatValue floatVal) {
-        float other = floatVal.value();
-        if (value() < other) {
-            return -1;
-        } else if (value() == other) {
-            return 0;
-        } else {
-            return 1;
-        }
-    }
-
-    public Type type() {
-        return vm.theFloatType();
-    }
-
-    public float value() {
-        return value;
-    }
-
-    public boolean booleanValue() {
-        return(value == 0.0)?false:true;
-    }
-
-    public byte byteValue() {
-        return(byte)value;
-    }
-
-    public char charValue() {
-        return(char)value;
-    }
-
-    public short shortValue() {
-        return(short)value;
-    }
-
-    public int intValue() {
-        return(int)value;
-    }
-
-    public long longValue() {
-        return(long)value;
-    }
-
-    public float floatValue() {
-        return(float)value;
-    }
-
-    public double doubleValue() {
-        return(double)value;
-    }
-
-    byte checkedByteValue() throws InvalidTypeException {
-        if ((value > Byte.MAX_VALUE) || (value < Byte.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to byte");
-        } else {
-            return super.checkedByteValue();
-        }
-    }
-
-    char checkedCharValue() throws InvalidTypeException {
-        if ((value > Character.MAX_VALUE) || (value < Character.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to char");
-        } else {
-            return super.checkedCharValue();
-        }
-    }
-
-    short checkedShortValue() throws InvalidTypeException {
-        if ((value > Short.MAX_VALUE) || (value < Short.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to short");
-        } else {
-            return super.checkedShortValue();
-        }
-    }
-
-    int checkedIntValue() throws InvalidTypeException {
-        int intValue = (int)value;
-        if (intValue != value) {
-            throw new InvalidTypeException("Can't convert " + value + " to int");
-        } else {
-            return super.checkedIntValue();
-        }
-    }
-
-    long checkedLongValue() throws InvalidTypeException {
-        long longValue = (long)value;
-        if (longValue != value) {
-            throw new InvalidTypeException("Can't convert " + value + " to long");
-        } else {
-            return super.checkedLongValue();
-        }
-    }
-
-    public String toString() {
-        return "" + value;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java
deleted file mode 100644
index 60344b7..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class IntegerTypeImpl extends PrimitiveTypeImpl implements IntegerType {
-    IntegerTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-    public String signature() {
-        return "I";
-    }
-
-    PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException {
-        return vm.mirrorOf(((PrimitiveValueImpl)value).checkedIntValue());
-    }
-
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java
deleted file mode 100644
index 461686e..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class IntegerValueImpl extends PrimitiveValueImpl
-                              implements IntegerValue {
-    private int value;
-
-    IntegerValueImpl(VirtualMachine aVm,int aValue) {
-        super(aVm);
-
-        value = aValue;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof IntegerValue)) {
-            return (value == ((IntegerValue)obj).value()) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return intValue();
-    }
-
-    public int compareTo(IntegerValue integerVal) {
-        return value() - integerVal.value();
-    }
-
-    public Type type() {
-        return vm.theIntegerType();
-    }
-
-    public int value() {
-        return value;
-    }
-
-    public boolean booleanValue() {
-        return(value == 0)?false:true;
-    }
-
-    public byte byteValue() {
-        return(byte)value;
-    }
-
-    public char charValue() {
-        return(char)value;
-    }
-
-    public short shortValue() {
-        return(short)value;
-    }
-
-    public int intValue() {
-        return(int)value;
-    }
-
-    public long longValue() {
-        return(long)value;
-    }
-
-    public float floatValue() {
-        return(float)value;
-    }
-
-    public double doubleValue() {
-        return(double)value;
-    }
-
-    byte checkedByteValue() throws InvalidTypeException {
-        if ((value > Byte.MAX_VALUE) || (value < Byte.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to byte");
-        } else {
-            return super.checkedByteValue();
-        }
-    }
-
-    char checkedCharValue() throws InvalidTypeException {
-        if ((value > Character.MAX_VALUE) || (value < Character.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to char");
-        } else {
-            return super.checkedCharValue();
-        }
-    }
-
-    short checkedShortValue() throws InvalidTypeException {
-        if ((value > Short.MAX_VALUE) || (value < Short.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to short");
-        } else {
-            return super.checkedShortValue();
-        }
-    }
-
-    public String toString() {
-        return "" + value;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java
deleted file mode 100644
index 4bc4201..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import java.lang.ref.SoftReference;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import sun.jvm.hotspot.oops.InstanceKlass;
-
-import com.sun.jdi.ClassNotPreparedException;
-import com.sun.jdi.ClassType;
-import com.sun.jdi.InterfaceType;
-import com.sun.jdi.Method;
-import com.sun.jdi.ReferenceType;
-import com.sun.jdi.VirtualMachine;
-
-public class InterfaceTypeImpl extends ReferenceTypeImpl
-                               implements InterfaceType {
-    private SoftReference superInterfacesCache = null;
-    private SoftReference subInterfacesCache = null;
-    private SoftReference implementorsCache = null;
-
-    protected InterfaceTypeImpl(VirtualMachine aVm, InstanceKlass aRef) {
-        super(aVm, aRef);
-    }
-
-    public List superinterfaces() throws ClassNotPreparedException {
-        List superinterfaces = (superInterfacesCache != null)? (List) superInterfacesCache.get() : null;
-        if (superinterfaces == null) {
-            checkPrepared();
-            superinterfaces = Collections.unmodifiableList(getInterfaces());
-            superInterfacesCache = new SoftReference(superinterfaces);
-        }
-        return superinterfaces;
-    }
-
-    public List subinterfaces() {
-        List subinterfaces = (subInterfacesCache != null)? (List) subInterfacesCache.get() : null;
-        if (subinterfaces == null) {
-            List all = vm.allClasses();
-            subinterfaces = new ArrayList();
-            Iterator iter = all.iterator();
-            while (iter.hasNext()) {
-                ReferenceType refType = (ReferenceType)iter.next();
-                if (refType instanceof InterfaceType) {
-                    InterfaceType interfaze = (InterfaceType)refType;
-                    if (interfaze.isPrepared() && interfaze.superinterfaces().contains(this)) {
-                        subinterfaces.add(interfaze);
-                    }
-               }
-            }
-            subinterfaces = Collections.unmodifiableList(subinterfaces);
-            subInterfacesCache = new SoftReference(subinterfaces);
-        }
-        return subinterfaces;
-    }
-
-    public List implementors() {
-        List implementors = (implementorsCache != null)? (List) implementorsCache.get() : null;
-        if (implementors == null) {
-            List all = vm.allClasses();
-            implementors = new ArrayList();
-            Iterator iter = all.iterator();
-            while (iter.hasNext()) {
-                ReferenceType refType = (ReferenceType)iter.next();
-                if (refType instanceof ClassType) {
-                    ClassType clazz = (ClassType)refType;
-                    if (clazz.isPrepared() && clazz.interfaces().contains(this)) {
-                        implementors.add(clazz);
-                    }
-                }
-            }
-            implementors = Collections.unmodifiableList(implementors);
-            implementorsCache = new SoftReference(implementors);
-        }
-        return implementors;
-    }
-
-    @Override
-    void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces) {
-        /*
-         * Add methods from
-         * parent types first, so that the methods in this class will
-         * overwrite them in the hash table
-         */
-        Iterator<InterfaceType> iter = superinterfaces().iterator();
-        while (iter.hasNext()) {
-            InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
-            if (!seenInterfaces.contains(interfaze)) {
-                interfaze.addVisibleMethods(methodMap, seenInterfaces);
-                seenInterfaces.add(interfaze);
-            }
-        }
-
-        addToMethodMap(methodMap, methods());
-    }
-
-    List getAllMethods() {
-        ArrayList list = new ArrayList(methods());
-        /*
-         * It's more efficient if don't do this
-         * recursively.
-         */
-        List interfaces = allSuperinterfaces();
-        Iterator iter = interfaces.iterator();
-        while (iter.hasNext()) {
-            InterfaceType interfaze = (InterfaceType)iter.next();
-            list.addAll(interfaze.methods());
-        }
-
-        return list;
-    }
-
-    List allSuperinterfaces() {
-        ArrayList list = new ArrayList();
-        addSuperinterfaces(list);
-        return list;
-    }
-
-    void addSuperinterfaces(List list) {
-        /*
-         * This code is a little strange because it
-         * builds the list with a more suitable order than the
-         * depth-first approach a normal recursive solution would
-         * take. Instead, all direct superinterfaces precede all
-         * indirect ones.
-         */
-
-        /*
-         * Get a list of direct superinterfaces that's not already in the
-         * list being built.
-         */
-        List immediate = new ArrayList(superinterfaces());
-        Iterator iter = immediate.iterator();
-        while (iter.hasNext()) {
-            InterfaceType interfaze = (InterfaceType)iter.next();
-            if (list.contains(interfaze)) {
-                iter.remove();
-            }
-        }
-
-        /*
-         * Add all new direct superinterfaces
-         */
-        list.addAll(immediate);
-
-        /*
-         * Recurse for all new direct superinterfaces.
-         */
-        iter = immediate.iterator();
-        while (iter.hasNext()) {
-            InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
-            interfaze.addSuperinterfaces(list);
-        }
-    }
-
-    boolean isAssignableTo(ReferenceType type) {
-
-        // Exact match?
-        if (this.equals(type)) {
-            return true;
-        } else {
-            // Try superinterfaces.
-            List supers = superinterfaces();
-            Iterator iter = supers.iterator();
-            while (iter.hasNext()) {
-                InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
-                if (interfaze.isAssignableTo(type)) {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-    }
-
-    List inheritedTypes() {
-        return superinterfaces();
-    }
-
-    public boolean isInitialized() {
-        return isPrepared();
-    }
-
-    public String toString() {
-       return "interface " + name() + " (" + loaderString() + ")";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java
deleted file mode 100644
index 031734c..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import java.util.List;
-import java.util.ArrayList;
-
-public class JNITypeParser {
-
-    static final char SIGNATURE_ENDCLASS = ';';
-    static final char SIGNATURE_FUNC = '(';
-    static final char SIGNATURE_ENDFUNC = ')';
-
-    private String signature;
-    private List typeNameList;
-    private List signatureList;
-    private int currentIndex;
-
-    JNITypeParser(String signature) {
-        this.signature = signature;
-    }
-
-    static String typeNameToSignature(String signature) {
-        StringBuffer buffer = new StringBuffer();
-        int firstIndex = signature.indexOf('[');
-        int index = firstIndex;
-        while (index != -1) {
-            buffer.append('[');
-            index = signature.indexOf('[', index + 1);
-        }
-
-        if (firstIndex != -1) {
-            signature = signature.substring(0, firstIndex);
-        }
-
-        if (signature.equals("boolean")) {
-            buffer.append('Z');
-        } else if (signature.equals("byte")) {
-            buffer.append('B');
-        } else if (signature.equals("char")) {
-            buffer.append('C');
-        } else if (signature.equals("short")) {
-            buffer.append('S');
-        } else if (signature.equals("int")) {
-            buffer.append('I');
-        } else if (signature.equals("long")) {
-            buffer.append('J');
-        } else if (signature.equals("float")) {
-            buffer.append('F');
-        } else if (signature.equals("double")) {
-            buffer.append('D');
-        } else {
-            buffer.append('L');
-            buffer.append(signature.replace('.', '/'));
-            buffer.append(';');
-        }
-
-        return buffer.toString();
-    }
-
-    String typeName() {
-        return (String)typeNameList().get(typeNameList().size()-1);
-    }
-
-    List argumentTypeNames() {
-        return typeNameList().subList(0, typeNameList().size() - 1);
-    }
-
-    String signature() {
-        return (String)signatureList().get(signatureList().size()-1);
-    }
-
-    List argumentSignatures() {
-        return signatureList().subList(0, signatureList().size() - 1);
-    }
-
-    int dimensionCount() {
-        int count = 0;
-        String signature = signature();
-        while (signature.charAt(count) == '[') {
-            count++;
-        }
-        return count;
-    }
-
-    String componentSignature(int level) {
-        return signature().substring(level);
-    }
-
-    private synchronized List signatureList() {
-        if (signatureList == null) {
-            signatureList = new ArrayList(10);
-            String elem;
-
-            currentIndex = 0;
-
-            while(currentIndex < signature.length()) {
-                elem = nextSignature();
-                signatureList.add(elem);
-            }
-            if (signatureList.size() == 0) {
-                throw new IllegalArgumentException("Invalid JNI signature '" +
-                                                   signature + "'");
-            }
-        }
-        return signatureList;
-    }
-
-    private synchronized List typeNameList() {
-        if (typeNameList == null) {
-            typeNameList = new ArrayList(10);
-            String elem;
-
-            currentIndex = 0;
-
-            while(currentIndex < signature.length()) {
-                elem = nextTypeName();
-                typeNameList.add(elem);
-            }
-            if (typeNameList.size() == 0) {
-                throw new IllegalArgumentException("Invalid JNI signature '" +
-                                                   signature + "'");
-            }
-        }
-        return typeNameList;
-    }
-
-    private String nextSignature() {
-        char key = signature.charAt(currentIndex++);
-
-        switch(key) {
-            case '[':
-                return  key + nextSignature();
-
-            case 'L':
-                int endClass = signature.indexOf(SIGNATURE_ENDCLASS,
-                                                 currentIndex);
-                String retVal = signature.substring(currentIndex - 1,
-                                                    endClass + 1);
-                currentIndex = endClass + 1;
-                return retVal;
-
-            case 'V':
-            case 'Z':
-            case 'B':
-            case 'C':
-            case 'S':
-            case 'I':
-            case 'J':
-            case 'F':
-            case 'D':
-                return String.valueOf(key);
-
-            case SIGNATURE_FUNC:
-            case SIGNATURE_ENDFUNC:
-                return nextSignature();
-
-            default:
-                throw new IllegalArgumentException(
-                    "Invalid JNI signature character '" + key + "'");
-
-        }
-    }
-
-    private String nextTypeName() {
-        char key = signature.charAt(currentIndex++);
-
-        switch(key) {
-            case '[':
-                return  nextTypeName() + "[]";
-
-            case 'B':
-                return "byte";
-
-            case 'C':
-                return "char";
-
-            case 'L':
-                int endClass = signature.indexOf(SIGNATURE_ENDCLASS,
-                                                 currentIndex);
-                String retVal = signature.substring(currentIndex,
-                                                    endClass);
-                retVal = retVal.replace('/','.');
-                currentIndex = endClass + 1;
-                return retVal;
-
-            case 'F':
-                return "float";
-
-            case 'D':
-                return "double";
-
-            case 'I':
-                return "int";
-
-            case 'J':
-                return "long";
-
-            case 'S':
-                return "short";
-
-            case 'V':
-                return "void";
-
-            case 'Z':
-                return "boolean";
-
-            case SIGNATURE_ENDFUNC:
-            case SIGNATURE_FUNC:
-                return nextTypeName();
-
-            default:
-                throw new IllegalArgumentException(
-                    "Invalid JNI signature character '" + key + "'");
-
-        }
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java
deleted file mode 100644
index 0dcb772..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-// from JVMTI specification - refer to jvmti.xml
-public interface JVMTIThreadState {
-    public static final int JVMTI_THREAD_STATE_ALIVE = 0x0001;
-    public static final int JVMTI_THREAD_STATE_TERMINATED = 0x0002;
-    public static final int JVMTI_THREAD_STATE_RUNNABLE = 0x0004;
-    public static final int JVMTI_THREAD_STATE_WAITING = 0x0080;
-    public static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
-    public static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
-    public static final int JVMTI_THREAD_STATE_SLEEPING = 0x0040;
-    public static final int JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 0x0100;
-    public static final int JVMTI_THREAD_STATE_PARKED = 0x0200;
-    public static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400;
-    public static final int JVMTI_THREAD_STATE_SUSPENDED = 0x100000;
-    public static final int JVMTI_THREAD_STATE_INTERRUPTED = 0x200000;
-    public static final int JVMTI_THREAD_STATE_IN_NATIVE = 0x400000;
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LineInfo.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LineInfo.java
deleted file mode 100644
index 840c077..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LineInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-interface LineInfo {
-
-    String liStratum();
-
-    int liLineNumber();
-
-    String liSourceName() throws AbsentInformationException;
-
-    String liSourcePath() throws AbsentInformationException;
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java
deleted file mode 100644
index da3ed8c..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-import com.sun.jdi.*;
-
-public class LocalVariableImpl extends MirrorImpl
-                               implements LocalVariable, ValueContainer
-{
-    private final Method method;
-    private final int slot;
-    private final Location scopeStart;
-    private final Location scopeEnd;
-    private final String name;
-    private final String signature;
-    private final String genericSignature;
-
-    LocalVariableImpl(VirtualMachine vm, Method method,
-                      int slot, Location scopeStart, Location scopeEnd,
-                      String name, String signature, String genericSignature) {
-        super(vm);
-        this.method = method;
-        this.slot = slot;
-        this.scopeStart = scopeStart;
-        this.scopeEnd = scopeEnd;
-        this.name = name;
-        this.signature = signature;
-        this.genericSignature = genericSignature;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof LocalVariableImpl)) {
-            LocalVariableImpl other = (LocalVariableImpl)obj;
-            return (method.equals(other.method) &&
-                    slot() == other.slot() &&
-                    super.equals(obj));
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return (int)method.hashCode() + slot();
-    }
-
-    public int compareTo(LocalVariable localVar) {
-        LocalVariableImpl other = (LocalVariableImpl) localVar;
-        int rc = method.compareTo(other.method);
-        if (rc == 0) {
-            rc = slot() - other.slot();
-        }
-        return rc;
-    }
-
-    public String name() {
-        return name;
-    }
-
-    /**
-     * @return a text representation of the declared type
-     * of this variable.
-     */
-    public String typeName() {
-        JNITypeParser parser = new JNITypeParser(signature);
-        return parser.typeName();
-    }
-
-    public Type type() throws ClassNotLoadedException {
-        return findType(signature());
-    }
-
-    public Type findType(String signature) throws ClassNotLoadedException {
-        ReferenceTypeImpl enclosing = (ReferenceTypeImpl)method.declaringType();
-        return enclosing.findType(signature);
-    }
-
-    public String signature() {
-        return signature;
-    }
-
-    public String genericSignature() {
-        return genericSignature;
-    }
-
-    public boolean isVisible(StackFrame frame) {
-        //validateMirror(frame);
-        Method frameMethod = frame.location().method();
-
-        if (!frameMethod.equals(method)) {
-            throw new IllegalArgumentException(
-                       "frame method different than variable's method");
-        }
-
-        // this is here to cover the possibility that we will
-        // allow LocalVariables for native methods.  If we do
-        // so we will have to re-examinine this.
-        if (frameMethod.isNative()) {
-            return false;
-        }
-
-        return ((scopeStart.compareTo(frame.location()) <= 0)
-             && (scopeEnd.compareTo(frame.location()) >= 0));
-    }
-
-    public boolean isArgument() {
-        try {
-            MethodImpl method = (MethodImpl)scopeStart.method();
-            return (slot < method.argSlotCount());
-        } catch (AbsentInformationException e) {
-            // If this variable object exists, there shouldn't be absent info
-            throw (InternalException) new InternalException().initCause(e);
-        }
-    }
-
-    int slot() {
-        return slot;
-    }
-
-    /*
-     * Compilers/VMs can have byte code ranges for variables of the
-     * same names that overlap. This is because the byte code ranges
-     * aren't necessarily scopes; they may have more to do with the
-     * lifetime of the variable's slot, depending on implementation.
-     *
-     * This method determines whether this variable hides an
-     * identically named variable; ie, their byte code ranges overlap
-     * this one starts after the given one. If it returns true this
-     * variable should be preferred when looking for a single variable
-     * with its name when both variables are visible.
-     */
-    boolean hides(LocalVariable other) {
-        LocalVariableImpl otherImpl = (LocalVariableImpl)other;
-        if (!method.equals(otherImpl.method) ||
-            !name.equals(otherImpl.name)) {
-            return false;
-        } else {
-            return (scopeStart.compareTo(otherImpl.scopeStart) > 0);
-        }
-    }
-
-    public String toString() {
-       return name() + " in " + method.toString() +
-              "@" + scopeStart.toString();
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java
deleted file mode 100644
index ab686ac..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-import java.util.*;
-
-public class LocationImpl extends MirrorImpl implements Location {
-    private final ReferenceTypeImpl declaringType;
-    private Method method;
-    private sun.jvm.hotspot.oops.Method methodRef;
-    private long codeIndex;
-    private LineInfo baseLineInfo = null;
-    private LineInfo otherLineInfo = null;
-
-    LocationImpl(VirtualMachine vm,
-                 Method method, long codeIndex) {
-        super(vm);
-
-        this.method = method;
-        this.codeIndex = method.isNative()? -1 : codeIndex;
-        this.declaringType = (ReferenceTypeImpl)method.declaringType();
-    }
-
-    /*
-     * This constructor allows lazy creation of the method mirror. This
-     * can be a performance savings if the method mirror does not yet
-     * exist.
-     */
-    LocationImpl(VirtualMachine vm, ReferenceType declaringType,
-                 sun.jvm.hotspot.oops.Method methodRef, long codeIndex) {
-        super(vm);
-
-        this.method = null;
-        this.codeIndex = codeIndex;
-        this.declaringType = (ReferenceTypeImpl)declaringType;
-        this.methodRef = methodRef;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof Location)) {
-            Location other = (Location)obj;
-            return (method().equals(other.method())) &&
-                   (codeIndex() == other.codeIndex()) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: better hash code?
-         */
-        return method().hashCode() + (int)codeIndex();
-    }
-
-    public int compareTo(Location other) {
-        int rc = method().compareTo(other.method());
-        if (rc == 0) {
-            long diff = codeIndex() - other.codeIndex();
-            if (diff < 0)
-                return -1;
-            else if (diff > 0)
-                return 1;
-            else
-                return 0;
-        }
-        return rc;
-    }
-
-    public ReferenceType declaringType() {
-        return declaringType;
-    }
-
-    public Method method() {
-        if (method == null) {
-            method = declaringType.getMethodMirror(methodRef);
-            if (method.isNative()) {
-                codeIndex = -1;
-            }
-        }
-        return method;
-    }
-
-    public long codeIndex() {
-        method();  // be sure information is up-to-date
-        return codeIndex;
-    }
-
-    LineInfo getBaseLineInfo(SDE.Stratum stratum) {
-        LineInfo lineInfo;
-
-        /* check if there is cached info to use */
-        if (baseLineInfo != null) {
-            return baseLineInfo;
-        }
-
-        /* compute the line info */
-        MethodImpl methodImpl = (MethodImpl)method();
-         lineInfo = methodImpl.codeIndexToLineInfo(stratum,
-                                                   codeIndex());
-
-        /* cache it */
-        addBaseLineInfo(lineInfo);
-
-        return lineInfo;
-    }
-
-    LineInfo getLineInfo(SDE.Stratum stratum) {
-        LineInfo lineInfo;
-
-        /* base stratum is done slighly differently */
-        if (stratum.isJava()) {
-            return getBaseLineInfo(stratum);
-        }
-
-        /* check if there is cached info to use */
-        lineInfo = otherLineInfo; // copy because of concurrency
-        if (lineInfo != null &&
-                           stratum.id().equals(lineInfo.liStratum())) {
-            return lineInfo;
-        }
-        int baseLineNumber = lineNumber(SDE.BASE_STRATUM_NAME);
-        SDE.LineStratum lineStratum =
-                  stratum.lineStratum(declaringType, baseLineNumber);
-
-        if (lineStratum != null && lineStratum.lineNumber() != -1) {
-            lineInfo = new StratumLineInfo(stratum.id(),
-                                           lineStratum.lineNumber(),
-                                           lineStratum.sourceName(),
-                                           lineStratum.sourcePath());
-        } else {
-            /* find best match */
-            MethodImpl methodImpl = (MethodImpl)method();
-            lineInfo = methodImpl.codeIndexToLineInfo(stratum,
-                                                      codeIndex());
-        }
-
-        /* cache it */
-        addStratumLineInfo(lineInfo);
-
-        return lineInfo;
-    }
-
-    void addStratumLineInfo(LineInfo lineInfo) {
-        otherLineInfo = lineInfo;
-    }
-
-    void addBaseLineInfo(LineInfo lineInfo) {
-        baseLineInfo = lineInfo;
-    }
-
-    public String sourceName() throws AbsentInformationException {
-        return sourceName(vm.getDefaultStratum());
-    }
-
-    public String sourceName(String stratumID)
-                               throws AbsentInformationException {
-        return sourceName(declaringType.stratum(stratumID));
-    }
-
-    String sourceName(SDE.Stratum stratum)
-                               throws AbsentInformationException {
-        return getLineInfo(stratum).liSourceName();
-    }
-
-    public String sourcePath() throws AbsentInformationException {
-        return sourcePath(vm.getDefaultStratum());
-    }
-
-    public String sourcePath(String stratumID)
-                               throws AbsentInformationException {
-        return sourcePath(declaringType.stratum(stratumID));
-    }
-
-    String sourcePath(SDE.Stratum stratum)
-                               throws AbsentInformationException {
-        return getLineInfo(stratum).liSourcePath();
-    }
-
-    public int lineNumber() {
-        return lineNumber(vm.getDefaultStratum());
-    }
-
-    public int lineNumber(String stratumID) {
-        return lineNumber(declaringType.stratum(stratumID));
-    }
-
-    int lineNumber(SDE.Stratum stratum) {
-        return getLineInfo(stratum).liLineNumber();
-    }
-
-    public String toString() {
-        if (lineNumber() == -1) {
-            return method().toString() + "+" + codeIndex();
-        } else {
-            return declaringType().name() + ":" + lineNumber();
-        }
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java
deleted file mode 100644
index e941cd6..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class LongTypeImpl extends PrimitiveTypeImpl implements LongType {
-    LongTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-
-    public String signature() {
-        return "J";
-    }
-
-    PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException {
-        return vm.mirrorOf(((PrimitiveValueImpl)value).checkedLongValue());
-    }
-
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java
deleted file mode 100644
index da41844..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class LongValueImpl extends PrimitiveValueImpl
-                           implements LongValue {
-    private long value;
-
-    LongValueImpl(VirtualMachine aVm,long aValue) {
-        super(aVm);
-
-        value = aValue;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof LongValue)) {
-            return (value == ((LongValue)obj).value()) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return intValue();
-    }
-
-    public int compareTo(LongValue longVal) {
-        long other = longVal.value();
-        if (value() < other) {
-            return -1;
-        } else if (value() == other) {
-            return 0;
-        } else {
-            return 1;
-        }
-    }
-
-    public Type type() {
-        return vm.theLongType();
-    }
-
-    public long value() {
-        return value;
-    }
-
-    public boolean booleanValue() {
-        return(value == 0)?false:true;
-    }
-
-    public byte byteValue() {
-        return(byte)value;
-    }
-
-    public char charValue() {
-        return(char)value;
-    }
-
-    public short shortValue() {
-        return(short)value;
-    }
-
-    public int intValue() {
-        return(int)value;
-    }
-
-    public long longValue() {
-        return(long)value;
-    }
-
-    public float floatValue() {
-        return(float)value;
-    }
-
-    public double doubleValue() {
-        return(double)value;
-    }
-
-    byte checkedByteValue() throws InvalidTypeException {
-        if ((value > Byte.MAX_VALUE) || (value < Byte.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to byte");
-        } else {
-            return super.checkedByteValue();
-        }
-    }
-
-    char checkedCharValue() throws InvalidTypeException {
-        if ((value > Character.MAX_VALUE) || (value < Character.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to char");
-        } else {
-            return super.checkedCharValue();
-        }
-    }
-
-    short checkedShortValue() throws InvalidTypeException {
-        if ((value > Short.MAX_VALUE) || (value < Short.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to short");
-        } else {
-            return super.checkedShortValue();
-        }
-    }
-
-    int checkedIntValue() throws InvalidTypeException {
-        if ((value > Integer.MAX_VALUE) || (value < Integer.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to int");
-        } else {
-            return super.checkedIntValue();
-        }
-    }
-
-    public String toString() {
-        return "" + value;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java
deleted file mode 100644
index 5853a91..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-import sun.jvm.hotspot.oops.Symbol;
-import sun.jvm.hotspot.oops.LocalVariableTableElement;
-import java.util.List;
-import java.util.Iterator;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.lang.ref.SoftReference;
-import java.util.Collections;
-
-public abstract class MethodImpl extends TypeComponentImpl implements Method {
-    private JNITypeParser signatureParser;
-    protected sun.jvm.hotspot.oops.Method saMethod;
-
-    abstract int argSlotCount() throws AbsentInformationException;
-    abstract List allLineLocations(SDE.Stratum stratum,
-                                   String sourceName)
-                           throws AbsentInformationException;
-    abstract List locationsOfLine(SDE.Stratum stratum,
-                                  String sourceName,
-                                  int lineNumber)
-                           throws AbsentInformationException;
-
-    static MethodImpl createMethodImpl(VirtualMachine vm, ReferenceTypeImpl declaringType,
-                                       sun.jvm.hotspot.oops.Method saMethod) {
-        // Someday might have to add concrete and non-concrete subclasses.
-        if (saMethod.isNative() || saMethod.isAbstract()) {
-            return new NonConcreteMethodImpl(vm, declaringType, saMethod);
-        } else {
-            return new ConcreteMethodImpl(vm, declaringType, saMethod);
-        }
-    }
-
-    MethodImpl(VirtualMachine vm, ReferenceTypeImpl declaringType,
-               sun.jvm.hotspot.oops.Method saMethod ) {
-        super(vm, declaringType);
-        this.saMethod = saMethod;
-        getParser();
-    }
-
-    private JNITypeParser getParser() {
-        if (signatureParser == null) {
-            Symbol sig1 = saMethod.getSignature();
-            signature = sig1.asString();
-            signatureParser = new JNITypeParser(signature);
-        }
-        return signatureParser;
-    }
-
-    // Object ref() {
-    sun.jvm.hotspot.oops.Method ref() {
-        return saMethod;
-    }
-
-    public String genericSignature() {
-        Symbol genSig = saMethod.getGenericSignature();
-        return (genSig != null)? genSig.asString() : null;
-    }
-
-    public String returnTypeName() {
-        return getParser().typeName();
-    }
-
-    public Type returnType() throws ClassNotLoadedException {
-        return findType(getParser().signature());
-    }
-
-    private Type findType(String signature) throws ClassNotLoadedException {
-        ReferenceTypeImpl enclosing = (ReferenceTypeImpl)declaringType();
-        return enclosing.findType(signature);
-    }
-
-    public List argumentTypeNames() {
-        return getParser().argumentTypeNames();
-    }
-
-    List argumentSignatures() {
-        return getParser().argumentSignatures();
-    }
-
-    Type argumentType(int index) throws ClassNotLoadedException {
-        ReferenceTypeImpl enclosing = (ReferenceTypeImpl)declaringType();
-        String signature = (String)argumentSignatures().get(index);
-        return enclosing.findType(signature);
-    }
-
-    public List argumentTypes() throws ClassNotLoadedException {
-        int size = argumentSignatures().size();
-        ArrayList types = new ArrayList(size);
-        for (int i = 0; i < size; i++) {
-            Type type = argumentType(i);
-            types.add(type);
-        }
-        return types;
-    }
-
-    public boolean isAbstract() {
-        return saMethod.isAbstract();
-    }
-
-    public boolean isBridge() {
-        return saMethod.isBridge();
-    }
-
-    public boolean isSynchronized() {
-        return saMethod.isSynchronized();
-    }
-
-    public boolean isNative() {
-        return saMethod.isNative();
-    }
-
-    public boolean isVarArgs() {
-        return saMethod.isVarArgs();
-    }
-
-    public boolean isConstructor() {
-        return saMethod.isConstructor();
-    }
-
-    public boolean isStaticInitializer() {
-        return saMethod.isStaticInitializer();
-    }
-
-    public boolean isObsolete() {
-        return saMethod.isObsolete();
-    }
-
-    public final List allLineLocations()
-                           throws AbsentInformationException {
-        return allLineLocations(vm.getDefaultStratum(), null);
-    }
-
-    public List allLineLocations(String stratumID,
-                                 String sourceName)
-                           throws AbsentInformationException {
-        return allLineLocations(declaringType.stratum(stratumID),
-                                sourceName);
-    }
-
-    public final List locationsOfLine(int lineNumber)
-                           throws AbsentInformationException {
-        return locationsOfLine(vm.getDefaultStratum(),
-                               null, lineNumber);
-    }
-
-    public List locationsOfLine(String stratumID,
-                                String sourceName,
-                                int lineNumber)
-                           throws AbsentInformationException {
-        return locationsOfLine(declaringType.stratum(stratumID),
-                               sourceName, lineNumber);
-    }
-
-    LineInfo codeIndexToLineInfo(SDE.Stratum stratum,
-                                 long codeIndex) {
-        if (stratum.isJava()) {
-            return new BaseLineInfo(-1, declaringType);
-        } else {
-            return new StratumLineInfo(stratum.id(), -1,
-                                       null, null);
-        }
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof MethodImpl)) {
-            MethodImpl other = (MethodImpl)obj;
-            return (declaringType().equals(other.declaringType())) &&
-                (ref().equals(other.ref())) &&
-                super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    // From interface Comparable
-    public int compareTo(Method method) {
-        ReferenceTypeImpl declaringType = (ReferenceTypeImpl)declaringType();
-         int rc = declaringType.compareTo(method.declaringType());
-         if (rc == 0) {
-           rc = declaringType.indexOf(this) -
-               declaringType.indexOf(method);
-         }
-         return rc;
-    }
-
-    // from interface Mirror
-    public String toString() {
-        StringBuffer sb = new StringBuffer();
-        sb.append(declaringType().name());
-        sb.append(".");
-        sb.append(name());
-        sb.append("(");
-        boolean first = true;
-        for (Iterator it = argumentTypeNames().iterator(); it.hasNext();) {
-            if (!first) {
-                sb.append(", ");
-            }
-            sb.append((String)it.next());
-            first = false;
-        }
-        sb.append(")");
-        return sb.toString();
-    }
-
-    public String name() {
-        Symbol myName = saMethod.getName();
-        return myName.asString();
-    }
-
-    public int modifiers() {
-        return saMethod.getAccessFlagsObj().getStandardFlags();
-    }
-
-    public boolean isPackagePrivate() {
-        return saMethod.isPackagePrivate();
-    }
-
-    public boolean isPrivate() {
-        return saMethod.isPrivate();
-    }
-
-    public boolean isProtected() {
-        return saMethod.isProtected();
-    }
-
-    public boolean isPublic() {
-        return saMethod.isPublic();
-    }
-
-    public boolean isStatic() {
-        return saMethod.isStatic();
-    }
-
-    public boolean isSynthetic() {
-        return saMethod.isSynthetic();
-    }
-
-    public boolean isFinal() {
-        return saMethod.isFinal();
-    }
-
-    public int hashCode() {
-        return saMethod.hashCode();
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java
deleted file mode 100644
index cf61c1f..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-abstract class MirrorImpl extends Object implements Mirror {
-    protected VirtualMachineImpl vm;
-
-    MirrorImpl(VirtualMachine aVm) {
-        super();
-
-        // Yes, its a bit of a hack. But by doing it this
-        // way, this is the only place we have to change
-        // typing to substitute a new impl.
-        vm = (VirtualMachineImpl)aVm;
-    }
-
-    public VirtualMachine virtualMachine() {
-        return vm;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof Mirror)) {
-            Mirror other = (Mirror)obj;
-            return vm.equals(other.virtualMachine());
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        return vm.hashCode();
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java
deleted file mode 100644
index 3df6ef5..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2005, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-// FIXME: This class should implement com.sun.jdi.MonitorInfo.
-//        So fix this when hotspot is started to build with
-//        jdk1.6.
-public class MonitorInfoImpl extends MirrorImpl {
-
-    /* Once false, monitorInfo should not be used.
-     * access synchronized on (vm.state())
-     */
-    private boolean isValid = true;
-
-    ObjectReference monitor;
-    ThreadReference thread;
-    int  stack_depth;
-
-    MonitorInfoImpl(VirtualMachine vm, ObjectReference mon,
-                    ThreadReference thread, int dpth) {
-        super(vm);
-        this.monitor = mon;
-        this.thread = thread;
-        this.stack_depth = dpth;
-    }
-
-    private void validateMonitorInfo() {
-        if (!isValid) {
-            throw new InvalidStackFrameException("Thread has been resumed");
-        }
-    }
-
-    public ObjectReference monitor() {
-        validateMonitorInfo();
-        return monitor;
-    }
-
-    public int stackDepth() {
-        validateMonitorInfo();
-        return stack_depth;
-    }
-
-    public ThreadReference thread() {
-        validateMonitorInfo();
-        return thread;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java
deleted file mode 100644
index 45c4ba2..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.HashMap;
-import java.util.ArrayList;
-import java.util.Collections;
-
-/**
- * Represents non-concrete (that is, native or abstract) methods.
- * Private to MethodImpl.
- */
-public class NonConcreteMethodImpl extends MethodImpl {
-
-    private Location location = null;
-
-    NonConcreteMethodImpl(VirtualMachine vm,
-                          ReferenceTypeImpl declaringType,
-                          sun.jvm.hotspot.oops.Method saMethod) {
-        super(vm, declaringType, saMethod);
-    }
-
-    public Location location() {
-        if (isAbstract()) {
-            return null;
-        }
-        if (location == null) {
-            location = new LocationImpl(vm, this, -1);
-        }
-        return location;
-    }
-
-    public List allLineLocations(String stratumID,
-                                 String sourceName) {
-        return new ArrayList(0);
-    }
-
-    public List allLineLocations(SDE.Stratum stratum,
-                                 String sourceName) {
-        return new ArrayList(0);
-    }
-
-    public List locationsOfLine(String stratumID,
-                                String sourceName,
-                                int lineNumber) {
-        return new ArrayList(0);
-    }
-
-    public List locationsOfLine(SDE.Stratum stratum,
-                                String sourceName,
-                                int lineNumber) {
-        return new ArrayList(0);
-    }
-
-    public Location locationOfCodeIndex(long codeIndex) {
-        return null;
-    }
-
-    LineInfo codeIndexToLineInfo(SDE.Stratum stratum,
-                                 long codeIndex) {
-
-        if (stratum.isJava()) {
-            return new BaseLineInfo(-1, declaringType);
-        } else {
-            return new StratumLineInfo(stratum.id(), -1,
-                                       null, null);
-        }
-    }
-
-    public List variables() throws AbsentInformationException {
-        throw new AbsentInformationException();
-    }
-
-    public List variablesByName(String name) throws AbsentInformationException {
-        throw new AbsentInformationException();
-    }
-
-    public List arguments() throws AbsentInformationException {
-        throw new AbsentInformationException();
-    }
-
-    public byte[] bytecodes() {
-        return new byte[0];
-    }
-
-    int argSlotCount() throws AbsentInformationException {
-        throw new InternalException("should not get here");
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java
deleted file mode 100644
index c2b13f1..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * Copyright (c) 2002, 2009, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import java.io.*;
-import com.sun.jdi.*;
-
-import sun.jvm.hotspot.debugger.Address;
-import sun.jvm.hotspot.debugger.OopHandle;
-import sun.jvm.hotspot.oops.Oop;
-import sun.jvm.hotspot.oops.Mark;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.Array;
-import sun.jvm.hotspot.oops.OopUtilities;
-import sun.jvm.hotspot.oops.Klass;
-import sun.jvm.hotspot.oops.DefaultHeapVisitor;
-import sun.jvm.hotspot.runtime.JavaThread;
-import sun.jvm.hotspot.runtime.JavaVFrame;
-import sun.jvm.hotspot.runtime.MonitorInfo;
-import sun.jvm.hotspot.runtime.ObjectMonitor;
-import sun.jvm.hotspot.runtime.Threads;
-import sun.jvm.hotspot.utilities.Assert;
-
-import java.util.*;
-
-public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
-    private Oop  saObject;
-    private long myID;
-    private boolean monitorInfoCached = false;
-    private ThreadReferenceImpl owningThread = null;
-    private List waitingThreads = null; // List<ThreadReferenceImpl>
-    private int entryCount = 0;
-
-    private static long nextID = 0L;
-    private static synchronized long nextID() {
-        return nextID++;
-    }
-
-    ObjectReferenceImpl(VirtualMachine aVm, sun.jvm.hotspot.oops.Oop oRef) {
-        super(aVm);
-        saObject = oRef;
-        myID = nextID();
-    }
-
-    protected Oop ref() {
-        return saObject;
-    }
-
-    public Type type() {
-        return referenceType();
-    }
-
-    public ReferenceType referenceType() {
-        Klass myKlass = ref().getKlass();
-        return vm.referenceType(myKlass);
-    }
-
-    public Value getValue(Field sig) {
-        List list = new ArrayList(1);
-        list.add(sig);
-        Map map = getValues(list);
-        return(Value)map.get(sig);
-    }
-
-    public Map getValues(List theFields) {
-        //validateMirrors(theFields);
-
-        List staticFields = new ArrayList(0);
-        int size = theFields.size();
-        List instanceFields = new ArrayList(size);
-
-        for (int i=0; i<size; i++) {
-            sun.jvm.hotspot.jdi.FieldImpl field =
-                (sun.jvm.hotspot.jdi.FieldImpl)theFields.get(i);
-
-            // Make sure the field is valid
-            ((ReferenceTypeImpl)referenceType()).validateFieldAccess(field);
-
-            // FIX ME! We need to do some sanity checking
-            // here; make sure the field belongs to this
-            // object.
-            if (field.isStatic()) {
-                staticFields.add(field);
-            } else {
-                instanceFields.add(field);
-            }
-        }
-
-        // Look up static field(s) first to mimic the JDI implementation
-        Map map;
-        if (staticFields.size() > 0) {
-            map = referenceType().getValues(staticFields);
-        } else {
-            map = new HashMap(size);
-        }
-
-        // Then get instance field(s)
-        size = instanceFields.size();
-        for (int ii=0; ii<size; ii++){
-            FieldImpl fieldImpl = (FieldImpl)instanceFields.get(ii);
-            map.put(fieldImpl, fieldImpl.getValue(saObject));
-        }
-
-        return map;
-    }
-
-    public void setValue(Field field, Value value)
-                   throws InvalidTypeException, ClassNotLoadedException {
-        vm.throwNotReadOnlyException("ObjectReference.setValue(...)");
-    }
-
-    public Value invokeMethod(ThreadReference threadIntf, Method methodIntf,
-                              List arguments, int options)
-                              throws InvalidTypeException,
-                                     IncompatibleThreadStateException,
-                                     InvocationException,
-                                     ClassNotLoadedException {
-        vm.throwNotReadOnlyException("ObjectReference.invokeMethod(...)");
-        return null;
-    }
-
-    public void disableCollection() {
-        vm.throwNotReadOnlyException("ObjectReference.disableCollection()");
-    }
-
-    public void enableCollection() {
-        vm.throwNotReadOnlyException("ObjectReference.enableCollection()");
-    }
-
-    public boolean isCollected() {
-        vm.throwNotReadOnlyException("ObjectReference.isCollected()");
-        return false;
-    }
-
-    public long uniqueID() {
-        return myID;
-    }
-
-    public List waitingThreads() throws IncompatibleThreadStateException {
-        if (vm.canGetMonitorInfo() == false) {
-            throw new UnsupportedOperationException();
-        }
-
-        if (! monitorInfoCached) {
-            computeMonitorInfo();
-        }
-        return waitingThreads;
-    }
-
-
-    public ThreadReference owningThread() throws IncompatibleThreadStateException {
-        if (vm.canGetMonitorInfo() == false) {
-            throw new UnsupportedOperationException();
-        }
-
-        if (! monitorInfoCached) {
-            computeMonitorInfo();
-        }
-        return owningThread;
-    }
-
-
-    public int entryCount() throws IncompatibleThreadStateException {
-        if (vm.canGetMonitorInfo() == false) {
-            throw new UnsupportedOperationException();
-        }
-
-        if (! monitorInfoCached) {
-            computeMonitorInfo();
-        }
-        return entryCount;
-    }
-
-    // new method since 1.6.
-    // Real body will be supplied later.
-    public List referringObjects(long maxReferrers) {
-        if (!vm.canGetInstanceInfo()) {
-            throw new UnsupportedOperationException(
-                      "target does not support getting instances");
-        }
-        if (maxReferrers < 0) {
-            throw new IllegalArgumentException("maxReferrers is less than zero: "
-                                              + maxReferrers);
-        }
-        final ObjectReference obj = this;
-        final List objects = new ArrayList(0);
-        final long max = maxReferrers;
-                vm.saObjectHeap().iterate(new DefaultHeapVisitor() {
-                private long refCount = 0;
-                public boolean doObj(Oop oop) {
-                                        try {
-                                                ObjectReference objref = vm.objectMirror(oop);
-                                                List fields = objref.referenceType().allFields();
-                                                for (int i=0; i < fields.size(); i++) {
-                                                        Field fld = (Field)fields.get(i);
-                                                        if (objref.getValue(fld).equals(obj) && !objects.contains(objref)) {
-                                                                objects.add(objref);
-                                                                refCount++;
-                                                        }
-                                                }
-                                                if (max > 0 && refCount >= max) {
-                                                        return true;
-                                                }
-                                        } catch  (RuntimeException x) {
-                                          // Ignore RuntimeException thrown from vm.objectMirror(oop)
-                                          // for bad oop. It is possible to see some bad oop
-                                          // because heap might be iterating at no safepoint.
-                                        }
-                                        return false;
-
-                }
-            });
-        return objects;
-    }
-
-    // refer to JvmtiEnvBase::count_locked_objects.
-    // Count the number of objects for a lightweight monitor. The obj
-    // parameter is object that owns the monitor so this routine will
-    // count the number of times the same object was locked by frames
-    // in JavaThread. i.e., we count total number of times the same
-    // object is (lightweight) locked by given thread.
-    private int countLockedObjects(JavaThread jt, Oop obj) {
-        int res = 0;
-        JavaVFrame frame = jt.getLastJavaVFrameDbg();
-        while (frame != null) {
-            List monitors = frame.getMonitors();
-            OopHandle givenHandle = obj.getHandle();
-            for (Iterator itr = monitors.iterator(); itr.hasNext();) {
-                MonitorInfo mi = (MonitorInfo) itr.next();
-                if (mi.eliminated() && frame.isCompiledFrame()) continue; // skip eliminated monitor
-                if (givenHandle.equals(mi.owner())) {
-                    res++;
-                }
-            }
-            frame = (JavaVFrame) frame.javaSender();
-        }
-        return res;
-    }
-
-    // wrappers on same named method of Threads class
-    // returns List<JavaThread>
-    private List getPendingThreads(ObjectMonitor mon) {
-        return vm.saVM().getThreads().getPendingThreads(mon);
-    }
-
-    // returns List<JavaThread>
-    private List getWaitingThreads(ObjectMonitor mon) {
-        return vm.saVM().getThreads().getWaitingThreads(mon);
-    }
-
-    private JavaThread owningThreadFromMonitor(Address addr) {
-        return vm.saVM().getThreads().owningThreadFromMonitor(addr);
-    }
-
-    // refer to JvmtiEnv::GetObjectMonitorUsage
-    private void computeMonitorInfo() {
-        monitorInfoCached = true;
-        Mark mark = saObject.getMark();
-        ObjectMonitor mon = null;
-        Address owner = null;
-        // check for heavyweight monitor
-        if (! mark.hasMonitor()) {
-            // check for lightweight monitor
-            if (mark.hasLocker()) {
-                owner = mark.locker().getAddress(); // save the address of the Lock word
-            }
-            // implied else: no owner
-        } else {
-            // this object has a heavyweight monitor
-            mon = mark.monitor();
-
-            // The owner field of a heavyweight monitor may be NULL for no
-            // owner, a JavaThread * or it may still be the address of the
-            // Lock word in a JavaThread's stack. A monitor can be inflated
-            // by a non-owning JavaThread, but only the owning JavaThread
-            // can change the owner field from the Lock word to the
-            // JavaThread * and it may not have done that yet.
-            owner = mon.owner();
-        }
-
-        // find the owning thread
-        if (owner != null) {
-            owningThread = vm.threadMirror(owningThreadFromMonitor(owner));
-        }
-
-        // compute entryCount
-        if (owningThread != null) {
-            if (owningThread.getJavaThread().getAddress().equals(owner)) {
-                // the owner field is the JavaThread *
-                if (Assert.ASSERTS_ENABLED) {
-                    Assert.that(false, "must have heavyweight monitor with JavaThread * owner");
-                }
-                entryCount = (int) mark.monitor().recursions() + 1;
-            } else {
-                // The owner field is the Lock word on the JavaThread's stack
-                // so the recursions field is not valid. We have to count the
-                // number of recursive monitor entries the hard way.
-                entryCount = countLockedObjects(owningThread.getJavaThread(), saObject);
-            }
-        }
-
-        // find the contenders & waiters
-        waitingThreads = new ArrayList();
-        if (mon != null) {
-            // this object has a heavyweight monitor. threads could
-            // be contenders or waiters
-            // add all contenders
-            List pendingThreads = getPendingThreads(mon);
-            // convert the JavaThreads to ThreadReferenceImpls
-            for (Iterator itrPend = pendingThreads.iterator(); itrPend.hasNext();) {
-                waitingThreads.add(vm.threadMirror((JavaThread) itrPend.next()));
-            }
-
-            // add all waiters (threads in Object.wait())
-            // note that we don't do this JVMTI way. To do it JVMTI way,
-            // we would need to access ObjectWaiter list maintained in
-            // ObjectMonitor::_queue. But we don't have this struct exposed
-            // in vmStructs. We do waiters list in a way similar to getting
-            // pending threads list
-            List objWaitingThreads = getWaitingThreads(mon);
-            // convert the JavaThreads to ThreadReferenceImpls
-            for (Iterator itrWait = objWaitingThreads.iterator(); itrWait.hasNext();) {
-                waitingThreads.add(vm.threadMirror((JavaThread) itrWait.next()));
-            }
-        }
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof ObjectReferenceImpl)) {
-            ObjectReferenceImpl other = (ObjectReferenceImpl)obj;
-            return (ref().equals(other.ref())) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        return saObject.hashCode();
-    }
-
-    public String toString() {
-        return  "instance of " + referenceType().name() + "(id=" + uniqueID() + ")";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java
deleted file mode 100644
index 7ee3303..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-abstract class PrimitiveTypeImpl extends TypeImpl implements PrimitiveType {
-
-    PrimitiveTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-    /*
-     * Converts the given primitive value to a value of this type.
-     */
-    abstract PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException;
-
-    public String toString() {
-        return name();
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java
deleted file mode 100644
index 464fb1d..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public abstract class PrimitiveValueImpl extends ValueImpl
-                                         implements PrimitiveValue {
-
-    PrimitiveValueImpl(VirtualMachine aVm) {
-        super(aVm);
-    }
-
-    abstract public boolean booleanValue();
-    abstract public byte byteValue();
-    abstract public char charValue();
-    abstract public short shortValue();
-    abstract public int intValue();
-    abstract public long longValue();
-    abstract public float floatValue();
-    abstract public double doubleValue();
-
-    /*
-     * The checked versions of the value accessors throw
-     * InvalidTypeException if the required conversion is
-     * narrowing and would result in the loss of information
-     * (either magnitude or precision).
-     *
-     * Default implementations here do no checking; subclasses
-     * override as necessary to do the proper checking.
-     */
-    byte checkedByteValue() throws InvalidTypeException {
-        return byteValue();
-    }
-    char checkedCharValue() throws InvalidTypeException {
-        return charValue();
-    }
-    short checkedShortValue() throws InvalidTypeException {
-        return shortValue();
-    }
-    int checkedIntValue() throws InvalidTypeException {
-        return intValue();
-    }
-    long checkedLongValue() throws InvalidTypeException {
-        return longValue();
-    }
-    float checkedFloatValue() throws InvalidTypeException {
-        return floatValue();
-    }
-
-    final boolean checkedBooleanValue() throws InvalidTypeException {
-        /*
-         * Always disallow a conversion to boolean from any other
-         * primitive
-         */
-        if (this instanceof BooleanValue) {
-            return booleanValue();
-        } else {
-            throw new InvalidTypeException("Can't convert non-boolean value to boolean");
-        }
-    }
-
-    final double checkedDoubleValue() throws InvalidTypeException {
-        /*
-         * Can't overflow by converting to double, so this method
-         * is never overridden
-         */
-        return doubleValue();
-    }
-
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java
deleted file mode 100644
index dd235f9..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java
+++ /dev/null
@@ -1,1008 +0,0 @@
-/*
- * Copyright (c) 2002, 2012, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.lang.ref.SoftReference;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import sun.jvm.hotspot.memory.SystemDictionary;
-import sun.jvm.hotspot.oops.ArrayKlass;
-import sun.jvm.hotspot.oops.DefaultHeapVisitor;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.InstanceKlass;
-import sun.jvm.hotspot.oops.JVMDIClassStatus;
-import sun.jvm.hotspot.oops.Klass;
-import sun.jvm.hotspot.oops.Oop;
-import sun.jvm.hotspot.oops.Symbol;
-import sun.jvm.hotspot.utilities.Assert;
-
-import com.sun.jdi.AbsentInformationException;
-import com.sun.jdi.ArrayType;
-import com.sun.jdi.ClassLoaderReference;
-import com.sun.jdi.ClassNotLoadedException;
-import com.sun.jdi.ClassNotPreparedException;
-import com.sun.jdi.ClassObjectReference;
-import com.sun.jdi.Field;
-import com.sun.jdi.InterfaceType;
-import com.sun.jdi.Method;
-import com.sun.jdi.ObjectReference;
-import com.sun.jdi.PrimitiveType;
-import com.sun.jdi.ReferenceType;
-import com.sun.jdi.Type;
-import com.sun.jdi.Value;
-import com.sun.jdi.VirtualMachine;
-
-public abstract class ReferenceTypeImpl extends TypeImpl
-implements ReferenceType {
-    protected Klass       saKlass;          // This can be an InstanceKlass or an ArrayKlass
-    protected Symbol      typeNameSymbol;   // This is used in vm.classesByName to speedup search
-    private int           modifiers = -1;
-    private String        signature = null;
-    private SoftReference sdeRef = null;
-    private SoftReference fieldsCache;
-    private SoftReference allFieldsCache;
-    private SoftReference methodsCache;
-    private SoftReference allMethodsCache;
-    private SoftReference nestedTypesCache;
-    private SoftReference methodInvokesCache;
-
-    /* to mark when no info available */
-    static final SDE NO_SDE_INFO_MARK = new SDE();
-
-    protected ReferenceTypeImpl(VirtualMachine aVm, sun.jvm.hotspot.oops.Klass klass) {
-        super(aVm);
-        saKlass = klass;
-        typeNameSymbol = saKlass.getName();
-        if (Assert.ASSERTS_ENABLED) {
-            Assert.that(typeNameSymbol != null, "null type name for a Klass");
-        }
-    }
-
-    Symbol typeNameAsSymbol() {
-        return typeNameSymbol;
-    }
-
-    Method getMethodMirror(sun.jvm.hotspot.oops.Method ref) {
-        // SA creates new Method objects when they are referenced which means
-        // that the incoming object might not be the same object as on our
-        // even though it is the same method. So do an address compare by
-        // calling equals rather than just reference compare.
-        Iterator it = methods().iterator();
-        while (it.hasNext()) {
-            MethodImpl method = (MethodImpl)it.next();
-            if (ref.equals(method.ref())) {
-                return method;
-            }
-        }
-        if (ref.getMethodHolder().equals(SystemDictionary.getMethodHandleKlass())) {
-          // invoke methods are generated as needed, so make mirrors as needed
-          List mis = null;
-          if (methodInvokesCache == null) {
-            mis = new ArrayList();
-            methodInvokesCache = new SoftReference(mis);
-          } else {
-            mis = (List)methodInvokesCache.get();
-          }
-          it = mis.iterator();
-          while (it.hasNext()) {
-            MethodImpl method = (MethodImpl)it.next();
-            if (ref.equals(method.ref())) {
-              return method;
-            }
-          }
-
-          MethodImpl method = MethodImpl.createMethodImpl(vm, this, ref);
-          mis.add(method);
-          return method;
-        }
-        throw new IllegalArgumentException("Invalid method id: " + ref);
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof ReferenceTypeImpl)) {
-            ReferenceTypeImpl other = (ReferenceTypeImpl)obj;
-            return (ref().equals(other.ref())) &&
-                (vm.equals(other.virtualMachine()));
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        return saKlass.hashCode();
-    }
-
-    public int compareTo(ReferenceType refType) {
-        /*
-         * Note that it is critical that compareTo() == 0
-         * implies that equals() == true. Otherwise, TreeSet
-         * will collapse classes.
-         *
-         * (Classes of the same name loaded by different class loaders
-         * or in different VMs must not return 0).
-         */
-        ReferenceTypeImpl other = (ReferenceTypeImpl)refType;
-        int comp = name().compareTo(other.name());
-        if (comp == 0) {
-            Klass rf1 = ref();
-            Klass rf2 = other.ref();
-            // optimize for typical case: refs equal and VMs equal
-            if (rf1.equals(rf2)) {
-                // sequenceNumbers are always positive
-                comp = vm.sequenceNumber -
-                 ((VirtualMachineImpl)(other.virtualMachine())).sequenceNumber;
-            } else {
-                comp = rf1.getAddress().minus(rf2.getAddress()) < 0? -1 : 1;
-            }
-        }
-        return comp;
-    }
-
-    public String signature() {
-        if (signature == null) {
-            signature = saKlass.signature();
-        }
-        return signature;
-    }
-
-    // refer to JvmtiEnv::GetClassSignature.
-    // null is returned for array klasses.
-    public String genericSignature() {
-        if (saKlass instanceof ArrayKlass) {
-            return null;
-        } else {
-            Symbol genSig = ((InstanceKlass)saKlass).getGenericSignature();
-            return (genSig != null)? genSig.asString() : null;
-        }
-    }
-
-    public ClassLoaderReference classLoader() {
-      Instance xx = (Instance)(((InstanceKlass)saKlass).getClassLoader());
-      return (ClassLoaderReferenceImpl)vm.classLoaderMirror(xx);
-    }
-
-    public boolean isPublic() {
-        return((modifiers() & VMModifiers.PUBLIC) != 0);
-    }
-
-    public boolean isProtected() {
-        return((modifiers() & VMModifiers.PROTECTED) != 0);
-    }
-
-    public boolean isPrivate() {
-        return((modifiers() & VMModifiers.PRIVATE) != 0);
-    }
-
-    public boolean isPackagePrivate() {
-        return !isPublic() && !isPrivate() && !isProtected();
-    }
-
-    public boolean isAbstract() {
-        return((modifiers() & VMModifiers.ABSTRACT) != 0);
-    }
-
-    public boolean isFinal() {
-        return((modifiers() & VMModifiers.FINAL) != 0);
-    }
-
-    public boolean isStatic() {
-        return((modifiers() & VMModifiers.STATIC) != 0);
-    }
-
-    public boolean isPrepared() {
-        return (saKlass.getClassStatus() & JVMDIClassStatus.PREPARED) != 0;
-    }
-
-    final void checkPrepared() throws ClassNotPreparedException {
-        if (! isPrepared()) {
-            throw new ClassNotPreparedException();
-        }
-    }
-
-    public boolean isVerified() {
-        return (saKlass.getClassStatus() & JVMDIClassStatus.VERIFIED) != 0;
-    }
-
-    public boolean isInitialized() {
-        return (saKlass.getClassStatus() & JVMDIClassStatus.INITIALIZED) != 0;
-    }
-
-    public boolean failedToInitialize() {
-        return (saKlass.getClassStatus() & JVMDIClassStatus.ERROR) != 0;
-    }
-
-    private boolean isThrowableBacktraceField(sun.jvm.hotspot.oops.Field fld) {
-        // refer to JvmtiEnv::GetClassFields in jvmtiEnv.cpp.
-        // We want to filter out java.lang.Throwable.backtrace (see 4446677).
-        // It contains some Method*s that aren't quite real Objects.
-        if (fld.getFieldHolder().getName().equals(vm.javaLangThrowable()) &&
-            fld.getID().getName().equals("backtrace")) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    public final List fields() throws ClassNotPreparedException {
-        List fields = (fieldsCache != null)? (List) fieldsCache.get() : null;
-        if (fields == null) {
-            checkPrepared();
-            if (saKlass instanceof ArrayKlass) {
-                fields = new ArrayList(0);
-            } else {
-                // Get a list of the sa Field types
-                List saFields = ((InstanceKlass)saKlass).getImmediateFields();
-
-                // Create a list of our Field types
-                int len = saFields.size();
-                fields = new ArrayList(len);
-                for (int ii = 0; ii < len; ii++) {
-                    sun.jvm.hotspot.oops.Field curField = (sun.jvm.hotspot.oops.Field)saFields.get(ii);
-                    if (! isThrowableBacktraceField(curField)) {
-                        fields.add(new FieldImpl(vm, this, curField));
-                    }
-                }
-            }
-            fields = Collections.unmodifiableList(fields);
-            fieldsCache = new SoftReference(fields);
-        }
-        return fields;
-    }
-
-    public final List allFields() throws ClassNotPreparedException {
-        List allFields = (allFieldsCache != null)? (List) allFieldsCache.get() : null;
-        if (allFields == null) {
-            checkPrepared();
-            if (saKlass instanceof ArrayKlass) {
-                // is 'length' a field of array klasses? To maintain
-                // consistency with JVMDI-JDI we return 0 size.
-                allFields = new ArrayList(0);
-            } else {
-                List saFields;
-
-                // Get a list of the sa Field types
-                saFields = ((InstanceKlass)saKlass).getAllFields();
-
-                // Create a list of our Field types
-                int len = saFields.size();
-                allFields = new ArrayList(len);
-                for (int ii = 0; ii < len; ii++) {
-                    sun.jvm.hotspot.oops.Field curField = (sun.jvm.hotspot.oops.Field)saFields.get(ii);
-                    if (! isThrowableBacktraceField(curField)) {
-                        allFields.add(new FieldImpl(vm, vm.referenceType(curField.getFieldHolder()), curField));
-                    }
-                }
-            }
-            allFields = Collections.unmodifiableList(allFields);
-            allFieldsCache = new SoftReference(allFields);
-        }
-        return allFields;
-    }
-
-    abstract List inheritedTypes();
-
-    void addVisibleFields(List visibleList, Map visibleTable, List ambiguousNames) {
-        List list = visibleFields();
-        Iterator iter = list.iterator();
-        while (iter.hasNext()) {
-            Field field = (Field)iter.next();
-            String name = field.name();
-            if (!ambiguousNames.contains(name)) {
-                Field duplicate = (Field)visibleTable.get(name);
-                if (duplicate == null) {
-                    visibleList.add(field);
-                    visibleTable.put(name, field);
-                } else if (!field.equals(duplicate)) {
-                    ambiguousNames.add(name);
-                    visibleTable.remove(name);
-                    visibleList.remove(duplicate);
-                } else {
-                    // identical field from two branches; do nothing
-                }
-            }
-        }
-    }
-
-    public final List visibleFields() throws ClassNotPreparedException {
-        checkPrepared();
-        /*
-         * Maintain two different collections of visible fields. The
-         * list maintains a reasonable order for return. The
-         * hash map provides an efficient way to lookup visible fields
-         * by name, important for finding hidden or ambiguous fields.
-         */
-        List visibleList = new ArrayList();
-        Map  visibleTable = new HashMap();
-
-        /* Track fields removed from above collection due to ambiguity */
-        List ambiguousNames = new ArrayList();
-
-        /* Add inherited, visible fields */
-        List types = inheritedTypes();
-        Iterator iter = types.iterator();
-        while (iter.hasNext()) {
-            /*
-             * TO DO: Be defensive and check for cyclic interface inheritance
-             */
-            ReferenceTypeImpl type = (ReferenceTypeImpl)iter.next();
-            type.addVisibleFields(visibleList, visibleTable, ambiguousNames);
-        }
-
-        /*
-         * Insert fields from this type, removing any inherited fields they
-         * hide.
-         */
-        List retList = new ArrayList(fields());
-        iter = retList.iterator();
-        while (iter.hasNext()) {
-            Field field = (Field)iter.next();
-            Field hidden = (Field)visibleTable.get(field.name());
-            if (hidden != null) {
-                visibleList.remove(hidden);
-            }
-        }
-        retList.addAll(visibleList);
-        return retList;
-    }
-
-   public final Field fieldByName(String fieldName) throws ClassNotPreparedException {
-        java.util.List searchList;
-        Field f;
-
-        // visibleFields calls checkPrepared
-        searchList = visibleFields();
-
-        for (int i=0; i<searchList.size(); i++) {
-            f = (Field)searchList.get(i);
-
-            if (f.name().equals(fieldName)) {
-                return f;
-            }
-        }
-        //throw new NoSuchFieldException("Field '" + fieldName + "' not found in " + name());
-        return null;
-    }
-
-    public final List methods() throws ClassNotPreparedException {
-        List methods = (methodsCache != null)? (List) methodsCache.get() : null;
-        if (methods == null) {
-            checkPrepared();
-            if (saKlass instanceof ArrayKlass) {
-                methods = new ArrayList(0);
-            } else {
-                List saMethods;
-                // Get a list of the SA Method types
-                saMethods = ((InstanceKlass)saKlass).getImmediateMethods();
-
-                // Create a list of our MethodImpl types
-                int len = saMethods.size();
-                methods = new ArrayList(len);
-                for (int ii = 0; ii < len; ii++) {
-                    methods.add(MethodImpl.createMethodImpl(vm, this, (sun.jvm.hotspot.oops.Method)saMethods.get(ii)));
-                }
-            }
-            methods = Collections.unmodifiableList(methods);
-            methodsCache = new SoftReference(methods);
-        }
-        return methods;
-    }
-
-    abstract List getAllMethods();
-    public final List allMethods() throws ClassNotPreparedException {
-        List allMethods = (allMethodsCache != null)? (List) allMethodsCache.get() : null;
-        if (allMethods == null) {
-            checkPrepared();
-            allMethods = Collections.unmodifiableList(getAllMethods());
-            allMethodsCache = new SoftReference(allMethods);
-        }
-        return allMethods;
-    }
-
-    /*
-     * Utility method used by subclasses to build lists of visible
-     * methods.
-     */
-    void addToMethodMap(Map methodMap, List methodList) {
-        Iterator iter = methodList.iterator();
-        while (iter.hasNext()) {
-            Method method = (Method)iter.next();
-            methodMap.put(method.name().concat(method.signature()), method);
-        }
-    }
-
-    abstract void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces);
-
-    public final List visibleMethods() throws ClassNotPreparedException {
-        checkPrepared();
-        /*
-         * Build a collection of all visible methods. The hash
-         * map allows us to do this efficiently by keying on the
-         * concatenation of name and signature.
-         */
-        //System.out.println("jj: RTI: Calling addVisibleMethods for:" + this);
-        Map<String, Method> map = new HashMap<String, Method>();
-        addVisibleMethods(map, new HashSet<InterfaceType>());
-
-        /*
-         * ... but the hash map destroys order. Methods should be
-         * returned in a sensible order, as they are in allMethods().
-         * So, start over with allMethods() and use the hash map
-         * to filter that ordered collection.
-         */
-        //System.out.println("jj: RTI: Calling allMethods for:" + this);
-
-        List<Method> list = new ArrayList<Method>(allMethods());
-        //System.out.println("jj: allMethods = " + jjstr(list));
-        //System.out.println("jj: map = " + map.toString());
-        //System.out.println("jj: map = " + jjstr(map.values()));
-        list.retainAll(map.values());
-        //System.out.println("jj: map = " + jjstr(list));
-        //System.exit(0);
-        return list;
-    }
-
-    static Object prev;
-
-    static public String jjstr(Collection cc) {
-        StringBuffer buf = new StringBuffer();
-        buf.append("[");
-        Iterator i = cc.iterator();
-        boolean hasNext = i.hasNext();
-        while (hasNext) {
-            Object o = i.next();
-            if (prev == null) {
-                prev = o;
-            } else {
-                System.out.println("prev == curr?" + prev.equals(o));
-                System.out.println("prev == curr?" + (prev == o));
-            }
-            buf.append( o + "@" + o.hashCode());
-            //buf.append( ((Object)o).toString());
-            hasNext = i.hasNext();
-            if (hasNext)
-                buf.append(", ");
-        }
-
-        buf.append("]");
-        return buf.toString();
-    }
-
-    public final List methodsByName(String name) throws ClassNotPreparedException {
-        // visibleMethods calls checkPrepared
-        List methods = visibleMethods();
-        ArrayList retList = new ArrayList(methods.size());
-        Iterator iter = methods.iterator();
-        while (iter.hasNext()) {
-            Method candidate = (Method)iter.next();
-            if (candidate.name().equals(name)) {
-                retList.add(candidate);
-            }
-        }
-        retList.trimToSize();
-        return retList;
-    }
-
-    public final List methodsByName(String name, String signature) throws ClassNotPreparedException {
-        // visibleMethods calls checkPrepared
-        List methods = visibleMethods();
-        ArrayList retList = new ArrayList(methods.size());
-        Iterator iter = methods.iterator();
-        while (iter.hasNext()) {
-            Method candidate = (Method)iter.next();
-            if (candidate.name().equals(name) &&
-                candidate.signature().equals(signature)) {
-                retList.add(candidate);
-            }
-        }
-        retList.trimToSize();
-        return retList;
-    }
-
-
-    List getInterfaces() {
-        List myInterfaces;
-        if (saKlass instanceof ArrayKlass) {
-            // Actually, JLS says arrays implement Cloneable and Serializable
-            // But, JVMDI-JDI just returns 0 interfaces for arrays. We follow
-            // the same for consistency.
-            myInterfaces = new ArrayList(0);
-        } else {
-            // Get a list of the sa InstanceKlass types
-            List saInterfaces = ((InstanceKlass)saKlass).getDirectImplementedInterfaces();
-
-            // Create a list of our InterfaceTypes
-            int len = saInterfaces.size();
-            myInterfaces = new ArrayList(len);
-            for (int ii = 0; ii < len; ii++) {
-                myInterfaces.add(new InterfaceTypeImpl(vm, (InstanceKlass)saInterfaces.get(ii)));
-            }
-        }
-        return myInterfaces;
-    }
-
-    public final List nestedTypes() {
-        List nestedTypes = (nestedTypesCache != null)? (List) nestedTypesCache.get() : null;
-        if (nestedTypes == null) {
-            if (saKlass instanceof ArrayKlass) {
-                nestedTypes = new ArrayList(0);
-            } else {
-                ClassLoaderReference cl = classLoader();
-                List classes = null;
-                if (cl != null) {
-                   classes = cl.visibleClasses();
-                } else {
-                   classes = vm.bootstrapClasses();
-                }
-                nestedTypes = new ArrayList();
-                Iterator iter = classes.iterator();
-                while (iter.hasNext()) {
-                    ReferenceTypeImpl refType = (ReferenceTypeImpl)iter.next();
-                    Symbol candidateName = refType.ref().getName();
-                    if (((InstanceKlass)saKlass).isInnerOrLocalClassName(candidateName)) {
-                        nestedTypes.add(refType);
-                    }
-                }
-            }
-            nestedTypes = Collections.unmodifiableList(nestedTypes);
-            nestedTypesCache = new SoftReference(nestedTypes);
-        }
-        return nestedTypes;
-    }
-
-    public Value getValue(Field sig) {
-        List list = new ArrayList(1);
-        list.add(sig);
-        Map map = getValues(list);
-        return(Value)map.get(sig);
-    }
-
-    /**
-     * Returns a map of field values
-     */
-    public Map getValues(List theFields) {
-        //validateMirrors();
-        int size = theFields.size();
-        Map map = new HashMap(size);
-        for (int ii=0; ii<size; ii++) {
-            FieldImpl fieldImpl = (FieldImpl)theFields.get(ii);
-
-            validateFieldAccess(fieldImpl);
-            // Do more validation specific to ReferenceType field getting
-            if (!fieldImpl.isStatic()) {
-                throw new IllegalArgumentException(
-                     "Attempt to use non-static field with ReferenceType: " +
-                     fieldImpl.name());
-            }
-            map.put(fieldImpl, fieldImpl.getValue());
-        }
-        return map;
-    }
-
-    void validateFieldAccess(Field field) {
-       /*
-        * Field must be in this object's class, a superclass, or
-        * implemented interface
-        */
-        ReferenceTypeImpl declType = (ReferenceTypeImpl)field.declaringType();
-        if (!declType.isAssignableFrom(this)) {
-            throw new IllegalArgumentException("Invalid field");
-        }
-    }
-
-    public ClassObjectReference classObject() {
-        return vm.classObjectMirror(ref().getJavaMirror());
-    }
-
-    SDE.Stratum stratum(String stratumID) {
-        SDE sde = sourceDebugExtensionInfo();
-        if (!sde.isValid()) {
-            sde = NO_SDE_INFO_MARK;
-        }
-        return sde.stratum(stratumID);
-    }
-
-    public String sourceName() throws AbsentInformationException {
-        return (String)(sourceNames(vm.getDefaultStratum()).get(0));
-    }
-
-    public List sourceNames(String stratumID)
-                                throws AbsentInformationException {
-        SDE.Stratum stratum = stratum(stratumID);
-        if (stratum.isJava()) {
-            List result = new ArrayList(1);
-            result.add(baseSourceName());
-            return result;
-        }
-        return stratum.sourceNames(this);
-    }
-
-    public List sourcePaths(String stratumID)
-                                throws AbsentInformationException {
-        SDE.Stratum stratum = stratum(stratumID);
-        if (stratum.isJava()) {
-            List result = new ArrayList(1);
-            result.add(baseSourceDir() + baseSourceName());
-            return result;
-        }
-        return stratum.sourcePaths(this);
-    }
-
-    String baseSourceName() throws AbsentInformationException {
-      if (saKlass instanceof ArrayKlass) {
-            throw new AbsentInformationException();
-      }
-      Symbol sym = ((InstanceKlass)saKlass).getSourceFileName();
-      if (sym != null) {
-          return sym.asString();
-      } else {
-          throw new AbsentInformationException();
-      }
-    }
-
-    String baseSourcePath() throws AbsentInformationException {
-        return baseSourceDir() + baseSourceName();
-    }
-
-    String baseSourceDir() {
-        String typeName = name();
-        StringBuffer sb = new StringBuffer(typeName.length() + 10);
-        int index = 0;
-        int nextIndex;
-
-        while ((nextIndex = typeName.indexOf('.', index)) > 0) {
-            sb.append(typeName.substring(index, nextIndex));
-            sb.append(java.io.File.separatorChar);
-            index = nextIndex + 1;
-        }
-        return sb.toString();
-    }
-
-    public String sourceDebugExtension()
-                           throws AbsentInformationException {
-        if (!vm.canGetSourceDebugExtension()) {
-            throw new UnsupportedOperationException();
-        }
-        SDE sde = sourceDebugExtensionInfo();
-        if (sde == NO_SDE_INFO_MARK) {
-            throw new AbsentInformationException();
-        }
-        return sde.sourceDebugExtension;
-    }
-
-    private SDE sourceDebugExtensionInfo() {
-        if (!vm.canGetSourceDebugExtension()) {
-            return NO_SDE_INFO_MARK;
-        }
-        SDE sde = null;
-        sde = (sdeRef == null) ?  null : (SDE)sdeRef.get();
-        if (sde == null) {
-           String extension = null;
-           if (saKlass instanceof InstanceKlass) {
-              extension = ((InstanceKlass)saKlass).getSourceDebugExtension();
-           }
-           if (extension == null) {
-              sde = NO_SDE_INFO_MARK;
-           } else {
-              sde = new SDE(extension);
-           }
-           sdeRef = new SoftReference(sde);
-        }
-        return sde;
-    }
-
-    public List availableStrata() {
-        SDE sde = sourceDebugExtensionInfo();
-        if (sde.isValid()) {
-            return sde.availableStrata();
-        } else {
-            List strata = new ArrayList();
-            strata.add(SDE.BASE_STRATUM_NAME);
-            return strata;
-        }
-    }
-
-    /**
-     * Always returns non-null stratumID
-     */
-    public String defaultStratum() {
-        SDE sdei = sourceDebugExtensionInfo();
-        if (sdei.isValid()) {
-            return sdei.defaultStratumId;
-        } else {
-            return SDE.BASE_STRATUM_NAME;
-        }
-    }
-
-    public final int modifiers() {
-        if (modifiers == -1) {
-            modifiers = getModifiers();
-        }
-        return modifiers;
-    }
-
-    // new method since 1.6.
-    // Real body will be supplied later.
-    public List instances(long maxInstances) {
-        if (!vm.canGetInstanceInfo()) {
-            throw new UnsupportedOperationException(
-                      "target does not support getting instances");
-        }
-
-        if (maxInstances < 0) {
-            throw new IllegalArgumentException("maxInstances is less than zero: "
-                                              + maxInstances);
-        }
-
-        final List objects = new ArrayList(0);
-        if (isAbstract() || (this instanceof InterfaceType)) {
-            return objects;
-        }
-
-        final Klass givenKls = this.ref();
-        final long max = maxInstances;
-        vm.saObjectHeap().iterate(new DefaultHeapVisitor() {
-                private long instCount=0;
-                public boolean doObj(Oop oop) {
-                    if (givenKls.equals(oop.getKlass())) {
-                        objects.add(vm.objectMirror(oop));
-                                                instCount++;
-                    }
-                    if (max > 0 && instCount >= max) {
-                        return true;
-                                        }
-                                        return false;
-                }
-            });
-        return objects;
-    }
-
-    int getModifiers() {
-        return (int) saKlass.getClassModifiers();
-    }
-
-    public List allLineLocations()
-                            throws AbsentInformationException {
-        return allLineLocations(vm.getDefaultStratum(), null);
-    }
-
-    public List allLineLocations(String stratumID, String sourceName)
-                            throws AbsentInformationException {
-        checkPrepared();
-        boolean someAbsent = false; // A method that should have info, didn't
-        SDE.Stratum stratum = stratum(stratumID);
-        List list = new ArrayList();  // location list
-
-        for (Iterator iter = methods().iterator(); iter.hasNext(); ) {
-            MethodImpl method = (MethodImpl)iter.next();
-            try {
-                list.addAll(
-                   method.allLineLocations(stratum.id(), sourceName));
-            } catch(AbsentInformationException exc) {
-                someAbsent = true;
-            }
-        }
-
-        // If we retrieved no line info, and at least one of the methods
-        // should have had some (as determined by an
-        // AbsentInformationException being thrown) then we rethrow
-        // the AbsentInformationException.
-        if (someAbsent && list.size() == 0) {
-            throw new AbsentInformationException();
-        }
-        return list;
-    }
-
-    public List locationsOfLine(int lineNumber)
-                           throws AbsentInformationException {
-        return locationsOfLine(vm.getDefaultStratum(),
-                               null,
-                               lineNumber);
-    }
-
-    public List locationsOfLine(String stratumID,
-                                String sourceName,
-                                int lineNumber)
-                           throws AbsentInformationException {
-        checkPrepared();
-        // A method that should have info, didn't
-        boolean someAbsent = false;
-        // A method that should have info, did
-        boolean somePresent = false;
-        List methods = methods();
-        SDE.Stratum stratum = stratum(stratumID);
-
-        List list = new ArrayList();
-
-        Iterator iter = methods.iterator();
-        while(iter.hasNext()) {
-            MethodImpl method = (MethodImpl)iter.next();
-            // eliminate native and abstract to eliminate
-            // false positives
-            if (!method.isAbstract() &&
-                !method.isNative()) {
-                try {
-                    list.addAll(
-                       method.locationsOfLine(stratum.id(),
-                                              sourceName,
-                                              lineNumber));
-                    somePresent = true;
-                } catch(AbsentInformationException exc) {
-                    someAbsent = true;
-                }
-            }
-        }
-        if (someAbsent && !somePresent) {
-            throw new AbsentInformationException();
-        }
-        return list;
-    }
-
-    Klass ref() {
-        return saKlass;
-    }
-
-
-    /*
-     * Return true if an instance of this type
-     * can be assigned to a variable of the given type
-     */
-    abstract boolean isAssignableTo(ReferenceType type);
-
-    boolean isAssignableFrom(ReferenceType type) {
-        return ((ReferenceTypeImpl)type).isAssignableTo(this);
-    }
-
-    boolean isAssignableFrom(ObjectReference object) {
-        return object == null ||
-            isAssignableFrom(object.referenceType());
-    }
-
-    int indexOf(Method method) {
-        // Make sure they're all here - the obsolete method
-        // won't be found and so will have index -1
-        return methods().indexOf(method);
-    }
-
-    int indexOf(Field field) {
-        // Make sure they're all here
-        return fields().indexOf(field);
-    }
-
-    private static boolean isPrimitiveArray(String signature) {
-        int i = signature.lastIndexOf('[');
-        /*
-         * TO DO: Centralize JNI signature knowledge.
-         *
-         * Ref:
-         *  jdk1.4/doc/guide/jpda/jdi/com/sun/jdi/doc-files/signature.html
-         */
-        boolean isPA;
-        if (i < 0) {
-            isPA = false;
-        } else {
-            char c = signature.charAt(i + 1);
-            isPA = (c != 'L');
-        }
-        return isPA;
-    }
-
-    Type findType(String signature) throws ClassNotLoadedException {
-        Type type;
-        if (signature.length() == 1) {
-            /* OTI FIX: Must be a primitive type or the void type */
-            char sig = signature.charAt(0);
-            if (sig == 'V') {
-                type = vm.theVoidType();
-            } else {
-                type = vm.primitiveTypeMirror(sig);
-            }
-        } else {
-            // Must be a reference type.
-            ClassLoaderReferenceImpl loader =
-                       (ClassLoaderReferenceImpl)classLoader();
-            if ((loader == null) ||
-                (isPrimitiveArray(signature)) //Work around 4450091
-                ) {
-                // Caller wants type of boot class field
-                type = vm.findBootType(signature);
-            } else {
-                // Caller wants type of non-boot class field
-                type = loader.findType(signature);
-            }
-        }
-        return type;
-    }
-
-    String loaderString() {
-        if (classLoader() != null) {
-            return "loaded by " + classLoader().toString();
-        } else {
-            return "loaded by bootstrap loader";
-        }
-    }
-
-    long uniqueID() {
-        return vm.getAddressValue(ref().getJavaMirror());
-    }
-
-    // new method since 1.6
-    public int majorVersion() {
-        if (!vm.canGetClassFileVersion()) {
-            throw new UnsupportedOperationException("Cannot get class file version");
-        }
-        return (int)((InstanceKlass)saKlass).majorVersion();
-    }
-
-    // new method since 1.6
-    public int minorVersion() {
-        if (!vm.canGetClassFileVersion()) {
-            throw new UnsupportedOperationException("Cannot get class file version");
-        }
-        return (int)((InstanceKlass)saKlass).minorVersion();
-    }
-
-    // new method since 1.6
-    public int constantPoolCount() {
-        if (!vm.canGetConstantPool()) {
-            throw new UnsupportedOperationException("Cannot get constant pool");
-        }
-        if (saKlass instanceof ArrayKlass) {
-            return 0;
-        } else {
-            return (int)((InstanceKlass)saKlass).getConstants().getLength();
-        }
-    }
-
-    // new method since 1.6
-    public byte[] constantPool() {
-        if (!vm.canGetConstantPool()) {
-            throw new UnsupportedOperationException("Cannot get constant pool");
-        }
-        if (this instanceof ArrayType || this instanceof PrimitiveType) {
-                        byte bytes[] = new byte[0];
-            return bytes;
-        } else {
-            ByteArrayOutputStream bs = new ByteArrayOutputStream();
-            try {
-                ((InstanceKlass)saKlass).getConstants().writeBytes(bs);
-            } catch (IOException ex) {
-                                ex.printStackTrace();
-                                byte bytes[] = new byte[0];
-                                return bytes;
-            }
-            return bs.toByteArray();
-        }
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java
deleted file mode 100644
index 3db35d4..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.connect.*;
-import com.sun.jdi.Bootstrap;
-import com.sun.jdi.VirtualMachine;
-import com.sun.jdi.VirtualMachineManager;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.net.*;
-import java.util.*;
-
-public class SACoreAttachingConnector extends ConnectorImpl implements AttachingConnector {
-
-    static final String ARG_COREFILE = "core";
-    static final String ARG_JAVA_EXECUTABLE = "javaExecutable";
-    private Transport transport;
-
-    public SACoreAttachingConnector(com.sun.tools.jdi.VirtualMachineManagerService ignored) {
-        this();
-    }
-
-    public SACoreAttachingConnector() {
-        super();
-        //fixme jjh  Must create resources for these strings
-        addStringArgument(
-                ARG_JAVA_EXECUTABLE,
-                "Java Executable",              //getString("sa.javaExecutable.label"),
-                "Pathname of Java Executable",  //getString("sa.javaExecutable.description");
-                "",
-                true);
-
-        addStringArgument(
-                ARG_COREFILE,
-                "Corefile",                                    // getString("sa.CoreFile.label"),
-                "Pathname of a corefile from a Java Process",  //getString("sa.CoreFile.description"),
-                "core",
-                false);
-
-        transport = new Transport() {
-                   public String name() {
-                       return "filesystem";
-                   }
-               };
-    }
-
-    // security check to see whether the caller can perform attach
-    private void checkCoreAttach(String corefile) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            try {
-                // whether the caller can link against SA native library?
-                checkNativeLink(sm, System.getProperty("os.name"));
-                // check whether the caller can read the core file?
-                sm.checkRead(corefile);
-            } catch (SecurityException se) {
-                throw new SecurityException("permission denied to attach to " + corefile);
-            }
-        }
-    }
-
-    private VirtualMachine createVirtualMachine(Class vmImplClass,
-                                                String javaExec, String corefile)
-        throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-        java.lang.reflect.Method connectByCoreMethod = vmImplClass.getMethod(
-                                 "createVirtualMachineForCorefile",
-                                  new Class[] {
-                                      VirtualMachineManager.class,
-                                      String.class, String.class,
-                                      Integer.TYPE
-                                  });
-        return (VirtualMachine) connectByCoreMethod.invoke(null,
-                                  new Object[] {
-                                      Bootstrap.virtualMachineManager(),
-                                      javaExec,
-                                      corefile,
-                                      new Integer(0)
-                                  });
-    }
-
-    public VirtualMachine attach(Map arguments) throws IOException,
-                                      IllegalConnectorArgumentsException {
-        String javaExec = argument(ARG_JAVA_EXECUTABLE, arguments).value();
-        if (javaExec == null || javaExec.equals("")) {
-            throw new IllegalConnectorArgumentsException("javaExec should be non-null and non-empty",
-                                                         ARG_JAVA_EXECUTABLE);
-        }
-        String corefile = argument(ARG_COREFILE, arguments).value();
-        if (corefile == null || corefile.equals("")) {
-            throw new IllegalConnectorArgumentsException("corefile should be non-null and non-empty",
-                                                         ARG_COREFILE);
-        }
-
-        checkCoreAttach(corefile);
-
-        VirtualMachine myVM = null;
-        try {
-            try {
-                Class vmImplClass = loadVirtualMachineImplClass();
-                myVM = createVirtualMachine(vmImplClass, javaExec, corefile);
-            } catch (InvocationTargetException ite) {
-                Class vmImplClass = handleVMVersionMismatch(ite);
-                if (vmImplClass != null) {
-                    return createVirtualMachine(vmImplClass, javaExec, corefile);
-                } else {
-                    throw ite;
-                }
-            }
-        } catch (Exception ee) {
-            if (DEBUG) {
-                System.out.println("VirtualMachineImpl() got an exception:");
-                ee.printStackTrace();
-                System.out.println("coreFile = " + corefile + ", javaExec = " + javaExec);
-            }
-            throw (IOException) new IOException().initCause(ee);
-        }
-        setVMDisposeObserver(myVM);
-        return myVM;
-    }
-
-    public String name() {
-        return "sun.jvm.hotspot.jdi.SACoreAttachingConnector";
-    }
-
-    public String description() {
-        return getString("This connector allows you to attach to a core file using the Serviceability Agent");
-    }
-
-    public Transport transport() {
-        return transport;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java
deleted file mode 100644
index 19c41df..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-public final class SADebugServer {
-   // do not allow instance creation
-   private SADebugServer() {}
-
-   private static void usage() {
-      java.io.PrintStream out = System.out;
-      out.println("Usage: jsadebugd [options] <pid> [server-id]");
-      out.println("\t\t(to connect to a live java process)");
-      out.println("   or  jsadebugd [options] <executable> <core> [server-id]");
-      out.println("\t\t(to connect to a core file produced by <executable>)");
-      out.println("\t\tserver-id is an optional unique id for this debug server, needed ");
-      out.println("\t\tif multiple debug servers are run on the same machine");
-      out.println("where options include:");
-      out.println("   -h | -help\tto print this help message");
-      System.exit(1);
-  }
-
-   public static void main(String[] args) {
-      if ((args.length < 1) || (args.length > 3)) {
-         usage();
-      }
-
-      // Attempt to handle "-h" or "-help"
-      if (args[0].startsWith("-")) {
-         usage();
-      }
-
-      // By default SA agent classes prefer Windows process debugger
-      // to windbg debugger. SA expects special properties to be set
-      // to choose other debuggers. We will set those here before
-      // attaching to SA agent.
-
-       System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true");
-
-      // delegate to the actual SA debug server.
-      sun.jvm.hotspot.DebugServer.main(args);
-   }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java
deleted file mode 100644
index d34f116..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.connect.*;
-import com.sun.jdi.Bootstrap;
-import com.sun.jdi.VirtualMachine;
-import com.sun.jdi.VirtualMachineManager;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.net.*;
-import java.util.*;
-
-public class SADebugServerAttachingConnector extends ConnectorImpl implements AttachingConnector {
-
-    static final String ARG_DEBUG_SERVER_NAME = "debugServerName";
-    private Transport transport;
-
-    public SADebugServerAttachingConnector(com.sun.tools.jdi.VirtualMachineManagerService ignored) {
-        this();
-    }
-
-    public SADebugServerAttachingConnector() {
-         // fixme jjh  create resources for the these strings,
-        addStringArgument(
-                ARG_DEBUG_SERVER_NAME,
-                "Debug Server",                      //getString("sa.debugServer.label"),
-                "Name of a remote SA Debug Server",  //getString("sa.debugServer.description");
-                "",
-                true);
-        transport = new Transport() {
-                   public String name() {
-                       return "RMI";
-                   }
-                 };
-    }
-
-    private VirtualMachine createVirtualMachine(Class vmImplClass,
-                                                String debugServerName)
-        throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-        java.lang.reflect.Method connectByServerMethod =
-                            vmImplClass.getMethod(
-                                   "createVirtualMachineForServer",
-                                   new Class[] {
-                                       VirtualMachineManager.class,
-                                       String.class,
-                                       Integer.TYPE
-                                   });
-        return (VirtualMachine) connectByServerMethod.invoke(null,
-                                   new Object[] {
-                                       Bootstrap.virtualMachineManager(),
-                                       debugServerName,
-                                       new Integer(0)
-                                   });
-    }
-
-    public VirtualMachine attach(Map arguments) throws IOException,
-                                      IllegalConnectorArgumentsException {
-        String debugServerName = argument(ARG_DEBUG_SERVER_NAME, arguments).value();
-        if (debugServerName == null || debugServerName.equals("")) {
-            throw new IllegalConnectorArgumentsException("debugServerName should be non-null and non-empty",
-                                                         ARG_DEBUG_SERVER_NAME);
-        }
-        VirtualMachine myVM;
-        try {
-            try {
-                Class vmImplClass = loadVirtualMachineImplClass();
-                myVM = createVirtualMachine(vmImplClass, debugServerName);
-            } catch (InvocationTargetException ite) {
-                Class vmImplClass = handleVMVersionMismatch(ite);
-                if (vmImplClass != null) {
-                    return createVirtualMachine(vmImplClass, debugServerName);
-                } else {
-                    throw ite;
-                }
-            }
-        } catch (Exception ee) {
-            if (DEBUG) {
-                System.out.println("VirtualMachineImpl() got an exception:");
-                ee.printStackTrace();
-                System.out.println("debug server name = " + debugServerName);
-            }
-            throw (IOException) new IOException().initCause(ee);
-        }
-        setVMDisposeObserver(myVM);
-        return myVM;
-    }
-
-    public String name() {
-        return "sun.jvm.hotspot.jdi.SADebugServerAttachingConnector";
-    }
-
-    public String description() {
-        return getString("This connector allows you to attach to a Java Process via a debug server with the Serviceability Agent");
-    }
-
-    public Transport transport() {
-        return transport;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java
deleted file mode 100644
index b2e5dae..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2003, 2008, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import java.io.*;
-import java.net.*;
-
-/*
- * This class loader is used for two different reasons:
- *
- * 1) To support multiple simultaneous debuggees.
- *
- * SA's architecture does not allow us to use multiple simultaneous
- * debuggees. This is because of lots of static fields caching
- * vmStruct fields and singleton assumption in classes such as
- * 'sun.jvm.hotspot.runtime.VM'. Hence, we use instances of this
- * class loader to create a separate namespace for each debuggee VM.
- *
- * 2) To support cross VM version debugging.
- *
- * SA has very close dependency on VM data structures. Due to this, a
- * version of SA can only support debuggees running a same dot-dot release and
- * update releases only. For eg. this version of SA supports only 1.4.2 and
- * 1.4.2_xx releases only. But, users may want to debug debuggees running
- * a different version of VM. To support this, we use an instance of this
- * class loader to load classes from corresponding sa-jdi.jar.
- *
- * Note that JDI classes would still be loaded from the debugger's tools.jar
- * and not from debuggee's tools.jar. This means that if JDI interface evolved
- * b/w debuggee and debugger VM versions, user may still get problems. This is
- * the case when debugger runs on 1.5.0 and debuggee runs on 1.4.2. Because JDI
- * evolved b/w these versions (generics, enum, varargs etc.), 1.4.2 sa-jdi.jar
- * won't implement 1.5.0 JDI properly and user would get verifier errors. This
- * class loader solution is suited for different dot-dot release where JDI will
- * not evolve but VM data structures might change and SA implementation might
- * have to change. For example, a debuggee running 1.5.1 VM can be debugged
- * with debugger running on 1.5.0 VM. Here, JDI is same but VM data structures
- * could still change.
- */
-
-class SAJDIClassLoader extends URLClassLoader {
-    private static final boolean DEBUG;
-    static {
-        DEBUG = System.getProperty("sun.jvm.hotspot.jdi.SAJDIClassLoader.DEBUG") != null;
-    }
-
-    private ClassLoader parent;
-    private boolean classPathSet;
-
-    SAJDIClassLoader(ClassLoader parent) {
-        super(new URL[0], parent);
-        this.parent = parent;
-    }
-
-    SAJDIClassLoader(ClassLoader parent, String classPath) {
-        this(parent);
-        this.classPathSet = true;
-        try {
-            addURL(new File(classPath).toURI().toURL());
-        } catch(MalformedURLException mue) {
-            throw new RuntimeException(mue);
-        }
-    }
-
-    public synchronized Class loadClass(String name)
-        throws ClassNotFoundException {
-        // First, check if the class has already been loaded
-        Class c = findLoadedClass(name);
-        if (c == null) {
-            /* If we are loading any class in 'sun.jvm.hotspot.'  or any of the
-             * sub-packages (except for 'debugger' sub-pkg. please refer below),
-             * we load it by 'this' loader. Or else, we forward the request to
-             * 'parent' loader, system loader etc. (rest of the code follows
-             * the patten in java.lang.ClassLoader.loadClass).
-             *
-             * 'sun.jvm.hotspot.debugger.' and sub-package classes are
-             * also loaded by parent loader. This is done for two reasons:
-             *
-             * 1. to avoid code bloat by too many classes.
-             * 2. to avoid loading same native library multiple times
-             *    from multiple class loaders (which results in getting a
-             *    UnsatisifiedLinkageError from System.loadLibrary).
-             */
-
-            if (name.startsWith("sun.jvm.hotspot.") &&
-                !name.startsWith("sun.jvm.hotspot.debugger.")) {
-                return findClass(name);
-            }
-            if (parent != null) {
-                c = parent.loadClass(name);
-            } else {
-                c = findSystemClass(name);
-            }
-        }
-        return c;
-    }
-
-    protected Class findClass(String name) throws ClassNotFoundException {
-        if (DEBUG) {
-            System.out.println("SA/JDI loader: about to load " + name);
-        }
-        if (classPathSet) {
-            return super.findClass(name);
-        } else {
-            byte[] b = null;
-            try {
-                InputStream in = getResourceAsStream(name.replace('.', '/') + ".class");
-                // Read until end of stream is reached
-                b = new byte[1024];
-                int total = 0;
-                int len = 0;
-                while ((len = in.read(b, total, b.length - total)) != -1) {
-                    total += len;
-                    if (total >= b.length) {
-                        byte[] tmp = new byte[total * 2];
-                        System.arraycopy(b, 0, tmp, 0, total);
-                        b = tmp;
-                    }
-                }
-                // Trim array to correct size, if necessary
-                if (total != b.length) {
-                    byte[] tmp = new byte[total];
-                    System.arraycopy(b, 0, tmp, 0, total);
-                    b = tmp;
-                }
-            } catch (Exception exp) {
-                throw (ClassNotFoundException) new ClassNotFoundException().initCause(exp);
-            }
-            return defineClass(name, b, 0, b.length);
-        }
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java
deleted file mode 100644
index fbba6b0..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.connect.*;
-import com.sun.jdi.Bootstrap;
-import com.sun.jdi.VirtualMachine;
-import com.sun.jdi.VirtualMachineManager;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.net.*;
-import java.util.*;
-
-public class SAPIDAttachingConnector extends ConnectorImpl implements AttachingConnector {
-    static final String ARG_PID = "pid";
-    private Transport transport;
-
-    public SAPIDAttachingConnector(com.sun.tools.jdi.VirtualMachineManagerService ignored) {
-         this();
-    }
-
-    public SAPIDAttachingConnector() {
-         super();
-         // fixme jjh:  create resources for the these strings,
-        addStringArgument(
-                ARG_PID,
-                "PID",                     //getString("sa.pid.label"),
-                "PID of a Java process",   //getString("sa.pid.description");
-                "",
-                true);
-        transport = new Transport() {
-                   public String name() {
-                       return "local process";
-                       }
-                };
-    }
-
-    // security check to see whether the caller can perform attach
-    private void checkProcessAttach(int pid) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            String os = System.getProperty("os.name");
-            try {
-                // Whether the caller can perform link against SA native library?
-                checkNativeLink(sm, os);
-                if (os.equals("SunOS") || os.equals("Linux")) {
-                    // Whether the caller can read /proc/<pid> file?
-                    sm.checkRead("/proc/" + pid);
-                }
-            } catch (SecurityException se) {
-                throw new SecurityException("permission denied to attach to " + pid);
-            }
-        }
-    }
-
-    private VirtualMachine createVirtualMachine(Class virtualMachineImplClass, int pid)
-        throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-        java.lang.reflect.Method createByPIDMethod
-                  = virtualMachineImplClass.getMethod("createVirtualMachineForPID",
-                     new Class[] {
-                         VirtualMachineManager.class,
-                         Integer.TYPE, Integer.TYPE
-                     });
-        return (VirtualMachine) createByPIDMethod.invoke(null,
-                     new Object[] {
-                         Bootstrap.virtualMachineManager(),
-                         new Integer(pid),
-                         new Integer(0)
-                     });
-    }
-
-    public VirtualMachine attach(Map arguments) throws IOException,
-                                      IllegalConnectorArgumentsException {
-        int pid = 0;
-        try {
-            pid = Integer.parseInt(argument(ARG_PID, arguments).value());
-        } catch (NumberFormatException nfe) {
-            throw (IllegalConnectorArgumentsException) new IllegalConnectorArgumentsException
-                                                  (nfe.getMessage(), ARG_PID).initCause(nfe);
-        }
-
-        checkProcessAttach(pid);
-
-        VirtualMachine myVM = null;
-        try {
-            try {
-                Class vmImplClass = loadVirtualMachineImplClass();
-                myVM = createVirtualMachine(vmImplClass, pid);
-            } catch (InvocationTargetException ite) {
-                Class vmImplClass = handleVMVersionMismatch(ite);
-                if (vmImplClass != null) {
-                    return createVirtualMachine(vmImplClass, pid);
-                } else {
-                    throw ite;
-                }
-            }
-        } catch (Exception ee) {
-            if (DEBUG) {
-                System.out.println("VirtualMachineImpl() got an exception:");
-                ee.printStackTrace();
-                System.out.println("pid = " + pid);
-            }
-            throw (IOException) new IOException().initCause(ee);
-        }
-        setVMDisposeObserver(myVM);
-        return myVM;
-    }
-
-    public String name() {
-        return "sun.jvm.hotspot.jdi.SAPIDAttachingConnector";
-    }
-
-    public String description() {
-        return getString("This connector allows you to attach to a Java process using the Serviceability Agent");
-    }
-
-    public Transport transport() {
-        return transport;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SDE.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SDE.java
deleted file mode 100644
index 0e90f2b..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SDE.java
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-import java.util.*;
-import java.io.File;
-
-class SDE {
-    private static final int INIT_SIZE_FILE = 3;
-    private static final int INIT_SIZE_LINE = 100;
-    private static final int INIT_SIZE_STRATUM = 3;
-
-    static final String BASE_STRATUM_NAME = "Java";
-
-    /* for C capatibility */
-    static final String NullString = null;
-
-    private class FileTableRecord {
-        int fileId;
-        String sourceName;
-        String sourcePath; // do not read - use accessor
-        boolean isConverted = false;
-
-        /**
-         * Return the sourcePath, computing it if not set.
-         * If set, convert '/' in the sourcePath to the
-         * local file separator.
-         */
-        String getSourcePath(ReferenceTypeImpl refType) {
-            if (!isConverted) {
-                if (sourcePath == null) {
-                    sourcePath = refType.baseSourceDir() + sourceName;
-                } else {
-                    StringBuffer buf = new StringBuffer();
-                    for (int i = 0; i < sourcePath.length(); ++i) {
-                        char ch = sourcePath.charAt(i);
-                        if (ch == '/') {
-                            buf.append(File.separatorChar);
-                        } else {
-                            buf.append(ch);
-                        }
-                    }
-                    sourcePath = buf.toString();
-                }
-                isConverted = true;
-            }
-            return sourcePath;
-        }
-    }
-
-    private class LineTableRecord {
-        int jplsStart;
-        int jplsEnd;
-        int jplsLineInc;
-        int njplsStart;
-        int njplsEnd;
-        int fileId;
-    }
-
-    private class StratumTableRecord {
-        String id;
-        int fileIndex;
-        int lineIndex;
-    }
-
-    class Stratum {
-        private final int sti; /* stratum index */
-
-        private Stratum(int sti) {
-            this.sti = sti;
-        }
-
-        String id() {
-            return stratumTable[sti].id;
-        }
-
-        boolean isJava() {
-            return sti == baseStratumIndex;
-        }
-
-        /**
-         * Return all the sourceNames for this stratum.
-         * Look from our starting fileIndex upto the starting
-         * fileIndex of next stratum - can do this since there
-         * is always a terminator stratum.
-         * Default sourceName (the first one) must be first.
-         */
-        List sourceNames(ReferenceTypeImpl refType) {
-            int i;
-            int fileIndexStart = stratumTable[sti].fileIndex;
-            /* one past end */
-            int fileIndexEnd = stratumTable[sti+1].fileIndex;
-            List result = new ArrayList(fileIndexEnd - fileIndexStart);
-            for (i = fileIndexStart; i < fileIndexEnd; ++i) {
-                result.add(fileTable[i].sourceName);
-            }
-            return result;
-        }
-
-        /**
-         * Return all the sourcePaths for this stratum.
-         * Look from our starting fileIndex upto the starting
-         * fileIndex of next stratum - can do this since there
-         * is always a terminator stratum.
-         * Default sourcePath (the first one) must be first.
-         */
-        List sourcePaths(ReferenceTypeImpl refType) {
-            int i;
-            int fileIndexStart = stratumTable[sti].fileIndex;
-            /* one past end */
-            int fileIndexEnd = stratumTable[sti+1].fileIndex;
-            List result = new ArrayList(fileIndexEnd - fileIndexStart);
-            for (i = fileIndexStart; i < fileIndexEnd; ++i) {
-                result.add(fileTable[i].getSourcePath(refType));
-            }
-            return result;
-        }
-
-        LineStratum lineStratum(ReferenceTypeImpl refType,
-                                int jplsLine) {
-            int lti = stiLineTableIndex(sti, jplsLine);
-            if (lti < 0) {
-                return null;
-            } else {
-                return new LineStratum(sti, lti, refType,
-                                       jplsLine);
-            }
-        }
-    }
-
-    class LineStratum {
-        private final int sti; /* stratum index */
-        private final int lti; /* line table index */
-        private final ReferenceTypeImpl refType;
-        private final int jplsLine;
-        private String sourceName = null;
-        private String sourcePath = null;
-
-        private LineStratum(int sti, int lti,
-                            ReferenceTypeImpl refType,
-                            int jplsLine) {
-            this.sti = sti;
-            this.lti = lti;
-            this.refType = refType;
-            this.jplsLine = jplsLine;
-        }
-
-        public boolean equals(Object obj) {
-            if ((obj != null) && (obj instanceof LineStratum)) {
-                LineStratum other = (LineStratum)obj;
-                return (lti == other.lti) &&
-                       (sti == other.sti) &&
-                       (lineNumber() == other.lineNumber()) &&
-                       (refType.equals(other.refType));
-            } else {
-                return false;
-            }
-        }
-
-        int lineNumber() {
-            return stiLineNumber(sti, lti, jplsLine);
-        }
-
-        /**
-         * Fetch the source name and source path for
-         * this line, converting or constructing
-         * the source path if needed.
-         */
-        void getSourceInfo() {
-            if (sourceName != null) {
-                // already done
-                return;
-            }
-            int fti = stiFileTableIndex(sti, lti);
-            if (fti == -1) {
-                throw new InternalError(
-              "Bad SourceDebugExtension, no matching source id " +
-              lineTable[lti].fileId + " jplsLine: " + jplsLine);
-            }
-            FileTableRecord ftr = fileTable[fti];
-            sourceName = ftr.sourceName;
-            sourcePath = ftr.getSourcePath(refType);
-        }
-
-        String sourceName() {
-            getSourceInfo();
-            return sourceName;
-        }
-
-        String sourcePath() {
-            getSourceInfo();
-            return sourcePath;
-        }
-    }
-
-    private FileTableRecord[] fileTable = null;
-    private LineTableRecord[] lineTable = null;
-    private StratumTableRecord[] stratumTable = null;
-
-    private int fileIndex = 0;
-    private int lineIndex = 0;
-    private int stratumIndex = 0;
-    private int currentFileId = 0;
-
-    private int defaultStratumIndex = -1;
-    private int baseStratumIndex = -2; /* so as not to match -1 above */
-    private int sdePos = 0;
-
-    final String sourceDebugExtension;
-    String jplsFilename = null;
-    String defaultStratumId = null;
-    boolean isValid = false;
-
-    SDE(String sourceDebugExtension) {
-        this.sourceDebugExtension = sourceDebugExtension;
-        decode();
-    }
-
-    SDE() {
-        this.sourceDebugExtension = null;
-        createProxyForAbsentSDE();
-    }
-
-    char sdePeek() {
-        if (sdePos >= sourceDebugExtension.length()) {
-            syntax();
-        }
-        return sourceDebugExtension.charAt(sdePos);
-    }
-
-    char sdeRead() {
-        if (sdePos >= sourceDebugExtension.length()) {
-            syntax();
-        }
-        return sourceDebugExtension.charAt(sdePos++);
-    }
-
-    void sdeAdvance() {
-        sdePos++;
-    }
-
-    void syntax() {
-        throw new InternalError("bad SourceDebugExtension syntax - position " +
-                                sdePos);
-    }
-
-    void syntax(String msg) {
-        throw new InternalError("bad SourceDebugExtension syntax: " + msg);
-    }
-
-    void assureLineTableSize() {
-        int len = lineTable == null? 0 : lineTable.length;
-        if (lineIndex >= len) {
-            int i;
-            int newLen = len == 0? INIT_SIZE_LINE : len * 2;
-            LineTableRecord[] newTable = new LineTableRecord[newLen];
-            for (i = 0; i < len; ++i) {
-                newTable[i] = lineTable[i];
-            }
-            for (; i < newLen; ++i) {
-                newTable[i] = new LineTableRecord();
-            }
-            lineTable = newTable;
-        }
-    }
-
-    void assureFileTableSize() {
-        int len = fileTable == null? 0 : fileTable.length;
-        if (fileIndex >= len) {
-            int i;
-            int newLen = len == 0? INIT_SIZE_FILE : len * 2;
-            FileTableRecord[] newTable = new FileTableRecord[newLen];
-            for (i = 0; i < len; ++i) {
-                newTable[i] = fileTable[i];
-            }
-            for (; i < newLen; ++i) {
-                newTable[i] = new FileTableRecord();
-            }
-            fileTable = newTable;
-        }
-    }
-
-    void assureStratumTableSize() {
-        int len = stratumTable == null? 0 : stratumTable.length;
-        if (stratumIndex >= len) {
-            int i;
-            int newLen = len == 0? INIT_SIZE_STRATUM : len * 2;
-            StratumTableRecord[] newTable = new StratumTableRecord[newLen];
-            for (i = 0; i < len; ++i) {
-                newTable[i] = stratumTable[i];
-            }
-            for (; i < newLen; ++i) {
-                newTable[i] = new StratumTableRecord();
-            }
-            stratumTable = newTable;
-        }
-    }
-
-    String readLine() {
-        StringBuffer sb = new StringBuffer();
-        char ch;
-
-        ignoreWhite();
-        while (((ch = sdeRead()) != '\n') && (ch != '\r')) {
-            sb.append((char)ch);
-        }
-        // check for CR LF
-        if ((ch == '\r') && (sdePeek() == '\n')) {
-            sdeRead();
-        }
-        ignoreWhite(); // leading white
-        return sb.toString();
-    }
-
-    private int defaultStratumTableIndex() {
-        if ((defaultStratumIndex == -1) && (defaultStratumId != null)) {
-            defaultStratumIndex =
-                stratumTableIndex(defaultStratumId);
-        }
-        return defaultStratumIndex;
-    }
-
-    int stratumTableIndex(String stratumId) {
-        int i;
-
-        if (stratumId == null) {
-            return defaultStratumTableIndex();
-        }
-        for (i = 0; i < (stratumIndex-1); ++i) {
-            if (stratumTable[i].id.equals(stratumId)) {
-                return i;
-            }
-        }
-        return defaultStratumTableIndex();
-    }
-
-    Stratum stratum(String stratumID) {
-        int sti = stratumTableIndex(stratumID);
-        return new Stratum(sti);
-    }
-
-    List availableStrata() {
-        List strata = new ArrayList();
-
-        for (int i = 0; i < (stratumIndex-1); ++i) {
-            StratumTableRecord rec = stratumTable[i];
-            strata.add(rec.id);
-        }
-        return strata;
-    }
-
-/*****************************
- * below functions/methods are written to compile under either Java or C
- *
- * Needed support functions:
- *   sdePeek()
- *   sdeRead()
- *   sdeAdvance()
- *   readLine()
- *   assureLineTableSize()
- *   assureFileTableSize()
- *   assureStratumTableSize()
- *   syntax()
- *
- *   stratumTableIndex(String)
- *
- * Needed support variables:
- *   lineTable
- *   lineIndex
- *   fileTable
- *   fileIndex
- *   currentFileId
- *
- * Needed types:
- *   String
- *
- * Needed constants:
- *   NullString
- */
-
-    void ignoreWhite() {
-        char ch;
-
-        while (((ch = sdePeek()) == ' ') || (ch == '\t')) {
-            sdeAdvance();
-        }
-    }
-
-    void ignoreLine() {
-        char ch;
-
-        while (((ch = sdeRead()) != '\n') && (ch != '\r')) {
-        }
-        /* check for CR LF */
-        if ((ch == '\r') && (sdePeek() == '\n')) {
-            sdeAdvance();
-        }
-        ignoreWhite(); /* leading white */
-    }
-
-    int readNumber() {
-        int value = 0;
-        char ch;
-
-        ignoreWhite();
-        while (((ch = sdePeek()) >= '0') && (ch <= '9')) {
-            sdeAdvance();
-            value = (value * 10) + ch - '0';
-        }
-        ignoreWhite();
-        return value;
-    }
-
-    void storeFile(int fileId, String sourceName, String sourcePath) {
-        assureFileTableSize();
-        fileTable[fileIndex].fileId = fileId;
-        fileTable[fileIndex].sourceName = sourceName;
-        fileTable[fileIndex].sourcePath = sourcePath;
-        ++fileIndex;
-    }
-
-    void fileLine() {
-        int hasAbsolute = 0; /* acts as boolean */
-        int fileId;
-        String sourceName;
-        String sourcePath = null;
-
-        /* is there an absolute filename? */
-        if (sdePeek() == '+') {
-            sdeAdvance();
-            hasAbsolute = 1;
-        }
-        fileId = readNumber();
-        sourceName = readLine();
-        if (hasAbsolute == 1) {
-            sourcePath = readLine();
-        }
-
-        storeFile(fileId, sourceName, sourcePath);
-    }
-
-    void storeLine(int jplsStart, int jplsEnd, int jplsLineInc,
-                  int njplsStart, int njplsEnd, int fileId) {
-        assureLineTableSize();
-        lineTable[lineIndex].jplsStart = jplsStart;
-        lineTable[lineIndex].jplsEnd = jplsEnd;
-        lineTable[lineIndex].jplsLineInc = jplsLineInc;
-        lineTable[lineIndex].njplsStart = njplsStart;
-        lineTable[lineIndex].njplsEnd = njplsEnd;
-        lineTable[lineIndex].fileId = fileId;
-        ++lineIndex;
-    }
-
-    /**
-     * Parse line translation info.  Syntax is
-     *     <NJ-start-line> [ # <file-id> ] [ , <line-count> ] :
-     *                 <J-start-line> [ , <line-increment> ] CR
-     */
-    void lineLine() {
-        int lineCount = 1;
-        int lineIncrement = 1;
-        int njplsStart;
-        int jplsStart;
-
-        njplsStart = readNumber();
-
-        /* is there a fileID? */
-        if (sdePeek() == '#') {
-            sdeAdvance();
-            currentFileId = readNumber();
-        }
-
-        /* is there a line count? */
-        if (sdePeek() == ',') {
-            sdeAdvance();
-            lineCount = readNumber();
-        }
-
-        if (sdeRead() != ':') {
-            syntax();
-        }
-        jplsStart = readNumber();
-        if (sdePeek() == ',') {
-            sdeAdvance();
-            lineIncrement = readNumber();
-        }
-        ignoreLine(); /* flush the rest */
-
-        storeLine(jplsStart,
-                  jplsStart + (lineCount * lineIncrement) -1,
-                  lineIncrement,
-                  njplsStart,
-                  njplsStart + lineCount -1,
-                  currentFileId);
-    }
-
-    /**
-     * Until the next stratum section, everything after this
-     * is in stratumId - so, store the current indicies.
-     */
-    void storeStratum(String stratumId) {
-        /* remove redundant strata */
-        if (stratumIndex > 0) {
-            if ((stratumTable[stratumIndex-1].fileIndex
-                                            == fileIndex) &&
-                (stratumTable[stratumIndex-1].lineIndex
-                                            == lineIndex)) {
-                /* nothing changed overwrite it */
-                --stratumIndex;
-            }
-        }
-        /* store the results */
-        assureStratumTableSize();
-        stratumTable[stratumIndex].id = stratumId;
-        stratumTable[stratumIndex].fileIndex = fileIndex;
-        stratumTable[stratumIndex].lineIndex = lineIndex;
-        ++stratumIndex;
-        currentFileId = 0;
-    }
-
-    /**
-     * The beginning of a stratum's info
-     */
-    void stratumSection() {
-        storeStratum(readLine());
-    }
-
-    void fileSection() {
-        ignoreLine();
-        while (sdePeek() != '*') {
-            fileLine();
-        }
-    }
-
-    void lineSection() {
-        ignoreLine();
-        while (sdePeek() != '*') {
-            lineLine();
-        }
-    }
-
-    /**
-     * Ignore a section we don't know about.
-     */
-    void ignoreSection() {
-        ignoreLine();
-        while (sdePeek() != '*') {
-            ignoreLine();
-        }
-    }
-
-    /**
-     * A base "Java" stratum is always available, though
-     * it is not in the SourceDebugExtension.
-     * Create the base stratum.
-     */
-    void createJavaStratum() {
-        baseStratumIndex = stratumIndex;
-        storeStratum(BASE_STRATUM_NAME);
-        storeFile(1, jplsFilename, NullString);
-        /* JPL line numbers cannot exceed 65535 */
-        storeLine(1, 65536, 1, 1, 65536, 1);
-        storeStratum("Aux"); /* in case they don't declare */
-    }
-
-    /**
-     * Decode a SourceDebugExtension which is in SourceMap format.
-     * This is the entry point into the recursive descent parser.
-     */
-    void decode() {
-        /* check for "SMAP" - allow EOF if not ours */
-        if ((sourceDebugExtension.length() < 4) ||
-            (sdeRead() != 'S') ||
-            (sdeRead() != 'M') ||
-            (sdeRead() != 'A') ||
-            (sdeRead() != 'P')) {
-            return; /* not our info */
-        }
-        ignoreLine(); /* flush the rest */
-        jplsFilename = readLine();
-        defaultStratumId = readLine();
-        createJavaStratum();
-        while (true) {
-            if (sdeRead() != '*') {
-                syntax();
-            }
-            switch (sdeRead()) {
-                case 'S':
-                    stratumSection();
-                    break;
-                case 'F':
-                    fileSection();
-                    break;
-                case 'L':
-                    lineSection();
-                    break;
-                case 'E':
-                    /* set end points */
-                    storeStratum("*terminator*");
-                    isValid = true;
-                    return;
-                default:
-                    ignoreSection();
-            }
-        }
-    }
-
-    void createProxyForAbsentSDE() {
-        jplsFilename = null;
-        defaultStratumId = BASE_STRATUM_NAME;
-        defaultStratumIndex = stratumIndex;
-        createJavaStratum();
-        storeStratum("*terminator*");
-    }
-
-    /***************** query functions ***********************/
-
-    private int stiLineTableIndex(int sti, int jplsLine) {
-        int i;
-        int lineIndexStart;
-        int lineIndexEnd;
-
-        lineIndexStart = stratumTable[sti].lineIndex;
-        /* one past end */
-        lineIndexEnd = stratumTable[sti+1].lineIndex;
-        for (i = lineIndexStart; i < lineIndexEnd; ++i) {
-            if ((jplsLine >= lineTable[i].jplsStart) &&
-                            (jplsLine <= lineTable[i].jplsEnd)) {
-                return i;
-            }
-        }
-        return -1;
-    }
-
-    private int stiLineNumber(int sti, int lti, int jplsLine) {
-        return lineTable[lti].njplsStart +
-                (((jplsLine - lineTable[lti].jplsStart) /
-                                   lineTable[lti].jplsLineInc));
-    }
-
-    private int fileTableIndex(int sti, int fileId) {
-        int i;
-        int fileIndexStart = stratumTable[sti].fileIndex;
-        /* one past end */
-        int fileIndexEnd = stratumTable[sti+1].fileIndex;
-        for (i = fileIndexStart; i < fileIndexEnd; ++i) {
-            if (fileTable[i].fileId == fileId) {
-                return i;
-            }
-        }
-        return -1;
-    }
-
-    private int stiFileTableIndex(int sti, int lti) {
-        return fileTableIndex(sti, lineTable[lti].fileId);
-    }
-
-    boolean isValid() {
-        return isValid;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java
deleted file mode 100644
index 03c1959..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class ShortTypeImpl extends PrimitiveTypeImpl implements ShortType {
-    ShortTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-
-    public String signature() {
-        return "S";
-    }
-
-    PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException {
-        return vm.mirrorOf(((PrimitiveValueImpl)value).checkedShortValue());
-    }
-
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java
deleted file mode 100644
index afbbcda..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class ShortValueImpl extends PrimitiveValueImpl
-                            implements ShortValue {
-    private short value;
-
-    ShortValueImpl(VirtualMachine aVm,short aValue) {
-        super(aVm);
-
-        value = aValue;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof ShortValue)) {
-            return (value == ((ShortValue)obj).value()) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        /*
-         * TO DO: Better hash code
-         */
-        return intValue();
-    }
-
-    public int compareTo(ShortValue shortVal) {
-        return value() - shortVal.value();
-    }
-
-    public Type type() {
-        return vm.theShortType();
-    }
-
-    public short value() {
-        return value;
-    }
-
-    public boolean booleanValue() {
-        return(value == 0)?false:true;
-    }
-
-    public byte byteValue() {
-        return(byte)value;
-    }
-
-    public char charValue() {
-        return(char)value;
-    }
-
-    public short shortValue() {
-        return(short)value;
-    }
-
-    public int intValue() {
-        return(int)value;
-    }
-
-    public long longValue() {
-        return(long)value;
-    }
-
-    public float floatValue() {
-        return(float)value;
-    }
-
-    public double doubleValue() {
-        return(double)value;
-    }
-
-    byte checkedByteValue() throws InvalidTypeException {
-        if ((value > Byte.MAX_VALUE) || (value < Byte.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to byte");
-        } else {
-            return super.checkedByteValue();
-        }
-    }
-
-    char checkedCharValue() throws InvalidTypeException {
-        if ((value > Character.MAX_VALUE) || (value < Character.MIN_VALUE)) {
-            throw new InvalidTypeException("Can't convert " + value + " to char");
-        } else {
-            return super.checkedCharValue();
-        }
-    }
-
-    public String toString() {
-        return "" + value;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java
deleted file mode 100644
index 69461d3..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Copyright (c) 2002, 2005, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-import sun.jvm.hotspot.oops.ObjectHeap;
-import sun.jvm.hotspot.debugger.OopHandle;
-import sun.jvm.hotspot.oops.Array;
-import sun.jvm.hotspot.oops.ObjArray;
-import sun.jvm.hotspot.oops.TypeArray;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.runtime.BasicType;
-import sun.jvm.hotspot.runtime.JavaVFrame;
-import sun.jvm.hotspot.runtime.StackValue;
-import sun.jvm.hotspot.runtime.StackValueCollection;
-import sun.jvm.hotspot.utilities.Assert;
-import java.util.List;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Collections;
-
-public class StackFrameImpl extends MirrorImpl
-                            implements StackFrame
-{
-    /* Once false, frame should not be used.
-     * access synchronized on (vm.state())
-     */
-    private boolean isValid = true;
-
-    private final ThreadReferenceImpl thread;
-    private final JavaVFrame saFrame;
-    private final Location location;
-    private Map visibleVariables =  null;
-    private ObjectReference thisObject = null;
-
-    StackFrameImpl(VirtualMachine vm, ThreadReferenceImpl thread,
-                   JavaVFrame jvf) {
-        super(vm);
-        this.thread = thread;
-        this.saFrame = jvf;
-
-        sun.jvm.hotspot.oops.Method SAMethod = jvf.getMethod();
-
-        ReferenceType rt = ((VirtualMachineImpl)vm).referenceType(SAMethod.getMethodHolder());
-
-        this.location = new LocationImpl(vm, rt, SAMethod, (long)jvf.getBCI());
-    }
-
-    private void validateStackFrame() {
-        if (!isValid) {
-            throw new InvalidStackFrameException("Thread has been resumed");
-        }
-    }
-
-    JavaVFrame getJavaVFrame() {
-        return saFrame;
-    }
-
-    /**
-     * Return the frame location.
-     * Need not be synchronized since it cannot be provably stale.
-     */
-    public Location location() {
-        validateStackFrame();
-        return location;
-    }
-
-    /**
-     * Return the thread holding the frame.
-     * Need not be synchronized since it cannot be provably stale.
-     */
-    public ThreadReference thread() {
-        validateStackFrame();
-        return thread;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof StackFrameImpl)) {
-            StackFrameImpl other = (StackFrameImpl)obj;
-            return (saFrame.equals(other.saFrame));
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        return saFrame.hashCode();
-    }
-
-    public ObjectReference thisObject() {
-        validateStackFrame();
-        MethodImpl currentMethod = (MethodImpl)location.method();
-        if (currentMethod.isStatic() || currentMethod.isNative()) {
-            return null;
-        }
-        if (thisObject == null) {
-            StackValueCollection values = saFrame.getLocals();
-            if (Assert.ASSERTS_ENABLED) {
-                Assert.that(values.size() > 0, "this is missing");
-            }
-            // 'this' at index 0.
-            if (values.get(0).getType() == BasicType.getTConflict()) {
-              return null;
-            }
-            OopHandle handle = values.oopHandleAt(0);
-            ObjectHeap heap = vm.saObjectHeap();
-            thisObject = vm.objectMirror(heap.newOop(handle));
-        }
-        return thisObject;
-    }
-
-    /**
-     * Build the visible variable map.
-     * Need not be synchronized since it cannot be provably stale.
-     */
-    private void createVisibleVariables() throws AbsentInformationException {
-        if (visibleVariables == null) {
-            List allVariables = location.method().variables();
-            Map map = new HashMap(allVariables.size());
-
-            Iterator iter = allVariables.iterator();
-            while (iter.hasNext()) {
-                LocalVariableImpl variable = (LocalVariableImpl)iter.next();
-                String name = variable.name();
-                if (variable.isVisible(this)) {
-                    LocalVariable existing = (LocalVariable)map.get(name);
-                    if ((existing == null) ||
-                        variable.hides(existing)) {
-                        map.put(name, variable);
-                    }
-                }
-            }
-            visibleVariables = map;
-        }
-    }
-
-    /**
-     * Return the list of visible variable in the frame.
-     * Need not be synchronized since it cannot be provably stale.
-     */
-    public List visibleVariables() throws AbsentInformationException {
-        validateStackFrame();
-        createVisibleVariables();
-        List mapAsList = new ArrayList(visibleVariables.values());
-        Collections.sort(mapAsList);
-        return mapAsList;
-    }
-
-    /**
-     * Return a particular variable in the frame.
-     * Need not be synchronized since it cannot be provably stale.
-     */
-    public LocalVariable visibleVariableByName(String name) throws AbsentInformationException  {
-        validateStackFrame();
-        createVisibleVariables();
-        return (LocalVariable)visibleVariables.get(name);
-    }
-
-    public Value getValue(LocalVariable variable) {
-        List list = new ArrayList(1);
-        list.add(variable);
-        Map map = getValues(list);
-        return (Value)map.get(variable);
-    }
-
-    public Map getValues(List variables) {
-        validateStackFrame();
-        StackValueCollection values = saFrame.getLocals();
-
-        int count = variables.size();
-        Map map = new HashMap(count);
-        for (int ii=0; ii<count; ++ii) {
-            LocalVariableImpl variable = (LocalVariableImpl)variables.get(ii);
-            if (!variable.isVisible(this)) {
-                throw new IllegalArgumentException(variable.name() +
-                                 " is not valid at this frame location");
-            }
-            ValueImpl valueImpl;
-            int ss = variable.slot();
-            char c = variable.signature().charAt(0);
-            BasicType variableType = BasicType.charToBasicType(c);
-            valueImpl = getSlotValue(values, variableType, ss);
-            map.put(variable, valueImpl);
-        }
-        return map;
-    }
-
-    public List getArgumentValues() {
-        validateStackFrame();
-        StackValueCollection values = saFrame.getLocals();
-        MethodImpl mmm = (MethodImpl)location.method();
-        if (mmm.isNative())
-            return null;
-        List argSigs = mmm.argumentSignatures();
-        int count = argSigs.size();
-        List res = new ArrayList(0);
-
-        int slot = mmm.isStatic()? 0 : 1;
-        for (int ii = 0; ii < count; ++slot, ++ii) {
-            char sigChar = ((String)argSigs.get(ii)).charAt(0);
-            BasicType variableType = BasicType.charToBasicType(sigChar);
-            res.add(getSlotValue(values, variableType, slot));
-            if (sigChar == 'J' || sigChar == 'D') {
-                slot++;
-            }
-        }
-        return res;
-    }
-
-    private ValueImpl getSlotValue(StackValueCollection values,
-                       BasicType variableType, int ss) {
-        ValueImpl valueImpl = null;
-        OopHandle handle = null;
-        ObjectHeap heap = vm.saObjectHeap();
-        if (values.get(ss).getType() == BasicType.getTConflict()) {
-          // Dead locals, so just represent them as a zero of the appropriate type
-          if (variableType == BasicType.T_BOOLEAN) {
-            valueImpl = (BooleanValueImpl) vm.mirrorOf(false);
-          } else if (variableType == BasicType.T_CHAR) {
-            valueImpl = (CharValueImpl) vm.mirrorOf((char)0);
-          } else if (variableType == BasicType.T_FLOAT) {
-            valueImpl = (FloatValueImpl) vm.mirrorOf((float)0);
-          } else if (variableType == BasicType.T_DOUBLE) {
-            valueImpl = (DoubleValueImpl) vm.mirrorOf((double)0);
-          } else if (variableType == BasicType.T_BYTE) {
-            valueImpl = (ByteValueImpl) vm.mirrorOf((byte)0);
-          } else if (variableType == BasicType.T_SHORT) {
-            valueImpl = (ShortValueImpl) vm.mirrorOf((short)0);
-          } else if (variableType == BasicType.T_INT) {
-            valueImpl = (IntegerValueImpl) vm.mirrorOf((int)0);
-          } else if (variableType == BasicType.T_LONG) {
-            valueImpl = (LongValueImpl) vm.mirrorOf((long)0);
-          } else if (variableType == BasicType.T_OBJECT) {
-            // we may have an [Ljava/lang/Object; - i.e., Object[] with the
-            // elements themselves may be arrays because every array is an Object.
-            handle = null;
-            valueImpl = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
-          } else if (variableType == BasicType.T_ARRAY) {
-            handle = null;
-            valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
-          } else if (variableType == BasicType.T_VOID) {
-            valueImpl = new VoidValueImpl(vm);
-          } else {
-            throw new RuntimeException("Should not read here");
-          }
-        } else {
-          if (variableType == BasicType.T_BOOLEAN) {
-            valueImpl = (BooleanValueImpl) vm.mirrorOf(values.booleanAt(ss));
-          } else if (variableType == BasicType.T_CHAR) {
-            valueImpl = (CharValueImpl) vm.mirrorOf(values.charAt(ss));
-          } else if (variableType == BasicType.T_FLOAT) {
-            valueImpl = (FloatValueImpl) vm.mirrorOf(values.floatAt(ss));
-          } else if (variableType == BasicType.T_DOUBLE) {
-            valueImpl = (DoubleValueImpl) vm.mirrorOf(values.doubleAt(ss));
-          } else if (variableType == BasicType.T_BYTE) {
-            valueImpl = (ByteValueImpl) vm.mirrorOf(values.byteAt(ss));
-          } else if (variableType == BasicType.T_SHORT) {
-            valueImpl = (ShortValueImpl) vm.mirrorOf(values.shortAt(ss));
-          } else if (variableType == BasicType.T_INT) {
-            valueImpl = (IntegerValueImpl) vm.mirrorOf(values.intAt(ss));
-          } else if (variableType == BasicType.T_LONG) {
-            valueImpl = (LongValueImpl) vm.mirrorOf(values.longAt(ss));
-          } else if (variableType == BasicType.T_OBJECT) {
-            // we may have an [Ljava/lang/Object; - i.e., Object[] with the
-            // elements themselves may be arrays because every array is an Object.
-            handle = values.oopHandleAt(ss);
-            valueImpl = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
-          } else if (variableType == BasicType.T_ARRAY) {
-            handle = values.oopHandleAt(ss);
-            valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
-          } else if (variableType == BasicType.T_VOID) {
-            valueImpl = new VoidValueImpl(vm);
-          } else {
-            throw new RuntimeException("Should not read here");
-          }
-        }
-
-        return valueImpl;
-    }
-
-    public void setValue(LocalVariable variableIntf, Value valueIntf)
-        throws InvalidTypeException, ClassNotLoadedException {
-
-        vm.throwNotReadOnlyException("StackFrame.setValue()");
-    }
-
-    public String toString() {
-        return location.toString() + " in thread " + thread.toString();
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java
deleted file mode 100644
index 3ab46b4..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-class StratumLineInfo implements LineInfo {
-    private final String stratumID;
-    private final int lineNumber;
-    private final String sourceName;
-    private final String sourcePath;
-
-    StratumLineInfo(String stratumID, int lineNumber,
-                    String sourceName, String sourcePath) {
-        this.stratumID = stratumID;
-        this.lineNumber = lineNumber;
-        this.sourceName = sourceName;
-        this.sourcePath = sourcePath;
-    }
-
-    public String liStratum() {
-        return stratumID;
-    }
-
-    public int liLineNumber() {
-        return lineNumber;
-    }
-
-    public String liSourceName()
-                            throws AbsentInformationException {
-        if (sourceName == null) {
-            throw new AbsentInformationException();
-        }
-        return sourceName;
-    }
-
-    public String liSourcePath()
-                            throws AbsentInformationException {
-        if (sourcePath == null) {
-            throw new AbsentInformationException();
-        }
-        return sourcePath;
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java
deleted file mode 100644
index c73bf43..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.OopUtilities;
-
-public class StringReferenceImpl extends ObjectReferenceImpl
-    implements StringReference
-{
-    private String value;
-
-    StringReferenceImpl(VirtualMachine aVm, sun.jvm.hotspot.oops.Instance oRef) {
-        super(aVm,oRef);
-        value = OopUtilities.stringOopToString(oRef);
-    }
-
-    public String value() {
-        return value;
-    }
-
-    public String toString() {
-        return "\"" + value() + "\"";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java
deleted file mode 100644
index 28159b1..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import sun.jvm.hotspot.oops.Oop;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.OopUtilities;
-import sun.jvm.hotspot.runtime.JavaThread;
-import com.sun.jdi.*;
-import java.util.*;
-
-public class ThreadGroupReferenceImpl extends ObjectReferenceImpl
-    implements ThreadGroupReference
-{
-    ThreadGroupReferenceImpl(VirtualMachine aVm, sun.jvm.hotspot.oops.Oop oRef) {
-        super(aVm, oRef);
-    }
-
-    protected String description() {
-        return "ThreadGroupReference " + uniqueID();
-    }
-
-    public String name() {
-        return OopUtilities.threadGroupOopGetName(ref());
-    }
-
-    public ThreadGroupReference parent() {
-        return (ThreadGroupReferenceImpl)vm.threadGroupMirror(
-               (Instance)OopUtilities.threadGroupOopGetParent(ref()));
-    }
-
-    public void suspend() {
-        vm.throwNotReadOnlyException("ThreadGroupReference.suspend()");
-    }
-
-    public void resume() {
-        vm.throwNotReadOnlyException("ThreadGroupReference.resume()");
-    }
-
-    public List threads() {
-        // Each element of this array is the Oop for a thread;
-        // NOTE it is not the JavaThread that we need to create
-        // a ThreadReferenceImpl.
-        Oop[] myThreads = OopUtilities.threadGroupOopGetThreads(ref());
-
-        ArrayList myList = new ArrayList(myThreads.length);
-        for (int ii = 0; ii < myThreads.length; ii++) {
-            JavaThread jt = OopUtilities.threadOopGetJavaThread(myThreads[ii]);
-            if (jt != null) {
-                ThreadReferenceImpl xx = (ThreadReferenceImpl)vm.threadMirror(jt);
-                myList.add(xx);
-            }
-        }
-        return myList;
-    }
-
-    public List threadGroups() {
-        Oop[] myGroups = OopUtilities.threadGroupOopGetGroups(ref());
-        ArrayList myList = new ArrayList(myGroups.length);
-        for (int ii = 0; ii < myGroups.length; ii++) {
-            ThreadGroupReferenceImpl xx = (ThreadGroupReferenceImpl)vm.threadGroupMirror(
-                                          (Instance)myGroups[ii]);
-            myList.add(xx);
-
-        }
-        return myList;
-    }
-
-    public String toString() {
-        return "instance of " + referenceType().name() +
-               "(name='" + name() + "', " + "id=" + uniqueID() + ")";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java
deleted file mode 100644
index d6b1732..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * Copyright (c) 2002, 2009, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import sun.jvm.hotspot.debugger.OopHandle;
-import sun.jvm.hotspot.runtime.VMObject;
-import sun.jvm.hotspot.runtime.JavaThread;
-import sun.jvm.hotspot.runtime.OSThread;
-//import sun.jvm.hotspot.runtime.StackFrameStream;
-import sun.jvm.hotspot.runtime.JavaVFrame;
-import sun.jvm.hotspot.runtime.JavaThreadState;
-import sun.jvm.hotspot.runtime.MonitorInfo;
-import sun.jvm.hotspot.runtime.ObjectMonitor;
-import sun.jvm.hotspot.oops.Oop;
-import sun.jvm.hotspot.oops.ObjectHeap;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.OopUtilities;
-import sun.jvm.hotspot.oops.Klass;
-import sun.jvm.hotspot.utilities.Assert;
-import com.sun.jdi.*;
-import java.util.*;
-
-public class ThreadReferenceImpl extends ObjectReferenceImpl
-             implements ThreadReference, /* imports */ JVMTIThreadState {
-
-    private JavaThread myJavaThread;
-    private ArrayList frames;    // StackFrames
-    private List ownedMonitors; // List<ObjectReferenceImpl>
-    private List ownedMonitorsInfo; // List<MonitorInfo>
-    private ObjectReferenceImpl currentContendingMonitor;
-
-    ThreadReferenceImpl(VirtualMachine aVm, sun.jvm.hotspot.runtime.JavaThread aRef) {
-        // We are given a JavaThread and save it in our myJavaThread field.
-        // But, our parent class is an ObjectReferenceImpl so we need an Oop
-        // for it.  JavaThread is a wrapper around a Thread Oop so we get
-        // that Oop and give it to our super.
-        // We can get it back again by calling ref().
-        super(aVm, (Instance)aRef.getThreadObj());
-        myJavaThread = aRef;
-    }
-
-    ThreadReferenceImpl(VirtualMachine vm, Instance oRef) {
-        // Instance must be of type java.lang.Thread
-        super(vm, oRef);
-
-        // JavaThread retrieved from java.lang.Thread instance may be null.
-        // This is the case for threads not-started and for zombies. Wherever
-        // appropriate, check for null instead of resulting in NullPointerException.
-        myJavaThread = OopUtilities.threadOopGetJavaThread(oRef);
-    }
-
-    // return value may be null. refer to the comment in constructor.
-    JavaThread getJavaThread() {
-        return myJavaThread;
-    }
-
-    protected String description() {
-        return "ThreadReference " + uniqueID();
-    }
-
-    /**
-     * Note that we only cache the name string while suspended because
-     * it can change via Thread.setName arbitrarily
-     */
-    public String name() {
-        return OopUtilities.threadOopGetName(ref());
-    }
-
-    public void suspend() {
-        vm.throwNotReadOnlyException("ThreadReference.suspend()");
-    }
-
-    public void resume() {
-        vm.throwNotReadOnlyException("ThreadReference.resume()");
-    }
-
-    public int suspendCount() {
-        // all threads are "suspended" when we attach to process or core.
-        // we interpret this as one suspend.
-        return 1;
-    }
-
-    public void stop(ObjectReference throwable) throws InvalidTypeException {
-        vm.throwNotReadOnlyException("ThreadReference.stop()");
-    }
-
-    public void interrupt() {
-        vm.throwNotReadOnlyException("ThreadReference.interrupt()");
-    }
-
-    // refer to jvmtiEnv::GetThreadState
-    private int jvmtiGetThreadState() {
-        // get most state bits
-        int state = OopUtilities.threadOopGetThreadStatus(ref());
-        // add more state bits
-        if (myJavaThread != null) {
-            JavaThreadState jts = myJavaThread.getThreadState();
-            if (myJavaThread.isBeingExtSuspended()) {
-                state |= JVMTI_THREAD_STATE_SUSPENDED;
-            }
-            if (jts == JavaThreadState.IN_NATIVE) {
-                state |= JVMTI_THREAD_STATE_IN_NATIVE;
-            }
-            OSThread osThread = myJavaThread.getOSThread();
-            if (osThread != null && osThread.interrupted()) {
-                state |= JVMTI_THREAD_STATE_INTERRUPTED;
-            }
-        }
-        return state;
-    }
-
-    public int status() {
-        int state = jvmtiGetThreadState();
-        int status = THREAD_STATUS_UNKNOWN;
-        // refer to map2jdwpThreadStatus in util.c (back-end)
-        if (! ((state & JVMTI_THREAD_STATE_ALIVE) != 0) ) {
-            if ((state & JVMTI_THREAD_STATE_TERMINATED) != 0) {
-                status = THREAD_STATUS_ZOMBIE;
-            } else {
-                status = THREAD_STATUS_NOT_STARTED;
-            }
-        } else {
-            if ((state & JVMTI_THREAD_STATE_SLEEPING) != 0) {
-                status = THREAD_STATUS_SLEEPING;
-            } else if ((state & JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER) != 0) {
-                status = THREAD_STATUS_MONITOR;
-            } else if ((state & JVMTI_THREAD_STATE_WAITING) != 0) {
-                status = THREAD_STATUS_WAIT;
-            } else if ((state & JVMTI_THREAD_STATE_RUNNABLE) != 0) {
-                status = THREAD_STATUS_RUNNING;
-            }
-        }
-        return status;
-    }
-
-    public boolean isSuspended() { //fixme jjh
-        // If we want to support doing this for a VM which was being
-        // debugged, then we need to fix this.
-        // In the meantime, we will say all threads are suspended,
-        // otherwise, some things won't work, like the jdb 'up' cmd.
-        return true;
-    }
-
-    public boolean isAtBreakpoint() { //fixme jjh
-        // If we want to support doing this for a VM which was being
-        // debugged, then we need to fix this.
-        return false;
-    }
-
-    public ThreadGroupReference threadGroup() {
-        return (ThreadGroupReferenceImpl)vm.threadGroupMirror(
-               (Instance)OopUtilities.threadOopGetThreadGroup(ref()));
-    }
-
-    public int frameCount() throws IncompatibleThreadStateException  { //fixme jjh
-        privateFrames(0, -1);
-        return frames.size();
-    }
-
-    public List frames() throws IncompatibleThreadStateException  {
-        return privateFrames(0, -1);
-    }
-
-    public StackFrame frame(int index) throws IncompatibleThreadStateException  {
-        List list = privateFrames(index, 1);
-        return (StackFrame)list.get(0);
-    }
-
-    public List frames(int start, int length)
-                              throws IncompatibleThreadStateException  {
-        if (length < 0) {
-            throw new IndexOutOfBoundsException(
-                "length must be greater than or equal to zero");
-        }
-        return privateFrames(start, length);
-    }
-
-    /**
-     * Private version of frames() allows "-1" to specify all
-     * remaining frames.
-     */
-
-    private List privateFrames(int start, int length)
-                              throws IncompatibleThreadStateException  {
-        if (myJavaThread == null) {
-            // for zombies and yet-to-be-started threads we need to throw exception
-            throw new IncompatibleThreadStateException();
-        }
-        if (frames == null) {
-            frames = new ArrayList(10);
-            JavaVFrame myvf = myJavaThread.getLastJavaVFrameDbg();
-            while (myvf != null) {
-                StackFrame myFrame = new StackFrameImpl(vm, this, myvf);
-                //fixme jjh null should be a Location
-                frames.add(myFrame);
-                myvf = (JavaVFrame)myvf.javaSender();
-            }
-        }
-
-        List retVal;
-        if (frames.size() == 0) {
-            retVal = new ArrayList(0);
-        } else {
-            int toIndex = start + length;
-            if (length == -1) {
-                toIndex = frames.size();
-            }
-            retVal = frames.subList(start, toIndex);
-        }
-        return Collections.unmodifiableList(retVal);
-    }
-
-    // refer to JvmtiEnvBase::get_owned_monitors
-    public List ownedMonitors()  throws IncompatibleThreadStateException {
-        if (vm.canGetOwnedMonitorInfo() == false) {
-            throw new UnsupportedOperationException();
-        }
-
-        if (myJavaThread == null) {
-           throw new IncompatibleThreadStateException();
-        }
-
-        if (ownedMonitors != null) {
-            return ownedMonitors;
-        }
-
-        ownedMonitorsWithStackDepth();
-
-        for (Iterator omi = ownedMonitorsInfo.iterator(); omi.hasNext(); ) {
-            //FIXME : Change the MonitorInfoImpl cast to com.sun.jdi.MonitorInfo
-            //        when hotspot start building with jdk1.6.
-            ownedMonitors.add(((MonitorInfoImpl)omi.next()).monitor());
-        }
-
-        return ownedMonitors;
-    }
-
-    // new method since 1.6.
-    // Real body will be supplied later.
-    public List ownedMonitorsAndFrames() throws IncompatibleThreadStateException {
-        if (!vm.canGetMonitorFrameInfo()) {
-            throw new UnsupportedOperationException(
-                "target does not support getting Monitor Frame Info");
-        }
-
-        if (myJavaThread == null) {
-           throw new IncompatibleThreadStateException();
-        }
-
-        if (ownedMonitorsInfo != null) {
-            return ownedMonitorsInfo;
-        }
-
-        ownedMonitorsWithStackDepth();
-        return ownedMonitorsInfo;
-    }
-
-    private void ownedMonitorsWithStackDepth() {
-
-        ownedMonitorsInfo = new ArrayList();
-        List lockedObjects = new ArrayList(); // List<OopHandle>
-        List stackDepth = new ArrayList(); // List<int>
-        ObjectMonitor waitingMonitor = myJavaThread.getCurrentWaitingMonitor();
-        ObjectMonitor pendingMonitor = myJavaThread.getCurrentPendingMonitor();
-        OopHandle waitingObj = null;
-        if (waitingMonitor != null) {
-            // save object of current wait() call (if any) for later comparison
-            waitingObj = waitingMonitor.object();
-        }
-        OopHandle pendingObj = null;
-        if (pendingMonitor != null) {
-            // save object of current enter() call (if any) for later comparison
-            pendingObj = pendingMonitor.object();
-        }
-
-        JavaVFrame frame = myJavaThread.getLastJavaVFrameDbg();
-        int depth=0;
-        while (frame != null) {
-            List frameMonitors = frame.getMonitors();  // List<MonitorInfo>
-            for (Iterator miItr = frameMonitors.iterator(); miItr.hasNext(); ) {
-                sun.jvm.hotspot.runtime.MonitorInfo mi = (sun.jvm.hotspot.runtime.MonitorInfo) miItr.next();
-                if (mi.eliminated() && frame.isCompiledFrame()) {
-                  continue; // skip eliminated monitor
-                }
-                OopHandle obj = mi.owner();
-                if (obj == null) {
-                    // this monitor doesn't have an owning object so skip it
-                    continue;
-                }
-
-                if (obj.equals(waitingObj)) {
-                    // the thread is waiting on this monitor so it isn't really owned
-                    continue;
-                }
-
-                if (obj.equals(pendingObj)) {
-                    // the thread is pending on this monitor so it isn't really owned
-                    continue;
-                }
-
-                boolean found = false;
-                for (Iterator loItr = lockedObjects.iterator(); loItr.hasNext(); ) {
-                    // check for recursive locks
-                    if (obj.equals(loItr.next())) {
-                        found = true;
-                        break;
-                    }
-                }
-                if (found) {
-                    // already have this object so don't include it
-                    continue;
-                }
-                // add the owning object to our list
-                lockedObjects.add(obj);
-                stackDepth.add(new Integer(depth));
-            }
-            frame = (JavaVFrame) frame.javaSender();
-            depth++;
-        }
-
-        // now convert List<OopHandle> to List<ObjectReference>
-        ObjectHeap heap = vm.saObjectHeap();
-        Iterator stk = stackDepth.iterator();
-        for (Iterator loItr = lockedObjects.iterator(); loItr.hasNext(); ) {
-            Oop obj = heap.newOop((OopHandle)loItr.next());
-            ownedMonitorsInfo.add(new MonitorInfoImpl(vm, vm.objectMirror(obj), this,
-                                                              ((Integer)stk.next()).intValue()));
-        }
-    }
-
-    // refer to JvmtiEnvBase::get_current_contended_monitor
-    public ObjectReference currentContendedMonitor()
-                              throws IncompatibleThreadStateException  {
-        if (vm.canGetCurrentContendedMonitor() == false) {
-            throw new UnsupportedOperationException();
-        }
-
-        if (myJavaThread == null) {
-           throw new IncompatibleThreadStateException();
-        }
-        ObjectMonitor mon = myJavaThread.getCurrentWaitingMonitor();
-        if (mon == null) {
-           // thread is not doing an Object.wait() call
-           mon = myJavaThread.getCurrentPendingMonitor();
-           if (mon != null) {
-               OopHandle handle = mon.object();
-               // If obj == NULL, then ObjectMonitor is raw which doesn't count
-               // as contended for this API
-               return vm.objectMirror(vm.saObjectHeap().newOop(handle));
-           } else {
-               // no contended ObjectMonitor
-               return null;
-           }
-        } else {
-           // thread is doing an Object.wait() call
-           OopHandle handle = mon.object();
-           if (Assert.ASSERTS_ENABLED) {
-               Assert.that(handle != null, "Object.wait() should have an object");
-           }
-           Oop obj = vm.saObjectHeap().newOop(handle);
-           return vm.objectMirror(obj);
-        }
-    }
-
-
-    public void popFrames(StackFrame frame) throws IncompatibleThreadStateException {
-        vm.throwNotReadOnlyException("ThreadReference.popFrames()");
-    }
-
-    public void forceEarlyReturn(Value returnValue) throws IncompatibleThreadStateException {
-        vm.throwNotReadOnlyException("ThreadReference.forceEarlyReturn()");
-    }
-
-    public String toString() {
-        return "instance of " + referenceType().name() +
-               "(name='" + name() + "', " + "id=" + uniqueID() + ")";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java
deleted file mode 100644
index 3a74843..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-import sun.jvm.hotspot.oops.Symbol;
-import sun.jvm.hotspot.oops.Oop;
-import sun.jvm.hotspot.oops.InstanceKlass;
-
-import java.util.List;
-
-/**
- * There is no SA class that corresponds to this.  Therefore,
- * all the methods in this class which involve the SA mirror class
- * have to be implemented in the subclasses.
- */
-abstract public class TypeComponentImpl extends MirrorImpl
-    implements TypeComponent {
-
-    protected final ReferenceTypeImpl declaringType;
-    protected String signature;
-
-    TypeComponentImpl(VirtualMachine vm, ReferenceTypeImpl declaringType) {
-        super(vm);
-        this.declaringType = declaringType;
-    }
-
-    public ReferenceType declaringType() {
-        return declaringType;
-    }
-
-    public String signature() {
-        return signature;
-    }
-
-    abstract public String name();
-    abstract public int modifiers();
-    abstract public boolean isPackagePrivate();
-    abstract public boolean isPrivate();
-    abstract public boolean isProtected();
-    abstract public boolean isPublic();
-    abstract public boolean isStatic();
-    abstract public boolean isFinal();
-    abstract public int hashCode();
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java
deleted file mode 100644
index c2e0091..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public abstract class TypeImpl extends MirrorImpl implements Type
-{
-    private String typeName;
-
-    TypeImpl(VirtualMachine aVm) {
-        super(aVm);
-    }
-
-    public abstract String signature();
-
-    public String name() {
-        if (typeName == null) {
-            JNITypeParser parser = new JNITypeParser(signature());
-            typeName = parser.typeName();
-        }
-        return typeName;
-    }
-
-    public boolean equals(Object obj) {
-        if ((obj != null) && (obj instanceof Type)) {
-            Type other = (Type)obj;
-            return signature().equals(other.signature()) &&
-                   super.equals(obj);
-        } else {
-            return false;
-        }
-    }
-
-    public int hashCode() {
-        return signature().hashCode();
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java
deleted file mode 100644
index a6adb73..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import sun.jvm.hotspot.runtime.ClassConstants;
-import com.sun.jdi.*;
-
-public interface VMModifiers extends ClassConstants {
-    int PUBLIC       = (int) JVM_ACC_PUBLIC;       /* visible to everyone */
-    int PRIVATE      = (int) JVM_ACC_PRIVATE;      /* visible only to the defining class */
-    int PROTECTED    = (int) JVM_ACC_PROTECTED;    /* visible to subclasses */
-    int STATIC       = (int) JVM_ACC_STATIC;       /* instance variable is static */
-    int FINAL        = (int) JVM_ACC_FINAL;        /* no further subclassing, overriding */
-    int SYNCHRONIZED = (int) JVM_ACC_SYNCHRONIZED; /* wrap method call in monitor lock */
-    int VOLATILE     = (int) JVM_ACC_VOLATILE;     /* can cache in registers */
-    int BRIDGE       = (int) JVM_ACC_BRIDGE;       /* bridge method generated by compiler */
-    int TRANSIENT    = (int) JVM_ACC_TRANSIENT;    /* not persistant */
-    int VARARGS      = (int) JVM_ACC_VARARGS;      /* method declared with variable number of args */
-    int IS_ENUM_CONSTANT = (int) JVM_ACC_ENUM;     /* field is declared as element of enum */
-    int NATIVE       = (int) JVM_ACC_NATIVE;       /* implemented in C */
-    int INTERFACE    = (int) JVM_ACC_INTERFACE;    /* class is an interface */
-    int ABSTRACT     = (int) JVM_ACC_ABSTRACT;     /* no definition provided */
-    int SYNTHETIC    = (int) JVM_ACC_SYNTHETIC;    /* not in source code */
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java
deleted file mode 100644
index 22ba42f..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-/*
- * This interface allows us to pass fields, variables, and
- * array components through the same interfaces. This currently allows
- * more common code for type checking. In the future we could use it for
- * more.
- */
-interface ValueContainer {
-    Type type() throws ClassNotLoadedException;
-    Type findType(String signature) throws ClassNotLoadedException;
-    String typeName();
-    String signature();
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java
deleted file mode 100644
index b046ae5..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-abstract class ValueImpl extends MirrorImpl implements Value {
-    ValueImpl(VirtualMachine aVm) {
-        super(aVm);
-    }
-
-    // type() is in the subclasses
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
deleted file mode 100644
index be256c2..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
+++ /dev/null
@@ -1,1224 +0,0 @@
-/*
- * Copyright (c) 2002, 2012, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.EventQueue;
-import com.sun.jdi.request.EventRequestManager;
-
-import sun.jvm.hotspot.HotSpotAgent;
-import sun.jvm.hotspot.types.TypeDataBase;
-import sun.jvm.hotspot.oops.Klass;
-import sun.jvm.hotspot.oops.InstanceKlass;
-import sun.jvm.hotspot.oops.ArrayKlass;
-import sun.jvm.hotspot.oops.ObjArrayKlass;
-import sun.jvm.hotspot.oops.TypeArrayKlass;
-import sun.jvm.hotspot.oops.Oop;
-import sun.jvm.hotspot.oops.Instance;
-import sun.jvm.hotspot.oops.Array;
-import sun.jvm.hotspot.oops.ObjArray;
-import sun.jvm.hotspot.oops.TypeArray;
-import sun.jvm.hotspot.oops.Symbol;
-import sun.jvm.hotspot.oops.ObjectHeap;
-import sun.jvm.hotspot.oops.DefaultHeapVisitor;
-import sun.jvm.hotspot.oops.JVMDIClassStatus;
-import sun.jvm.hotspot.runtime.VM;
-import sun.jvm.hotspot.runtime.JavaThread;
-import sun.jvm.hotspot.memory.SystemDictionary;
-import sun.jvm.hotspot.memory.SymbolTable;
-import sun.jvm.hotspot.memory.Universe;
-import sun.jvm.hotspot.utilities.Assert;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Observer;
-import java.util.StringTokenizer;
-import java.lang.ref.SoftReference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.Reference;
-
-public class VirtualMachineImpl extends MirrorImpl implements PathSearchingVirtualMachine {
-
-    private HotSpotAgent     saAgent = new HotSpotAgent();
-    private VM               saVM;
-    private Universe         saUniverse;
-    private SystemDictionary saSystemDictionary;
-    private SymbolTable      saSymbolTable;
-    private ObjectHeap       saObjectHeap;
-
-    VM saVM() {
-        return saVM;
-    }
-
-    SystemDictionary saSystemDictionary() {
-        return saSystemDictionary;
-    }
-
-    SymbolTable saSymbolTable() {
-        return saSymbolTable;
-    }
-
-    Universe saUniverse() {
-        return saUniverse;
-    }
-
-    ObjectHeap saObjectHeap() {
-        return saObjectHeap;
-    }
-
-    com.sun.jdi.VirtualMachineManager vmmgr;
-
-    private final ThreadGroup             threadGroupForJDI;
-
-    // Per-vm singletons for primitive types and for void.
-    // singleton-ness protected by "synchronized(this)".
-    private BooleanType theBooleanType;
-    private ByteType    theByteType;
-    private CharType    theCharType;
-    private ShortType   theShortType;
-    private IntegerType theIntegerType;
-    private LongType    theLongType;
-    private FloatType   theFloatType;
-    private DoubleType  theDoubleType;
-
-    private VoidType    theVoidType;
-
-    private VoidValue voidVal;
-    private Map       typesByID;             // Map<Klass, ReferenceTypeImpl>
-    private List      typesBySignature;      // List<ReferenceTypeImpl> - used in signature search
-    private boolean   retrievedAllTypes = false;
-    private List      bootstrapClasses;      // all bootstrap classes
-    private ArrayList allThreads;
-    private ArrayList topLevelGroups;
-    final   int       sequenceNumber;
-
-    // ObjectReference cache
-    // "objectsByID" protected by "synchronized(this)".
-    private final Map            objectsByID = new HashMap();
-    private final ReferenceQueue referenceQueue = new ReferenceQueue();
-
-    // names of some well-known classes to jdi
-    private Symbol javaLangString;
-    private Symbol javaLangThread;
-    private Symbol javaLangThreadGroup;
-    private Symbol javaLangClass;
-    private Symbol javaLangClassLoader;
-
-    // used in ReferenceTypeImpl.isThrowableBacktraceField
-    private Symbol javaLangThrowable;
-
-    // names of classes used in array assignment check
-    // refer to ArrayTypeImpl.isAssignableTo
-    private Symbol javaLangObject;
-    private Symbol javaLangCloneable;
-    private Symbol javaIoSerializable;
-
-    // symbol used in ClassTypeImpl.isEnum check
-    private Symbol javaLangEnum;
-
-    Symbol javaLangObject() {
-        return javaLangObject;
-    }
-
-    Symbol javaLangCloneable() {
-        return javaLangCloneable;
-    }
-
-    Symbol javaIoSerializable() {
-        return javaIoSerializable;
-    }
-
-    Symbol javaLangEnum() {
-        return javaLangEnum;
-    }
-
-    Symbol javaLangThrowable() {
-        return javaLangThrowable;
-    }
-
-    // name of the current default stratum
-    private String defaultStratum;
-
-    // initialize known class name symbols
-    private void initClassNameSymbols() {
-        SymbolTable st = saSymbolTable();
-        javaLangString = st.probe("java/lang/String");
-        javaLangThread = st.probe("java/lang/Thread");
-        javaLangThreadGroup = st.probe("java/lang/ThreadGroup");
-        javaLangClass = st.probe("java/lang/Class");
-        javaLangClassLoader = st.probe("java/lang/ClassLoader");
-        javaLangThrowable = st.probe("java/lang/Throwable");
-        javaLangObject = st.probe("java/lang/Object");
-        javaLangCloneable = st.probe("java/lang/Cloneable");
-        javaIoSerializable = st.probe("java/io/Serializable");
-        javaLangEnum = st.probe("java/lang/Enum");
-    }
-
-    private void init() {
-        saVM = VM.getVM();
-        saUniverse = saVM.getUniverse();
-        saSystemDictionary = saVM.getSystemDictionary();
-        saSymbolTable = saVM.getSymbolTable();
-        saObjectHeap = saVM.getObjectHeap();
-        initClassNameSymbols();
-    }
-
-    static public VirtualMachineImpl createVirtualMachineForCorefile(VirtualMachineManager mgr,
-                                                                     String javaExecutableName,
-                                                                     String coreFileName,
-                                                                     int sequenceNumber)
-        throws Exception {
-        if (Assert.ASSERTS_ENABLED) {
-            Assert.that(coreFileName != null, "SA VirtualMachineImpl: core filename = null is not yet implemented");
-        }
-        if (Assert.ASSERTS_ENABLED) {
-            Assert.that(javaExecutableName != null, "SA VirtualMachineImpl: java executable = null is not yet implemented");
-        }
-
-        VirtualMachineImpl myvm = new VirtualMachineImpl(mgr, sequenceNumber);
-        try {
-            myvm.saAgent.attach(javaExecutableName, coreFileName);
-            myvm.init();
-        } catch (Exception ee) {
-            myvm.saAgent.detach();
-            throw ee;
-        }
-        return myvm;
-    }
-
-    static public VirtualMachineImpl createVirtualMachineForPID(VirtualMachineManager mgr,
-                                                                int pid,
-                                                                int sequenceNumber)
-        throws Exception {
-
-        VirtualMachineImpl myvm = new VirtualMachineImpl(mgr, sequenceNumber);
-        try {
-            myvm.saAgent.attach(pid);
-            myvm.init();
-        } catch (Exception ee) {
-            myvm.saAgent.detach();
-            throw ee;
-        }
-        return myvm;
-    }
-
-    static public VirtualMachineImpl createVirtualMachineForServer(VirtualMachineManager mgr,
-                                                                String server,
-                                                                int sequenceNumber)
-        throws Exception {
-        if (Assert.ASSERTS_ENABLED) {
-            Assert.that(server != null, "SA VirtualMachineImpl: DebugServer = null is not yet implemented");
-        }
-
-        VirtualMachineImpl myvm = new VirtualMachineImpl(mgr, sequenceNumber);
-        try {
-            myvm.saAgent.attach(server);
-            myvm.init();
-        } catch (Exception ee) {
-            myvm.saAgent.detach();
-            throw ee;
-        }
-        return myvm;
-    }
-
-
-    VirtualMachineImpl(VirtualMachineManager mgr, int sequenceNumber)
-        throws Exception {
-        super(null);  // Can't use super(this)
-        vm = this;
-
-        this.sequenceNumber = sequenceNumber;
-        this.vmmgr = mgr;
-
-        /* Create ThreadGroup to be used by all threads servicing
-         * this VM.
-         */
-        threadGroupForJDI = new ThreadGroup("JDI [" +
-                                            this.hashCode() + "]");
-
-        ((com.sun.tools.jdi.VirtualMachineManagerImpl)mgr).addVirtualMachine(this);
-
-        // By default SA agent classes prefer Windows process debugger
-        // to windbg debugger. SA expects special properties to be set
-        // to choose other debuggers. We will set those here before
-        // attaching to SA agent.
-
-        System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true");
-    }
-
-    // we reflectively use newly spec'ed class because our ALT_BOOTDIR
-    // is 1.4.2 and not 1.5.
-    private static Class vmCannotBeModifiedExceptionClass = null;
-    void throwNotReadOnlyException(String operation) {
-        RuntimeException re = null;
-        if (vmCannotBeModifiedExceptionClass == null) {
-            try {
-                vmCannotBeModifiedExceptionClass = Class.forName("com.sun.jdi.VMCannotBeModifiedException");
-            } catch (ClassNotFoundException cnfe) {
-                vmCannotBeModifiedExceptionClass = UnsupportedOperationException.class;
-            }
-        }
-        try {
-            re = (RuntimeException) vmCannotBeModifiedExceptionClass.newInstance();
-        } catch (Exception exp) {
-            re = new RuntimeException(exp.getMessage());
-        }
-        throw re;
-    }
-
-    public boolean equals(Object obj) {
-        // Oh boy; big recursion troubles if we don't have this!
-        // See MirrorImpl.equals
-        return this == obj;
-    }
-
-    public int hashCode() {
-        // big recursion if we don't have this. See MirrorImpl.hashCode
-        return System.identityHashCode(this);
-    }
-
-    public List classesByName(String className) {
-        String signature = JNITypeParser.typeNameToSignature(className);
-        List list;
-        if (!retrievedAllTypes) {
-            retrieveAllClasses();
-        }
-        list = findReferenceTypes(signature);
-        return Collections.unmodifiableList(list);
-    }
-
-    public List allClasses() {
-        if (!retrievedAllTypes) {
-            retrieveAllClasses();
-        }
-        ArrayList a;
-        synchronized (this) {
-            a = new ArrayList(typesBySignature);
-        }
-        return Collections.unmodifiableList(a);
-    }
-
-    // classes loaded by bootstrap loader
-    List bootstrapClasses() {
-        if (bootstrapClasses == null) {
-            bootstrapClasses = new ArrayList();
-            List all = allClasses();
-            for (Iterator itr = all.iterator(); itr.hasNext();) {
-               ReferenceType type = (ReferenceType) itr.next();
-               if (type.classLoader() == null) {
-                   bootstrapClasses.add(type);
-               }
-            }
-        }
-        return bootstrapClasses;
-    }
-
-    private synchronized List findReferenceTypes(String signature) {
-        if (typesByID == null) {
-            return new ArrayList(0);
-        }
-
-        // we haven't sorted types by signatures. But we can take
-        // advantage of comparing symbols instead of name. In the worst
-        // case, we will be comparing N addresses rather than N strings
-        // where N being total no. of classes in allClasses() list.
-
-        // The signature could be Lx/y/z; or [....
-        // If it is Lx/y/z; the internal type name is x/y/x
-        // for array klasses internal type name is same as
-        // signature
-        String typeName = null;
-        if (signature.charAt(0) == 'L') {
-            typeName = signature.substring(1, signature.length() - 1);
-        } else {
-            typeName = signature;
-        }
-
-        Symbol typeNameSym = saSymbolTable().probe(typeName);
-        // if there is no symbol in VM, then we wouldn't have that type
-        if (typeNameSym == null) {
-            return new ArrayList(0);
-        }
-
-        Iterator iter = typesBySignature.iterator();
-        List list = new ArrayList();
-        while (iter.hasNext()) {
-            // We have cached type name as symbol in reference type
-            ReferenceTypeImpl type = (ReferenceTypeImpl)iter.next();
-            if (typeNameSym.equals(type.typeNameAsSymbol())) {
-                list.add(type);
-            }
-        }
-        return list;
-    }
-
-    private void retrieveAllClasses() {
-        final List saKlasses = new ArrayList();
-        SystemDictionary.ClassVisitor visitor = new SystemDictionary.ClassVisitor() {
-                public void visit(Klass k) {
-                    for (Klass l = k; l != null; l = l.arrayKlassOrNull()) {
-                        // for non-array classes filter out un-prepared classes
-                        // refer to 'allClasses' in share/back/VirtualMachineImpl.c
-                        if (l instanceof ArrayKlass) {
-                           saKlasses.add(l);
-                        } else {
-                           int status = l.getClassStatus();
-                           if ((status & JVMDIClassStatus.PREPARED) != 0) {
-                               saKlasses.add(l);
-                           }
-                        }
-                    }
-                }
-        };
-
-        // refer to jvmtiGetLoadedClasses.cpp - getLoadedClasses in VM code.
-
-        // classes from SystemDictionary
-        saSystemDictionary.classesDo(visitor);
-
-        // From SystemDictionary we do not get primitive single
-        // dimensional array classes. add primitive single dimensional array
-        // klasses from Universe.
-        saVM.getUniverse().basicTypeClassesDo(visitor);
-
-        // Hold lock during processing to improve performance
-        // and to have safe check/set of retrievedAllTypes
-        synchronized (this) {
-            if (!retrievedAllTypes) {
-                // Number of classes
-                int count = saKlasses.size();
-                for (int ii = 0; ii < count; ii++) {
-                    Klass kk = (Klass)saKlasses.get(ii);
-                    ReferenceTypeImpl type = referenceType(kk);
-                }
-                retrievedAllTypes = true;
-            }
-        }
-    }
-
-    ReferenceTypeImpl referenceType(Klass kk) {
-        ReferenceTypeImpl retType = null;
-        synchronized (this) {
-            if (typesByID != null) {
-                retType = (ReferenceTypeImpl)typesByID.get(kk);
-            }
-            if (retType == null) {
-                retType = addReferenceType(kk);
-            }
-        }
-        return retType;
-    }
-
-    private void initReferenceTypes() {
-        typesByID = new HashMap();
-        typesBySignature = new ArrayList();
-    }
-
-    private synchronized ReferenceTypeImpl addReferenceType(Klass kk) {
-        if (typesByID == null) {
-            initReferenceTypes();
-        }
-        ReferenceTypeImpl newRefType = null;
-        if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
-            newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
-        } else if (kk instanceof InstanceKlass) {
-            if (kk.isInterface()) {
-                newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
-            } else {
-                newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
-            }
-        } else {
-            throw new RuntimeException("should not reach here:" + kk);
-        }
-
-        typesByID.put(kk, newRefType);
-        typesBySignature.add(newRefType);
-        return newRefType;
-    }
-
-    ThreadGroup threadGroupForJDI() {
-        return threadGroupForJDI;
-    }
-
-    public void redefineClasses(Map classToBytes) {
-        throwNotReadOnlyException("VirtualMachineImpl.redefineClasses()");
-    }
-
-    private List getAllThreads() {
-        if (allThreads == null) {
-            allThreads = new ArrayList(10);  // Might be enough, might not be
-            for (sun.jvm.hotspot.runtime.JavaThread thread =
-                     saVM.getThreads().first(); thread != null;
-                     thread = thread.next()) {
-                // refer to JvmtiEnv::GetAllThreads in jvmtiEnv.cpp.
-                // filter out the hidden-from-external-view threads.
-                if (thread.isHiddenFromExternalView() == false) {
-                    ThreadReferenceImpl myThread = threadMirror(thread);
-                    allThreads.add(myThread);
-                }
-            }
-        }
-        return allThreads;
-    }
-
-    public List allThreads() { //fixme jjh
-        return Collections.unmodifiableList(getAllThreads());
-    }
-
-    public void suspend() {
-        throwNotReadOnlyException("VirtualMachineImpl.suspend()");
-    }
-
-    public void resume() {
-        throwNotReadOnlyException("VirtualMachineImpl.resume()");
-    }
-
-    public List topLevelThreadGroups() { //fixme jjh
-        // The doc for ThreadGroup says that The top-level thread group
-        // is the only thread group whose parent is null.  This means there is
-        // only one top level thread group.  There will be a thread in this
-        // group so we will just find a thread whose threadgroup has no parent
-        // and that will be it.
-
-        if (topLevelGroups == null) {
-            topLevelGroups = new ArrayList(1);
-            Iterator myIt = getAllThreads().iterator();
-            while (myIt.hasNext()) {
-                ThreadReferenceImpl myThread = (ThreadReferenceImpl)myIt.next();
-                ThreadGroupReference myGroup = myThread.threadGroup();
-                ThreadGroupReference myParent = myGroup.parent();
-                if (myGroup.parent() == null) {
-                    topLevelGroups.add(myGroup);
-                    break;
-                }
-            }
-        }
-        return  Collections.unmodifiableList(topLevelGroups);
-    }
-
-    public EventQueue eventQueue() {
-        throwNotReadOnlyException("VirtualMachine.eventQueue()");
-        return null;
-    }
-
-    public EventRequestManager eventRequestManager() {
-        throwNotReadOnlyException("VirtualMachineImpl.eventRequestManager()");
-        return null;
-    }
-
-    public BooleanValue mirrorOf(boolean value) {
-        return new BooleanValueImpl(this,value);
-    }
-
-    public ByteValue mirrorOf(byte value) {
-        return new ByteValueImpl(this,value);
-    }
-
-    public CharValue mirrorOf(char value) {
-        return new CharValueImpl(this,value);
-    }
-
-    public ShortValue mirrorOf(short value) {
-        return new ShortValueImpl(this,value);
-    }
-
-    public IntegerValue mirrorOf(int value) {
-        return new IntegerValueImpl(this,value);
-    }
-
-    public LongValue mirrorOf(long value) {
-        return new LongValueImpl(this,value);
-    }
-
-    public FloatValue mirrorOf(float value) {
-        return new FloatValueImpl(this,value);
-    }
-
-    public DoubleValue mirrorOf(double value) {
-        return new DoubleValueImpl(this,value);
-    }
-
-    public StringReference mirrorOf(String value) {
-        throwNotReadOnlyException("VirtualMachinestop.mirrorOf(String)");
-        return null;
-    }
-
-    public VoidValue mirrorOfVoid() {
-        if (voidVal == null) {
-            voidVal = new VoidValueImpl(this);
-        }
-        return voidVal;
-    }
-
-
-    public Process process() {
-        throwNotReadOnlyException("VirtualMachine.process");
-        return null;
-    }
-
-    // dispose observer for Class re-use. refer to ConnectorImpl.
-    private Observer disposeObserver;
-
-    // ConnectorImpl loaded by a different class loader can not access it.
-    // i.e., runtime package of <ConnectorImpl, L1> is not the same that of
-    // <VirtualMachineImpl, L2> when L1 != L2. So, package private method
-    // can be called reflectively after using setAccessible(true).
-
-    void setDisposeObserver(Observer observer) {
-       disposeObserver = observer;
-    }
-
-    private void notifyDispose() {
-        if (Assert.ASSERTS_ENABLED) {
-            Assert.that(disposeObserver != null, "null VM.dispose observer");
-        }
-        disposeObserver.update(null, null);
-    }
-
-    public void dispose() {
-        saAgent.detach();
-        notifyDispose();
-    }
-
-    public void exit(int exitCode) {
-        throwNotReadOnlyException("VirtualMachine.exit(int)");
-    }
-
-    public boolean canBeModified() {
-        return false;
-    }
-
-    public boolean canWatchFieldModification() {
-        return false;
-    }
-
-    public boolean canWatchFieldAccess() {
-        return false;
-    }
-
-    public boolean canGetBytecodes() {
-        return true;
-    }
-
-    public boolean canGetSyntheticAttribute() {
-        return true;
-    }
-
-    // FIXME: For now, all monitor capabilities are disabled
-    public boolean canGetOwnedMonitorInfo() {
-        return false;
-    }
-
-    public boolean canGetCurrentContendedMonitor() {
-        return false;
-    }
-
-    public boolean canGetMonitorInfo() {
-        return false;
-    }
-
-    // because this SA works only with 1.5 and update releases
-    // this should always succeed unlike JVMDI/JDI.
-    public boolean canGet1_5LanguageFeatures() {
-        return true;
-    }
-
-    public boolean canUseInstanceFilters() {
-        return false;
-    }
-
-    public boolean canRedefineClasses() {
-        return false;
-    }
-
-    public boolean canAddMethod() {
-        return false;
-    }
-
-    public boolean canUnrestrictedlyRedefineClasses() {
-        return false;
-    }
-
-    public boolean canPopFrames() {
-        return false;
-    }
-
-    public boolean canGetSourceDebugExtension() {
-        // We can use InstanceKlass.getSourceDebugExtension only if
-        // ClassFileParser parsed the info. But, ClassFileParser parses
-        // SourceDebugExtension attribute only if corresponding JVMDI/TI
-        // capability is set to true. Currently, vmStructs does not expose
-        // JVMDI/TI capabilities and hence we conservatively assume false.
-        return false;
-    }
-
-    public boolean canRequestVMDeathEvent() {
-        return false;
-    }
-
-    // new method since 1.6
-    public boolean canForceEarlyReturn() {
-        return false;
-    }
-
-    // new method since 1.6
-    public boolean canGetConstantPool() {
-        return true;
-    }
-
-    // new method since 1.6
-    public boolean canGetClassFileVersion() {
-        return true;
-    }
-
-    // new method since 1.6.
-    public boolean canGetMethodReturnValues() {
-        return false;
-    }
-
-    // new method since 1.6
-    // Real body will be supplied later.
-    public boolean canGetInstanceInfo() {
-        return true;
-    }
-
-    // new method since 1.6
-    public boolean canUseSourceNameFilters() {
-        return false;
-    }
-
-    // new method since 1.6.
-    public boolean canRequestMonitorEvents() {
-        return false;
-    }
-
-    // new method since 1.6.
-    public boolean canGetMonitorFrameInfo() {
-        return true;
-    }
-
-    // new method since 1.6
-    // Real body will be supplied later.
-    public long[] instanceCounts(List classes) {
-        if (!canGetInstanceInfo()) {
-            throw new UnsupportedOperationException(
-                      "target does not support getting instances");
-        }
-
-        final long[] retValue = new long[classes.size()] ;
-
-        final Klass [] klassArray = new Klass[classes.size()];
-
-        boolean allAbstractClasses = true;
-        for (int i=0; i < classes.size(); i++) {
-            ReferenceTypeImpl rti = (ReferenceTypeImpl)classes.get(i);
-            klassArray[i] = rti.ref();
-            retValue[i]=0;
-            if (!(rti.isAbstract() || ((ReferenceType)rti instanceof InterfaceType))) {
-                allAbstractClasses = false;
-            }
-        }
-
-        if (allAbstractClasses) {
-            return retValue;
-        }
-        final int size = classes.size();
-        saObjectHeap.iterate(new DefaultHeapVisitor() {
-                public boolean doObj(Oop oop) {
-                    for (int i=0; i < size; i++) {
-                        if (klassArray[i].equals(oop.getKlass())) {
-                            retValue[i]++;
-                            break;
-                        }
-                    }
-                                        return false;
-                }
-            });
-
-        return retValue;
-    }
-
-    private List getPath (String pathName) {
-        String cp = saVM.getSystemProperty(pathName);
-        String pathSep = saVM.getSystemProperty("path.separator");
-        ArrayList al = new ArrayList();
-        StringTokenizer st = new StringTokenizer(cp, pathSep);
-        while (st.hasMoreTokens()) {
-            al.add(st.nextToken());
-        }
-        al.trimToSize();
-        return al;
-    }
-
-    public List classPath() {
-        return getPath("java.class.path");
-    }
-
-    public List<String> bootClassPath() {
-        return Collections.emptyList();
-    }
-
-    public String baseDirectory() {
-        return saVM.getSystemProperty("user.dir");
-    }
-
-    public void setDefaultStratum(String stratum) {
-        defaultStratum = stratum;
-    }
-
-    public String getDefaultStratum() {
-        return defaultStratum;
-    }
-
-    public String description() {
-        return java.text.MessageFormat.format(java.util.ResourceBundle.
-                                              getBundle("com.sun.tools.jdi.resources.jdi").getString("version_format"),
-                                              "" + vmmgr.majorInterfaceVersion(),
-                                              "" + vmmgr.minorInterfaceVersion(),
-                                              name());
-    }
-
-    public String version() {
-        return saVM.getSystemProperty("java.version");
-    }
-
-    public String name() {
-        StringBuffer sb = new StringBuffer();
-        sb.append("JVM version ");
-        sb.append(version());
-        sb.append(" (");
-        sb.append(saVM.getSystemProperty("java.vm.name"));
-        sb.append(", ");
-        sb.append(saVM.getSystemProperty("java.vm.info"));
-        sb.append(")");
-        return sb.toString();
-    }
-
-    // from interface Mirror
-    public VirtualMachine virtualMachine() {
-        return this;
-    }
-
-    public String toString() {
-        return name();
-    }
-
-    public void setDebugTraceMode(int traceFlags) {
-        // spec. says output is implementation dependent
-        // and trace mode may be ignored. we ignore it :-)
-    }
-
-    // heap walking API
-
-    // capability check
-    public boolean canWalkHeap() {
-        return true;
-    }
-
-    // return a list of all objects in heap
-    public List/*<ObjectReference>*/ allObjects() {
-        final List objects = new ArrayList(0);
-        saObjectHeap.iterate(
-            new DefaultHeapVisitor() {
-                public boolean doObj(Oop oop) {
-                    objects.add(objectMirror(oop));
-                                        return false;
-                }
-            });
-        return objects;
-    }
-
-    // equivalent to objectsByType(type, true)
-    public List/*<ObjectReference>*/ objectsByType(ReferenceType type) {
-        return objectsByType(type, true);
-    }
-
-    // returns objects of type exactly equal to given type
-    private List/*<ObjectReference>*/ objectsByExactType(ReferenceType type) {
-        final List objects = new ArrayList(0);
-        final Klass givenKls = ((ReferenceTypeImpl)type).ref();
-        saObjectHeap.iterate(new DefaultHeapVisitor() {
-                public boolean doObj(Oop oop) {
-                    if (givenKls.equals(oop.getKlass())) {
-                        objects.add(objectMirror(oop));
-                    }
-                        return false;
-                }
-            });
-        return objects;
-    }
-
-    // returns objects of given type as well as it's subtypes
-    private List/*<ObjectReference>*/ objectsBySubType(ReferenceType type) {
-        final List objects = new ArrayList(0);
-        final ReferenceType givenType = type;
-        saObjectHeap.iterate(new DefaultHeapVisitor() {
-                public boolean doObj(Oop oop) {
-                    ReferenceTypeImpl curType = (ReferenceTypeImpl) referenceType(oop.getKlass());
-                    if (curType.isAssignableTo(givenType)) {
-                        objects.add(objectMirror(oop));
-                    }
-                        return false;
-                }
-            });
-        return objects;
-    }
-
-    // includeSubtypes - do you want to include subclass/subtype instances of given
-    // ReferenceType or do we want objects of exact type only?
-    public List/*<ObjectReference>*/ objectsByType(ReferenceType type, boolean includeSubtypes) {
-        Klass kls = ((ReferenceTypeImpl)type).ref();
-        if (kls instanceof InstanceKlass) {
-            InstanceKlass ik = (InstanceKlass) kls;
-            // if the Klass is final or if there are no subklasses loaded yet
-            if (ik.getAccessFlagsObj().isFinal() || ik.getSubklassKlass() == null) {
-                includeSubtypes = false;
-            }
-        } else {
-            // no subtypes for primitive array types
-            ArrayTypeImpl arrayType = (ArrayTypeImpl) type;
-            try {
-                Type componentType = arrayType.componentType();
-                if (componentType instanceof PrimitiveType) {
-                    includeSubtypes = false;
-                }
-            } catch (ClassNotLoadedException cnle) {
-                // ignore. component type not yet loaded
-            }
-        }
-
-        if (includeSubtypes) {
-            return objectsBySubType(type);
-        } else {
-            return objectsByExactType(type);
-        }
-    }
-
-    Type findBootType(String signature) throws ClassNotLoadedException {
-        List types = allClasses();
-        Iterator iter = types.iterator();
-        while (iter.hasNext()) {
-            ReferenceType type = (ReferenceType)iter.next();
-            if ((type.classLoader() == null) &&
-                (type.signature().equals(signature))) {
-                return type;
-            }
-        }
-        JNITypeParser parser = new JNITypeParser(signature);
-        throw new ClassNotLoadedException(parser.typeName(),
-                                         "Type " + parser.typeName() + " not loaded");
-    }
-
-    BooleanType theBooleanType() {
-        if (theBooleanType == null) {
-            synchronized(this) {
-                if (theBooleanType == null) {
-                    theBooleanType = new BooleanTypeImpl(this);
-                }
-            }
-        }
-        return theBooleanType;
-    }
-
-    ByteType theByteType() {
-        if (theByteType == null) {
-            synchronized(this) {
-                if (theByteType == null) {
-                    theByteType = new ByteTypeImpl(this);
-                }
-            }
-        }
-        return theByteType;
-    }
-
-    CharType theCharType() {
-        if (theCharType == null) {
-            synchronized(this) {
-                if (theCharType == null) {
-                    theCharType = new CharTypeImpl(this);
-                }
-            }
-        }
-        return theCharType;
-    }
-
-    ShortType theShortType() {
-        if (theShortType == null) {
-            synchronized(this) {
-                if (theShortType == null) {
-                    theShortType = new ShortTypeImpl(this);
-                }
-            }
-        }
-        return theShortType;
-    }
-
-    IntegerType theIntegerType() {
-        if (theIntegerType == null) {
-            synchronized(this) {
-                if (theIntegerType == null) {
-                    theIntegerType = new IntegerTypeImpl(this);
-                }
-            }
-        }
-        return theIntegerType;
-    }
-
-    LongType theLongType() {
-        if (theLongType == null) {
-            synchronized(this) {
-                if (theLongType == null) {
-                    theLongType = new LongTypeImpl(this);
-                }
-            }
-        }
-        return theLongType;
-    }
-
-    FloatType theFloatType() {
-        if (theFloatType == null) {
-            synchronized(this) {
-                if (theFloatType == null) {
-                    theFloatType = new FloatTypeImpl(this);
-                }
-            }
-        }
-        return theFloatType;
-    }
-
-    DoubleType theDoubleType() {
-        if (theDoubleType == null) {
-            synchronized(this) {
-                if (theDoubleType == null) {
-                    theDoubleType = new DoubleTypeImpl(this);
-                }
-            }
-        }
-        return theDoubleType;
-    }
-
-    VoidType theVoidType() {
-        if (theVoidType == null) {
-            synchronized(this) {
-                if (theVoidType == null) {
-                    theVoidType = new VoidTypeImpl(this);
-                }
-            }
-        }
-        return theVoidType;
-    }
-
-    PrimitiveType primitiveTypeMirror(char tag) {
-        switch (tag) {
-        case 'Z':
-                return theBooleanType();
-        case 'B':
-                return theByteType();
-        case 'C':
-                return theCharType();
-        case 'S':
-                return theShortType();
-        case 'I':
-                return theIntegerType();
-        case 'J':
-                return theLongType();
-        case 'F':
-                return theFloatType();
-        case 'D':
-                return theDoubleType();
-        default:
-                throw new IllegalArgumentException("Unrecognized primitive tag " + tag);
-        }
-    }
-
-    private void processQueue() {
-        Reference ref;
-        while ((ref = referenceQueue.poll()) != null) {
-            SoftObjectReference softRef = (SoftObjectReference)ref;
-            removeObjectMirror(softRef);
-        }
-    }
-
-    // Address value is used as uniqueID by ObjectReferenceImpl
-    long getAddressValue(Oop obj) {
-        return vm.saVM.getDebugger().getAddressValue(obj.getHandle());
-    }
-
-    synchronized ObjectReferenceImpl objectMirror(Oop key) {
-
-        // Handle any queue elements that are not strongly reachable
-        processQueue();
-
-        if (key == null) {
-            return null;
-        }
-        ObjectReferenceImpl object = null;
-
-        /*
-         * Attempt to retrieve an existing object object reference
-         */
-        SoftObjectReference ref = (SoftObjectReference)objectsByID.get(key);
-        if (ref != null) {
-            object = ref.object();
-        }
-
-        /*
-         * If the object wasn't in the table, or it's soft reference was
-         * cleared, create a new instance.
-         */
-        if (object == null) {
-            if (key instanceof Instance) {
-                // look for well-known classes
-                Symbol className = key.getKlass().getName();
-                if (Assert.ASSERTS_ENABLED) {
-                    Assert.that(className != null, "Null class name");
-                }
-                Instance inst = (Instance) key;
-                if (className.equals(javaLangString)) {
-                    object = new StringReferenceImpl(this, inst);
-                } else if (className.equals(javaLangThread)) {
-                    object = new ThreadReferenceImpl(this, inst);
-                } else if (className.equals(javaLangThreadGroup)) {
-                    object = new ThreadGroupReferenceImpl(this, inst);
-                } else if (className.equals(javaLangClass)) {
-                    object = new ClassObjectReferenceImpl(this, inst);
-                } else if (className.equals(javaLangClassLoader)) {
-                    object = new ClassLoaderReferenceImpl(this, inst);
-                } else {
-                    // not a well-known class. But the base class may be
-                    // one of the known classes.
-                    Klass kls = key.getKlass().getSuper();
-                    while (kls != null) {
-                       className = kls.getName();
-                       // java.lang.Class and java.lang.String are final classes
-                       if (className.equals(javaLangThread)) {
-                          object = new ThreadReferenceImpl(this, inst);
-                          break;
-                       } else if(className.equals(javaLangThreadGroup)) {
-                          object = new ThreadGroupReferenceImpl(this, inst);
-                          break;
-                       } else if (className.equals(javaLangClassLoader)) {
-                          object = new ClassLoaderReferenceImpl(this, inst);
-                          break;
-                       }
-                       kls = kls.getSuper();
-                    }
-
-                    if (object == null) {
-                       // create generic object reference
-                       object = new ObjectReferenceImpl(this, inst);
-                    }
-                }
-            } else if (key instanceof TypeArray) {
-                object = new ArrayReferenceImpl(this, (Array) key);
-            } else if (key instanceof ObjArray) {
-                object = new ArrayReferenceImpl(this, (Array) key);
-            } else {
-                throw new RuntimeException("unexpected object type " + key);
-            }
-            ref = new SoftObjectReference(key, object, referenceQueue);
-
-            /*
-             * If there was no previous entry in the table, we add one here
-             * If the previous entry was cleared, we replace it here.
-             */
-            objectsByID.put(key, ref);
-        } else {
-            ref.incrementCount();
-        }
-
-        return object;
-    }
-
-    synchronized void removeObjectMirror(SoftObjectReference ref) {
-        /*
-         * This will remove the soft reference if it has not been
-         * replaced in the cache.
-         */
-        objectsByID.remove(ref.key());
-    }
-
-    StringReferenceImpl stringMirror(Instance id) {
-        return (StringReferenceImpl) objectMirror(id);
-    }
-
-    ArrayReferenceImpl arrayMirror(Array id) {
-       return (ArrayReferenceImpl) objectMirror(id);
-    }
-
-    ThreadReferenceImpl threadMirror(Instance id) {
-        return (ThreadReferenceImpl) objectMirror(id);
-    }
-
-    ThreadReferenceImpl threadMirror(JavaThread jt) {
-        return (ThreadReferenceImpl) objectMirror(jt.getThreadObj());
-    }
-
-    ThreadGroupReferenceImpl threadGroupMirror(Instance id) {
-        return (ThreadGroupReferenceImpl) objectMirror(id);
-    }
-
-    ClassLoaderReferenceImpl classLoaderMirror(Instance id) {
-        return (ClassLoaderReferenceImpl) objectMirror(id);
-    }
-
-    ClassObjectReferenceImpl classObjectMirror(Instance id) {
-        return (ClassObjectReferenceImpl) objectMirror(id);
-    }
-
-    // Use of soft refs and caching stuff here has to be re-examined.
-    //  It might not make sense for JDI - SA.
-    static private class SoftObjectReference extends SoftReference {
-       int count;
-       Object key;
-
-       SoftObjectReference(Object key, ObjectReferenceImpl mirror,
-                           ReferenceQueue queue) {
-           super(mirror, queue);
-           this.count = 1;
-           this.key = key;
-       }
-
-       int count() {
-           return count;
-       }
-
-       void incrementCount() {
-           count++;
-       }
-
-       Object key() {
-           return key;
-       }
-
-       ObjectReferenceImpl object() {
-           return (ObjectReferenceImpl)get();
-       }
-   }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java
deleted file mode 100644
index b833304..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class VoidTypeImpl extends TypeImpl implements VoidType {
-    VoidTypeImpl(VirtualMachine vm) {
-        super(vm);
-    }
-
-    public String signature() {
-        return "V";
-    }
-
-    public String toString() {
-        return name();
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java
deleted file mode 100644
index 922c9ac..0000000
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, 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.
- *
- */
-
-package sun.jvm.hotspot.jdi;
-
-import com.sun.jdi.*;
-
-public class VoidValueImpl extends ValueImpl implements VoidValue {
-
-    VoidValueImpl(VirtualMachine aVm) {
-        super(aVm);
-    }
-
-    public boolean equals(Object obj) {
-        return (obj != null) && (obj instanceof VoidValue) && super.equals(obj);
-    }
-
-    public int hashCode() {
-        return type().hashCode();
-    }
-
-    public Type type() {
-        return vm.theVoidType();
-    }
-
-    ValueImpl prepareForAssignmentTo(ValueContainer destination)
-                    throws InvalidTypeException {
-
-        throw new InvalidTypeException();
-    }
-
-    public String toString() {
-        return "<void value>";
-    }
-}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
index de12216..79ae949 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
@@ -242,7 +242,15 @@
   }
 
   public long getSize() {
-    return alignSize(getHeaderSize() + getVtableLen() + getItableLen() + getNonstaticOopMapSize());
+    long wordLength = VM.getVM().getBytesPerWord();
+    long size = getHeaderSize() +
+                (getVtableLen() +
+                 getItableLen() +
+                 getNonstaticOopMapSize()) * wordLength;
+    if (isInterface()) {
+      size += wordLength;
+    }
+    return alignSize(size);
   }
 
   public static long getHeaderSize() { return headerSize; }
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
index 3afdab8..8a52e4e 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -31,11 +31,10 @@
 import sun.jvm.hotspot.runtime.*;
 import sun.jvm.hotspot.types.TypeDataBase;
 import sun.jvm.hotspot.utilities.*;
-import sun.jvm.hotspot.jdi.JVMTIThreadState;
 
 /** A utility class encapsulating useful oop operations */
 
-public class OopUtilities implements /* imports */ JVMTIThreadState {
+public class OopUtilities {
 
   // FIXME: access should be synchronized and cleared when VM is
   // resumed
@@ -78,6 +77,8 @@
   // java.util.concurrent.locks.AbstractOwnableSynchronizer fields
   private static OopField absOwnSyncOwnerThreadField;
 
+  private static final int JVMTI_THREAD_STATE_ALIVE = 0x0001;
+
   static {
     VM.registerVMInitializedObserver(new Observer() {
         public void update(Observable o, Object data) {
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java
index e82d807..4eab2fe 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -33,7 +33,6 @@
 import sun.jvm.hotspot.types.Type;
 import sun.jvm.hotspot.types.TypeDataBase;
 import sun.jvm.hotspot.utilities.*;
-import sun.jvm.hotspot.jdi.JVMTIThreadState;
 
 /** A utility class encapsulating useful oop operations */
 
diff --git a/src/jdk.hotspot.agent/test/jdi/README.jjh b/src/jdk.hotspot.agent/test/jdi/README.jjh
deleted file mode 100644
index 33b284f..0000000
--- a/src/jdk.hotspot.agent/test/jdi/README.jjh
+++ /dev/null
@@ -1,39 +0,0 @@
-
-This dir contains a test for the JDI-SA implementation.
-
-sagtest.java, sagtarg.java are a normal JDI regression test
-that uses TargetAdapter.java, TargetListener.java,  TestScaffold.java,
-and VMConnection.java.
-
-This test starts the debuggee, sagtarg.java, which just does a wait.
-The test then calls sagdoit.java which calls all the JDJI interface
-functions.  Well, it doesn't call them all yet, but that is the plan.
-At least all that are interesting to the JDI-SA client. The result of
-each call is sent to stdout
-
-The script runjpda.sh runs this test.  It then runs the targ part of
-the test and calls gcore on it to get a core dump into file sagcore.
-Do
-        runjpda.sh >& kk
-
-to run this.  
-
-        NOTE that this produces 1000s of lines of output
-        so be sure to redirect to a file.
-
-File sagclient.java is a test program that uses the JDI-SA
-client to connect to a core file or pid and then calls sagdoit
-which calls the JDI methods.
-
-The script runsa.sh can be used to run sagclient on sagcore:
-        runsa.sh sagcore >& kk1
-
-You can then look at the differences between the runjpda.sh 
-and the runsa.sh run to see if there are bugs.  Note that the
-order of things might be different.
-
-
------------------------------------------
-
-runjdb.sh contains a script that will run jdb on a core file
-using the JDI-sa binding.
diff --git a/src/jdk.hotspot.agent/test/jdi/SASanityChecker.java b/src/jdk.hotspot.agent/test/jdi/SASanityChecker.java
deleted file mode 100644
index 61dbff3..0000000
--- a/src/jdk.hotspot.agent/test/jdi/SASanityChecker.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, 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.
- *
- */
-
-import sun.jvm.hotspot.tools.*;
-import sun.jvm.hotspot.runtime.*;
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-
-/**
-This is a sanity checking tool for Serviceability Agent. To use this class,
-refer to sasanity.sh script in the current directory.
-*/
-
-public class SASanityChecker extends Tool {
-  private static final String saJarName;
-  private static final Map c2types;
-
-  static {
-     saJarName = System.getProperty("SASanityChecker.SAJarName", "sa-jdi.jar");
-     c2types = new HashMap();
-     Object value = new Object();
-     c2types.put("sun.jvm.hotspot.code.ExceptionBlob", value);
-     c2types.put("sun.jvm.hotspot.code.DeoptimizationBlob", value);
-     c2types.put("sun.jvm.hotspot.code.UncommonTrapBlob", value);
-
-  }
-
-  public void run() {
-     String classPath = System.getProperty("java.class.path");
-     StringTokenizer st = new StringTokenizer(classPath, File.pathSeparator);
-     String saJarPath = null;
-     while (st.hasMoreTokens()) {
-        saJarPath = st.nextToken();
-        if (saJarPath.endsWith(saJarName)) {
-           break;
-        }
-     }
-
-     if (saJarPath == null) {
-        throw new RuntimeException(saJarName + " is not the CLASSPATH");
-     }
-
-     String cpuDot = "." + VM.getVM().getCPU() + ".";
-     String platformDot = "." + VM.getVM().getOS() + "_" + VM.getVM().getCPU() + ".";
-     boolean isClient = VM.getVM().isClientCompiler();
-
-     try {
-        FileInputStream fis = new FileInputStream(saJarPath);
-        JarInputStream jis = new JarInputStream(fis);
-        JarEntry je = null;
-        while ( (je = jis.getNextJarEntry()) != null) {
-           String entryName = je.getName();
-           int dotClassIndex = entryName.indexOf(".class");
-           if (dotClassIndex == -1) {
-              // skip non-.class stuff
-              continue;
-           }
-
-           entryName = entryName.substring(0, dotClassIndex).replace('/', '.');
-
-           // skip debugger, asm classes, type classes and jdi binding classes
-           if (entryName.startsWith("sun.jvm.hotspot.debugger.") ||
-               entryName.startsWith("sun.jvm.hotspot.asm.") ||
-               entryName.startsWith("sun.jvm.hotspot.type.") ||
-               entryName.startsWith("sun.jvm.hotspot.jdi.") ) {
-              continue;
-           }
-
-           String runtimePkgPrefix = "sun.jvm.hotspot.runtime.";
-           int runtimeIndex = entryName.indexOf(runtimePkgPrefix);
-           if (runtimeIndex != -1) {
-              // look for further dot. if there, it has to be sub-package.
-              // in runtime sub-packages include only current platform classes.
-              if (entryName.substring(runtimePkgPrefix.length() + 1, entryName.length()).indexOf('.') != -1) {
-                 if (entryName.indexOf(cpuDot) == -1 &&
-                     entryName.indexOf(platformDot) == -1) {
-                    continue;
-                 }
-              }
-           }
-
-           if (isClient) {
-              if (c2types.get(entryName) != null) {
-                 continue;
-              }
-           } else {
-              if (entryName.equals("sun.jvm.hotspot.c1.Runtime1")) {
-                 continue;
-              }
-           }
-
-           System.out.println("checking " + entryName + " ..");
-           // force init of the class to uncover any vmStructs mismatch
-           Class.forName(entryName);
-        }
-     } catch (Exception exp) {
-        System.out.println();
-        System.out.println("FAILED");
-        System.out.println();
-        throw new RuntimeException(exp.getMessage());
-     }
-     System.out.println();
-     System.out.println("PASSED");
-     System.out.println();
-  }
-
-  public static void main(String[] args) {
-     SASanityChecker checker = new SASanityChecker();
-     checker.start(args);
-     checker.stop();
-  }
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/TEST.ROOT b/src/jdk.hotspot.agent/test/jdi/TEST.ROOT
deleted file mode 100644
index 7d760f6..0000000
--- a/src/jdk.hotspot.agent/test/jdi/TEST.ROOT
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright (c) 2002, 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 identifies the root of the test-suite hierarchy.
-# It also contains test-suite configuration information.
-# DO NOT EDIT without first contacting jdk-regtest@eng.
-
-# The list of keywords supported in this test suite
-keys=2d dnd i18n
diff --git a/src/jdk.hotspot.agent/test/jdi/TargetAdapter.java b/src/jdk.hotspot.agent/test/jdi/TargetAdapter.java
deleted file mode 100644
index 76bd16f..0000000
--- a/src/jdk.hotspot.agent/test/jdi/TargetAdapter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- */
-
-import com.sun.jdi.event.*;
-
-/**
- * Base TargetListener implementation
- */
-public class TargetAdapter implements TargetListener {
-    boolean shouldRemoveListener = false;
-
-    public void removeThisListener() {
-        shouldRemoveListener = true;
-    }
-
-    public boolean shouldRemoveListener() {
-        return shouldRemoveListener;
-    }
-
-    public void eventSetReceived(EventSet set) {}
-    public void eventSetComplete(EventSet set) {}
-    public void eventReceived(Event event) {}
-    public void breakpointReached(BreakpointEvent event) {}
-    public void exceptionThrown(ExceptionEvent event) {}
-    public void stepCompleted(StepEvent event) {}
-    public void classPrepared(ClassPrepareEvent event) {}
-    public void classUnloaded(ClassUnloadEvent event) {}
-    public void methodEntered(MethodEntryEvent event) {}
-    public void methodExited(MethodExitEvent event) {}
-    public void fieldAccessed(AccessWatchpointEvent event) {}
-    public void fieldModified(ModificationWatchpointEvent event) {}
-    public void threadStarted(ThreadStartEvent event) {}
-    public void threadDied(ThreadDeathEvent event) {}
-    public void vmStarted(VMStartEvent event) {}
-    public void vmDied(VMDeathEvent event) {}
-    public void vmDisconnected(VMDisconnectEvent event) {}
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/TargetListener.java b/src/jdk.hotspot.agent/test/jdi/TargetListener.java
deleted file mode 100644
index ee7fe4f..0000000
--- a/src/jdk.hotspot.agent/test/jdi/TargetListener.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- */
-
-import com.sun.jdi.event.*;
-
-/**
- * Event listener framework
- */
-public interface TargetListener {
-    boolean shouldRemoveListener();
-
-    void eventSetReceived(EventSet set);
-    void eventSetComplete(EventSet set);
-    void eventReceived(Event event);
-    void breakpointReached(BreakpointEvent event);
-    void exceptionThrown(ExceptionEvent event);
-    void stepCompleted(StepEvent event);
-    void classPrepared(ClassPrepareEvent event);
-    void classUnloaded(ClassUnloadEvent event);
-    void methodEntered(MethodEntryEvent event);
-    void methodExited(MethodExitEvent event);
-    void fieldAccessed(AccessWatchpointEvent event);
-    void fieldModified(ModificationWatchpointEvent event);
-    void threadStarted(ThreadStartEvent event);
-    void threadDied(ThreadDeathEvent event);
-    void vmStarted(VMStartEvent event);
-    void vmDied(VMDeathEvent event);
-    void vmDisconnected(VMDisconnectEvent event);
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/TestScaffold.java b/src/jdk.hotspot.agent/test/jdi/TestScaffold.java
deleted file mode 100644
index ce96b3a..0000000
--- a/src/jdk.hotspot.agent/test/jdi/TestScaffold.java
+++ /dev/null
@@ -1,758 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- */
-
-import com.sun.jdi.*;
-import com.sun.jdi.request.*;
-import com.sun.jdi.event.*;
-import java.util.*;
-import java.io.*;
-
-/**
- * Framework used by all JDI regression tests
- */
-abstract public class TestScaffold extends TargetAdapter {
-    private boolean shouldTrace = false;
-    private VMConnection connection;
-    private VirtualMachine vm;
-    private EventRequestManager requestManager;
-    private List listeners = Collections.synchronizedList(new LinkedList());
-
-    /**
-     * We create a VMDeathRequest, SUSPEND_ALL, to sync the BE and FE.
-     */
-    //private VMDeathRequest ourVMDeathRequest = null;
-    Object ourVMDeathRequest = null;
-
-    /**
-     * We create an ExceptionRequest, SUSPEND_NONE so that we can
-     * catch it and output a msg if an exception occurs in the
-     * debuggee.
-     */
-    private ExceptionRequest ourExceptionRequest = null;
-
-    /**
-     * If we do catch an uncaught exception, we set this true
-     * so the testcase can find out if it wants to.
-     */
-    private boolean exceptionCaught = false;
-    ThreadReference vmStartThread = null;
-    boolean vmDied = false;
-    boolean vmDisconnected = false;
-    final String[] args;
-    protected boolean testFailed = false;
-
-    static private class ArgInfo {
-        String targetVMArgs = "";
-        String targetAppCommandLine = "";
-        String connectorSpec = "com.sun.jdi.CommandLineLaunch:";
-        int traceFlags = 0;
-    }
-
-    /**
-     * An easy way to sleep for awhile
-     */
-    public void mySleep(int millis) {
-        try {
-            Thread.sleep(millis);
-        } catch (InterruptedException ee) {
-        }
-    }
-
-    boolean getExceptionCaught() {
-        return exceptionCaught;
-    }
-
-    void setExceptionCaught(boolean value) {
-        exceptionCaught = value;
-    }
-
-    /**
-     * Return true if eventSet contains the VMDeathEvent for the request in
-     * the ourVMDeathRequest ivar.
-     */
-    private boolean containsOurVMDeathRequest(EventSet eventSet) {
-        if (ourVMDeathRequest != null) {
-            Iterator myIter = eventSet.iterator();
-            while (myIter.hasNext()) {
-                Event myEvent = (Event)myIter.next();
-                if (!(myEvent instanceof VMDeathEvent)) {
-                    // We assume that an EventSet contains only VMDeathEvents
-                    // or no VMDeathEvents.
-                    break;
-                }
-                if (ourVMDeathRequest.equals(myEvent.request())) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /************************************************************************
-     * The following methods override those in our base class, TargetAdapter.
-     *************************************************************************/
-
-    /**
-     * Events handled directly by scaffold always resume (well, almost always)
-     */
-    public void eventSetComplete(EventSet set) {
-        // The listener in connect(..) resumes after receiving our
-        // special VMDeathEvent.  We can't also do the resume
-        // here or we will probably get a VMDisconnectedException
-        if (!containsOurVMDeathRequest(set)) {
-            traceln("TS: set.resume() called");
-            set.resume();
-        }
-    }
-
-    /**
-     * This method sets up default requests.
-     * Testcases can override this to change default behavior.
-     */
-    protected void createDefaultEventRequests() {
-        createDefaultVMDeathRequest();
-        createDefaultExceptionRequest();
-    }
-
-    /**
-     * We want the BE to stop when it issues a VMDeathEvent in order to
-     * give the FE time to complete handling events that occured before
-     * the VMDeath.  When we get the VMDeathEvent for this request in
-     * the listener in connect(), we will do a resume.
-     * If a testcase wants to do something special with VMDeathEvent's,
-     * then it should override this method with an empty method or
-     * whatever in order to suppress the automatic resume.  The testcase
-     * will then be responsible for the handling of VMDeathEvents.  It
-     * has to be sure that it does a resume if it gets a VMDeathEvent
-     * with SUSPEND_ALL, and it has to be sure that it doesn't do a
-     * resume after getting a VMDeath with SUSPEND_NONE (the automatically
-     * generated VMDeathEvent.)
-     */
-    protected void createDefaultVMDeathRequest() {
-//         ourVMDeathRequest = requestManager.createVMDeathRequest();
-//         ourVMDeathRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
-//         ourVMDeathRequest.enable();
-    }
-
-    /**
-     * This will allow us to print a warning if a debuggee gets an
-     * unexpected exception.  The unexpected exception will be handled in
-     * the exceptionThrown method in the listener created in the connect()
-     * method.
-     * If a testcase does not want an uncaught exception to cause a
-     * msg, it must override this method.
-     */
-    protected void createDefaultExceptionRequest() {
-        ourExceptionRequest = requestManager.createExceptionRequest(null,
-                                                                false, true);
-
-        // We can't afford to make this be other than SUSPEND_NONE.  Otherwise,
-        // it would have to be resumed.  If our connect() listener resumes it,
-        // what about the case where the EventSet contains other events with
-        // SUSPEND_ALL and there are other listeners who expect the BE to still
-        // be suspended when their handlers get called?
-        ourExceptionRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
-        ourExceptionRequest.enable();
-    }
-
-    private class EventHandler implements Runnable {
-        EventHandler() {
-            Thread thread = new Thread(this);
-            thread.setDaemon(true);
-            thread.start();
-        }
-
-        private void notifyEvent(TargetListener listener, Event event) {
-            if (event instanceof BreakpointEvent) {
-                listener.breakpointReached((BreakpointEvent)event);
-            } else if (event instanceof ExceptionEvent) {
-                listener.exceptionThrown((ExceptionEvent)event);
-            } else if (event instanceof StepEvent) {
-                listener.stepCompleted((StepEvent)event);
-            } else if (event instanceof ClassPrepareEvent) {
-                listener.classPrepared((ClassPrepareEvent)event);
-            } else if (event instanceof ClassUnloadEvent) {
-                listener.classUnloaded((ClassUnloadEvent)event);
-            } else if (event instanceof MethodEntryEvent) {
-                listener.methodEntered((MethodEntryEvent)event);
-            } else if (event instanceof MethodExitEvent) {
-                listener.methodExited((MethodExitEvent)event);
-            } else if (event instanceof AccessWatchpointEvent) {
-                listener.fieldAccessed((AccessWatchpointEvent)event);
-            } else if (event instanceof ModificationWatchpointEvent) {
-                listener.fieldModified((ModificationWatchpointEvent)event);
-            } else if (event instanceof ThreadStartEvent) {
-                listener.threadStarted((ThreadStartEvent)event);
-            } else if (event instanceof ThreadDeathEvent) {
-                listener.threadDied((ThreadDeathEvent)event);
-            } else if (event instanceof VMStartEvent) {
-                listener.vmStarted((VMStartEvent)event);
-            } else if (event instanceof VMDeathEvent) {
-                listener.vmDied((VMDeathEvent)event);
-            } else if (event instanceof VMDisconnectEvent) {
-                listener.vmDisconnected((VMDisconnectEvent)event);
-            } else {
-                throw new InternalError("Unknown event type: " + event.getClass());
-            }
-        }
-
-        private void traceSuspendPolicy(int policy) {
-            if (shouldTrace) {
-                switch (policy) {
-                case EventRequest.SUSPEND_NONE:
-                    traceln("TS: eventHandler: suspend = SUSPEND_NONE");
-                    break;
-                case EventRequest.SUSPEND_ALL:
-                    traceln("TS: eventHandler: suspend = SUSPEND_ALL");
-                    break;
-                case EventRequest.SUSPEND_EVENT_THREAD:
-                    traceln("TS: eventHandler: suspend = SUSPEND_EVENT_THREAD");
-                    break;
-                }
-            }
-        }
-
-        public void run() {
-            boolean connected = true;
-            do {
-                try {
-                    EventSet set = vm.eventQueue().remove();
-                    traceSuspendPolicy(set.suspendPolicy());
-                    synchronized (listeners) {
-                        ListIterator iter = listeners.listIterator();
-                        while (iter.hasNext()) {
-                            TargetListener listener = (TargetListener)iter.next();
-                            traceln("TS: eventHandler: listener = " + listener);
-                            listener.eventSetReceived(set);
-                            if (listener.shouldRemoveListener()) {
-                                iter.remove();
-                            } else {
-                                Iterator jter = set.iterator();
-                                while (jter.hasNext()) {
-                                    Event event = (Event)jter.next();
-                                    traceln("TS: eventHandler:    event = " + event.getClass());
-
-                                    if (event instanceof VMDisconnectEvent) {
-                                        connected = false;
-                                    }
-                                    listener.eventReceived(event);
-                                    if (listener.shouldRemoveListener()) {
-                                        iter.remove();
-                                        break;
-                                    }
-                                    notifyEvent(listener, event);
-                                    if (listener.shouldRemoveListener()) {
-                                        iter.remove();
-                                        break;
-                                    }
-                                }
-                                traceln("TS: eventHandler:   end of events loop");
-                                if (!listener.shouldRemoveListener()) {
-                                    traceln("TS: eventHandler:   calling ESC");
-                                    listener.eventSetComplete(set);
-                                    if (listener.shouldRemoveListener()) {
-                                        iter.remove();
-                                    }
-                                }
-                            }
-                            traceln("TS: eventHandler: end of listeners loop");
-                        }
-                    }
-                } catch (InterruptedException e) {
-                    traceln("TS: eventHandler: InterruptedException");
-                } catch (Exception e) {
-                    failure("FAILED: Exception occured in eventHandler: " + e);
-                    e.printStackTrace();
-                    connected = false;
-                    synchronized(TestScaffold.this) {
-                        // This will make the waiters such as waitForVMDisconnect
-                        // exit their wait loops.
-                        vmDisconnected = true;
-                        TestScaffold.this.notifyAll();
-                    }
-                }
-                traceln("TS: eventHandler: End of outerloop");
-            } while (connected);
-            traceln("TS: eventHandler: finished");
-        }
-    }
-
-    /**
-     * Constructor
-     */
-    public TestScaffold(String[] args) {
-        this.args = args;
-    }
-
-    public void enableScaffoldTrace() {
-        this.shouldTrace = true;
-    }
-
-    public void disableScaffoldTrace() {
-        this.shouldTrace = false;
-    }
-
-
-    protected void startUp(String targetName) {
-        List argList = new ArrayList(Arrays.asList(args));
-        argList.add(targetName);
-        println("run args: " + argList);
-        connect((String[]) argList.toArray(args));
-        waitForVMStart();
-    }
-
-    protected BreakpointEvent startToMain(String targetName) {
-        startUp(targetName);
-        traceln("TS: back from startUp");
-        BreakpointEvent bpr = resumeTo(targetName, "main", "([Ljava/lang/String;)V");
-        waitForInput();
-        return bpr;
-    }
-
-    protected void waitForInput() {
-        if (System.getProperty("jpda.wait") != null) {
-            try {
-                System.err.println("Press <enter> to continue");
-                System.in.read();
-                System.err.println("running...");
-
-            } catch(Exception e) {
-            }
-        }
-    }
-
-    /*
-     * Test cases should implement tests in runTests and should
-     * initiate testing by calling run().
-     */
-    abstract protected void runTests() throws Exception;
-
-    final public void startTests() throws Exception {
-        try {
-            runTests();
-        } finally {
-            shutdown();
-        }
-    }
-
-    protected void println(String str) {
-        System.err.println(str);
-    }
-
-    protected void print(String str) {
-        System.err.print(str);
-    }
-
-    protected void traceln(String str) {
-        if (shouldTrace) {
-            println(str);
-        }
-    }
-
-    protected void failure(String str) {
-        println(str);
-        testFailed = true;
-    }
-
-    private ArgInfo parseArgs(String args[]) {
-        ArgInfo argInfo = new ArgInfo();
-        for (int i = 0; i < args.length; i++) {
-            if (args[i].equals("-connect")) {
-                i++;
-                argInfo.connectorSpec = args[i];
-            } else if (args[i].equals("-trace")) {
-                i++;
-                argInfo.traceFlags = Integer.decode(args[i]).intValue();
-            } else if (args[i].startsWith("-J")) {
-                argInfo.targetVMArgs += (args[i].substring(2) + ' ');
-
-                /*
-                 * classpath can span two arguments so we need to handle
-                 * it specially.
-                 */
-                if (args[i].equals("-J-classpath")) {
-                    i++;
-                    argInfo.targetVMArgs += (args[i] + ' ');
-                }
-            } else {
-                argInfo.targetAppCommandLine += (args[i] + ' ');
-            }
-        }
-        return argInfo;
-    }
-
-    /**
-     * This is called to connect to a debuggee VM.  It starts the VM and
-     * installs a listener to catch VMStartEvent, our default events, and
-     * VMDisconnectedEvent.  When these events appear, that is remembered
-     * and waiters are notified.
-     * This is normally called in the main thread of the test case.
-     * It starts up an EventHandler thread that gets events coming in
-     * from the debuggee and distributes them to listeners.  That thread
-     * keeps running until a VMDisconnectedEvent occurs or some exception
-     * occurs during its processing.
-     *
-     * The 'listenUntilVMDisconnect' method adds 'this' as a listener.
-     * This means that 'this's vmDied method will get called.  This has a
-     * default impl in TargetAdapter.java which can be overridden in the
-     * testcase.
-     *
-     * waitForRequestedEvent also adds an adaptor listener that listens
-     * for the particular event it is supposed to wait for (and it also
-     * catches VMDisconnectEvents.)  This listener is removed once
-     * its eventReceived method is called.
-     * waitForRequestedEvent is called by most of the methods to do bkpts,
-     * etc.
-     */
-    public void connect(String args[]) {
-        ArgInfo argInfo = parseArgs(args);
-
-        argInfo.targetVMArgs += VMConnection.getDebuggeeVMOptions();
-        connection = new VMConnection(argInfo.connectorSpec,
-                                      argInfo.traceFlags);
-
-        addListener(new TargetAdapter() {
-                public void eventSetComplete(EventSet set) {
-                    if (TestScaffold.this.containsOurVMDeathRequest(set)) {
-                        traceln("TS: connect: set.resume() called");
-                        set.resume();
-
-                        // Note that we want to do the above resume before
-                        // waking up any sleepers.
-                        synchronized(TestScaffold.this) {
-                            TestScaffold.this.notifyAll();
-                        }
-                    }
-                }
-
-                public void vmStarted(VMStartEvent event) {
-                    synchronized(TestScaffold.this) {
-                        vmStartThread = event.thread();
-                        TestScaffold.this.notifyAll();
-                    }
-                }
-                /**
-                 * By default, we catch uncaught exceptions and print a msg.
-                 * The testcase must override the createDefaultExceptionRequest
-                 * method if it doesn't want this behavior.
-                 */
-                public void exceptionThrown(ExceptionEvent event) {
-                    if (TestScaffold.this.ourExceptionRequest != null &&
-                        TestScaffold.this.ourExceptionRequest.equals(
-                                                        event.request())) {
-                        println("Note: Unexpected Debuggee Exception: " +
-                                event.exception().referenceType().name() +
-                                " at line " + event.location().lineNumber());
-                        TestScaffold.this.exceptionCaught = true;
-                    }
-                }
-
-                public void vmDied(VMDeathEvent event) {
-                    vmDied = true;
-                    traceln("TS: vmDied called");
-                }
-
-                public void vmDisconnected(VMDisconnectEvent event) {
-                    synchronized(TestScaffold.this) {
-                        vmDisconnected = true;
-                        TestScaffold.this.notifyAll();
-                    }
-                }
-            });
-        if (connection.connector().name().equals("com.sun.jdi.CommandLineLaunch")) {
-            if (argInfo.targetVMArgs.length() > 0) {
-                if (connection.connectorArg("options").length() > 0) {
-                    throw new IllegalArgumentException("VM options in two places");
-                }
-                connection.setConnectorArg("options", argInfo.targetVMArgs);
-            }
-            if (argInfo.targetAppCommandLine.length() > 0) {
-                if (connection.connectorArg("main").length() > 0) {
-                    throw new IllegalArgumentException("Command line in two places");
-                }
-                connection.setConnectorArg("main", argInfo.targetAppCommandLine);
-            }
-        }
-
-        vm = connection.open();
-        requestManager = vm.eventRequestManager();
-        createDefaultEventRequests();
-        new EventHandler();
-    }
-
-
-    public VirtualMachine vm() {
-        return vm;
-    }
-
-    public EventRequestManager eventRequestManager() {
-        return requestManager;
-    }
-
-    public void addListener(TargetListener listener) {
-        traceln("TS: Adding listener " + listener);
-        listeners.add(listener);
-    }
-
-    public void removeListener(TargetListener listener) {
-        traceln("TS: Removing listener " + listener);
-        listeners.remove(listener);
-    }
-
-
-    protected void listenUntilVMDisconnect() {
-        try {
-            addListener (this);
-        } catch (Exception ex){
-            ex.printStackTrace();
-            testFailed = true;
-        } finally {
-            // Allow application to complete and shut down
-            resumeToVMDisconnect();
-        }
-    }
-
-    public synchronized ThreadReference waitForVMStart() {
-        while ((vmStartThread == null) && !vmDisconnected) {
-            try {
-                wait();
-            } catch (InterruptedException e) {
-            }
-        }
-
-        if (vmStartThread == null) {
-            throw new VMDisconnectedException();
-        }
-
-        return vmStartThread;
-    }
-
-    public synchronized void waitForVMDisconnect() {
-        traceln("TS: waitForVMDisconnect");
-        while (!vmDisconnected) {
-            try {
-                wait();
-            } catch (InterruptedException e) {
-            }
-        }
-        traceln("TS: waitForVMDisconnect: done");
-    }
-
-    public Event waitForRequestedEvent(final EventRequest request) {
-        class EventNotification {
-            Event event;
-            boolean disconnected = false;
-        }
-        final EventNotification en = new EventNotification();
-
-        TargetAdapter adapter = new TargetAdapter() {
-            public void eventReceived(Event event) {
-                if (request.equals(event.request())) {
-                    traceln("TS:Listener2: got requested event");
-                    synchronized (en) {
-                        en.event = event;
-                        en.notifyAll();
-                    }
-                    removeThisListener();
-                } else if (event instanceof VMDisconnectEvent) {
-                    traceln("TS:Listener2: got VMDisconnectEvent");
-                    synchronized (en) {
-                        en.disconnected = true;
-                        en.notifyAll();
-                    }
-                    removeThisListener();
-                }
-            }
-        };
-
-        addListener(adapter);
-
-        try {
-            synchronized (en) {
-                traceln("TS: waitForRequestedEvent: vm.resume called");
-                vm.resume();
-
-                while (!en.disconnected && (en.event == null)) {
-                    en.wait();
-                }
-            }
-        } catch (InterruptedException e) {
-            return null;
-        }
-
-        if (en.disconnected) {
-            throw new RuntimeException("VM Disconnected before requested event occurred");
-        }
-        return en.event;
-    }
-
-    private StepEvent doStep(ThreadReference thread, int gran, int depth) {
-        final StepRequest sr =
-                  requestManager.createStepRequest(thread, gran, depth);
-
-        sr.addClassExclusionFilter("java.*");
-        sr.addClassExclusionFilter("sun.*");
-        sr.addClassExclusionFilter("com.sun.*");
-        sr.addCountFilter(1);
-        sr.enable();
-        StepEvent retEvent = (StepEvent)waitForRequestedEvent(sr);
-        requestManager.deleteEventRequest(sr);
-        return retEvent;
-    }
-
-    public StepEvent stepIntoInstruction(ThreadReference thread) {
-        return doStep(thread, StepRequest.STEP_MIN, StepRequest.STEP_INTO);
-    }
-
-    public StepEvent stepIntoLine(ThreadReference thread) {
-        return doStep(thread, StepRequest.STEP_LINE, StepRequest.STEP_INTO);
-    }
-
-    public StepEvent stepOverInstruction(ThreadReference thread) {
-        return doStep(thread, StepRequest.STEP_MIN, StepRequest.STEP_OVER);
-    }
-
-    public StepEvent stepOverLine(ThreadReference thread) {
-        return doStep(thread, StepRequest.STEP_LINE, StepRequest.STEP_OVER);
-    }
-
-    public StepEvent stepOut(ThreadReference thread) {
-        return doStep(thread, StepRequest.STEP_LINE, StepRequest.STEP_OUT);
-    }
-
-    public BreakpointEvent resumeTo(Location loc) {
-        final BreakpointRequest request =
-            requestManager.createBreakpointRequest(loc);
-        request.addCountFilter(1);
-        request.enable();
-        return (BreakpointEvent)waitForRequestedEvent(request);
-    }
-
-    public ReferenceType findReferenceType(String name) {
-        List rts = vm.classesByName(name);
-        Iterator iter = rts.iterator();
-        while (iter.hasNext()) {
-            ReferenceType rt = (ReferenceType)iter.next();
-            if (rt.name().equals(name)) {
-                return rt;
-            }
-        }
-        return null;
-    }
-
-    public Method findMethod(ReferenceType rt, String name, String signature) {
-        List methods = rt.methods();
-        Iterator iter = methods.iterator();
-        while (iter.hasNext()) {
-            Method method = (Method)iter.next();
-            if (method.name().equals(name) &&
-                method.signature().equals(signature)) {
-                return method;
-            }
-        }
-        return null;
-    }
-
-    public Location findLocation(ReferenceType rt, int lineNumber)
-                         throws AbsentInformationException {
-        List locs = rt.locationsOfLine(lineNumber);
-        if (locs.size() == 0) {
-            throw new IllegalArgumentException("Bad line number");
-        } else if (locs.size() > 1) {
-            throw new IllegalArgumentException("Line number has multiple locations");
-        }
-
-        return (Location)locs.get(0);
-    }
-
-    public BreakpointEvent resumeTo(String clsName, String methodName,
-                                         String methodSignature) {
-        ReferenceType rt = findReferenceType(clsName);
-        if (rt == null) {
-            rt = resumeToPrepareOf(clsName).referenceType();
-        }
-
-        Method method = findMethod(rt, methodName, methodSignature);
-        if (method == null) {
-            throw new IllegalArgumentException("Bad method name/signature");
-        }
-
-        return resumeTo(method.location());
-    }
-
-    public BreakpointEvent resumeTo(String clsName, int lineNumber) throws AbsentInformationException {
-        ReferenceType rt = findReferenceType(clsName);
-        if (rt == null) {
-            rt = resumeToPrepareOf(clsName).referenceType();
-        }
-
-        return resumeTo(findLocation(rt, lineNumber));
-    }
-
-    public ClassPrepareEvent resumeToPrepareOf(String className) {
-        final ClassPrepareRequest request =
-            requestManager.createClassPrepareRequest();
-        request.addClassFilter(className);
-        request.addCountFilter(1);
-        request.enable();
-        return (ClassPrepareEvent)waitForRequestedEvent(request);
-    }
-
-    public void resumeToVMDisconnect() {
-        try {
-            traceln("TS: resumeToVMDisconnect: vm.resume called");
-            vm.resume();
-        } catch (VMDisconnectedException e) {
-            // clean up below
-        }
-        waitForVMDisconnect();
-    }
-
-    public void shutdown() {
-        shutdown(null);
-    }
-
-    public void shutdown(String message) {
-        traceln("TS: shutdown: vmDied= " + vmDied +
-                 ", vmDisconnected= " + vmDisconnected +
-                 ", connection = " + connection);
-
-        if ((connection != null)) {
-            try {
-                connection.disposeVM();
-             } catch (VMDisconnectedException e) {
-                // Shutting down after the VM has gone away. This is
-                // not an error, and we just ignore it.
-            }
-        } else {
-            traceln("TS: shutdown: disposeVM not called");
-        }
-        if (message != null) {
-            println(message);
-        }
-
-        vmDied = true;
-        vmDisconnected = true;
-    }
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/VMConnection.java b/src/jdk.hotspot.agent/test/jdi/VMConnection.java
deleted file mode 100644
index 8c42174..0000000
--- a/src/jdk.hotspot.agent/test/jdi/VMConnection.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- */
-
-import com.sun.jdi.*;
-import com.sun.jdi.connect.*;
-import com.sun.jdi.request.EventRequestManager;
-
-import java.util.*;
-import java.io.*;
-
-
-/**
- * Manages a VM conection for the JDI test framework.
- */
-class VMConnection {
-    private VirtualMachine vm;
-    private Process process = null;
-    private int outputCompleteCount = 0;
-
-    private final Connector connector;
-    private final Map connectorArgs;
-    private final int traceFlags;
-
-    /**
-     * Return a String containing VM Options to pass to the debugee
-     * or an empty string if there are none.
-     * These are read from the first non-comment line
-     * in file test/com/sun/jdi/@debuggeeVMOptions.
-     */
-    static public String getDebuggeeVMOptions() {
-
-        // When we run under jtreg, test.src contains the pathname of
-        // the test/com/sun/jdi dir.
-        BufferedReader reader;
-        final String filename = "@debuggeeVMOptions";
-        String srcDir = System.getProperty("test.src");
-
-        if (srcDir == null) {
-          srcDir = System.getProperty("user.dir");
-        }
-        srcDir = srcDir + File.separator;
-
-        File myDir = new File(srcDir);
-
-        File myFile = new File(myDir, filename);
-        if (!myFile.canRead()) {
-            try {
-                // We have some subdirs of test/com/sun/jdi so in case we
-                // are in one of them, look in our parent dir for the file.
-                myFile = new File(myDir.getCanonicalFile().getParent(),
-                                  filename);
-                if (!myFile.canRead()) {
-                    return "";
-                }
-            } catch (IOException ee) {
-                System.out.println("-- Error 1 trying to access file " +
-                                   myFile.getPath() + ": " + ee);
-                return "";
-            }
-        }
-        String wholePath = myFile.getPath();
-        try {
-            reader = new BufferedReader(new FileReader(myFile));
-        } catch (FileNotFoundException ee) {
-            System.out.println("-- Error 2 trying to access file " +
-                               wholePath + ": " + ee);
-            return "";
-        }
-
-        String line;
-        String retVal = "";
-        while (true) {
-            try {
-                line = reader.readLine();
-            } catch (IOException ee) {
-                System.out.println("-- Error reading options from file " +
-                                   wholePath + ": " + ee);
-                break;
-            }
-            if (line == null) {
-                System.out.println("-- No debuggee VM options found in file " +
-                                   wholePath);
-                break;
-            }
-            line = line.trim();
-            if (line.length() != 0 && !line.startsWith("#")) {
-                System.out.println("-- Added debuggeeVM options from file " +
-                                   wholePath + ": " + line);
-                retVal = line;
-                break;
-            }
-            // Else, read he next line.
-        }
-        try {
-            reader.close();
-        } catch (IOException ee) {
-        }
-        return retVal;
-    }
-
-    private Connector findConnector(String name) {
-        List connectors = Bootstrap.virtualMachineManager().allConnectors();
-        Iterator iter = connectors.iterator();
-        while (iter.hasNext()) {
-            Connector connector = (Connector)iter.next();
-            if (connector.name().equals(name)) {
-                return connector;
-            }
-        }
-        return null;
-    }
-
-    private Map parseConnectorArgs(Connector connector, String argString) {
-        StringTokenizer tokenizer = new StringTokenizer(argString, ",");
-        Map arguments = connector.defaultArguments();
-
-        while (tokenizer.hasMoreTokens()) {
-            String token = tokenizer.nextToken();
-            int index = token.indexOf('=');
-            if (index == -1) {
-                throw new IllegalArgumentException("Illegal connector argument: " +
-                                                   token);
-            }
-            String name = token.substring(0, index);
-            String value = token.substring(index + 1);
-            Connector.Argument argument = (Connector.Argument)arguments.get(name);
-            if (argument == null) {
-                throw new IllegalArgumentException("Argument " + name +
-                                               "is not defined for connector: " +
-                                               connector.name());
-            }
-            argument.setValue(value);
-        }
-        return arguments;
-    }
-
-    VMConnection(String connectSpec, int traceFlags) {
-        String nameString;
-        String argString;
-        int index = connectSpec.indexOf(':');
-        if (index == -1) {
-            nameString = connectSpec;
-            argString = "";
-        } else {
-            nameString = connectSpec.substring(0, index);
-            argString = connectSpec.substring(index + 1);
-        }
-
-        connector = findConnector(nameString);
-        if (connector == null) {
-            throw new IllegalArgumentException("No connector named: " +
-                                               nameString);
-        }
-
-        connectorArgs = parseConnectorArgs(connector, argString);
-        this.traceFlags = traceFlags;
-    }
-
-    synchronized VirtualMachine open() {
-        if (connector instanceof LaunchingConnector) {
-            vm = launchTarget();
-        } else if (connector instanceof AttachingConnector) {
-            vm = attachTarget();
-        } else if (connector instanceof ListeningConnector) {
-            vm = listenTarget();
-        } else {
-            throw new InternalError("Invalid connect type");
-        }
-        vm.setDebugTraceMode(traceFlags);
-        System.out.println("JVM version:" + vm.version());
-        System.out.println("JDI version: " + Bootstrap.virtualMachineManager().majorInterfaceVersion() +
-                           "." + Bootstrap.virtualMachineManager().minorInterfaceVersion());
-        System.out.println("JVM description: " + vm.description());
-
-        return vm;
-    }
-
-    boolean setConnectorArg(String name, String value) {
-        /*
-         * Too late if the connection already made
-         */
-        if (vm != null) {
-            return false;
-        }
-
-        Connector.Argument argument = (Connector.Argument)connectorArgs.get(name);
-        if (argument == null) {
-            return false;
-        }
-        argument.setValue(value);
-        return true;
-    }
-
-    String connectorArg(String name) {
-        Connector.Argument argument = (Connector.Argument)connectorArgs.get(name);
-        if (argument == null) {
-            return "";
-        }
-        return argument.value();
-    }
-
-    public synchronized VirtualMachine vm() {
-        if (vm == null) {
-            throw new InternalError("VM not connected");
-        } else {
-            return vm;
-        }
-    }
-
-    boolean isOpen() {
-        return (vm != null);
-    }
-
-    boolean isLaunch() {
-        return (connector instanceof LaunchingConnector);
-    }
-
-    Connector connector() {
-        return connector;
-    }
-
-    boolean isListen() {
-        return (connector instanceof ListeningConnector);
-    }
-
-    boolean isAttach() {
-        return (connector instanceof AttachingConnector);
-    }
-
-    private synchronized void notifyOutputComplete() {
-        outputCompleteCount++;
-        notifyAll();
-    }
-
-    private synchronized void waitOutputComplete() {
-        // Wait for stderr and stdout
-        if (process != null) {
-            while (outputCompleteCount < 2) {
-                try {wait();} catch (InterruptedException e) {}
-            }
-        }
-    }
-
-    public void disposeVM() {
-        try {
-            if (vm != null) {
-                vm.dispose();
-                vm = null;
-            }
-        } finally {
-            if (process != null) {
-                process.destroy();
-                process = null;
-            }
-            waitOutputComplete();
-        }
-    }
-
-    private void dumpStream(InputStream stream) throws IOException {
-        PrintStream outStream = System.out;
-        BufferedReader in =
-            new BufferedReader(new InputStreamReader(stream));
-        String line;
-        while ((line = in.readLine()) != null) {
-            outStream.println(line);
-        }
-    }
-
-    /**
-     *  Create a Thread that will retrieve and display any output.
-     *  Needs to be high priority, else debugger may exit before
-     *  it can be displayed.
-     */
-    private void displayRemoteOutput(final InputStream stream) {
-        Thread thr = new Thread("output reader") {
-            public void run() {
-                try {
-                    dumpStream(stream);
-                } catch (IOException ex) {
-                    System.err.println("IOException reading output of child java interpreter:"
-                                       + ex.getMessage());
-                } finally {
-                    notifyOutputComplete();
-                }
-            }
-        };
-        thr.setPriority(Thread.MAX_PRIORITY-1);
-        thr.start();
-    }
-
-    private void dumpFailedLaunchInfo(Process process) {
-        try {
-            dumpStream(process.getErrorStream());
-            dumpStream(process.getInputStream());
-        } catch (IOException e) {
-            System.err.println("Unable to display process output: " +
-                               e.getMessage());
-        }
-    }
-
-    /* launch child target vm */
-    private VirtualMachine launchTarget() {
-        LaunchingConnector launcher = (LaunchingConnector)connector;
-        try {
-            VirtualMachine vm = launcher.launch(connectorArgs);
-            process = vm.process();
-            displayRemoteOutput(process.getErrorStream());
-            displayRemoteOutput(process.getInputStream());
-            return vm;
-        } catch (IOException ioe) {
-            ioe.printStackTrace();
-            System.err.println("\n Unable to launch target VM.");
-        } catch (IllegalConnectorArgumentsException icae) {
-            icae.printStackTrace();
-            System.err.println("\n Internal debugger error.");
-        } catch (VMStartException vmse) {
-            System.err.println(vmse.getMessage() + "\n");
-            dumpFailedLaunchInfo(vmse.process());
-            System.err.println("\n Target VM failed to initialize.");
-        }
-        return null; // Shuts up the compiler
-    }
-
-    /* attach to running target vm */
-    private VirtualMachine attachTarget() {
-        AttachingConnector attacher = (AttachingConnector)connector;
-        try {
-            return attacher.attach(connectorArgs);
-        } catch (IOException ioe) {
-            ioe.printStackTrace();
-            System.err.println("\n Unable to attach to target VM.");
-        } catch (IllegalConnectorArgumentsException icae) {
-            icae.printStackTrace();
-            System.err.println("\n Internal debugger error.");
-        }
-        return null; // Shuts up the compiler
-    }
-
-    /* listen for connection from target vm */
-    private VirtualMachine listenTarget() {
-        ListeningConnector listener = (ListeningConnector)connector;
-        try {
-            String retAddress = listener.startListening(connectorArgs);
-            System.out.println("Listening at address: " + retAddress);
-            vm = listener.accept(connectorArgs);
-            listener.stopListening(connectorArgs);
-            return vm;
-        } catch (IOException ioe) {
-            ioe.printStackTrace();
-            System.err.println("\n Unable to attach to target VM.");
-        } catch (IllegalConnectorArgumentsException icae) {
-            icae.printStackTrace();
-            System.err.println("\n Internal debugger error.");
-        }
-        return null; // Shuts up the compiler
-    }
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/jstack.sh b/src/jdk.hotspot.agent/test/jdi/jstack.sh
deleted file mode 100644
index 67f7770..0000000
--- a/src/jdk.hotspot.agent/test/jdi/jstack.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2003, 2012, 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.
-#  
-#
-
-$JAVA_HOME/bin/java -showversion ${OPTIONS} -classpath $JAVA_HOME/lib/sa-jdi.jar sun.jvm.hotspot.tools.StackTrace $*
diff --git a/src/jdk.hotspot.agent/test/jdi/jstack64.sh b/src/jdk.hotspot.agent/test/jdi/jstack64.sh
deleted file mode 100644
index cd2a422..0000000
--- a/src/jdk.hotspot.agent/test/jdi/jstack64.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2003, 2012, 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.
-#  
-#
-
-$JAVA_HOME/bin/java -d64 -showversion ${OPTIONS} -classpath $JAVA_HOME/lib/sa-jdi.jar sun.jvm.hotspot.tools.StackTrace $*
diff --git a/src/jdk.hotspot.agent/test/jdi/multivm.java b/src/jdk.hotspot.agent/test/jdi/multivm.java
deleted file mode 100644
index 8ba06e7..0000000
--- a/src/jdk.hotspot.agent/test/jdi/multivm.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- *
- */
-
-import com.sun.jdi.*;
-import com.sun.jdi.connect.*;
-
-import java.util.Map;
-import java.util.List;
-import java.util.Iterator;
-import java.io.IOException;
-
-/* This class is used to test multi VM connectivity feature of
- * SA/JDI. Accepts two PIDs as arguments. Connects to first VM
- *, Connects to second VM and disposes them in that order.
- */
-
-public class multivm {
-    static AttachingConnector myPIDConn;
-    static VirtualMachine vm1;
-    static VirtualMachine vm2;
-    static VirtualMachineManager vmmgr;
-
-    public static void println(String msg) {
-        System.out.println(msg);
-    }
-
-    private static void usage() {
-        System.err.println("Usage: java multivm <pid1> <pid2>");
-        System.exit(1);
-    }
-
-    public static void main(String args[]) {
-        vmmgr = Bootstrap.virtualMachineManager();
-        List attachingConnectors = vmmgr.attachingConnectors();
-        if (attachingConnectors.isEmpty()) {
-            System.err.println( "ERROR: No attaching connectors");
-            return;
-        }
-        Iterator myIt = attachingConnectors.iterator();
-        while (myIt.hasNext()) {
-            AttachingConnector tmpCon = (AttachingConnector)myIt.next();
-            if (tmpCon.name().equals(
-                "sun.jvm.hotspot.jdi.SAPIDAttachingConnector")) {
-                myPIDConn = tmpCon;
-                break;
-            }
-        }
-
-        int pid1 = 0, pid2 = 0;
-        String pidText = null;
-        switch (args.length) {
-        case (2):
-            try {
-                pidText = args[0];
-                pid1 = Integer.parseInt(pidText);
-                System.out.println( "pid1: " + pid1);
-                vm1 = attachPID(pid1);
-                pidText = args[1];
-                pid2 = Integer.parseInt(pidText);
-                System.out.println( "pid2: " + pid2);
-                vm2 = attachPID(pid2);
-            } catch (NumberFormatException e) {
-                println(e.getMessage());
-                usage();
-            }
-            break;
-        default:
-            usage();
-        }
-
-        if (vm1 != null) {
-            System.out.println("vm1: attached ok!");
-            System.out.println(vm1.version());
-            sagdoit mine = new sagdoit(vm1);
-            mine.doAll();
-        }
-
-        if (vm2 != null) {
-            System.out.println("vm2: attached ok!");
-            System.out.println(vm2.version());
-            sagdoit mine = new sagdoit(vm2);
-            mine.doAll();
-        }
-
-        if (vm1 != null) {
-            vm1.dispose();
-        }
-
-        if (vm2 != null) {
-            vm2.dispose();
-        }
-    }
-
-   private static VirtualMachine attachPID(int pid) {
-        Map connArgs = myPIDConn.defaultArguments();
-        System.out.println("connArgs = " + connArgs);
-        VirtualMachine vm;
-        Connector.StringArgument connArg = (Connector.StringArgument)connArgs.get("pid");
-        connArg.setValue(Integer.toString(pid));
-
-        try {
-            vm = myPIDConn.attach(connArgs);
-        } catch (IOException ee) {
-            System.err.println("ERROR: myPIDConn.attach got IO Exception:" + ee);
-            vm = null;
-        } catch (IllegalConnectorArgumentsException ee) {
-            System.err.println("ERROR: myPIDConn.attach got illegal args exception:" + ee);
-            vm = null;
-        }
-        return vm;
-   }
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/multivm.sh b/src/jdk.hotspot.agent/test/jdi/multivm.sh
deleted file mode 100644
index 5d114c0..0000000
--- a/src/jdk.hotspot.agent/test/jdi/multivm.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/ksh
-#
-# Copyright (c) 2003, 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.
-#  
-#
-
-doUsage()
-{
-    cat <<EOF
-    Run multivm.class using Serviceability Agent to talk to 2 pids
-    simultaneousely. i.e, before detaching one attach another.
-    Usage:  multivm.sh <jdk-pathname> <pid1> <pid2>
-
-EOF
-}
-
-if [ $# = 4 ] ; then
-    doUsage
-    exit 1
-fi
-
-jdk=$1
-javacp="$jdk/lib/sa-jdi.jar:$classesDir:$jdk/lib/tools.jar:$jdk/classes:./workdir"
-
-mkdir -p workdir
-if [ sagdoit.java -nt ./workdir/sagdoit.class ] ; then
-    $jdk/bin/javac -d ./workdir -classpath $javacp sagdoit.java
-    if [ $? != 0 ] ; then
-        exit 1
-    fi
-fi
-if [ multivm.java -nt ./workdir/multivm.class ] ; then
-    $jdk/bin/javac -d ./workdir -classpath $javacp multivm.java
-    if [ $? != 0 ] ; then
-        exit 1
-    fi
-fi
-
-$jdk/bin/java -Dsun.jvm.hotspot.jdi.ConnectorImpl.DEBUG -Dsun.jvm.hotspot.jdi.SAJDIClassLoader.DEBUG -Djava.class.path=$javacp multivm $2 $3
diff --git a/src/jdk.hotspot.agent/test/jdi/runjdb.sh b/src/jdk.hotspot.agent/test/jdi/runjdb.sh
deleted file mode 100644
index cd1b10f..0000000
--- a/src/jdk.hotspot.agent/test/jdi/runjdb.sh
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2002, 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.
-#  
-#
-
-#  jdb is a .c file that seems to discard the setting of CLASSPATH.
-# So, we have to run jdb by calling java directly :-(
-
-# License file for development version of dbx
-LM_LICENSE_FILE=7588@extend.eng:/usr/dist/local/config/sparcworks/license.dat:7588@setlicense
-export LM_LICENSE_FILE
-
-doUsage()
-{
-   cat <<EOF
-Usage:  runjdb.sh corefile -jdk jdk-pathname -sa sa-pathname
-    sa-pathname is the path of a JDI-SA build dir.
-EOF
-}
-
-jdk=
-javaArgs=
-args=
-sa=
-while [ $# != 0 ] ; do
-    case $1 in
-      -vv)
-        set -x
-        ;;
-     -jdk)
-        jdk=$2
-        shift
-        ;;
-     -sa)
-        sa=$2
-        shift
-        ;;
-     -help | help)
-        doUsage
-        exit
-        ;;
-     -*)
-        javaArgs="$javaArgs $1"
-        ;;
-     *)
-        if [ ! -z "$args" ] ; then
-            echo "Error: Only one core file or pid can be specified"
-            exit 1
-        fi
-        echo "$1" | grep -s '^[0-9]*$' > /dev/null
-        if [ $? = 0 ] ; then
-            # it is a pid
-            args="$args $1"
-            echo "Error: A pid is not yet allowed"
-            exit 1
-        else
-            # It is a core.        
-            # We have to pass the name of the program that produced the
-            # core, and the core file itself.
-            args="$1"
-        fi
-        ;;
-   esac
-   shift
-done
-
-if [ -z "$jdk" ] ; then
-    echo "Error:  -jdk jdk-pathname is required"
-    exit 1
-fi
-if [ -z "$sa" ] ; then
-    echo "Error:  -sa sa-pathname is required"
-    exit 1
-fi
-
-if [ -z "$args" ] ; then
-    echo "Error:  a core file or pid must be specified"
-    exit 1
-fi
-
-set -x
-$jdk/bin/jdb -J-Xbootclasspath/a:$sa  -connect \
-  sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=$args,javaExecutable=$jdk/bin/java
-
-
-#$jdk/bin/java -Xbootclasspath/a:$mmm/ws/merlin-sa/build/agent \
-#  com.sun.tools.example.debug.tty.TTY -connect \
-#  sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=sagcore,javaExecutable=$jdk/bin/java
diff --git a/src/jdk.hotspot.agent/test/jdi/runjpda.sh b/src/jdk.hotspot.agent/test/jdi/runjpda.sh
deleted file mode 100644
index a245946..0000000
--- a/src/jdk.hotspot.agent/test/jdi/runjpda.sh
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/bin/ksh
-#
-# Copyright (c) 2002, 2004, 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 script runs the test program, sagtest.java, with the regular
-# JPDA jdi.
-# It then starts up the debuggee part of the test, sagtarg.java,
-# and calls gcore to create file sagcore for use in running
-# the SA JDI client.
-
-set -x
-# jdk is a jdk with the vm from the sa workspace
-while [ $# != 0 ] ; do
-    case $1 in
-      -vv)
-        set -x
-        ;;
-      -gui)
-        theClass=sun.jvm.hotspot.HSDB
-        ;;
-     -jdk)
-        jdk=$2
-        shift
-        ;;
-     -jdbx)
-        do=jdbx
-        ;;
-     -jdb)
-        do=jdb
-        ;;
-     -help | help)
-        doUsage
-        exit
-        ;;
-     -dontkill)
-        dontkill=true
-        ;;
-     -d64)
-        d64=-d64
-        ;;
-     -*)
-        javaArgs="$javaArgs $1"
-        ;;
-     *)
-        echo "$1" | grep -s '^[0-9]*$' > /dev/null
-        if [ $? = 0 ] ; then
-            # it is a pid
-            args="$args $1"
-        else
-            # It is a core.        
-            # We have to pass the name of the program that produced the
-            # core, and the core file itself.
-            args="$jdk/bin/java $1"
-        fi
-        ;;
-   esac
-   shift
-done
-
-# First, run the sagtest.java with the regular JPDA jdi
-workdir=./workdir
-mkdir -p $workdir
-CLASSPATH=$jdk/classes:$jdk/lib/tools.jar:$workdir
-export CLASSPATH
-
-$jdk/bin/javac -g  -source 1.5 -classpath $jdk/classes:$jdk/lib/tools.jar:$workdir -J-Xms40m -d $workdir \
-    TestScaffold.java \
-    VMConnection.java \
-    TargetListener.java \
-    TargetAdapter.java \
-    sagdoit.java \
-    sagtarg.java \
-    sagtest.java
-
-if [ $? != 0 ] ; then
-    exit 1
-fi
-
-$jdk/bin/java $javaArgs -Dtest.classes=$workdir sagtest
-
-# Now run create a core file for use in running sa-jdi
-
-if [ ! core.satest -nt sagtarg.class ] ; then
-    tmp=/tmp/sagsetup
-    rm -f $tmp
-    $jdk/bin/java $d64 sagtarg > $tmp &
-    pid=$!
-    while [ ! -s $tmp ] ; do
-        # Kludge alert!
-        sleep 2
-    done
-    #rm -f $tmp
-
-    # force core dump of the debuggee
-    OS=`uname`
-    if [ "$OS" = "Linux" ]; then
-        # Linux does not have gcore command. Instead, we use 'gdb's
-        # gcore command. Note that only some versions of gdb support
-        # gdb command.
-        echo "gcore" > gdbscript
-        gdb -batch -p $pid -x gdbscript
-        rm -f gdbscript
-    else
-        gcore  $* $pid
-    fi
-    mv core.$pid sagcore
-
-    if [ "$dontkill" != "true" ]; then
-       kill -9 $pid
-    fi
-fi
-
diff --git a/src/jdk.hotspot.agent/test/jdi/runsa.sh b/src/jdk.hotspot.agent/test/jdi/runsa.sh
deleted file mode 100644
index aa4d778..0000000
--- a/src/jdk.hotspot.agent/test/jdi/runsa.sh
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/bin/ksh
-#
-# Copyright (c) 2002, 2012, 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 jdk must be hopper or better; it must have the 
-# SA connectors in VirtualMachineManagerImpl.
-jdk=/java/re/jdk/1.4.1/promoted/latest/binaries/solaris-sparc
-#jdk=/net/mmm/export/mmm/jdk1.4fcs.sa
-
-doUsage()
-{
-    cat <<EOF
-    Run sagclient.class using Serviceability Agent to talk to a corefile/pid/debugserver.
-    Usage:  runsa.sh [-jdk <jdk-pathname>] [-jdb] [ -jdbx ] [ -d64 ] [ -remote ] [ pid | corefile | debugserver ]
-
-    -jdk means to use that jdk.  Default is 1.4.1/latest.
-    -jdbx means to run it under jdbx
-    -jdb means to connect using jdb instead of the sagclient program.
-    -remote debugserver means you want to connect to a remote debug server
-
-    The corefile must have been produced by the same java as is running SA.
-
-EOF
-}
-
-if [ $# = 0 ] ; then
-    doUsage
-    exit 1
-fi
-
-# License file for development version of dbx
-#LM_LICENSE_FILE=7588@extend.eng:/usr/dist/local/config/sparcworks/license.dat:7588@setlicense
-#export LM_LICENSE_FILE
-
-do=
-args=
-theClass=sagclient
-javaArgs=
-
-while [ $# != 0 ] ; do
-    case $1 in
-      -vv)
-        set -x
-        ;;
-     -jdk)
-        jdk=$2
-        shift
-        ;;
-     -jdbx)
-        do=jdbx
-        ;;
-     -jdb)
-        do=jdb
-        ;;
-     -help | help)
-        doUsage
-        exit
-        ;;
-     -d64) 
-        d64=-d64
-        ;;
-     -remote)
-        shift 
-        args="$1"
-        do=remote
-        ;;
-     -*)
-        javaArgs="$javaArgs $1"
-        ;;
-     *)
-        echo "$1" | grep -s '^[0-9]*$' > /dev/null
-        if [ $? = 0 ] ; then
-            # it is a pid
-            args="$args $1"
-        else
-            # It is a core.        
-            # We have to pass the name of the program that produced the
-            # core, and the core file itself.
-            args="$jdk/bin/java $1"
-        fi
-        ;;
-   esac
-   shift
-done
-
-if [ -z "$jdk" ] ; then
-    error "--Error: runsa.sh:  Must specify -jdk <jdk-pathname>."
-    error "         Do runsa.sh -help for more info"
-    exit 1
-fi
-
-set -x
-
-# If jjh makes this, then the classes are in .../build/agent.
-# if someone else does, they are in  .
-classesDir=../../../../../../build/agent
-if [ ! -r $classesDir ] ; then
-    classesDir=.
-    if [ ! -r $classesDir ] ; then
-        echo "-- Error: runsa.sh can't find the SA classes"
-        exit 1
-    fi
-fi
-#javacp="/net/mmm/export/mmm/ws/sabaseline/build/solaris/solaris_sparc_compiler1/generated/sa-jdi.jar:$classesDir:$jdk/lib/tools.jar:$jdk/classes:./workdir"
-
-javacp="$jdk/lib/sa-jdi.jar:$classesDir:$jdk/lib/tools.jar:$jdk/classes:./workdir"
-
-
-extraArgs="-showversion $javaArgs"
-#extraArgs="-DdbxSvcAgentDSOPathName=/net/mmm/export/mmm/ws/m/b2/sa/src/os/solaris/agent/64bit/libsvc_agent_dbx.so $extraArgs"
-#extraArgs="-DdbxSvcAgentDSOPathName=/net/jano.eng/export/disk05/hotspot/sa/solaris/sparcv9/lib/libsvc_agent_dbx.so $extraArgs"
-
-mkdir -p workdir
-if [ sagclient.java -nt ./workdir/sagclient.class ] ; then
-    $jdk/bin/javac -d ./workdir -classpath $javacp sagclient.java
-    if [ $? != 0 ] ; then
-        exit 1
-    fi
-fi
-if [ sagdoit.java -nt ./workdir/sagdoit.class ] ; then
-    $jdk/bin/javac -d ./workdir -classpath $javacp sagdoit.java
-    if [ $? != 0 ] ; then
-        exit 1
-    fi
-fi
-
-if [ "$do" = jdbx ] ; then
-    set -x
-    dbx=/net/sparcworks.eng/export/set/sparcworks2/dbx_70_nightly/dev/buildbin/Derived-sparc-S2-opt/bin/dbx
-
-    # Have to do this export for jdbx to work.  -cp and -classpath don't work.
-    CLASSPATH=$javacp
-    export CLASSPATH
-    #extraArgs="-Djava.class.path=$mhs/../sa/build/agent sun.jvm.hotspot.HSDB $*"
-    jvm_invocation="$jdk/bin/java -Xdebug \
-               -Dsun.boot.class.path=$jdk/classes \
-               $extraArgs"
-    #export jvm_invocation
-    
-    JAVASRCPATH=$mhs/../sa/src/share/vm/agent
-    export JAVASRCPATH
-
-    #operand is pathname of .class file, eg ./jj.class.
-    echo run $args
-    clss=`echo $theClass | sed -e 's@\.@/@'`
-    if [ -r ./workdir/$clss.class ] ; then
-        # kludge for running sagclient
-        $dbx  ./workdir/$clss.class
-    else
-        # kludge for running HSDB
-        $dbx  $mhs/../sa/build/agent/$clss.class
-    fi
-elif [ "$do" = jdb ] ; then
-    # This hasn't been tested.
-    $jdk/bin/jdb -J-Xbootclasspath/a:$classesDir -connect sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=sagcore
-elif [ "$do" = remote ] ; then
-    $jdk/bin/java $d64 -Djava.class.path=$javacp $extraArgs $theClass $args
-else
-    $jdk/bin/java $d64 -Djava.class.path=$javacp $extraArgs $theClass $args
-
-fi
diff --git a/src/jdk.hotspot.agent/test/jdi/sagclient.java b/src/jdk.hotspot.agent/test/jdi/sagclient.java
deleted file mode 100644
index 8160b76..0000000
--- a/src/jdk.hotspot.agent/test/jdi/sagclient.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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.
- *
- */
-
-import com.sun.jdi.*;
-import com.sun.jdi.connect.*;
-
-import java.util.Map;
-import java.util.List;
-import java.util.Iterator;
-import java.io.IOException;
-
-public class sagclient {
-    static AttachingConnector myCoreConn;
-    static AttachingConnector myPIDConn;
-    static AttachingConnector myDbgSvrConn;
-    static VirtualMachine vm;
-    static VirtualMachineManager vmmgr;
-
-    public static void println(String msg) {
-        System.out.println("jj: " + msg);
-    }
-
-
-    public static void main(String args[]) {
-        vmmgr = Bootstrap.virtualMachineManager();
-        List attachingConnectors = vmmgr.attachingConnectors();
-        if (attachingConnectors.isEmpty()) {
-            System.err.println( "ERROR: No attaching connectors");
-            return;
-        }
-        Iterator myIt = attachingConnectors.iterator();
-        while (myIt.hasNext()) {
-            AttachingConnector tmpCon = (AttachingConnector)myIt.next();
-            if (tmpCon.name().equals(
-                "sun.jvm.hotspot.jdi.SACoreAttachingConnector")) {
-                myCoreConn = tmpCon;
-            } else if (tmpCon.name().equals(
-                "sun.jvm.hotspot.jdi.SAPIDAttachingConnector")) {
-                myPIDConn = tmpCon;
-            } else if (tmpCon.name().equals(
-                "sun.jvm.hotspot.jdi.SADebugServerAttachingConnector")) {
-                myDbgSvrConn = tmpCon;
-            }
-        }
-        String execPath = null;
-        String pidText = null;
-        String coreFilename = null;
-        String debugServer = null;
-        int pid = 0;
-        switch (args.length) {
-        case (0):
-            break;
-        case (1):
-            // If all numbers, it is a PID to attach to
-            // Else, it is a pathname to a .../bin/java for a core file.
-            try {
-                pidText = args[0];
-                pid = Integer.parseInt(pidText);
-                System.out.println( "pid: " + pid);
-                vm = attachPID(pid);
-            } catch (NumberFormatException e) {
-                System.out.println("trying remote server ..");
-                debugServer = args[0];
-                System.out.println( "remote server: " + debugServer);
-                vm = attachDebugServer(debugServer);
-            }
-            break;
-
-        case (2):
-            execPath = args[0];
-            coreFilename = args[1];
-            System.out.println( "jdk: " + execPath);
-            System.out.println( "core: " + coreFilename);
-            vm = attachCore(coreFilename, execPath);
-            break;
-        }
-
-
-        if (vm != null) {
-            System.out.println("sagclient: attached ok!");
-            sagdoit mine = new sagdoit(vm);
-            mine.doAll();
-            vm.dispose();
-        }
-    }
-
-    private static VirtualMachine attachCore(String coreFilename, String execPath) {
-        Map connArgs = myCoreConn.defaultArguments();
-        System.out.println("connArgs = " + connArgs);
-        VirtualMachine vm;
-        Connector.StringArgument connArg = (Connector.StringArgument)connArgs.get("core");
-        connArg.setValue(coreFilename);
-
-        connArg =  (Connector.StringArgument)connArgs.get("javaExecutable");
-        connArg.setValue(execPath);
-        try {
-            vm = myCoreConn.attach(connArgs);
-        } catch (IOException ee) {
-            System.err.println("ERROR: myCoreConn.attach got IO Exception:" + ee);
-            vm = null;
-        } catch (IllegalConnectorArgumentsException ee) {
-            System.err.println("ERROR: myCoreConn.attach got illegal args exception:" + ee);
-            vm = null;
-        }
-        return vm;
-   }
-
-   private static VirtualMachine attachPID(int pid) {
-        Map connArgs = myPIDConn.defaultArguments();
-        System.out.println("connArgs = " + connArgs);
-        VirtualMachine vm;
-        Connector.StringArgument connArg = (Connector.StringArgument)connArgs.get("pid");
-        connArg.setValue(Integer.toString(pid));
-
-        try {
-            vm = myPIDConn.attach(connArgs);
-        } catch (IOException ee) {
-            System.err.println("ERROR: myPIDConn.attach got IO Exception:" + ee);
-            vm = null;
-        } catch (IllegalConnectorArgumentsException ee) {
-            System.err.println("ERROR: myPIDConn.attach got illegal args exception:" + ee);
-            vm = null;
-        }
-        return vm;
-   }
-
-
-   private static VirtualMachine attachDebugServer(String debugServer) {
-        Map connArgs = myDbgSvrConn.defaultArguments();
-        System.out.println("connArgs = " + connArgs);
-        VirtualMachine vm;
-        Connector.StringArgument connArg = (Connector.StringArgument)connArgs.get("debugServerName");
-        connArg.setValue(debugServer);
-
-        try {
-            vm = myDbgSvrConn.attach(connArgs);
-        } catch (IOException ee) {
-            System.err.println("ERROR: myDbgSvrConn.attach got IO Exception:" + ee);
-            vm = null;
-        } catch (IllegalConnectorArgumentsException ee) {
-            System.err.println("ERROR: myDbgSvrConn.attach got illegal args exception:" + ee);
-            vm = null;
-        }
-        return vm;
-   }
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/sagdoit.java b/src/jdk.hotspot.agent/test/jdi/sagdoit.java
deleted file mode 100644
index 27c6931..0000000
--- a/src/jdk.hotspot.agent/test/jdi/sagdoit.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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.
- *
- */
-
-import com.sun.jdi.*;
-import java.util.*;
-
-
-// This just contains a bunch of methods that call various JDI methods.
-// It is called from the sagtest.java jtreg test to get this info for the standard
-// JDI and from the sagclient.java test to get this info for the SA JDI.
-
-class comparator implements Comparator {
-
-    public int compare(Object o1, Object o2) {
-        ReferenceType rt1 = (ReferenceType)o1;
-        ReferenceType rt2 = (ReferenceType)o2;
-        return rt1.signature().compareTo(rt2.signature());
-    }
-
-    public boolean equals(Object oo) {
-        return false;
-    }
-}
-
-public class sagdoit {
-
-    VirtualMachine myVm;
-    int margin = 0;
-    static String blanks = "                                                        ";
-    static int nblanks = blanks.length();
-
-    sagdoit(VirtualMachine vm) {
-        super();
-        myVm = vm;
-    }
-
-    void indent(int count) {
-        margin += count;
-    }
-
-    void pp(String msg) {
-        System.out.println(blanks.substring(nblanks - margin) + msg);
-    }
-
-    public void doAll() {
-        doThreadGroups();
-        //System.out.println("NOTE: dumping of class info is disabled in sagdoit.java");
-        //System.out.println("      just to keep the output small while working on objects");
-        doClasses();  //fixme jj: uncomment this to see all class info
-
-    }
-    public void doThreadGroups() {
-        doThreadGroupList(myVm.topLevelThreadGroups());
-    }
-
-    private void doThreadGroupList(List groups) {
-        // sort; need a comparator
-        if (groups == null) {
-            return;
-        }
-
-        Iterator myIter = groups.iterator();
-        while(myIter.hasNext()) {
-            ThreadGroupReference aGroup = (ThreadGroupReference)myIter.next();
-            doOneThreadGroup(aGroup);
-        }
-
-    }
-
-    public void doOneThreadGroup(ThreadGroupReference xx) {
-        pp("threadGroup:" + xx.name());
-        indent(4);
-        pp("parent()       = " + xx.parent());
-        pp("threads:");
-        indent(4);
-        doThreadList(xx.threads());
-        indent(-4);
-        pp("threadGroups:");
-        indent(4);
-        doThreadGroupList(xx.threadGroups());
-        indent(-4);
-        indent(-4);
-    }
-
-    public void doThreads() {
-        doThreadList(myVm.allThreads());
-    }
-
-    public void doThreadList(List threads) {
-        if (threads == null) {
-            return;
-        }
-        Iterator myIter = threads.iterator();
-        while(myIter.hasNext()) {
-            ThreadReference aThread = (ThreadReference)myIter.next();
-            doOneThread(aThread);
-        }
-    }
-
-    public void doOneThread(ThreadReference xx) {
-        pp("Thread: " + xx.name());
-        indent(4);
-        pp("suspendCount()      = " + xx.suspendCount());
-
-        //void stop(ObjectReference throwable) throws InvalidTypeException;
-        //void interrupt();
-        pp("status()            = " + xx.status());
-        pp("isSuspended()       = " + xx.isSuspended());
-        pp("isAtBreakpoint()    = " + xx.isAtBreakpoint());
-
-        pp("threadGroup()       = " + xx.threadGroup());
-        indent(-4);
-
-        indent(4);
-        try {
-            List allFrames = xx.frames();
-            for (int ii = 0; ii < xx.frameCount(); ii++) {
-                StackFrame oneFrame = xx.frame(ii);
-                pp("frame(" + ii + ") = " + oneFrame);
-                doOneFrame(oneFrame);
-            }
-            //List frames(int start, int length) throws IncompatibleThreadStateException;
-            // unsupported List allMonitors = xx.ownedMonitors();
-            // unsupported pp("currentContendedMonitor() = " + xx.currentContendedMonitor());
-        } catch (IncompatibleThreadStateException ee) {
-            pp("GOT IncompatibleThreadStateException: " + ee);
-        }
-        indent(-4);
-    }
-
-    public void doOneFrame(StackFrame frame) {
-
-        List localVars = null;
-        try {
-            localVars = frame.visibleVariables();
-        } catch (AbsentInformationException ee) {
-            // we compile with -g so this shouldn't happen
-            return;
-        }
-        indent(4);
-        for (Iterator it = localVars.iterator(); it.hasNext();) {
-            LocalVariable lv = (LocalVariable) it.next();
-            pp("lv name = " + lv.name() +
-               ", type =  " + lv.typeName() +
-               ", sig =   " + lv.signature() +
-               ", gsig =  " + lv.genericSignature() +
-               ", isVis = " + lv.isVisible(frame) +
-               ", isArg = " + lv.isArgument());
-        }
-        indent(-4);
-    }
-
-    public void doClasses() {
-        List myClasses = myVm.allClasses();
-        myClasses = new ArrayList(myClasses);
-        Collections.sort(myClasses, new comparator());
-        for (int ii = 0; ii < myClasses.size(); ii++) {
-            // Spec says each is a ReferenceType
-            //System.out.println("class " + (ii + 1) + " is " + myClasses.get(ii));
-            ReferenceType aClass = (ReferenceType)myClasses.get(ii);
-            System.out.println("class " + (ii + 1) + " is " + aClass.signature());
-            doOneClass(aClass);
-            // Uncomment this to just do a few classes.
-            //if ( ii > 4) break;
-        }
-    }
-
-    public void doOneClass(ReferenceType xx) {
-        indent(5);
-        // inherited from Mirror
-        pp("toString()       = " + xx.toString());
-        pp("virtualMachine() = " + xx.virtualMachine());
-
-        // inherited from Type
-        pp("name()           = " + xx.name());
-        pp("signature()      = " + xx.signature());
-
-        // ReferenceType fields
-        doReferenceTypeFields(xx);
-
-
-
-
-
-        String className = xx.getClass().getName();
-        pp("subclass           = " + className);
-
-         Class referenceType = null;
-         Class arrayType = null;
-         Class classType = null;
-         Class interfaceType = null;
-
-         try {
-             referenceType = Class.forName("com.sun.jdi.ReferenceType");
-             arrayType = Class.forName("com.sun.jdi.ArrayType");
-             interfaceType = Class.forName("com.sun.jdi.InterfaceType");
-             classType = Class.forName("com.sun.jdi.ClassType");
-         } catch (ClassNotFoundException ee) {
-         }
-
-
-         if (referenceType.isInstance(xx)) {
-             pp("ReferenceType fields");
-             ReferenceType rr = (ReferenceType)xx;
-
-             if (arrayType.isInstance(xx)) {
-                 pp("ArrayType fields");
-             }
-
-             if (classType.isInstance(xx)) {
-                 pp("ClassType fields");
-             }
-
-             if (interfaceType.isInstance(xx)) {
-                 pp("InterfaceType fields");
-             }
-         }
-        indent(-5);
-
-    }
-
-
-  public void doReferenceTypeFields(ReferenceType xx) {
-    Object zz;
-      pp("classLoader() = " + xx.classLoader());
-      try {zz =xx.sourceName();} catch(AbsentInformationException ee) { zz = ee;} pp("sourceName() = " + zz);
-      try {zz =xx.sourceNames("stratum");} catch(AbsentInformationException ee) { zz = ee;} pp("sourceNames() = " + zz);
-      try {zz =xx.sourcePaths("stratum");} catch(AbsentInformationException ee) { zz = ee;} pp("sourcePaths() = " + zz);
-      //try {zz =xx.sourceDebugExtension();} catch(AbsentInformationException ee) { zz = ee;} pp("sourceDebugExtension() = " + zz);
-      //fixme: jj; should sourceDebugExtension throw UnsupportedOperationException?
-      try {zz =xx.sourceDebugExtension();} catch(Exception ee) { zz = ee;} pp("sourceDebugExtension() = " + zz);
-      // If xx is an array, this can cause a ClassNotLoadedException on the
-      // component type.  Is that a JDI bug?
-      pp("isStatic() = " + xx.isStatic());
-      pp("isAbstract() = " + xx.isAbstract());
-      pp("isFinal() = " + xx.isFinal());
-      pp("isPrepared() = " + xx.isPrepared());
-      pp("isVerified() = " + xx.isVerified());
-      pp("isInitialized() = " + xx.isInitialized());
-      pp("failedToInitialize() = " + xx.failedToInitialize());
-      pp("fields() = " + xx.fields());
-      pp("visibleFields() = " + xx.visibleFields());
-      pp("allFields() = " + xx.allFields());
-      pp("fieldByName(String fieldName) = " + xx.fieldByName("fieldName"));
-      pp("methods() = " + xx.methods());
-
-
-       List meths = xx.methods();
-       Iterator iter = meths.iterator();
-       while (iter.hasNext()) {
-           Method mm = (Method)iter.next();
-           pp("  name/sig:" + mm.name() + "/" + mm.signature());
-       }
-
-      pp(" visibleMethods() = " + xx.visibleMethods());
-
-      //if (1 == 1) return;
-
-      pp("allMethods() = " + xx.allMethods());
-
-
-      pp("methodsByName(String name) = " + xx.methodsByName("name"));
-      pp("methodsByName(String name, String signature) = " + xx.methodsByName("name", "signature"));
-      pp("nestedTypes() = " + xx.nestedTypes());
-      //pp("getValue(Field field) = " + xx.getValue("field"));
-      pp("getValue(Field field) = " + "fixme: jjh");
-      //pp("getValues(List fields) = " + xx.getValues(new List[] = {"fields"}));
-      pp("getValues(List fields) = " + "fixme: jjh");
-      pp("classObject() = " + xx.classObject());
-      //x      pp("allLineLocations() = " + xx.allLineLocations());
-      //x      pp("allLineLocations(String stratum, String sourceName) = " + xx.allLineLocations("stratum", "sourceName"));
-      //x      pp("locationsOfLine(int lineNumber) = " + xx.locationsOfLine(89));
-      //x      pp("locationsOfLine(String stratum, String sourceName, int lineNumber) = " + xx.locationsOfLine("stratum", "sourceName", 89));
-      pp("availableStrata() = " + xx.availableStrata());
-      pp("defaultStratum() = " + xx.defaultStratum());
-      pp("equals(Object obj) = " + xx.equals(xx));
-      pp("hashCode() = " + xx.hashCode());
-  }
-
-}
-
-//         try {
-//             ReferenceType rr = (ReferenceType)xx;
-//             pp("ReferenceType fields");
-
-//             try {
-//                 ArrayType ff = (ArrayType)xx;
-//                 pp("ArrayType fields");
-
-//             } catch(ClassCastException ee) {
-//             }
-
-//             try {
-//                 ClassType ff = (ClassType)xx;
-//                 pp("ClassType fields");
-
-//             } catch(ClassCastException ee) {
-//             }
-
-//             try {
-//                 InterfaceType ff = (InterfaceType)xx;
-//                 pp("InterfaceType fields");
-
-//             } catch(ClassCastException ee) {
-//             }
-
-//         } catch(ClassCastException ee) {
-//         }
diff --git a/src/jdk.hotspot.agent/test/jdi/sagtarg.java b/src/jdk.hotspot.agent/test/jdi/sagtarg.java
deleted file mode 100644
index 6e7c2c0..0000000
--- a/src/jdk.hotspot.agent/test/jdi/sagtarg.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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 is the target debuggee for sagtest.java.
-// It just waits which lets the test call all the JDI
-// methods on it.
-
-import java.util.List;
-
-interface MyInterface {
-    public void myMethod();
-}
-
-
-abstract class MySuper implements MyInterface {
-}
-
-class sagtarg extends MySuper {
-    public static void main(String[] args){
-        String stringVar = "localVar1";
-        int    intVar = 89;
-        List<String> genVar = null;
-        System.out.println("Howdy!");
-        String myStr = "";
-        synchronized(myStr) {
-            try {
-                myStr.wait();
-            } catch (InterruptedException ee) {
-            }
-        }
-        System.out.println("Goodbye from sagtarg!");
-    }
-
-    public void myMethod() {
-    }
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/sagtest.java b/src/jdk.hotspot.agent/test/jdi/sagtest.java
deleted file mode 100644
index 09327a3..0000000
--- a/src/jdk.hotspot.agent/test/jdi/sagtest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, 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 0000000
- *  @summary This is just an exercise of various JDI elements for use in
- *           testing the SA/JDI client
- *
- *  @author jjh
- *
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter sagdoit
- *  @run compile -g -source 1.5 sagtarg.java
- *  @run main sagtest
- */
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-import com.sun.jdi.request.*;
-
-import java.util.*;
-
-    /********** target program **********/
-
-// The target program is sagtarg.java
-
-    /********** test program **********/
-
-public class sagtest extends TestScaffold {
-    ReferenceType targetClass;
-    ThreadReference mainThread;
-
-    sagtest (String args[]) {
-        super(args);
-    }
-
-    public static void main(String[] args)      throws Exception {
-        new sagtest(args).startTests();
-    }
-
-    /********** event handlers **********/
-
-
-    /********** test core **********/
-
-    protected void runTests() throws Exception {
-        /*
-         * Get to the top of main()
-         * to determine targetClass and mainThread
-         */
-        BreakpointEvent bpe = startToMain("sagtarg");
-        targetClass = bpe.location().declaringType();
-        mainThread = bpe.thread();
-        EventRequestManager erm = vm().eventRequestManager();
-        stepOverLine(mainThread);  //stop on 18
-        stepOverLine(mainThread);  //stop on 19
-        stepOverLine(mainThread);  //stop on 20
-        stepOverLine(mainThread);  //stop on 21
-        stepOverLine(mainThread);  //stop on 22
-
-        sagdoit mine = new sagdoit(vm());
-        mine.doAll();
-
-        if (!testFailed) {
-            println("sagtest: passed");
-        } else {
-            throw new Exception("sagtest: failed");
-        }
-    }
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/sasanity.sh b/src/jdk.hotspot.agent/test/jdi/sasanity.sh
deleted file mode 100644
index 0e15552..0000000
--- a/src/jdk.hotspot.agent/test/jdi/sasanity.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/ksh
-#
-# Copyright (c) 2003, 2012, 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 script is used to run sanity check on vmStructs.
-# Each SA class is checked against a given VM. "PASSED" is 
-# printed if vmStructs are consistent. Else, "FAILED" is
-# printed and an exception stack trace follows.
-
-usage() {
-    echo "usage: ./sasanity.sh <jdk>"
-    echo "<jdk> is the 1.5 j2se directory against which you want to run sanity check"
-    exit 1   
-}
-
-if [ "$1" == "" ]; then
-    usage
-fi
-
-if [ "$1" == "-help" ]; then
-    usage
-fi
-
-jdk=$1
-shift
-OS=`uname`
-
-javacp=$jdk/lib/sa-jdi.jar:./workdir
-
-mkdir -p workdir
-if [ SASanityChecker.java -nt ./workdir/SASanityChecker.class ] ; then
-    $jdk/bin/javac -d ./workdir -classpath $javacp SASanityChecker.java
-    if [ $? != 0 ] ; then
-        exit 1
-    fi
-fi
-
-if [ sagtarg.java -nt ./workdir/sagtarg.class ]; then
-    $jdk/bin/javac -g  -classpath -d $workdir sagtarg.java
-    if [ $? != 0 ] ; then
-        exit 1
-    fi
-fi
-
-tmp=/tmp/sagsetup
-rm -f $tmp
-$jdk/bin/java $* sagtarg > $tmp &
-pid=$!
-while [ ! -s $tmp ] ; do
-  # Kludge alert!
-  sleep 2
-done
-
-$jdk/bin/java -showversion ${OPTIONS} -classpath $javacp $* SASanityChecker $pid
-kill -9 $pid
diff --git a/src/jdk.hotspot.agent/test/jdi/serialvm.java b/src/jdk.hotspot.agent/test/jdi/serialvm.java
deleted file mode 100644
index 7cee578..0000000
--- a/src/jdk.hotspot.agent/test/jdi/serialvm.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- *
- */
-
-import com.sun.jdi.*;
-import com.sun.jdi.connect.*;
-
-import java.util.Map;
-import java.util.List;
-import java.util.Iterator;
-import java.io.IOException;
-
-
-/* This class is used to test multi VM connectivity feature of
- * SA/JDI. Accepts two PIDs as arguments. Connects to first VM
- *, disposes it, connects to second VM, disposes second VM.
- */
-
-
-public class serialvm {
-    static AttachingConnector myPIDConn;
-    static VirtualMachine vm1;
-    static VirtualMachine vm2;
-    static VirtualMachineManager vmmgr;
-
-    public static void println(String msg) {
-        System.out.println(msg);
-    }
-
-    private static void usage() {
-        System.err.println("Usage: java serialvm <pid1> <pid2>");
-        System.exit(1);
-    }
-
-    public static void main(String args[]) {
-        vmmgr = Bootstrap.virtualMachineManager();
-        List attachingConnectors = vmmgr.attachingConnectors();
-        if (attachingConnectors.isEmpty()) {
-            System.err.println( "ERROR: No attaching connectors");
-            return;
-        }
-        Iterator myIt = attachingConnectors.iterator();
-        while (myIt.hasNext()) {
-            AttachingConnector tmpCon = (AttachingConnector)myIt.next();
-            if (tmpCon.name().equals(
-                "sun.jvm.hotspot.jdi.SAPIDAttachingConnector")) {
-                myPIDConn = tmpCon;
-                break;
-            }
-        }
-
-        int pid1 = 0, pid2 = 0;
-        String pidText = null;
-        switch (args.length) {
-        case (2):
-            try {
-                pidText = args[0];
-                pid1 = Integer.parseInt(pidText);
-                System.out.println( "pid1: " + pid1);
-                pidText = args[1];
-                pid2 = Integer.parseInt(pidText);
-                System.out.println( "pid2: " + pid2);
-            } catch (NumberFormatException e) {
-                println(e.getMessage());
-                usage();
-            }
-            break;
-        default:
-            usage();
-        }
-
-        // attach, dispose, attach2, dispose2 pattern
-        // as opposed to attach1, attach2, dispose1, dispose2
-        vm1 = attachPID(pid1);
-        if (vm1 != null) {
-            System.out.println("vm1: attached ok!");
-            System.out.println(vm1.version());
-            sagdoit mine = new sagdoit(vm1);
-            mine.doAll();
-        }
-        if (vm1 != null) {
-            vm1.dispose();
-        }
-
-        vm2 = attachPID(pid2);
-        if (vm2 != null) {
-            System.out.println("vm2: attached ok!");
-            System.out.println(vm2.version());
-            sagdoit mine = new sagdoit(vm2);
-            mine.doAll();
-        }
-
-
-        if (vm2 != null) {
-            vm2.dispose();
-        }
-    }
-
-   private static VirtualMachine attachPID(int pid) {
-        Map connArgs = myPIDConn.defaultArguments();
-        System.out.println("connArgs = " + connArgs);
-        VirtualMachine vm;
-        Connector.StringArgument connArg = (Connector.StringArgument)connArgs.get("pid");
-        connArg.setValue(Integer.toString(pid));
-
-        try {
-            vm = myPIDConn.attach(connArgs);
-        } catch (IOException ee) {
-            System.err.println("ERROR: myPIDConn.attach got IO Exception:" + ee);
-            vm = null;
-        } catch (IllegalConnectorArgumentsException ee) {
-            System.err.println("ERROR: myPIDConn.attach got illegal args exception:" + ee);
-            vm = null;
-        }
-        return vm;
-   }
-}
diff --git a/src/jdk.hotspot.agent/test/jdi/serialvm.sh b/src/jdk.hotspot.agent/test/jdi/serialvm.sh
deleted file mode 100644
index e2839ae..0000000
--- a/src/jdk.hotspot.agent/test/jdi/serialvm.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/ksh
-#
-# Copyright (c) 2003, 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.
-#  
-#
-
-doUsage()
-{
-    cat <<EOF
-    Run serialvm.class using Serviceability Agent to talk to 2 pids one
-    after another in serial fashion.
-    Usage:  serialvm.sh <jdk-pathname> <pid1> <pid2>
-
-EOF
-}
-
-if [ $# = 4 ] ; then
-    doUsage
-    exit 1
-fi
-
-jdk=$1
-javacp="$jdk/lib/sa-jdi.jar:$classesDir:$jdk/lib/tools.jar:$jdk/classes:./workdir"
-
-mkdir -p workdir
-if [ sagdoit.java -nt ./workdir/sagdoit.class ] ; then
-    $jdk/bin/javac -d ./workdir -classpath $javacp sagdoit.java
-    if [ $? != 0 ] ; then
-        exit 1
-    fi
-fi
-if [ serialvm.java -nt ./workdir/serialvm.class ] ; then
-    $jdk/bin/javac -d ./workdir -classpath $javacp serialvm.java
-    if [ $? != 0 ] ; then
-        exit 1
-    fi
-fi
-
-$jdk/bin/java -Dsun.jvm.hotspot.jdi.ConnectorImpl.DEBUG -Dsun.jvm.hotspot.jdi.SAJDIClassLoader.DEBUG -Djava.class.path=$javacp serialvm $2 $3
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java
index 7f3eb35..705f0b9 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java
@@ -105,7 +105,9 @@
 
     private final RegisterArray javaGeneralParameterRegisters;
     private final RegisterArray nativeGeneralParameterRegisters;
-    private final RegisterArray xmmParameterRegisters = new RegisterArray(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7);
+    private final RegisterArray javaXMMParameterRegisters;
+    private final RegisterArray nativeXMMParameterRegisters;
+    private final boolean windowsOS;
 
     /*
      * Some ABIs (e.g. Windows) require a so-called "home space", that is a save area on the stack
@@ -143,23 +145,27 @@
         assert callerSaved.size() >= allocatable.size();
     }
 
-    public AMD64HotSpotRegisterConfig(TargetDescription target, RegisterArray allocatable, boolean windowsOs) {
+    public AMD64HotSpotRegisterConfig(TargetDescription target, RegisterArray allocatable, boolean windowsOS) {
         this.target = target;
+        this.windowsOS = windowsOS;
 
-        if (windowsOs) {
+        if (windowsOS) {
             javaGeneralParameterRegisters = new RegisterArray(rdx, r8, r9, rdi, rsi, rcx);
             nativeGeneralParameterRegisters = new RegisterArray(rcx, rdx, r8, r9);
+            nativeXMMParameterRegisters = new RegisterArray(xmm0, xmm1, xmm2, xmm3);
             this.needsNativeStackHomeSpace = true;
         } else {
             javaGeneralParameterRegisters = new RegisterArray(rsi, rdx, rcx, r8, r9, rdi);
             nativeGeneralParameterRegisters = new RegisterArray(rdi, rsi, rdx, rcx, r8, r9);
+            nativeXMMParameterRegisters = new RegisterArray(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7);
             this.needsNativeStackHomeSpace = false;
         }
+        javaXMMParameterRegisters = new RegisterArray(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7);
 
         this.allocatable = allocatable;
         Set<Register> callerSaveSet = new HashSet<>();
         allocatable.addTo(callerSaveSet);
-        xmmParameterRegisters.addTo(callerSaveSet);
+        javaXMMParameterRegisters.addTo(callerSaveSet);
         callerSaveSet.addAll(javaGeneralParameterRegisters.asList());
         nativeGeneralParameterRegisters.addTo(callerSaveSet);
         callerSaved = new RegisterArray(callerSaveSet);
@@ -187,11 +193,11 @@
     public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, ValueKindFactory<?> valueKindFactory) {
         HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type;
         if (type == HotSpotCallingConventionType.NativeCall) {
-            return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, hotspotType, valueKindFactory);
+            return callingConvention(nativeGeneralParameterRegisters, nativeXMMParameterRegisters, windowsOS, returnType, parameterTypes, hotspotType, valueKindFactory);
         }
         // On x64, parameter locations are the same whether viewed
         // from the caller or callee perspective
-        return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, hotspotType, valueKindFactory);
+        return callingConvention(javaGeneralParameterRegisters, javaXMMParameterRegisters, false, returnType, parameterTypes, hotspotType, valueKindFactory);
     }
 
     @Override
@@ -208,14 +214,33 @@
                 return hotspotType == HotSpotCallingConventionType.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters;
             case Float:
             case Double:
-                return xmmParameterRegisters;
+                return hotspotType == HotSpotCallingConventionType.NativeCall ? nativeXMMParameterRegisters : javaXMMParameterRegisters;
             default:
                 throw JVMCIError.shouldNotReachHere();
         }
     }
 
-    private CallingConvention callingConvention(RegisterArray generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type,
+    /**
+     * Hand out registers matching the calling convention from the {@code generalParameterRegisters}
+     * and {@code xmmParameterRegisters} sets. Normally registers are handed out from each set
+     * individually based on the type of the argument. If the {@code unified} flag is true then hand
+     * out registers in a single sequence, selecting between the sets based on the type. This is to
+     * support the Windows calling convention which only ever passes 4 arguments in registers, no
+     * matter their types.
+     *
+     * @param generalParameterRegisters
+     * @param xmmParameterRegisters
+     * @param unified
+     * @param returnType
+     * @param parameterTypes
+     * @param type
+     * @param valueKindFactory
+     * @return the resulting calling convention
+     */
+    private CallingConvention callingConvention(RegisterArray generalParameterRegisters, RegisterArray xmmParameterRegisters, boolean unified, JavaType returnType, JavaType[] parameterTypes,
+                    HotSpotCallingConventionType type,
                     ValueKindFactory<?> valueKindFactory) {
+        assert !unified || generalParameterRegisters.size() == xmmParameterRegisters.size() : "must be same size in unified mode";
         AllocatableValue[] locations = new AllocatableValue[parameterTypes.length];
 
         int currentGeneral = 0;
@@ -240,8 +265,8 @@
                     break;
                 case Float:
                 case Double:
-                    if (currentXMM < xmmParameterRegisters.size()) {
-                        Register register = xmmParameterRegisters.get(currentXMM++);
+                    if ((unified ? currentGeneral : currentXMM) < xmmParameterRegisters.size()) {
+                        Register register = xmmParameterRegisters.get(unified ? currentGeneral++ : currentXMM++);
                         locations[i] = register.asValue(valueKindFactory.getValueKind(kind));
                     }
                     break;
@@ -255,6 +280,7 @@
                 currentStackOffset += Math.max(valueKind.getPlatformKind().getSizeInBytes(), target.wordSize);
             }
         }
+        assert !unified || currentXMM == 0 : "shouldn't be used in unified mode";
 
         JavaKind returnKind = returnType == null ? JavaKind.Void : returnType.getJavaKind();
         AllocatableValue returnLocation = returnKind == JavaKind.Void ? Value.ILLEGAL : getReturnRegister(returnKind).asValue(valueKindFactory.getValueKind(returnKind.getStackKind()));
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java
index bb25c61..3b07a90 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java
@@ -26,17 +26,41 @@
 import static jdk.vm.ci.meta.Value.ILLEGAL;
 import static jdk.vm.ci.sparc.SPARC.REGISTER_SAFE_AREA_SIZE;
 import static jdk.vm.ci.sparc.SPARC.d0;
+import static jdk.vm.ci.sparc.SPARC.d10;
+import static jdk.vm.ci.sparc.SPARC.d12;
+import static jdk.vm.ci.sparc.SPARC.d14;
+import static jdk.vm.ci.sparc.SPARC.d16;
+import static jdk.vm.ci.sparc.SPARC.d18;
 import static jdk.vm.ci.sparc.SPARC.d2;
+import static jdk.vm.ci.sparc.SPARC.d20;
+import static jdk.vm.ci.sparc.SPARC.d22;
+import static jdk.vm.ci.sparc.SPARC.d24;
+import static jdk.vm.ci.sparc.SPARC.d26;
+import static jdk.vm.ci.sparc.SPARC.d28;
+import static jdk.vm.ci.sparc.SPARC.d30;
 import static jdk.vm.ci.sparc.SPARC.d4;
 import static jdk.vm.ci.sparc.SPARC.d6;
+import static jdk.vm.ci.sparc.SPARC.d8;
 import static jdk.vm.ci.sparc.SPARC.f0;
 import static jdk.vm.ci.sparc.SPARC.f1;
+import static jdk.vm.ci.sparc.SPARC.f11;
+import static jdk.vm.ci.sparc.SPARC.f13;
+import static jdk.vm.ci.sparc.SPARC.f15;
+import static jdk.vm.ci.sparc.SPARC.f17;
+import static jdk.vm.ci.sparc.SPARC.f19;
 import static jdk.vm.ci.sparc.SPARC.f2;
+import static jdk.vm.ci.sparc.SPARC.f21;
+import static jdk.vm.ci.sparc.SPARC.f23;
+import static jdk.vm.ci.sparc.SPARC.f25;
+import static jdk.vm.ci.sparc.SPARC.f27;
+import static jdk.vm.ci.sparc.SPARC.f29;
 import static jdk.vm.ci.sparc.SPARC.f3;
+import static jdk.vm.ci.sparc.SPARC.f31;
 import static jdk.vm.ci.sparc.SPARC.f4;
 import static jdk.vm.ci.sparc.SPARC.f5;
 import static jdk.vm.ci.sparc.SPARC.f6;
 import static jdk.vm.ci.sparc.SPARC.f7;
+import static jdk.vm.ci.sparc.SPARC.f9;
 import static jdk.vm.ci.sparc.SPARC.g0;
 import static jdk.vm.ci.sparc.SPARC.g2;
 import static jdk.vm.ci.sparc.SPARC.g6;
@@ -95,11 +119,6 @@
 
     private final RegisterAttributes[] attributesMap;
 
-    /**
-     * Does native code (C++ code) spill arguments in registers to the parent frame?
-     */
-    private final boolean addNativeRegisterArgumentSlots;
-
     @Override
     public RegisterArray getAllocatableRegisters() {
         return allocatable;
@@ -124,10 +143,18 @@
     private final RegisterArray cpuCallerParameterRegisters = new RegisterArray(o0, o1, o2, o3, o4, o5);
     private final RegisterArray cpuCalleeParameterRegisters = new RegisterArray(i0, i1, i2, i3, i4, i5);
 
-    private final RegisterArray fpuFloatParameterRegisters = new RegisterArray(f0, f1, f2, f3, f4, f5, f6, f7);
-    private final RegisterArray fpuDoubleParameterRegisters = new RegisterArray(d0, null, d2, null, d4, null, d6, null);
+    private final RegisterArray fpuFloatJavaParameterRegisters = new RegisterArray(f0, f1, f2, f3, f4, f5, f6, f7);
+    private final RegisterArray fpuDoubleJavaParameterRegisters = new RegisterArray(d0, null, d2, null, d4, null, d6, null);
 
     // @formatter:off
+    private final RegisterArray fpuFloatNativeParameterRegisters = new RegisterArray(
+                    f1,   f3,  f5,  f7,  f9, f11, f13, f15,
+                    f17, f19, f21, f23, f25, f27, f29, f31);
+
+    private final RegisterArray fpuDoubleNativeParameterRegisters = new RegisterArray(
+                     d0,  d2,  d4,  d6,  d8, d10, d12, d14,
+                    d16, d18, d20, d22, d24, d26, d28, d30);
+
     private final RegisterArray callerSaveRegisters;
 
     /**
@@ -170,7 +197,6 @@
     public SPARCHotSpotRegisterConfig(TargetDescription target, RegisterArray allocatable) {
         this.target = target;
         this.allocatable = allocatable;
-        this.addNativeRegisterArgumentSlots = false;
         HashSet<Register> callerSaveSet = new HashSet<>(target.arch.getAvailableValueRegisters().asList());
         for (Register cs : windowSaveRegisters) {
             callerSaveSet.remove(cs);
@@ -220,7 +246,7 @@
                 return hotspotType == HotSpotCallingConventionType.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters;
             case Double:
             case Float:
-                return fpuFloatParameterRegisters;
+                return fpuFloatJavaParameterRegisters;
             default:
                 throw JVMCIError.shouldNotReachHere("Unknown JavaKind " + kind);
         }
@@ -233,48 +259,77 @@
         int currentGeneral = 0;
         int currentFloating = 0;
         int currentStackOffset = 0;
+        boolean isNative = type == HotSpotCallingConventionType.NativeCall;
 
         for (int i = 0; i < parameterTypes.length; i++) {
             final JavaKind kind = parameterTypes[i].getJavaKind().getStackKind();
-
-            switch (kind) {
-                case Byte:
-                case Boolean:
-                case Short:
-                case Char:
-                case Int:
-                case Long:
-                case Object:
-                    if (currentGeneral < generalParameterRegisters.size()) {
-                        Register register = generalParameterRegisters.get(currentGeneral++);
-                        locations[i] = register.asValue(valueKindFactory.getValueKind(kind));
-                    }
-                    break;
-                case Double:
-                    if (currentFloating < fpuFloatParameterRegisters.size()) {
-                        if (currentFloating % 2 != 0) {
-                            // Make register number even to be a double reg
-                            currentFloating++;
+            if (isNative) {
+                RegisterArray registerSet;
+                switch (kind) {
+                    case Byte:
+                    case Boolean:
+                    case Short:
+                    case Char:
+                    case Int:
+                    case Long:
+                    case Object:
+                        registerSet = generalParameterRegisters;
+                        break;
+                    case Double:
+                        registerSet = fpuDoubleNativeParameterRegisters;
+                        break;
+                    case Float:
+                        registerSet = fpuFloatNativeParameterRegisters;
+                        break;
+                    default:
+                        throw JVMCIError.shouldNotReachHere();
+                }
+                if (i < registerSet.size()) {
+                    locations[i] = registerSet.get(i).asValue(valueKindFactory.getValueKind(kind));
+                    currentStackOffset += target.arch.getWordSize();
+                }
+            } else {
+                switch (kind) {
+                    case Byte:
+                    case Boolean:
+                    case Short:
+                    case Char:
+                    case Int:
+                    case Long:
+                    case Object:
+                        if (currentGeneral < generalParameterRegisters.size()) {
+                            Register register = generalParameterRegisters.get(currentGeneral++);
+                            locations[i] = register.asValue(valueKindFactory.getValueKind(kind));
                         }
-                        Register register = fpuDoubleParameterRegisters.get(currentFloating);
-                        currentFloating += 2; // Only every second is a double register
-                        locations[i] = register.asValue(valueKindFactory.getValueKind(kind));
-                    }
-                    break;
-                case Float:
-                    if (currentFloating < fpuFloatParameterRegisters.size()) {
-                        Register register = fpuFloatParameterRegisters.get(currentFloating++);
-                        locations[i] = register.asValue(valueKindFactory.getValueKind(kind));
-                    }
-                    break;
-                default:
-                    throw JVMCIError.shouldNotReachHere();
+                        break;
+                    case Double:
+                        if (currentFloating < fpuFloatJavaParameterRegisters.size()) {
+                            if (currentFloating % 2 != 0) {
+                                // Make register number even to be a double reg
+                                currentFloating++;
+                            }
+                            Register register = fpuDoubleJavaParameterRegisters.get(currentFloating);
+                            currentFloating += 2; // Only every second is a double register
+                            locations[i] = register.asValue(valueKindFactory.getValueKind(kind));
+                        }
+                        break;
+                    case Float:
+                        if (currentFloating < fpuFloatJavaParameterRegisters.size()) {
+                            Register register = fpuFloatJavaParameterRegisters.get(currentFloating++);
+                            locations[i] = register.asValue(valueKindFactory.getValueKind(kind));
+                        }
+                        break;
+                    default:
+                        throw JVMCIError.shouldNotReachHere();
+                }
             }
 
             if (locations[i] == null) {
                 ValueKind<?> valueKind = valueKindFactory.getValueKind(kind);
-                // Stack slot is always aligned to its size in bytes but minimum wordsize
                 int typeSize = valueKind.getPlatformKind().getSizeInBytes();
+                if (isNative) {
+                    currentStackOffset += target.arch.getWordSize() - typeSize;
+                }
                 currentStackOffset = roundUp(currentStackOffset, typeSize);
                 int slotOffset = currentStackOffset + REGISTER_SAFE_AREA_SIZE;
                 locations[i] = StackSlot.get(valueKind, slotOffset, !type.out);
@@ -284,15 +339,7 @@
 
         JavaKind returnKind = returnType == null ? Void : returnType.getJavaKind();
         AllocatableValue returnLocation = returnKind == Void ? ILLEGAL : getReturnRegister(returnKind, type).asValue(valueKindFactory.getValueKind(returnKind.getStackKind()));
-
-        int outArgSpillArea;
-        if (type == HotSpotCallingConventionType.NativeCall && addNativeRegisterArgumentSlots) {
-            // Space for native callee which may spill our outgoing arguments
-            outArgSpillArea = Math.min(locations.length, generalParameterRegisters.size()) * target.wordSize;
-        } else {
-            outArgSpillArea = 0;
-        }
-        return new CallingConvention(currentStackOffset + outArgSpillArea, returnLocation, locations);
+        return new CallingConvention(currentStackOffset, returnLocation, locations);
     }
 
     private static int roundUp(int number, int mod) {
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java
index 672cf0b..89e2ae2 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java
@@ -32,6 +32,11 @@
 
 final class HotSpotJVMCICompilerConfig {
 
+    /**
+     * This factory allows JVMCI initialization to succeed but raises an error if the VM asks JVMCI
+     * to perform a compilation. This allows the reflective parts of the JVMCI API to be used
+     * without requiring a compiler implementation to be available.
+     */
     private static class DummyCompilerFactory extends JVMCICompilerFactory implements JVMCICompiler {
 
         public HotSpotCompilationRequestResult compileMethod(CompilationRequest request) {
@@ -67,7 +72,6 @@
                 for (JVMCICompilerFactory f : Services.load(JVMCICompilerFactory.class)) {
                     if (f.getCompilerName().equals(compilerName)) {
                         Services.exportJVMCITo(f.getClass());
-                        f.onSelection();
                         factory = f;
                     }
                 }
@@ -75,8 +79,21 @@
                     throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
                 }
             } else {
-                factory = new DummyCompilerFactory();
+                // Auto select a single available compiler
+                for (JVMCICompilerFactory f : Services.load(JVMCICompilerFactory.class)) {
+                    if (factory == null) {
+                        factory = f;
+                    } else {
+                        // Multiple factories seen - cancel auto selection
+                        factory = null;
+                        break;
+                    }
+                }
+                if (factory == null) {
+                    factory = new DummyCompilerFactory();
+                }
             }
+            factory.onSelection();
             compilerFactory = factory;
         }
         return compilerFactory;
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java
index 6bdf2ee..be8e3a3 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java
@@ -109,13 +109,7 @@
         }
     }
 
-    private boolean verifyReadRawObject(Object expected, Constant base, long displacement, boolean compressed) {
-        if (compressed == runtime.getConfig().useCompressedOops) {
-            Object obj = asObject(base);
-            if (obj != null) {
-                assert expected == UNSAFE.getObject(obj, displacement) : "readUnsafeOop doesn't agree with unsafe.getObject";
-            }
-        }
+    private boolean verifyReadRawObject(Object expected, Constant base, long displacement) {
         if (base instanceof HotSpotMetaspaceConstant) {
             MetaspaceWrapperObject metaspaceObject = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base);
             if (metaspaceObject instanceof HotSpotResolvedObjectTypeImpl) {
@@ -136,11 +130,11 @@
             assert !compressed;
             displacement += asRawPointer(baseConstant);
             ret = UNSAFE.getUncompressedObject(displacement);
+            assert verifyReadRawObject(ret, baseConstant, initialDisplacement);
         } else {
             assert runtime.getConfig().useCompressedOops == compressed;
             ret = UNSAFE.getObject(base, displacement);
         }
-        assert verifyReadRawObject(ret, baseConstant, initialDisplacement, compressed);
         return ret;
     }
 
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java
index 821f3da..c4eab6c 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2014, 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
@@ -28,10 +28,12 @@
 import jdk.vm.ci.common.JVMCIError;
 import jdk.vm.ci.meta.ConstantReflectionProvider;
 import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.MethodHandleAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaField;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.ResolvedJavaType;
+import jdk.vm.ci.meta.Signature;
 
 public class HotSpotMethodHandleAccessProvider implements MethodHandleAccessProvider {
 
@@ -51,46 +53,80 @@
         static final ResolvedJavaMethod lambdaFormCompileToBytecodeMethod;
         static final HotSpotResolvedJavaField memberNameVmtargetField;
 
+        static final ResolvedJavaType CLASS = fromObjectClass(LazyInitialization.class);
+
         /**
          * Search for an instance field with the given name in a class.
          *
          * @param className name of the class to search in
          * @param fieldName name of the field to be searched
-         * @return resolved java field
+         * @param fieldType resolved Java type of the field
+         * @return resolved Java field
          * @throws ClassNotFoundException
+         * @throws NoSuchFieldError
          */
-        private static ResolvedJavaField findFieldInClass(String className, String fieldName) throws ClassNotFoundException {
+        private static ResolvedJavaField findFieldInClass(String className, String fieldName, ResolvedJavaType fieldType)
+                throws ClassNotFoundException {
             Class<?> clazz = Class.forName(className);
             ResolvedJavaType type = runtime().fromClass(clazz);
             ResolvedJavaField[] fields = type.getInstanceFields(false);
             for (ResolvedJavaField field : fields) {
-                if (field.getName().equals(fieldName)) {
+                if (field.getName().equals(fieldName) && field.getType().equals(fieldType)) {
                     return field;
                 }
             }
-            return null;
+            throw new NoSuchFieldError(fieldType.getName() + " " + className + "." + fieldName);
         }
 
-        private static ResolvedJavaMethod findMethodInClass(String className, String methodName) throws ClassNotFoundException {
+        private static ResolvedJavaMethod findMethodInClass(String className, String methodName,
+                ResolvedJavaType resultType, ResolvedJavaType[] parameterTypes) throws ClassNotFoundException {
             Class<?> clazz = Class.forName(className);
             HotSpotResolvedObjectTypeImpl type = fromObjectClass(clazz);
             ResolvedJavaMethod result = null;
             for (ResolvedJavaMethod method : type.getDeclaredMethods()) {
-                if (method.getName().equals(methodName)) {
-                    assert result == null : "more than one method found: " + className + "." + methodName;
+                if (method.getName().equals(methodName) && signatureMatches(method, resultType, parameterTypes)) {
                     result = method;
                 }
             }
-            assert result != null : "method not found: " + className + "." + methodName;
+            if (result == null) {
+                StringBuilder sig = new StringBuilder("(");
+                for (ResolvedJavaType t : parameterTypes) {
+                    sig.append(t.getName()).append(",");
+                }
+                if (sig.length() > 1) {
+                    sig.replace(sig.length() - 1, sig.length(), ")");
+                } else {
+                    sig.append(')');
+                }
+                throw new NoSuchMethodError(resultType.getName() + " " + className + "." + methodName + sig.toString());
+            }
             return result;
         }
 
+        private static boolean signatureMatches(ResolvedJavaMethod m, ResolvedJavaType resultType,
+                ResolvedJavaType[] parameterTypes) {
+            Signature s = m.getSignature();
+            if (!s.getReturnType(CLASS).equals(resultType)) {
+                return false;
+            }
+            for (int i = 0; i < s.getParameterCount(false); ++i) {
+                if (!s.getParameterType(i, CLASS).equals(parameterTypes[i])) {
+                    return false;
+                }
+            }
+            return true;
+        }
+
         static {
             try {
-                methodHandleFormField = findFieldInClass("java.lang.invoke.MethodHandle", "form");
-                lambdaFormVmentryField = findFieldInClass("java.lang.invoke.LambdaForm", "vmentry");
-                lambdaFormCompileToBytecodeMethod = findMethodInClass("java.lang.invoke.LambdaForm", "compileToBytecode");
-                memberNameVmtargetField = (HotSpotResolvedJavaField) findFieldInClass("java.lang.invoke.MemberName", "vmtarget");
+                methodHandleFormField = findFieldInClass("java.lang.invoke.MethodHandle", "form",
+                    fromObjectClass(Class.forName("java.lang.invoke.LambdaForm")));
+                lambdaFormVmentryField = findFieldInClass("java.lang.invoke.LambdaForm", "vmentry",
+                    fromObjectClass(Class.forName("java.lang.invoke.MemberName")));
+                lambdaFormCompileToBytecodeMethod = findMethodInClass("java.lang.invoke.LambdaForm", "compileToBytecode",
+                    new HotSpotResolvedPrimitiveType(JavaKind.Void), new ResolvedJavaType[]{});
+                memberNameVmtargetField = (HotSpotResolvedJavaField) findFieldInClass("java.lang.invoke.MemberName", "vmtarget",
+                    new HotSpotResolvedPrimitiveType(JavaKind.Long));
             } catch (Throwable ex) {
                 throw new JVMCIError(ex);
             }
@@ -134,14 +170,12 @@
             return null;
         }
 
-        JavaConstant memberName;
         if (forceBytecodeGeneration) {
             /* Invoke non-public method: MemberName LambdaForm.compileToBytecode() */
-            memberName = LazyInitialization.lambdaFormCompileToBytecodeMethod.invoke(lambdaForm, new JavaConstant[0]);
-        } else {
-            /* Load non-public field: MemberName LambdaForm.vmentry */
-            memberName = constantReflection.readFieldValue(LazyInitialization.lambdaFormVmentryField, lambdaForm);
+            LazyInitialization.lambdaFormCompileToBytecodeMethod.invoke(lambdaForm, new JavaConstant[0]);
         }
+        /* Load non-public field: MemberName LambdaForm.vmentry */
+        JavaConstant memberName = constantReflection.readFieldValue(LazyInitialization.lambdaFormVmentryField, lambdaForm);
         return getTargetMethod(memberName);
     }
 
@@ -163,3 +197,4 @@
         return compilerToVM().getResolvedJavaMethod(object, LazyInitialization.memberNameVmtargetField.offset());
     }
 }
+
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
index c446eda..46f5d71 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
@@ -252,7 +252,7 @@
     final int universeBaseVtableSize = getFieldValue("CompilerToVM::Data::Universe_base_vtable_size", Integer.class, "int");
 
     final int baseVtableLength() {
-        return universeBaseVtableSize / vtableEntrySize;
+        return universeBaseVtableSize / (vtableEntrySize / heapWordSize);
     }
 
     final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int");
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
index adba998..75c2e5f 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
@@ -97,15 +97,6 @@
     ResolvedJavaType asJavaType(Constant constant);
 
     /**
-     * Check if the constant is embeddable in the code.
-     *
-     * @param constant the constant to test
-     */
-    default boolean isEmbeddable(Constant constant) {
-        return true;
-    }
-
-    /**
      * Gets access to the internals of {@link MethodHandle}.
      */
     MethodHandleAccessProvider getMethodHandleAccess();
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
index 71109dc..c67cc6b 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
@@ -30,32 +30,46 @@
 public class LineNumberTable {
 
     private final int[] lineNumbers;
-    private final int[] bci;
+    private final int[] bcis;
 
     /**
      *
-     * @param lineNumbers an array or source line numbers. This array is now owned by this object
+     * @param lineNumbers an array of source line numbers. This array is now owned by this object
      *            and should not be mutated by the caller.
-     * @param bci an array of bytecode indexes the same length at {@code lineNumbers} whose entries
+     * @param bcis an array of bytecode indexes the same length at {@code lineNumbers} whose entries
      *            are sorted in ascending order. This array is now owned by this object and must not
      *            be mutated by the caller.
      */
     @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "caller transfers ownership of `lineNumbers` and `bcis`")
-    public LineNumberTable(int[] lineNumbers, int[] bci) {
-        assert bci.length == lineNumbers.length;
+    public LineNumberTable(int[] lineNumbers, int[] bcis) {
+        assert bcis.length == lineNumbers.length;
         this.lineNumbers = lineNumbers;
-        this.bci = bci;
+        this.bcis = bcis;
     }
 
     /**
-     * Gets a source line number for {@code atBci}.
+     * Gets a source line number for bytecode index {@code atBci}.
      */
     public int getLineNumber(int atBci) {
-        for (int i = 0; i < this.bci.length - 1; i++) {
-            if (this.bci[i] <= atBci && atBci < this.bci[i + 1]) {
+        for (int i = 0; i < this.bcis.length - 1; i++) {
+            if (this.bcis[i] <= atBci && atBci < this.bcis[i + 1]) {
                 return lineNumbers[i];
             }
         }
         return lineNumbers[lineNumbers.length - 1];
     }
+
+    /**
+     * Gets a copy of the array of line numbers that was passed to this object's constructor.
+     */
+    public int[] getLineNumbers() {
+        return lineNumbers.clone();
+    }
+
+    /**
+     * Gets a copy of the array of bytecode indexes that was passed to this object's constructor.
+     */
+    public int[] getBcis() {
+        return bcis.clone();
+    }
 }
diff --git a/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java b/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
index b81ec8d..63f135e 100644
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
@@ -26,6 +26,8 @@
 import java.util.List;
 
 /**
+ * Describes the {@link Local}s for a Java method.
+ *
  * @see "https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.13"
  */
 public class LocalVariableTable {
@@ -33,6 +35,7 @@
     private final Local[] locals;
 
     /**
+     * Creates an object describing the {@link Local}s for a Java method.
      *
      * @param locals array of objects describing local variables. This array is now owned by this
      *            object and must not be mutated by the caller.
@@ -42,6 +45,13 @@
         this.locals = locals;
     }
 
+    /**
+     * Gets a description of a local variable that occupies the bytecode frame slot indexed by
+     * {@code slot} and is live at the bytecode index {@code bci}
+     *
+     * @return a description of the requested local variable or null if no such variable matches
+     *         {@code slot} and {@code bci}
+     */
     public Local getLocal(int slot, int bci) {
         Local result = null;
         for (Local local : locals) {
@@ -56,6 +66,16 @@
         return result;
     }
 
+    /**
+     * Gets a copy of the array of {@link Local}s that was passed to this object's constructor.
+     */
+    public Local[] getLocals() {
+        return locals.clone();
+    }
+
+    /**
+     * Gets a description of all the local variables live at the bytecode index {@code bci}
+     */
     public Local[] getLocalsAt(int bci) {
         List<Local> result = new ArrayList<>();
         for (Local l : locals) {
diff --git a/src/os/aix/vm/attachListener_aix.cpp b/src/os/aix/vm/attachListener_aix.cpp
index 4e69822..0622561 100644
--- a/src/os/aix/vm/attachListener_aix.cpp
+++ b/src/os/aix/vm/attachListener_aix.cpp
@@ -383,23 +383,20 @@
     struct peercred_struct cred_info;
     socklen_t optlen = sizeof(cred_info);
     if (::getsockopt(s, SOL_SOCKET, SO_PEERID, (void*)&cred_info, &optlen) == -1) {
-      int res;
-      RESTARTABLE(::close(s), res);
+      ::close(s);
       continue;
     }
     uid_t euid = geteuid();
     gid_t egid = getegid();
 
     if (cred_info.euid != euid || cred_info.egid != egid) {
-      int res;
-      RESTARTABLE(::close(s), res);
+      ::close(s);
       continue;
     }
 
     // peer credential look okay so we read the request
     AixAttachOperation* op = read_request(s);
     if (op == NULL) {
-      int res;
       ::close(s);
       continue;
     } else {
diff --git a/src/os/aix/vm/mutex_aix.inline.hpp b/src/os/aix/vm/mutex_aix.inline.hpp
deleted file mode 100644
index ee59295..0000000
--- a/src/os/aix/vm/mutex_aix.inline.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 SAP SE. 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.
- *
- */
-
-#ifndef OS_AIX_VM_MUTEX_AIX_INLINE_HPP
-#define OS_AIX_VM_MUTEX_AIX_INLINE_HPP
-
-#include "os_aix.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-#endif // OS_AIX_VM_MUTEX_AIX_INLINE_HPP
diff --git a/src/os/aix/vm/os_aix.cpp b/src/os/aix/vm/os_aix.cpp
index 6b676df..42aa1a6 100644
--- a/src/os/aix/vm/os_aix.cpp
+++ b/src/os/aix/vm/os_aix.cpp
@@ -44,7 +44,6 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
 #include "misc_aix.hpp"
-#include "mutex_aix.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_aix.inline.hpp"
 #include "os_share_aix.hpp"
diff --git a/src/os/aix/vm/perfMemory_aix.cpp b/src/os/aix/vm/perfMemory_aix.cpp
index 62212be..71bf015 100644
--- a/src/os/aix/vm/perfMemory_aix.cpp
+++ b/src/os/aix/vm/perfMemory_aix.cpp
@@ -951,25 +951,24 @@
 
   // open the file
   int result;
-  // No O_NOFOLLOW defined at buildtime, and it is not documented for open;
-  // so provide a workaround in this case
+  // provide a workaround in case no O_NOFOLLOW is defined at buildtime
 #ifdef O_NOFOLLOW
   RESTARTABLE(::open(filename, oflags), result);
 #else
   result = open_o_nofollow(filename, oflags);
 #endif
-
   if (result == OS_ERR) {
     if (errno == ENOENT) {
-      THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
-                  "Process not found");
+      THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
+                 "Process not found", OS_ERR);
     }
     else if (errno == EACCES) {
-      THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
-                  "Permission denied");
+      THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
+                 "Permission denied", OS_ERR);
     }
     else {
-      THROW_MSG_0(vmSymbols::java_io_IOException(), os::strerror(errno));
+      THROW_MSG_(vmSymbols::java_io_IOException(),
+                 os::strerror(errno), OS_ERR);
     }
   }
   int fd = result;
@@ -987,7 +986,7 @@
 // memory region on success or NULL on failure. A return value of
 // NULL will ultimately disable the shared memory feature.
 //
-// On AIX, Solaris and Linux, the name space for shared memory objects
+// On AIX, the name space for shared memory objects
 // is the file system name space.
 //
 // A monitoring application attaching to a JVM does not need to know
@@ -1011,6 +1010,7 @@
 
   char* dirname = get_user_tmp_dir(user_name);
   char* filename = get_sharedmem_filename(dirname, vmid);
+
   // get the short filename.
   char* short_filename = strrchr(filename, '/');
   if (short_filename == NULL) {
diff --git a/src/os/bsd/vm/mutex_bsd.cpp b/src/os/bsd/vm/mutex_bsd.cpp
deleted file mode 100644
index 3a1b5eb..0000000
--- a/src/os/bsd/vm/mutex_bsd.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2007, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "mutex_bsd.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/mutex.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/events.hpp"
-
-// put OS-includes here
-# include <signal.h>
diff --git a/src/os/bsd/vm/mutex_bsd.inline.hpp b/src/os/bsd/vm/mutex_bsd.inline.hpp
deleted file mode 100644
index 63c63f0..0000000
--- a/src/os/bsd/vm/mutex_bsd.inline.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 1999, 2010, 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.
- *
- */
-
-#ifndef OS_BSD_VM_MUTEX_BSD_INLINE_HPP
-#define OS_BSD_VM_MUTEX_BSD_INLINE_HPP
-
-#include "os_bsd.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-
-// Reconciliation History
-// mutex_solaris.inline.hpp     1.5 99/06/22 16:38:49
-// End
-
-#endif // OS_BSD_VM_MUTEX_BSD_INLINE_HPP
diff --git a/src/os/bsd/vm/os_bsd.cpp b/src/os/bsd/vm/os_bsd.cpp
index b8c40f6..738144b 100644
--- a/src/os/bsd/vm/os_bsd.cpp
+++ b/src/os/bsd/vm/os_bsd.cpp
@@ -35,7 +35,6 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
-#include "mutex_bsd.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_bsd.inline.hpp"
 #include "os_share_bsd.hpp"
diff --git a/src/os/bsd/vm/perfMemory_bsd.cpp b/src/os/bsd/vm/perfMemory_bsd.cpp
index f87f81d..2cb2d59 100644
--- a/src/os/bsd/vm/perfMemory_bsd.cpp
+++ b/src/os/bsd/vm/perfMemory_bsd.cpp
@@ -881,14 +881,15 @@
   if (result == OS_ERR) {
     if (errno == ENOENT) {
       THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
-                  "Process not found", OS_ERR);
+                 "Process not found", OS_ERR);
     }
     else if (errno == EACCES) {
       THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
-                  "Permission denied", OS_ERR);
+                 "Permission denied", OS_ERR);
     }
     else {
-      THROW_MSG_(vmSymbols::java_io_IOException(), os::strerror(errno), OS_ERR);
+      THROW_MSG_(vmSymbols::java_io_IOException(),
+                 os::strerror(errno), OS_ERR);
     }
   }
   int fd = result;
@@ -906,7 +907,7 @@
 // memory region on success or NULL on failure. A return value of
 // NULL will ultimately disable the shared memory feature.
 //
-// On Solaris and Bsd, the name space for shared memory objects
+// On BSD, the name space for shared memory objects
 // is the file system name space.
 //
 // A monitoring application attaching to a JVM does not need to know
diff --git a/src/os/linux/vm/mutex_linux.cpp b/src/os/linux/vm/mutex_linux.cpp
deleted file mode 100644
index a54ec99..0000000
--- a/src/os/linux/vm/mutex_linux.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2007, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "mutex_linux.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/mutex.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/events.hpp"
-
-// put OS-includes here
-# include <signal.h>
diff --git a/src/os/linux/vm/mutex_linux.inline.hpp b/src/os/linux/vm/mutex_linux.inline.hpp
deleted file mode 100644
index ff3ac28..0000000
--- a/src/os/linux/vm/mutex_linux.inline.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 1999, 2010, 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.
- *
- */
-
-#ifndef OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
-#define OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
-
-#include "os_linux.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-
-// Reconciliation History
-// mutex_solaris.inline.hpp     1.5 99/06/22 16:38:49
-// End
-
-#endif // OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
index 2407381..b8c1a72 100644
--- a/src/os/linux/vm/os_linux.cpp
+++ b/src/os/linux/vm/os_linux.cpp
@@ -35,7 +35,6 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
-#include "mutex_linux.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_linux.inline.hpp"
 #include "os_share_linux.hpp"
diff --git a/src/os/linux/vm/perfMemory_linux.cpp b/src/os/linux/vm/perfMemory_linux.cpp
index 610a1a0..da8c572 100644
--- a/src/os/linux/vm/perfMemory_linux.cpp
+++ b/src/os/linux/vm/perfMemory_linux.cpp
@@ -891,14 +891,15 @@
   if (result == OS_ERR) {
     if (errno == ENOENT) {
       THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
-                  "Process not found", OS_ERR);
+                 "Process not found", OS_ERR);
     }
     else if (errno == EACCES) {
       THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
-                  "Permission denied", OS_ERR);
+                 "Permission denied", OS_ERR);
     }
     else {
-      THROW_MSG_(vmSymbols::java_io_IOException(), os::strerror(errno), OS_ERR);
+      THROW_MSG_(vmSymbols::java_io_IOException(),
+                 os::strerror(errno), OS_ERR);
     }
   }
   int fd = result;
@@ -916,7 +917,7 @@
 // memory region on success or NULL on failure. A return value of
 // NULL will ultimately disable the shared memory feature.
 //
-// On Solaris and Linux, the name space for shared memory objects
+// On Linux, the name space for shared memory objects
 // is the file system name space.
 //
 // A monitoring application attaching to a JVM does not need to know
@@ -940,6 +941,7 @@
 
   char* dirname = get_user_tmp_dir(user_name);
   char* filename = get_sharedmem_filename(dirname, vmid);
+
   // get the short filename
   char* short_filename = strrchr(filename, '/');
   if (short_filename == NULL) {
diff --git a/src/os/posix/vm/os_posix.cpp b/src/os/posix/vm/os_posix.cpp
index ad10c82..6ed034c 100644
--- a/src/os/posix/vm/os_posix.cpp
+++ b/src/os/posix/vm/os_posix.cpp
@@ -28,6 +28,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/os.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/vmError.hpp"
 
 #include <signal.h>
@@ -214,7 +215,7 @@
   else st->print("%luk", rlim.rlim_cur >> 10);
 
   // Isn't there on solaris
-#if !defined(TARGET_OS_FAMILY_solaris) && !defined(TARGET_OS_FAMILY_aix)
+#if !defined(SOLARIS) && !defined(AIX)
   st->print(", NPROC ");
   getrlimit(RLIMIT_NPROC, &rlim);
   if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
@@ -1062,28 +1063,28 @@
 }
 
 address os::Posix::ucontext_get_pc(const ucontext_t* ctx) {
-#ifdef TARGET_OS_FAMILY_linux
-   return Linux::ucontext_get_pc(ctx);
-#elif defined(TARGET_OS_FAMILY_solaris)
-   return Solaris::ucontext_get_pc(ctx);
-#elif defined(TARGET_OS_FAMILY_aix)
+#if defined(AIX)
    return Aix::ucontext_get_pc(ctx);
-#elif defined(TARGET_OS_FAMILY_bsd)
+#elif defined(BSD)
    return Bsd::ucontext_get_pc(ctx);
+#elif defined(LINUX)
+   return Linux::ucontext_get_pc(ctx);
+#elif defined(SOLARIS)
+   return Solaris::ucontext_get_pc(ctx);
 #else
    VMError::report_and_die("unimplemented ucontext_get_pc");
 #endif
 }
 
 void os::Posix::ucontext_set_pc(ucontext_t* ctx, address pc) {
-#ifdef TARGET_OS_FAMILY_linux
-   Linux::ucontext_set_pc(ctx, pc);
-#elif defined(TARGET_OS_FAMILY_solaris)
-   Solaris::ucontext_set_pc(ctx, pc);
-#elif defined(TARGET_OS_FAMILY_aix)
+#if defined(AIX)
    Aix::ucontext_set_pc(ctx, pc);
-#elif defined(TARGET_OS_FAMILY_bsd)
+#elif defined(BSD)
    Bsd::ucontext_set_pc(ctx, pc);
+#elif defined(LINUX)
+   Linux::ucontext_set_pc(ctx, pc);
+#elif defined(SOLARIS)
+   Solaris::ucontext_set_pc(ctx, pc);
 #else
    VMError::report_and_die("unimplemented ucontext_get_pc");
 #endif
diff --git a/src/os/posix/vm/vmError_posix.cpp b/src/os/posix/vm/vmError_posix.cpp
index 23cafc4..3c61a8b 100644
--- a/src/os/posix/vm/vmError_posix.cpp
+++ b/src/os/posix/vm/vmError_posix.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -33,17 +33,17 @@
 #include <sys/wait.h>
 #include <signal.h>
 
-#ifdef TARGET_OS_FAMILY_linux
+#ifdef LINUX
 #include <sys/syscall.h>
 #include <unistd.h>
 #endif
-#ifdef TARGET_OS_FAMILY_solaris
+#ifdef SOLARIS
 #include <thread.h>
 #endif
-#ifdef TARGET_OS_FAMILY_aix
+#ifdef AIX
 #include <unistd.h>
 #endif
-#ifdef TARGET_OS_FAMILY_bsd
+#ifdef BSD
 #include <sys/syscall.h>
 #include <unistd.h>
 #endif
diff --git a/src/os/solaris/vm/jvm_solaris.h b/src/os/solaris/vm/jvm_solaris.h
index e961d36..7398e0b 100644
--- a/src/os/solaris/vm/jvm_solaris.h
+++ b/src/os/solaris/vm/jvm_solaris.h
@@ -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
@@ -41,9 +41,7 @@
  * JNI conversion, which should be sorted out later.
  */
 
-#define __USE_LEGACY_PROTOTYPES__
 #include <dirent.h>             /* For DIR */
-#undef __USE_LEGACY_PROTOTYPES__
 #include <sys/param.h>          /* For MAXPATHLEN */
 #include <sys/socket.h>         /* For socklen_t */
 #include <unistd.h>             /* For F_OK, R_OK, W_OK */
diff --git a/src/os/solaris/vm/mutex_solaris.cpp b/src/os/solaris/vm/mutex_solaris.cpp
deleted file mode 100644
index 4d8166f..0000000
--- a/src/os/solaris/vm/mutex_solaris.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2007, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "mutex_solaris.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/mutex.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/events.hpp"
-
-// Solaris-specific include, therefore not in includeDB_*
-# include "os_share_solaris.hpp"
-
-// put OS-includes here
-# include <signal.h>
diff --git a/src/os/solaris/vm/mutex_solaris.inline.hpp b/src/os/solaris/vm/mutex_solaris.inline.hpp
deleted file mode 100644
index b683a3b..0000000
--- a/src/os/solaris/vm/mutex_solaris.inline.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 1998, 2010, 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.
- *
- */
-
-#ifndef OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
-#define OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
-
-#include "os_solaris.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-#endif // OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
diff --git a/src/os/solaris/vm/os_solaris.cpp b/src/os/solaris/vm/os_solaris.cpp
index 67ca5ee..3b9a379 100644
--- a/src/os/solaris/vm/os_solaris.cpp
+++ b/src/os/solaris/vm/os_solaris.cpp
@@ -35,7 +35,6 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
-#include "mutex_solaris.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_share_solaris.hpp"
 #include "os_solaris.inline.hpp"
@@ -79,7 +78,6 @@
 # include <link.h>
 # include <poll.h>
 # include <pthread.h>
-# include <pwd.h>
 # include <schedctl.h>
 # include <setjmp.h>
 # include <signal.h>
diff --git a/src/os/solaris/vm/perfMemory_solaris.cpp b/src/os/solaris/vm/perfMemory_solaris.cpp
index a5bfbb7..2b80a4f 100644
--- a/src/os/solaris/vm/perfMemory_solaris.cpp
+++ b/src/os/solaris/vm/perfMemory_solaris.cpp
@@ -34,16 +34,18 @@
 #include "utilities/exceptions.hpp"
 
 // put OS-includes here
-# include <sys/types.h>
-# include <sys/mman.h>
-# include <errno.h>
-# include <stdio.h>
-# include <unistd.h>
-# include <sys/stat.h>
-# include <signal.h>
-# include <pwd.h>
-# include <procfs.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <signal.h>
+#include <procfs.h>
 
+/* For POSIX-compliant getpwuid_r on Solaris */
+#define _POSIX_PTHREAD_SEMANTICS
+#include <pwd.h>
 
 static char* backing_store_file_name = NULL;  // name of the backing store
                                               // file, if successfully created.
@@ -334,7 +336,7 @@
   }
 
   // Check to make sure fd and dirp are referencing the same file system object.
-  if (!is_same_fsobject(fd, dirp->dd_fd)) {
+  if (!is_same_fsobject(fd, dirp->d_fd)) {
     // The directory is not secure.
     os::close(fd);
     os::closedir(dirp);
@@ -366,7 +368,7 @@
     // Directory doesn't exist or is insecure, so there is nothing to cleanup.
     return dirp;
   }
-  int fd = dirp->dd_fd;
+  int fd = dirp->d_fd;
 
   // Open a fd to the cwd and save it off.
   int result;
@@ -453,12 +455,8 @@
 
   char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 
-#ifdef _GNU_SOURCE
   struct passwd* p = NULL;
   int result = getpwuid_r(uid, &pwent, pwbuf, (size_t)bufsize, &p);
-#else  // _GNU_SOURCE
-  struct passwd* p = getpwuid_r(uid, &pwent, pwbuf, (int)bufsize);
-#endif // _GNU_SOURCE
 
   if (p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') {
     if (PrintMiscellaneous && Verbose) {
@@ -909,14 +907,15 @@
   if (result == OS_ERR) {
     if (errno == ENOENT) {
       THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
-                  "Process not found", OS_ERR);
+                 "Process not found", OS_ERR);
     }
     else if (errno == EACCES) {
       THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
-                  "Permission denied", OS_ERR);
+                 "Permission denied", OS_ERR);
     }
     else {
-      THROW_MSG_(vmSymbols::java_io_IOException(), os::strerror(errno), OS_ERR);
+      THROW_MSG_(vmSymbols::java_io_IOException(),
+                 os::strerror(errno), OS_ERR);
     }
   }
   int fd = result;
@@ -934,7 +933,7 @@
 // memory region on success or NULL on failure. A return value of
 // NULL will ultimately disable the shared memory feature.
 //
-// On Solaris and Linux, the name space for shared memory objects
+// On Solaris, the name space for shared memory objects
 // is the file system name space.
 //
 // A monitoring application attaching to a JVM does not need to know
diff --git a/src/os/windows/vm/mutex_windows.cpp b/src/os/windows/vm/mutex_windows.cpp
deleted file mode 100644
index f8e0633..0000000
--- a/src/os/windows/vm/mutex_windows.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 1998, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "mutex_windows.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/mutex.hpp"
-#include "runtime/thread.inline.hpp"
-#include "utilities/events.hpp"
-
-// put OS-includes here
-# include <windows.h>
diff --git a/src/os/windows/vm/mutex_windows.inline.hpp b/src/os/windows/vm/mutex_windows.inline.hpp
deleted file mode 100644
index fbfe7ac..0000000
--- a/src/os/windows/vm/mutex_windows.inline.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 1998, 2010, 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.
- *
- */
-
-#ifndef OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
-#define OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
-
-#include "os_windows.inline.hpp"
-#include "runtime/interfaceSupport.hpp"
-#include "runtime/thread.inline.hpp"
-
-#endif // OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
diff --git a/src/os/windows/vm/os_windows.cpp b/src/os/windows/vm/os_windows.cpp
index 23a06c9..bd85cf0 100644
--- a/src/os/windows/vm/os_windows.cpp
+++ b/src/os/windows/vm/os_windows.cpp
@@ -38,7 +38,6 @@
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
-#include "mutex_windows.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_share_windows.hpp"
 #include "os_windows.inline.hpp"
@@ -3898,6 +3897,13 @@
     DWORD res;
     HANDLE hproc, hthr;
 
+    // We only attempt to register threads until a process exiting
+    // thread manages to set the process_exiting flag. Any threads
+    // that come through here after the process_exiting flag is set
+    // are unregistered and will be caught in the SuspendThread()
+    // infinite loop below.
+    bool registered = false;
+
     // The first thread that reached this point, initializes the critical section.
     if (!InitOnceExecuteOnce(&init_once_crit_sect, init_crit_sect_call, &crit_sect, NULL)) {
       warning("crit_sect initialization failed in %s: %d\n", __FILE__, __LINE__);
@@ -3957,12 +3963,21 @@
                              0, FALSE, DUPLICATE_SAME_ACCESS)) {
           warning("DuplicateHandle failed (%u) in %s: %d\n",
                   GetLastError(), __FILE__, __LINE__);
+
+          // We can't register this thread (no more handles) so this thread
+          // may be racing with a thread that is calling exit(). If the thread
+          // that is calling exit() has managed to set the process_exiting
+          // flag, then this thread will be caught in the SuspendThread()
+          // infinite loop below which closes that race. A small timing
+          // window remains before the process_exiting flag is set, but it
+          // is only exposed when we are out of handles.
         } else {
           ++handle_count;
-        }
+          registered = true;
 
-        // The current exiting thread has stored its handle in the array, and now
-        // should leave the critical section before calling _endthreadex().
+          // The current exiting thread has stored its handle in the array, and now
+          // should leave the critical section before calling _endthreadex().
+        }
 
       } else if (what != EPT_THREAD && handle_count > 0) {
         jlong start_time, finish_time, timeout_left;
@@ -4012,10 +4027,11 @@
       LeaveCriticalSection(&crit_sect);
     }
 
-    if (OrderAccess::load_acquire(&process_exiting) != 0 &&
+    if (!registered &&
+        OrderAccess::load_acquire(&process_exiting) != 0 &&
         process_exiting != (jint)GetCurrentThreadId()) {
-      // Some other thread is about to call exit(), so we
-      // don't let the current thread proceed to exit() or _endthreadex()
+      // Some other thread is about to call exit(), so we don't let
+      // the current unregistered thread proceed to exit() or _endthreadex()
       while (true) {
         SuspendThread(GetCurrentThread());
         // Avoid busy-wait loop, if SuspendThread() failed.
@@ -4027,7 +4043,7 @@
   // We are here if either
   // - there's no 'race at exit' bug on this OS release;
   // - initialization of the critical section failed (unlikely);
-  // - the current thread has stored its handle and left the critical section;
+  // - the current thread has registered itself and left the critical section;
   // - the process-exiting thread has raised the flag and left the critical section.
   if (what == EPT_THREAD) {
     _endthreadex((unsigned)exit_code);
diff --git a/test/compiler/native/libTestDirtyInt.c b/src/os_cpu/aix_ppc/vm/bytes_aix_ppc.inline.hpp
similarity index 80%
copy from test/compiler/native/libTestDirtyInt.c
copy to src/os_cpu/aix_ppc/vm/bytes_aix_ppc.inline.hpp
index b688a36..2e6ec99 100644
--- a/test/compiler/native/libTestDirtyInt.c
+++ b/src/os_cpu/aix_ppc/vm/bytes_aix_ppc.inline.hpp
@@ -19,15 +19,14 @@
  * 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.
+ *
  */
 
-#include "jni.h"
-#include <stdio.h>
+#ifndef OS_CPU_AIX_PPC_VM_BYTES_AIX_PPC_INLINE_HPP
+#define OS_CPU_AIX_PPC_VM_BYTES_AIX_PPC_INLINE_HPP
 
-static int array = 0x42;
+#if defined(VM_LITTLE_ENDIAN)
+// Aix is not little endian.
+#endif // VM_LITTLE_ENDIAN
 
-JNIEXPORT jint JNICALL Java_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v)
-{
-  int* ptr = &array + v + 4;
-  return *ptr;
-}
+#endif // OS_CPU_AIX_PPC_VM_BYTES_AIX_PPC_INLINE_HPP
diff --git a/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp b/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
index 84ae1ab..e5c9867 100644
--- a/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
+++ b/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
@@ -34,7 +34,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_aix.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_aix.inline.hpp"
 #include "nativeInst_ppc.hpp"
 #include "os_share_aix.hpp"
 #include "prims/jniFastGetField.hpp"
diff --git a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
index 9fe34fc..5f7d479 100644
--- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
+++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_bsd.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_bsd.inline.hpp"
 #include "os_share_bsd.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
diff --git a/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp b/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
index 72d5785..f7ff3e5 100644
--- a/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
+++ b/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
@@ -38,7 +38,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_bsd.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_bsd.inline.hpp"
 #include "nativeInst_zero.hpp"
 #include "os_share_bsd.hpp"
 #include "prims/jniFastGetField.hpp"
diff --git a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
index 0417992..b4bc43a 100644
--- a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
+++ b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
@@ -35,7 +35,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
diff --git a/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp b/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
index 18cd557..0003988 100644
--- a/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
+++ b/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
@@ -34,7 +34,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "nativeInst_ppc.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
diff --git a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
index 4a0da12..7cf5edb 100644
--- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
+++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "nativeInst_sparc.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
diff --git a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
index 8bc9e6a..06a8a6e 100644
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
diff --git a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
index abd5296..b43499e 100644
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_linux.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_linux.inline.hpp"
 #include "nativeInst_zero.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
diff --git a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
index 39663ed..be5134d 100644
--- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
+++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
@@ -34,7 +34,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_solaris.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_solaris.inline.hpp"
 #include "nativeInst_sparc.hpp"
 #include "os_share_solaris.hpp"
 #include "prims/jniFastGetField.hpp"
@@ -74,7 +73,6 @@
 # include <sys/systeminfo.h>
 # include <sys/socket.h>
 # include <sys/lwp.h>
-# include <pwd.h>
 # include <poll.h>
 # include <sys/lwp.h>
 
@@ -545,10 +543,6 @@
     // factor me: setPC
     os::Solaris::ucontext_set_pc(uc, stub);
 
-#ifndef PRODUCT
-    if (TraceJumps) thread->record_jump(stub, NULL, __FILE__, __LINE__);
-#endif /* PRODUCT */
-
     return true;
   }
 
diff --git a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
index 695fc12..328ac2e 100644
--- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
+++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
@@ -33,7 +33,6 @@
 #include "interpreter/interpreter.hpp"
 #include "jvm_solaris.h"
 #include "memory/allocation.inline.hpp"
-#include "mutex_solaris.inline.hpp"
 #include "os_share_solaris.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
@@ -74,7 +73,6 @@
 # include <sys/socket.h>
 # include <sys/trap.h>
 # include <sys/lwp.h>
-# include <pwd.h>
 # include <poll.h>
 # include <sys/lwp.h>
 # include <procfs.h>     //  see comment in <sys/procfs.h>
diff --git a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
index d71b9a7..efb1b3b 100644
--- a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
+++ b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
@@ -34,7 +34,6 @@
 #include "jvm_windows.h"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
-#include "mutex_windows.inline.hpp"
 #include "nativeInst_x86.hpp"
 #include "os_share_windows.hpp"
 #include "prims/jniFastGetField.hpp"
diff --git a/src/share/vm/adlc/formssel.cpp b/src/share/vm/adlc/formssel.cpp
index 42aefeb..7f720b1 100644
--- a/src/share/vm/adlc/formssel.cpp
+++ b/src/share/vm/adlc/formssel.cpp
@@ -3647,14 +3647,14 @@
     // Check left operands
     if( (_lChild == NULL) && (mRule2->_lChild == NULL) ) {
       left_spillable = Maybe_cisc_spillable;
-    } else {
+    } else  if (_lChild != NULL) {
       left_spillable = _lChild->cisc_spill_match(globals, registers, mRule2->_lChild, operand, reg_type);
     }
 
     // Check right operands
     if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) {
       right_spillable =  Maybe_cisc_spillable;
-    } else {
+    } else if (_rChild != NULL) {
       right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type);
     }
 
diff --git a/src/share/vm/asm/assembler.hpp b/src/share/vm/asm/assembler.hpp
index 2ef9d99..a7b523d 100644
--- a/src/share/vm/asm/assembler.hpp
+++ b/src/share/vm/asm/assembler.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -33,6 +33,7 @@
 #include "runtime/vm_version.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/growableArray.hpp"
+#include "utilities/macros.hpp"
 
 // This file contains platform-independent assembler declarations.
 
@@ -337,6 +338,15 @@
   //
   // We must remember the code section (insts or stubs) in c1
   // so we can reset to the proper section in end_a_const().
+  address int_constant(jint c) {
+    CodeSection* c1 = _code_section;
+    address ptr = start_a_const(sizeof(c), sizeof(c));
+    if (ptr != NULL) {
+      emit_int32(c);
+      end_a_const(c1);
+    }
+    return ptr;
+  }
   address long_constant(jlong c) {
     CodeSection* c1 = _code_section;
     address ptr = start_a_const(sizeof(c), sizeof(c));
@@ -417,24 +427,6 @@
 
 };
 
-#ifdef TARGET_ARCH_x86
-# include "assembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "assembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "assembler_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "assembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "assembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "assembler_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(assembler)
 
 #endif // SHARE_VM_ASM_ASSEMBLER_HPP
diff --git a/src/share/vm/asm/assembler.inline.hpp b/src/share/vm/asm/assembler.inline.hpp
index 1a48cb3..8b35e12 100644
--- a/src/share/vm/asm/assembler.inline.hpp
+++ b/src/share/vm/asm/assembler.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -27,23 +27,6 @@
 
 #include "asm/assembler.hpp"
 
-#ifdef TARGET_ARCH_x86
-# include "assembler_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "assembler_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "assembler_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "assembler_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "assembler_ppc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "assembler_aarch64.inline.hpp"
-#endif
+#include CPU_HEADER_INLINE(assembler)
 
 #endif // SHARE_VM_ASM_ASSEMBLER_INLINE_HPP
diff --git a/src/share/vm/asm/codeBuffer.hpp b/src/share/vm/asm/codeBuffer.hpp
index aefcbab..a6c0e84 100644
--- a/src/share/vm/asm/codeBuffer.hpp
+++ b/src/share/vm/asm/codeBuffer.hpp
@@ -28,6 +28,7 @@
 #include "code/oopRecorder.hpp"
 #include "code/relocInfo.hpp"
 #include "utilities/debug.hpp"
+#include "utilities/macros.hpp"
 
 class CodeStrings;
 class PhaseCFG;
@@ -633,24 +634,7 @@
 
 
   // The following header contains architecture-specific implementations
-#ifdef TARGET_ARCH_x86
-# include "codeBuffer_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "codeBuffer_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "codeBuffer_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "codeBuffer_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "codeBuffer_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "codeBuffer_aarch64.hpp"
-#endif
+#include CPU_HEADER(codeBuffer)
 
 };
 
diff --git a/src/share/vm/asm/macroAssembler.hpp b/src/share/vm/asm/macroAssembler.hpp
index 1482eb6..84289ff 100644
--- a/src/share/vm/asm/macroAssembler.hpp
+++ b/src/share/vm/asm/macroAssembler.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,24 +26,8 @@
 #define SHARE_VM_ASM_MACROASSEMBLER_HPP
 
 #include "asm/assembler.hpp"
+#include "utilities/macros.hpp"
 
-#ifdef TARGET_ARCH_x86
-# include "macroAssembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "macroAssembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "assembler_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "macroAssembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "macroAssembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "macroAssembler_aarch64.hpp"
-#endif
+#include CPU_HEADER(macroAssembler)
 
 #endif // SHARE_VM_ASM_MACROASSEMBLER_HPP
diff --git a/src/share/vm/asm/macroAssembler.inline.hpp b/src/share/vm/asm/macroAssembler.inline.hpp
index db3daa5..51a1f72 100644
--- a/src/share/vm/asm/macroAssembler.inline.hpp
+++ b/src/share/vm/asm/macroAssembler.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,24 +26,6 @@
 #define SHARE_VM_ASM_MACROASSEMBLER_INLINE_HPP
 
 #include "asm/macroAssembler.hpp"
-
-#ifdef TARGET_ARCH_x86
-// no macroAssembler_x86.inline.hpp
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "macroAssembler_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "assembler_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "macroAssembler_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "macroAssembler_ppc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "macroAssembler_aarch64.inline.hpp"
-#endif
+#include CPU_HEADER_INLINE(macroAssembler)
 
 #endif // SHARE_VM_ASM_MACROASSEMBLER_INLINE_HPP
diff --git a/src/share/vm/asm/register.hpp b/src/share/vm/asm/register.hpp
index e258e86..3c71d94 100644
--- a/src/share/vm/asm/register.hpp
+++ b/src/share/vm/asm/register.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -27,6 +27,7 @@
 
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 // Use AbstractRegister as shortcut
 class AbstractRegisterImpl;
@@ -94,25 +95,7 @@
 #define REGISTER_DEFINITION(type, name) \
 const type name = ((type)name##_##type##EnumValue)
 
-#ifdef TARGET_ARCH_x86
-# include "register_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "register_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "register_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "register_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "register_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "register_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(register)
 
 // Debugging support
 
diff --git a/src/share/vm/c1/c1_Compilation.hpp b/src/share/vm/c1/c1_Compilation.hpp
index a60d1fd..bca812f 100644
--- a/src/share/vm/c1/c1_Compilation.hpp
+++ b/src/share/vm/c1/c1_Compilation.hpp
@@ -194,12 +194,7 @@
   const char* bailout_msg() const                { return _bailout_msg; }
 
   static int desired_max_code_buffer_size() {
-#ifndef PPC32
-    return (int) NMethodSizeLimit;  // default 256K or 512K
-#else
-    // conditional branches on PPC are restricted to 16 bit signed
-    return MIN2((unsigned int)NMethodSizeLimit,32*K);
-#endif
+    return (int)NMethodSizeLimit;  // default 64K
   }
   static int desired_max_constant_size() {
     return desired_max_code_buffer_size() / 10;
diff --git a/src/share/vm/c1/c1_Defs.hpp b/src/share/vm/c1/c1_Defs.hpp
index 79320b8..9cd61c4 100644
--- a/src/share/vm/c1/c1_Defs.hpp
+++ b/src/share/vm/c1/c1_Defs.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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,8 +25,9 @@
 #ifndef SHARE_VM_C1_C1_DEFS_HPP
 #define SHARE_VM_C1_C1_DEFS_HPP
 
-#include "utilities/globalDefinitions.hpp"
 #include "asm/register.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 // set frame size and return address offset to these values in blobs
 // (if the compiled frame uses ebp as link pointer on IA; otherwise,
@@ -35,23 +36,7 @@
   no_frame_size            = -1
 };
 
-
-#ifdef TARGET_ARCH_x86
-# include "c1_Defs_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_Defs_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_Defs_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_Defs_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_Defs_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(c1_Defs)
 
 // native word offsets from memory address
 enum {
diff --git a/src/share/vm/c1/c1_FpuStackSim.hpp b/src/share/vm/c1/c1_FpuStackSim.hpp
index 491b064..3094bbe 100644
--- a/src/share/vm/c1/c1_FpuStackSim.hpp
+++ b/src/share/vm/c1/c1_FpuStackSim.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -27,26 +27,12 @@
 
 #include "c1/c1_FrameMap.hpp"
 #include "memory/allocation.hpp"
+#include "utilities/macros.hpp"
 
 // Provides location for forward declaration of this class, which is
 // only implemented on Intel
 class FpuStackSim;
 
-#ifdef TARGET_ARCH_x86
-# include "c1_FpuStackSim_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_FpuStackSim_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_FpuStackSim_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_FpuStackSim_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_FpuStackSim_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(c1_FpuStackSim)
 
 #endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP
diff --git a/src/share/vm/c1/c1_FrameMap.hpp b/src/share/vm/c1/c1_FrameMap.hpp
index 5e29ca3..33aa9a3 100644
--- a/src/share/vm/c1/c1_FrameMap.hpp
+++ b/src/share/vm/c1/c1_FrameMap.hpp
@@ -33,6 +33,7 @@
 #include "runtime/frame.hpp"
 #include "runtime/synchronizer.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 class ciMethod;
 class CallingConvention;
@@ -80,22 +81,7 @@
     spill_slot_size_in_bytes = 4
   };
 
-#ifdef TARGET_ARCH_x86
-# include "c1_FrameMap_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_FrameMap_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_FrameMap_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_FrameMap_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_FrameMap_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(c1_FrameMap)
 
   friend class LIR_OprDesc;
 
diff --git a/src/share/vm/c1/c1_LIR.cpp b/src/share/vm/c1/c1_LIR.cpp
index c650ec0..ced682b 100644
--- a/src/share/vm/c1/c1_LIR.cpp
+++ b/src/share/vm/c1/c1_LIR.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -42,44 +42,6 @@
   return FrameMap::cpu_rnr2reg(cpu_regnrHi());
 }
 
-#if defined(X86)
-
-XMMRegister LIR_OprDesc::as_xmm_float_reg() const {
-  return FrameMap::nr2xmmreg(xmm_regnr());
-}
-
-XMMRegister LIR_OprDesc::as_xmm_double_reg() const {
-  assert(xmm_regnrLo() == xmm_regnrHi(), "assumed in calculation");
-  return FrameMap::nr2xmmreg(xmm_regnrLo());
-}
-
-#endif // X86
-
-#if defined(SPARC) || defined(PPC32)
-
-FloatRegister LIR_OprDesc::as_float_reg() const {
-  return FrameMap::nr2floatreg(fpu_regnr());
-}
-
-FloatRegister LIR_OprDesc::as_double_reg() const {
-  return FrameMap::nr2floatreg(fpu_regnrHi());
-}
-
-#endif
-
-#if defined(ARM) || defined(AARCH64) || defined(PPC64)
-
-FloatRegister LIR_OprDesc::as_float_reg() const {
-  return as_FloatRegister(fpu_regnr());
-}
-
-FloatRegister LIR_OprDesc::as_double_reg() const {
-  return as_FloatRegister(fpu_regnrLo());
-}
-
-#endif
-
-
 LIR_Opr LIR_OprFact::illegalOpr = LIR_OprFact::illegal();
 
 LIR_Opr LIR_OprFact::value_type(ValueType* type) {
@@ -140,32 +102,6 @@
   return LIR_Address::times_1;
 }
 
-
-#ifndef PRODUCT
-void LIR_Address::verify0() const {
-#if defined(SPARC) || defined(PPC)
-  assert(scale() == times_1, "Scaled addressing mode not available on SPARC/PPC and should not be used");
-  assert(disp() == 0 || index()->is_illegal(), "can't have both");
-#endif
-#ifdef _LP64
-  assert(base()->is_cpu_register(), "wrong base operand");
-#ifndef AARCH64
-  assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
-#else
-  assert(index()->is_illegal() || index()->is_double_cpu() || index()->is_single_cpu(), "wrong index operand");
-#endif
-  assert(base()->type() == T_OBJECT || base()->type() == T_LONG || base()->type() == T_METADATA,
-         "wrong type for addresses");
-#else
-  assert(base()->is_single_cpu(), "wrong base operand");
-  assert(index()->is_illegal() || index()->is_single_cpu(), "wrong index operand");
-  assert(base()->type() == T_OBJECT || base()->type() == T_INT || base()->type() == T_METADATA,
-         "wrong type for addresses");
-#endif
-}
-#endif
-
-
 //---------------------------------------------------
 
 char LIR_OprDesc::type_char(BasicType t) {
diff --git a/src/share/vm/c1/c1_LIR.hpp b/src/share/vm/c1/c1_LIR.hpp
index 2943b38..7ca75ff 100644
--- a/src/share/vm/c1/c1_LIR.hpp
+++ b/src/share/vm/c1/c1_LIR.hpp
@@ -28,6 +28,7 @@
 #include "c1/c1_Defs.hpp"
 #include "c1/c1_ValueType.hpp"
 #include "oops/method.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 class BlockBegin;
 class BlockList;
@@ -438,15 +439,13 @@
     return as_register();
   }
 
-#ifdef X86
-  XMMRegister as_xmm_float_reg() const;
-  XMMRegister as_xmm_double_reg() const;
-  // for compatibility with RInfo
-  int fpu () const                                  { return lo_reg_half(); }
-#endif
-#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64)
   FloatRegister as_float_reg   () const;
   FloatRegister as_double_reg  () const;
+#ifdef X86
+  XMMRegister as_xmm_float_reg () const;
+  XMMRegister as_xmm_double_reg() const;
+  // for compatibility with RInfo
+  int fpu() const { return lo_reg_half(); }
 #endif
 
   jint      as_jint()    const { return as_constant_ptr()->as_jint(); }
@@ -534,14 +533,19 @@
      , _type(type)
      , _disp(0) { verify(); }
 
-#if defined(X86) || defined(ARM) || defined(AARCH64)
+  LIR_Address(LIR_Opr base, LIR_Opr index, intx disp, BasicType type):
+       _base(base)
+     , _index(index)
+     , _scale(times_1)
+     , _type(type)
+     , _disp(disp) { verify(); }
+
   LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type):
        _base(base)
      , _index(index)
      , _scale(scale)
      , _type(type)
      , _disp(disp) { verify(); }
-#endif // X86 || ARM
 
   LIR_Opr base()  const                          { return _base;  }
   LIR_Opr index() const                          { return _index; }
@@ -554,13 +558,7 @@
   virtual BasicType type() const                 { return _type; }
   virtual void print_value_on(outputStream* out) const PRODUCT_RETURN;
 
-  void verify0() const PRODUCT_RETURN;
-#if defined(LIR_ADDRESS_PD_VERIFY) && !defined(PRODUCT)
-  void pd_verify() const;
-  void verify() const { pd_verify(); }
-#else
-  void verify() const { verify0(); }
-#endif
+  void verify() const PRODUCT_RETURN;
 
   static Scale scale(BasicType type);
 };
@@ -605,59 +603,49 @@
                                LIR_OprDesc::double_size);
   }
 
-  static LIR_Opr single_fpu(int reg)            { return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
-                                                                             LIR_OprDesc::float_type           |
-                                                                             LIR_OprDesc::fpu_register         |
-                                                                             LIR_OprDesc::single_size); }
-#if defined(ARM32)
-  static LIR_Opr double_fpu(int reg1, int reg2)    { return (LIR_Opr)((reg1 << LIR_OprDesc::reg1_shift) | (reg2 << LIR_OprDesc::reg2_shift) | LIR_OprDesc::double_type | LIR_OprDesc::fpu_register | LIR_OprDesc::double_size); }
-  static LIR_Opr single_softfp(int reg)            { return (LIR_Opr)((reg  << LIR_OprDesc::reg1_shift) |                                     LIR_OprDesc::float_type  | LIR_OprDesc::cpu_register | LIR_OprDesc::single_size); }
-  static LIR_Opr double_softfp(int reg1, int reg2) { return (LIR_Opr)((reg1 << LIR_OprDesc::reg1_shift) | (reg2 << LIR_OprDesc::reg2_shift) | LIR_OprDesc::double_type | LIR_OprDesc::cpu_register | LIR_OprDesc::double_size); }
-#endif
-#ifdef SPARC
-  static LIR_Opr double_fpu(int reg1, int reg2) { return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
-                                                                             (reg2 << LIR_OprDesc::reg2_shift) |
-                                                                             LIR_OprDesc::double_type          |
-                                                                             LIR_OprDesc::fpu_register         |
-                                                                             LIR_OprDesc::double_size); }
-#endif
-#if defined(X86) || defined(AARCH64)
-  static LIR_Opr double_fpu(int reg)            { return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
-                                                                             (reg  << LIR_OprDesc::reg2_shift) |
-                                                                             LIR_OprDesc::double_type          |
-                                                                             LIR_OprDesc::fpu_register         |
-                                                                             LIR_OprDesc::double_size); }
+  static LIR_Opr single_fpu(int reg) {
+    return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
+                               LIR_OprDesc::float_type           |
+                               LIR_OprDesc::fpu_register         |
+                               LIR_OprDesc::single_size);
+  }
 
-  static LIR_Opr single_xmm(int reg)            { return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
-                                                                             LIR_OprDesc::float_type           |
-                                                                             LIR_OprDesc::fpu_register         |
-                                                                             LIR_OprDesc::single_size          |
-                                                                             LIR_OprDesc::is_xmm_mask); }
-  static LIR_Opr double_xmm(int reg)            { return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
-                                                                             (reg  << LIR_OprDesc::reg2_shift) |
-                                                                             LIR_OprDesc::double_type          |
-                                                                             LIR_OprDesc::fpu_register         |
-                                                                             LIR_OprDesc::double_size          |
-                                                                             LIR_OprDesc::is_xmm_mask); }
+  // Platform dependant.
+  static LIR_Opr double_fpu(int reg1, int reg2 = -1 /*fnoreg*/);
+
+#ifdef __SOFTFP__
+  static LIR_Opr single_softfp(int reg) {
+    return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
+                               LIR_OprDesc::float_type           |
+                               LIR_OprDesc::cpu_register         |
+                               LIR_OprDesc::single_size);
+  }
+  static LIR_Opr double_softfp(int reg1, int reg2) {
+    return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
+                               (reg2 << LIR_OprDesc::reg2_shift) |
+                               LIR_OprDesc::double_type          |
+                               LIR_OprDesc::cpu_register         |
+                               LIR_OprDesc::double_size);
+  }
+#endif // __SOFTFP__
+
+#if defined(X86)
+  static LIR_Opr single_xmm(int reg) {
+    return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) |
+                               LIR_OprDesc::float_type          |
+                               LIR_OprDesc::fpu_register        |
+                               LIR_OprDesc::single_size         |
+                               LIR_OprDesc::is_xmm_mask);
+  }
+  static LIR_Opr double_xmm(int reg) {
+    return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) |
+                               (reg << LIR_OprDesc::reg2_shift) |
+                               LIR_OprDesc::double_type         |
+                               LIR_OprDesc::fpu_register        |
+                               LIR_OprDesc::double_size         |
+                               LIR_OprDesc::is_xmm_mask);
+  }
 #endif // X86
-#if defined(PPC)
-  static LIR_Opr double_fpu(int reg)            { return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
-                                                                             (reg  << LIR_OprDesc::reg2_shift) |
-                                                                             LIR_OprDesc::double_type          |
-                                                                             LIR_OprDesc::fpu_register         |
-                                                                             LIR_OprDesc::double_size); }
-#endif
-#ifdef PPC32
-  static LIR_Opr single_softfp(int reg)            { return (LIR_Opr)((reg  << LIR_OprDesc::reg1_shift)        |
-                                                                             LIR_OprDesc::float_type           |
-                                                                             LIR_OprDesc::cpu_register         |
-                                                                             LIR_OprDesc::single_size); }
-  static LIR_Opr double_softfp(int reg1, int reg2) { return (LIR_Opr)((reg2 << LIR_OprDesc::reg1_shift)        |
-                                                                             (reg1 << LIR_OprDesc::reg2_shift) |
-                                                                             LIR_OprDesc::double_type          |
-                                                                             LIR_OprDesc::cpu_register         |
-                                                                             LIR_OprDesc::double_size); }
-#endif // PPC32
 
   static LIR_Opr virtual_register(int index, BasicType type) {
     LIR_Opr res;
@@ -1467,37 +1455,15 @@
  private:
    Bytecodes::Code _bytecode;
    ConversionStub* _stub;
-#ifdef PPC32
-  LIR_Opr _tmp1;
-  LIR_Opr _tmp2;
-#endif
 
  public:
    LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub)
      : LIR_Op1(lir_convert, opr, result)
      , _stub(stub)
-#ifdef PPC32
-     , _tmp1(LIR_OprDesc::illegalOpr())
-     , _tmp2(LIR_OprDesc::illegalOpr())
-#endif
      , _bytecode(code)                           {}
 
-#ifdef PPC32
-   LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub
-                 ,LIR_Opr tmp1, LIR_Opr tmp2)
-     : LIR_Op1(lir_convert, opr, result)
-     , _stub(stub)
-     , _tmp1(tmp1)
-     , _tmp2(tmp2)
-     , _bytecode(code)                           {}
-#endif
-
   Bytecodes::Code bytecode() const               { return _bytecode; }
   ConversionStub* stub() const                   { return _stub; }
-#ifdef PPC32
-  LIR_Opr tmp1() const                           { return _tmp1; }
-  LIR_Opr tmp2() const                           { return _tmp2; }
-#endif
 
   virtual void emit_code(LIR_Assembler* masm);
   virtual LIR_OpConvert* as_OpConvert() { return this; }
@@ -2136,9 +2102,6 @@
 
   void safepoint(LIR_Opr tmp, CodeEmitInfo* info)  { append(new LIR_Op1(lir_safepoint, tmp, info)); }
 
-#ifdef PPC32
-  void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); }
-#endif
   void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); }
 
   void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and,  left, right, dst)); }
diff --git a/src/share/vm/c1/c1_LIRAssembler.hpp b/src/share/vm/c1/c1_LIRAssembler.hpp
index c7d3170..c0d39d6 100644
--- a/src/share/vm/c1/c1_LIRAssembler.hpp
+++ b/src/share/vm/c1/c1_LIRAssembler.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -28,6 +28,7 @@
 #include "c1/c1_CodeStubs.hpp"
 #include "ci/ciMethodData.hpp"
 #include "oops/methodData.hpp"
+#include "utilities/macros.hpp"
 
 class Compilation;
 class ScopeValue;
@@ -257,21 +258,7 @@
 
   void atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp);
 
-#ifdef TARGET_ARCH_x86
-# include "c1_LIRAssembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_LIRAssembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_LIRAssembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_LIRAssembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_LIRAssembler_aarch64.hpp"
-#endif
+#include CPU_HEADER(c1_LIRAssembler)
 
 };
 
diff --git a/src/share/vm/c1/c1_LIRGenerator.cpp b/src/share/vm/c1/c1_LIRGenerator.cpp
index 53701de..a0f9454 100644
--- a/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -3434,7 +3434,7 @@
   __ load(counter, result);
   __ add(result, LIR_OprFact::intConst(InvocationCounter::count_increment), result);
   __ store(result, counter);
-  if (notify) {
+  if (notify && (!backedge || UseOnStackReplacement)) {
     LIR_Opr meth = LIR_OprFact::metadataConst(method->constant_encoding());
     // The bci for info can point to cmp for if's we want the if bci
     CodeStub* overflow = new CounterOverflowStub(info, bci, meth);
diff --git a/src/share/vm/c1/c1_LinearScan.hpp b/src/share/vm/c1/c1_LinearScan.hpp
index 00ed78f..54ce364 100644
--- a/src/share/vm/c1/c1_LinearScan.hpp
+++ b/src/share/vm/c1/c1_LinearScan.hpp
@@ -31,6 +31,7 @@
 #include "c1/c1_Instruction.hpp"
 #include "c1/c1_LIR.hpp"
 #include "c1/c1_LIRGenerator.hpp"
+#include "utilities/macros.hpp"
 
 class DebugInfoCache;
 class FpuStackAllocator;
@@ -959,23 +960,7 @@
 
 #endif // ifndef PRODUCT
 
-
 // Pick up platform-dependent implementation details
-#ifdef TARGET_ARCH_x86
-# include "c1_LinearScan_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_LinearScan_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_LinearScan_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_LinearScan_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_LinearScan_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(c1_LinearScan)
 
 #endif // SHARE_VM_C1_C1_LINEARSCAN_HPP
diff --git a/src/share/vm/c1/c1_MacroAssembler.hpp b/src/share/vm/c1/c1_MacroAssembler.hpp
index 7493766..7607a08 100644
--- a/src/share/vm/c1/c1_MacroAssembler.hpp
+++ b/src/share/vm/c1/c1_MacroAssembler.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -27,6 +27,7 @@
 
 #include "asm/macroAssembler.hpp"
 #include "asm/macroAssembler.inline.hpp"
+#include "utilities/macros.hpp"
 
 class CodeEmitInfo;
 
@@ -47,21 +48,7 @@
   void verify_stack_oop(int offset) PRODUCT_RETURN;
   void verify_not_null_oop(Register r)  PRODUCT_RETURN;
 
-#ifdef TARGET_ARCH_x86
-# include "c1_MacroAssembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_MacroAssembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_MacroAssembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_MacroAssembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_MacroAssembler_aarch64.hpp"
-#endif
+#include CPU_HEADER(c1_MacroAssembler)
 
 };
 
diff --git a/src/share/vm/c1/c1_globals.hpp b/src/share/vm/c1/c1_globals.hpp
index a7a0f2e..a07f844 100644
--- a/src/share/vm/c1/c1_globals.hpp
+++ b/src/share/vm/c1/c1_globals.hpp
@@ -26,36 +26,10 @@
 #define SHARE_VM_C1_C1_GLOBALS_HPP
 
 #include "runtime/globals.hpp"
-#ifdef TARGET_ARCH_x86
-# include "c1_globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_globals_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "c1_globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "c1_globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "c1_globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "c1_globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "c1_globals_bsd.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(c1_globals)
+#include OS_HEADER(c1_globals)
 
 //
 // Defines all global flags used by the client compiler.
diff --git a/src/share/vm/ci/ciEnv.cpp b/src/share/vm/ci/ciEnv.cpp
index 7bb8f75..323b75a 100644
--- a/src/share/vm/ci/ciEnv.cpp
+++ b/src/share/vm/ci/ciEnv.cpp
@@ -204,11 +204,13 @@
 }
 
 ciEnv::~ciEnv() {
-  CompilerThread* current_thread = CompilerThread::current();
-  _factory->remove_symbols();
-  // Need safepoint to clear the env on the thread.  RedefineClasses might
-  // be reading it.
-  GUARDED_VM_ENTRY(current_thread->set_env(NULL);)
+  GUARDED_VM_ENTRY(
+      CompilerThread* current_thread = CompilerThread::current();
+      _factory->remove_symbols();
+      // Need safepoint to clear the env on the thread.  RedefineClasses might
+      // be reading it.
+      current_thread->set_env(NULL);
+  )
 }
 
 // ------------------------------------------------------------------
diff --git a/src/share/vm/ci/ciReplay.cpp b/src/share/vm/ci/ciReplay.cpp
index 27b0002..ec78891 100644
--- a/src/share/vm/ci/ciReplay.cpp
+++ b/src/share/vm/ci/ciReplay.cpp
@@ -490,7 +490,8 @@
     int comp_level = parse_int(comp_level_label);
     // old version w/o comp_level
     if (had_error() && (error_message() == comp_level_label)) {
-      comp_level = CompLevel_full_optimization;
+      // use highest available tier
+      comp_level = TieredCompilation ? TieredStopAtLevel : CompLevel_highest_tier;
     }
     if (!is_valid_comp_level(comp_level)) {
       return;
diff --git a/src/share/vm/classfile/classFileParser.cpp b/src/share/vm/classfile/classFileParser.cpp
index c6155dd..0028f1a 100644
--- a/src/share/vm/classfile/classFileParser.cpp
+++ b/src/share/vm/classfile/classFileParser.cpp
@@ -5406,7 +5406,6 @@
                                  Symbol* name,
                                  ClassLoaderData* loader_data,
                                  Handle protection_domain,
-                                 TempNewSymbol* parsed_name,
                                  const Klass* host_klass,
                                  GrowableArray<Handle>* cp_patches,
                                  Publicity pub_level,
@@ -5416,7 +5415,6 @@
   _loader_data(loader_data),
   _host_klass(host_klass),
   _cp_patches(cp_patches),
-  _parsed_name(parsed_name),
   _super_klass(),
   _cp(NULL),
   _fields(NULL),
@@ -5657,15 +5655,6 @@
   Symbol* const class_name_in_cp = cp->klass_name_at(_this_class_index);
   assert(class_name_in_cp != NULL, "class_name can't be null");
 
-  if (_parsed_name != NULL) {
-    // It's important to set parsed_name *before* resolving the super class.
-    // (it's used for cleanup by the caller if parsing fails)
-    *_parsed_name = class_name_in_cp;
-    // parsed_name is returned and can be used if there's an error, so add to
-    // its reference count.  Caller will decrement the refcount.
-    (*_parsed_name)->increment_refcount();
-  }
-
   // Update _class_name which could be null previously
   // to reflect the name in the constant pool
   _class_name = class_name_in_cp;
@@ -5692,6 +5681,10 @@
     return;
   }
 
+  // Verification prevents us from creating names with dots in them, this
+  // asserts that that's the case.
+  assert(is_internal_format(_class_name), "external class name format used internally");
+
   if (!is_internal()) {
     if (log_is_enabled(Debug, class, preorder)){
       ResourceMark rm(THREAD);
@@ -5900,3 +5893,20 @@
 
   return _stream->clone();
 }
+// ----------------------------------------------------------------------------
+// debugging
+
+#ifdef ASSERT
+
+// return true if class_name contains no '.' (internal format is '/')
+bool ClassFileParser::is_internal_format(Symbol* class_name) {
+  if (class_name != NULL) {
+    ResourceMark rm;
+    char* name = class_name->as_C_string();
+    return strchr(name, '.') == NULL;
+  } else {
+    return true;
+  }
+}
+
+#endif
diff --git a/src/share/vm/classfile/classFileParser.hpp b/src/share/vm/classfile/classFileParser.hpp
index 47ec539..4b62875 100644
--- a/src/share/vm/classfile/classFileParser.hpp
+++ b/src/share/vm/classfile/classFileParser.hpp
@@ -81,7 +81,6 @@
   mutable ClassLoaderData* _loader_data;
   const Klass* _host_klass;
   GrowableArray<Handle>* _cp_patches; // overrides for CP entries
-  TempNewSymbol* _parsed_name;
 
   // Metadata created before the instance klass is created.  Must be deallocated
   // if not transferred to the InstanceKlass upon successful class loading
@@ -475,7 +474,6 @@
                   Symbol* name,
                   ClassLoaderData* loader_data,
                   Handle protection_domain,
-                  TempNewSymbol* parsed_name,
                   const Klass* host_klass,
                   GrowableArray<Handle>* cp_patches,
                   Publicity pub_level,
@@ -514,6 +512,11 @@
   bool is_internal() const { return INTERNAL == _pub_level; }
 
   static bool verify_unqualified_name(const char* name, unsigned int length, int type);
+
+#ifdef ASSERT
+  static bool is_internal_format(Symbol* class_name);
+#endif
+
 };
 
 #endif // SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP
diff --git a/src/share/vm/classfile/classLoader.cpp b/src/share/vm/classfile/classLoader.cpp
index 1186067..92bf8fe 100644
--- a/src/share/vm/classfile/classLoader.cpp
+++ b/src/share/vm/classfile/classLoader.cpp
@@ -141,11 +141,11 @@
 PerfCounter*    ClassLoader::_load_instance_class_failCounter = NULL;
 
 GrowableArray<ModuleClassPathList*>* ClassLoader::_xpatch_entries = NULL;
-ClassPathEntry* ClassLoader::_first_entry        = NULL;
-ClassPathEntry* ClassLoader::_last_entry         = NULL;
-int             ClassLoader::_num_entries        = 0;
+GrowableArray<ModuleClassPathList*>* ClassLoader::_exploded_entries = NULL;
+ClassPathEntry* ClassLoader::_jrt_entry = NULL;
 ClassPathEntry* ClassLoader::_first_append_entry = NULL;
-bool            ClassLoader::_has_jimage = false;
+ClassPathEntry* ClassLoader::_last_append_entry  = NULL;
+int             ClassLoader::_num_entries        = 0;
 #if INCLUDE_CDS
 GrowableArray<char*>* ClassLoader::_boot_modules_array = NULL;
 GrowableArray<char*>* ClassLoader::_platform_modules_array = NULL;
@@ -508,7 +508,7 @@
 #endif
 
       } else {
-        PackageEntry* package_entry = get_package_entry(name, ClassLoaderData::the_null_class_loader_data(), THREAD);
+        PackageEntry* package_entry = get_package_entry(name, ClassLoaderData::the_null_class_loader_data(), CHECK_NULL);
         if (package_entry != NULL) {
           ResourceMark rm;
           // Get the module name
@@ -651,7 +651,6 @@
 #endif
 
 void ClassLoader::setup_bootstrap_search_path() {
-  assert(_first_entry == NULL, "should not setup bootstrap class search path twice");
   const char* sys_class_path = Arguments::get_sysclasspath();
   const char* java_class_path = Arguments::get_appclasspath();
   if (PrintSharedArchiveAndExit) {
@@ -694,7 +693,10 @@
   GrowableArray<ModuleXPatchPath*>* xpatch_args = Arguments::get_xpatchprefix();
   int num_of_entries = xpatch_args->length();
 
-  // Set up the boot loader's xpatch_entries list
+  assert(!DumpSharedSpaces, "DumpSharedSpaces not supported with -Xpatch");
+  assert(!UseSharedSpaces, "UseSharedSpaces not supported with -Xpatch");
+
+  // Set up the boot loader's _xpatch_entries list
   _xpatch_entries = new (ResourceObj::C_HEAP, mtModule) GrowableArray<ModuleClassPathList*>(num_of_entries, true);
 
   for (int i = 0; i < num_of_entries; i++) {
@@ -742,10 +744,9 @@
 }
 
 void ClassLoader::setup_search_path(const char *class_path, bool bootstrap_search) {
-  int offset = 0;
   int len = (int)strlen(class_path);
   int end = 0;
-  bool mark_append_entry = false;
+  bool set_base_piece = bootstrap_search;
 
   // Iterate over class path entries
   for (int start = 0; start < len; start = end) {
@@ -754,21 +755,45 @@
     }
     EXCEPTION_MARK;
     ResourceMark rm(THREAD);
-    mark_append_entry = (mark_append_entry ||
-      (bootstrap_search && (start == Arguments::bootclassloader_append_index())));
     char* path = NEW_RESOURCE_ARRAY(char, end - start + 1);
     strncpy(path, &class_path[start], end - start);
     path[end - start] = '\0';
-    update_class_path_entry_list(path, false, mark_append_entry, false, bootstrap_search);
 
-    // Check on the state of the boot loader's append path
-    if (mark_append_entry && (_first_append_entry == NULL)) {
-      // Failure to mark the first append entry, most likely
-      // due to a non-existent path. Record the next entry
-      // as the first boot loader append entry.
-      mark_append_entry = true;
+    // The first time through the bootstrap_search setup, it must be determined
+    // what the base or core piece of the boot loader search is.  Either a java runtime
+    // image is present or this is an exploded module build situation.
+    if (set_base_piece) {
+      assert(string_ends_with(path, MODULES_IMAGE_NAME) || string_ends_with(path, "java.base"),
+             "Incorrect boot loader search path, no java runtime image or java.base exploded build");
+      struct stat st;
+      if (os::stat(path, &st) == 0) {
+        // Directory found
+        Thread* THREAD = Thread::current();
+        ClassPathEntry* new_entry = create_class_path_entry(path, &st, false, false, CHECK);
+
+        // Check for a jimage
+        if (Arguments::has_jimage()) {
+          assert(_jrt_entry == NULL, "should not setup bootstrap class search path twice");
+          assert(new_entry != NULL && new_entry->is_jrt(), "No java runtime image present");
+          _jrt_entry = new_entry;
+          ++_num_entries;
+#if INCLUDE_CDS
+          if (DumpSharedSpaces) {
+            JImageFile *jimage = _jrt_entry->jimage();
+            assert(jimage != NULL, "No java runtime image file present");
+            ClassLoader::initialize_module_loader_map(jimage);
+          }
+#endif
+        }
+      } else {
+        // If path does not exist, exit
+        vm_exit_during_initialization("Unable to establish the boot loader search path", path);
+      }
+      set_base_piece = false;
     } else {
-      mark_append_entry = false;
+      // Every entry on the system boot class path after the initial base piece,
+      // which is set by os::set_boot_path(), is considered an appended entry.
+      update_class_path_entry_list(path, false, bootstrap_search);
     }
 
 #if INCLUDE_CDS
@@ -782,6 +807,45 @@
   }
 }
 
+// During an exploded modules build, each module defined to the boot loader
+// will be added to the ClassLoader::_exploded_entries array.
+void ClassLoader::add_to_exploded_build_list(Symbol* module_sym, TRAPS) {
+  assert(!ClassLoader::has_jrt_entry(), "Exploded build not applicable");
+
+  // Set up the boot loader's _exploded_entries list
+  if (_exploded_entries == NULL) {
+    _exploded_entries = new (ResourceObj::C_HEAP, mtModule) GrowableArray<ModuleClassPathList*>(EXPLODED_ENTRY_SIZE, true);
+  }
+
+  // Find the module's symbol
+  ResourceMark rm(THREAD);
+  const char *module_name = module_sym->as_C_string();
+  const char *home = Arguments::get_java_home();
+  const char file_sep = os::file_separator()[0];
+  // 10 represents the length of "modules" + 2 file separators + \0
+  size_t len = strlen(home) + strlen(module_name) + 10;
+  char *path = NEW_C_HEAP_ARRAY(char, len, mtModule);
+  jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name);
+
+  struct stat st;
+  if (os::stat(path, &st) == 0) {
+    // Directory found
+    ClassPathEntry* new_entry = create_class_path_entry(path, &st, false, false, CHECK);
+
+    // If the path specification is valid, enter it into this module's list.
+    // There is no need to check for duplicate modules in the exploded entry list,
+    // since no two modules with the same name can be defined to the boot loader.
+    // This is checked at module definition time in Modules::define_module.
+    if (new_entry != NULL) {
+      ModuleClassPathList* module_cpl = new ModuleClassPathList(module_sym);
+      module_cpl->add_to_list(new_entry);
+      _exploded_entries->push(module_cpl);
+      log_info(class, load)("path: %s", path);
+    }
+  }
+  FREE_C_HEAP_ARRAY(char, path);
+}
+
 ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const struct stat* st,
                                                      bool throw_exception,
                                                      bool is_boot_append, TRAPS) {
@@ -872,21 +936,9 @@
   return NULL;
 }
 
-// The boot class loader must adhere to specfic visibility rules.
-// Prior to loading a class in a named package, the package is checked
-// to see if it is in a module defined to the boot loader. If the
-// package is not in a module defined to the boot loader, the class
-// must be loaded only in the boot loader's append path, which
-// consists of [-Xbootclasspath/a]; [jvmti appended entries]
-void ClassLoader::set_first_append_entry(ClassPathEntry *new_entry) {
-  if (_first_append_entry == NULL) {
-    _first_append_entry = new_entry;
-  }
-}
-
 // returns true if entry already on class path
 bool ClassLoader::contains_entry(ClassPathEntry *entry) {
-  ClassPathEntry* e = _first_entry;
+  ClassPathEntry* e = _first_append_entry;
   while (e != NULL) {
     // assume zip entries have been canonicalized
     if (strcmp(entry->name(), e->name()) == 0) {
@@ -899,41 +951,24 @@
 
 void ClassLoader::add_to_list(ClassPathEntry *new_entry) {
   if (new_entry != NULL) {
-    if (_last_entry == NULL) {
-      _first_entry = _last_entry = new_entry;
+    if (_last_append_entry == NULL) {
+      assert(_first_append_entry == NULL, "boot loader's append class path entry list not empty");
+      _first_append_entry = _last_append_entry = new_entry;
     } else {
-      _last_entry->set_next(new_entry);
-      _last_entry = new_entry;
+      _last_append_entry->set_next(new_entry);
+      _last_append_entry = new_entry;
     }
   }
-  _num_entries ++;
-}
-
-void ClassLoader::prepend_to_list(ClassPathEntry *new_entry) {
-  if (new_entry != NULL) {
-    if (_last_entry == NULL) {
-      _first_entry = _last_entry = new_entry;
-    } else {
-      new_entry->set_next(_first_entry);
-      _first_entry = new_entry;
-    }
-  }
-  _num_entries ++;
+  _num_entries++;
 }
 
 void ClassLoader::add_to_list(const char *apath) {
-  update_class_path_entry_list((char*)apath, false, false, false, false);
-}
-
-void ClassLoader::prepend_to_list(const char *apath) {
-  update_class_path_entry_list((char*)apath, false, false, true, false);
+  update_class_path_entry_list((char*)apath, false, false);
 }
 
 // Returns true IFF the file/dir exists and the entry was successfully created.
 bool ClassLoader::update_class_path_entry_list(const char *path,
                                                bool check_for_duplicates,
-                                               bool mark_append_entry,
-                                               bool prepend_entry,
                                                bool is_boot_append,
                                                bool throw_exception) {
   struct stat st;
@@ -946,19 +981,10 @@
       return false;
     }
 
-    // Ensure that the first boot loader append entry will always be set correctly.
-    assert((!mark_append_entry ||
-            (mark_append_entry && (!check_for_duplicates || !contains_entry(new_entry)))),
-           "failed to mark boot loader's first append boundary");
-
     // Do not reorder the bootclasspath which would break get_system_package().
     // Add new entry to linked list
-
     if (!check_for_duplicates || !contains_entry(new_entry)) {
-      ClassLoaderExt::add_class_path_entry(path, check_for_duplicates, new_entry, prepend_entry);
-      if (mark_append_entry) {
-        set_first_append_entry(new_entry);
-      }
+      ClassLoaderExt::add_class_path_entry(path, check_for_duplicates, new_entry);
     }
     return true;
   } else {
@@ -971,30 +997,47 @@
   }
 }
 
+static void print_module_entry_table(const GrowableArray<ModuleClassPathList*>* const module_list) {
+  ResourceMark rm;
+  int num_of_entries = module_list->length();
+  for (int i = 0; i < num_of_entries; i++) {
+    ClassPathEntry* e;
+    ModuleClassPathList* mpl = module_list->at(i);
+    tty->print("%s=", mpl->module_name()->as_C_string());
+    e = mpl->module_first_entry();
+    while (e != NULL) {
+      tty->print("%s", e->name());
+      e = e->next();
+      if (e != NULL) {
+        tty->print("%s", os::path_separator());
+      }
+    }
+    tty->print(" ;");
+  }
+}
+
 void ClassLoader::print_bootclasspath() {
   ClassPathEntry* e;
   tty->print("[bootclasspath= ");
 
   // Print -Xpatch module/path specifications first
   if (_xpatch_entries != NULL) {
-    ResourceMark rm;
-    int num_of_entries = _xpatch_entries->length();
-    for (int i = 0; i < num_of_entries; i++) {
-      ModuleClassPathList* mpl = _xpatch_entries->at(i);
-      tty->print("%s=", mpl->module_name()->as_C_string());
-      e = mpl->module_first_entry();
-      while (e != NULL) {
-        tty->print("%s", e->name());
-        e = e->next();
-        if (e != NULL) {
-          tty->print("%s", os::path_separator());
-        }
-      }
-      tty->print(" ;");
+    print_module_entry_table(_xpatch_entries);
+  }
+
+  // [jimage | exploded modules build]
+  if (has_jrt_entry()) {
+    // Print the location of the java runtime image
+    tty->print("%s ;", _jrt_entry->name());
+  } else {
+    // Print exploded module build path specifications
+    if (_exploded_entries != NULL) {
+      print_module_entry_table(_exploded_entries);
     }
   }
 
-  e = _first_entry;
+  // appended entries
+  e = _first_append_entry;
   while (e != NULL) {
     tty->print("%s ;", e->name());
     e = e->next();
@@ -1298,6 +1341,60 @@
   return file_name;
 }
 
+// Search either the xpatch or exploded build entries for class
+ClassFileStream* ClassLoader::search_module_entries(const GrowableArray<ModuleClassPathList*>* const module_list,
+                                                    const char* const class_name, const char* const file_name, TRAPS) {
+  ClassFileStream* stream = NULL;
+
+  // Find the class' defining module in the boot loader's module entry table
+  PackageEntry* pkg_entry = get_package_entry(class_name, ClassLoaderData::the_null_class_loader_data(), CHECK_NULL);
+  ModuleEntry* mod_entry = (pkg_entry != NULL) ? pkg_entry->module() : NULL;
+
+  // If the module system has not defined java.base yet, then
+  // classes loaded are assumed to be defined to java.base.
+  // When java.base is eventually defined by the module system,
+  // all packages of classes that have been previously loaded
+  // are verified in ModuleEntryTable::verify_javabase_packages().
+  if (!Universe::is_module_initialized() &&
+      !ModuleEntryTable::javabase_defined() &&
+      mod_entry == NULL) {
+    mod_entry = ModuleEntryTable::javabase_module();
+  }
+
+  // The module must be a named module
+  if (mod_entry != NULL && mod_entry->is_named()) {
+    int num_of_entries = module_list->length();
+    const Symbol* class_module_name = mod_entry->name();
+
+    // Loop through all the modules in either the xpatch or exploded entries looking for module
+    for (int i = 0; i < num_of_entries; i++) {
+      ModuleClassPathList* module_cpl = module_list->at(i);
+      Symbol* module_cpl_name = module_cpl->module_name();
+
+      if (module_cpl_name->fast_compare(class_module_name) == 0) {
+        // Class' module has been located, attempt to load
+        // the class from the module's ClassPathEntry list.
+        ClassPathEntry* e = module_cpl->module_first_entry();
+        while (e != NULL) {
+          stream = e->open_stream(file_name, CHECK_NULL);
+          // No context.check is required since CDS is not supported
+          // for an exploded modules build or if -Xpatch is specified.
+          if (NULL != stream) {
+            return stream;
+          }
+          e = e->next();
+        }
+        // If the module was located, break out even if the class was not
+        // located successfully from that module's ClassPathEntry list.
+        // There will not be another valid entry for that module.
+        return NULL;
+      }
+    }
+  }
+
+  return NULL;
+}
+
 instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_only, TRAPS) {
   assert(name != NULL, "invariant");
   assert(THREAD->is_Java_thread(), "must be a JavaThread");
@@ -1321,18 +1418,19 @@
   s2 classpath_index = 0;
   ClassPathEntry* e = NULL;
 
-  // If DumpSharedSpaces is true, boot loader visibility boundaries are set
-  // to be _first_entry to the end (all path entries). No -Xpatch entries are
-  // included since CDS and AppCDS are not supported if -Xpatch is specified.
+  // If DumpSharedSpaces is true boot loader visibility boundaries are set to:
+  //   - [jimage] + [_first_append_entry to _last_append_entry] (all path entries).
+  // No -Xpatch entries or exploded module builds are included since CDS
+  // is not supported if -Xpatch or exploded module builds are used.
   //
   // If search_append_only is true, boot loader visibility boundaries are
   // set to be _first_append_entry to the end. This includes:
   //   [-Xbootclasspath/a]; [jvmti appended entries]
   //
   // If both DumpSharedSpaces and search_append_only are false, boot loader
-  // visibility boundaries are set to be _first_entry to the entry before
-  // the _first_append_entry.  This would include:
-  //   [-Xpatch:<module>=<file>(<pathsep><file>)*];  [exploded build | jimage]
+  // visibility boundaries are set to be the -Xpatch entries plus the base piece.
+  // This would include:
+  //   [-Xpatch:<module>=<file>(<pathsep><file>)*]; [jimage | exploded module build]
   //
   // DumpSharedSpaces and search_append_only are mutually exclusive and cannot
   // be true at the same time.
@@ -1341,85 +1439,37 @@
   // Load Attempt #1: -Xpatch
   // Determine the class' defining module.  If it appears in the _xpatch_entries,
   // attempt to load the class from those locations specific to the module.
+  // Specifications to -Xpatch can contain a partial number of classes
+  // that are part of the overall module definition.  So if a particular class is not
+  // found within its module specification, the search should continue to Load Attempt #2.
   // Note: The -Xpatch entries are never searched if the boot loader's
   //       visibility boundary is limited to only searching the append entries.
   if (_xpatch_entries != NULL && !search_append_only && !DumpSharedSpaces) {
-    // Find the module in the boot loader's module entry table
-    PackageEntry* pkg_entry = get_package_entry(class_name, ClassLoaderData::the_null_class_loader_data(), THREAD);
-    ModuleEntry* mod_entry = (pkg_entry != NULL) ? pkg_entry->module() : NULL;
-
-    // If the module system has not defined java.base yet, then
-    // classes loaded are assumed to be defined to java.base.
-    // When java.base is eventually defined by the module system,
-    // all packages of classes that have been previously loaded
-    // are verified in ModuleEntryTable::verify_javabase_packages().
-    if (!Universe::is_module_initialized() &&
-        !ModuleEntryTable::javabase_defined() &&
-        mod_entry == NULL) {
-      mod_entry = ModuleEntryTable::javabase_module();
-    }
-
-    // The module must be a named module
-    if (mod_entry != NULL && mod_entry->is_named()) {
-      int num_of_entries = _xpatch_entries->length();
-      const Symbol* class_module_name = mod_entry->name();
-
-      // Loop through all the xpatch entries looking for module
-      for (int i = 0; i < num_of_entries; i++) {
-        ModuleClassPathList* module_cpl = _xpatch_entries->at(i);
-        Symbol* module_cpl_name = module_cpl->module_name();
-
-        if (module_cpl_name->fast_compare(class_module_name) == 0) {
-          // Class' module has been located, attempt to load
-          // the class from the module's ClassPathEntry list.
-          e = module_cpl->module_first_entry();
-          while (e != NULL) {
-            stream = e->open_stream(file_name, CHECK_NULL);
-            // No context.check is required since both CDS
-            // and AppCDS are turned off if -Xpatch is specified.
-            if (NULL != stream) {
-              break;
-            }
-            e = e->next();
-          }
-          // If the module was located in the xpatch entries, break out
-          // even if the class was not located successfully from that module's
-          // ClassPathEntry list. There will not be another valid entry for
-          // that module in the _xpatch_entries array.
-          break;
-        }
-      }
-    }
+    stream = search_module_entries(_xpatch_entries, class_name, file_name, CHECK_NULL);
   }
 
-  // Load Attempt #2: [exploded build | jimage]
+  // Load Attempt #2: [jimage | exploded build]
   if (!search_append_only && (NULL == stream)) {
-    e = _first_entry;
-    while ((e != NULL) && (e != _first_append_entry)) {
-      stream = e->open_stream(file_name, CHECK_NULL);
+    if (has_jrt_entry()) {
+      e = _jrt_entry;
+      stream = _jrt_entry->open_stream(file_name, CHECK_NULL);
       if (!context.check(stream, classpath_index)) {
         return NULL;
       }
-      if (NULL != stream) {
-        break;
-      }
-      e = e->next();
-      ++classpath_index;
+    } else {
+      // Exploded build - attempt to locate class in its defining module's location.
+      assert(_exploded_entries != NULL, "No exploded build entries present");
+      stream = search_module_entries(_exploded_entries, class_name, file_name, CHECK_NULL);
     }
   }
 
   // Load Attempt #3: [-Xbootclasspath/a]; [jvmti appended entries]
   if ((search_append_only || DumpSharedSpaces) && (NULL == stream)) {
-    // For the boot loader append path search, must calculate
-    // the starting classpath_index prior to attempting to
-    // load the classfile.
-    if (search_append_only) {
-      ClassPathEntry *tmp_e = _first_entry;
-      while ((tmp_e != NULL) && (tmp_e != _first_append_entry)) {
-        tmp_e = tmp_e->next();
-        ++classpath_index;
-      }
-    }
+    // For the boot loader append path search, the starting classpath_index
+    // for the appended piece is always 1 to account for either the
+    // _jrt_entry or the _exploded_entries.
+    assert(classpath_index == 0, "The classpath_index has been incremented incorrectly");
+    classpath_index = 1;
 
     e = _first_append_entry;
     while (e != NULL) {
@@ -1453,7 +1503,6 @@
                                                                 protection_domain,
                                                                 NULL, // host_klass
                                                                 NULL, // cp_patches
-                                                                NULL, // parsed_name
                                                                 THREAD);
   if (HAS_PENDING_EXCEPTION) {
     if (DumpSharedSpaces) {
@@ -1597,16 +1646,25 @@
 }
 
 // Complete the ClassPathEntry setup for the boot loader
-void classLoader_init2() {
+void ClassLoader::classLoader_init2(TRAPS) {
+  // Create the moduleEntry for java.base
+  create_javabase();
+
   // Setup the list of module/path pairs for -Xpatch processing
   // This must be done after the SymbolTable is created in order
   // to use fast_compare on module names instead of a string compare.
   if (Arguments::get_xpatchprefix() != NULL) {
-    ClassLoader::setup_xpatch_entries();
+    setup_xpatch_entries();
   }
 
-  // Determine if this is an exploded build
-  ClassLoader::set_has_jimage();
+  // Setup the initial java.base/path pair for the exploded build entries.
+  // As more modules are defined during module system initialization, more
+  // entries will be added to the exploded build array.
+  if (!has_jrt_entry()) {
+    assert(!DumpSharedSpaces, "DumpSharedSpaces not supported with exploded module builds");
+    assert(!UseSharedSpaces, "UsedSharedSpaces not supported with exploded module builds");
+    add_to_exploded_build_list(vmSymbols::java_base(), CHECK);
+  }
 }
 
 
@@ -1654,26 +1712,6 @@
   }
 }
 
-void ClassLoader::set_has_jimage() {
-  // Determine if this is an exploded build. When looking for
-  // the jimage file, only search the piece of the boot
-  // loader's boot class path which contains [exploded build | jimage].
-  // Do not search the boot loader's xpatch entries or append path.
-  ClassPathEntry* e = _first_entry;
-  ClassPathEntry* last_e = _first_append_entry;
-  while ((e != NULL) && (e != last_e)) {
-    JImageFile *jimage = e->jimage();
-    if (jimage != NULL && e->is_jrt()) {
-      _has_jimage = true;
-#if INCLUDE_CDS
-      ClassLoader::initialize_module_loader_map(jimage);
-#endif
-      return;
-    }
-    e = e->next();
-  }
-}
-
 #ifndef PRODUCT
 
 // CompileTheWorld
@@ -1762,14 +1800,19 @@
   HandleMark hm(THREAD);
   ResourceMark rm(THREAD);
 
+  assert(has_jrt_entry(), "Compile The World not supported with exploded module build");
+
   // Find bootstrap loader
   Handle system_class_loader (THREAD, SystemDictionary::java_system_loader());
-  // Iterate over all bootstrap class path entries
-  ClassPathEntry* e = _first_entry;
   jlong start = os::javaTimeMillis();
+
+  // Compile the world for the modular java runtime image
+  _jrt_entry->compile_the_world(system_class_loader, CATCH);
+
+  // Iterate over all bootstrap class path appended entries
+  ClassPathEntry* e = _first_append_entry;
   while (e != NULL) {
-    // We stop at "modules" jimage, unless it is the first bootstrap path entry
-    if (e->is_jrt() && e != _first_entry) break;
+    assert(!e->is_jrt(), "A modular java runtime image is present on the list of appended entries");
     e->compile_the_world(system_class_loader, CATCH);
     e = e->next();
   }
diff --git a/src/share/vm/classfile/classLoader.hpp b/src/share/vm/classfile/classLoader.hpp
index c59697c..045bfab 100644
--- a/src/share/vm/classfile/classLoader.hpp
+++ b/src/share/vm/classfile/classLoader.hpp
@@ -216,33 +216,34 @@
   //  1. the module/path pairs specified to -Xpatch
   //    -Xpatch:<module>=<file>(<pathsep><file>)*
   //  2. the base piece
-  //    [exploded build | jimage]
+  //    [jimage | build with exploded modules]
   //  3. boot loader append path
   //    [-Xbootclasspath/a]; [jvmti appended entries]
   //
   // The boot loader must obey this order when attempting
   // to load a class.
 
-  // Contains the module/path pairs specified to -Xpatch
+  // 1. Contains the module/path pairs specified to -Xpatch
   static GrowableArray<ModuleClassPathList*>* _xpatch_entries;
 
-  // Contains the ClassPathEntry instances that include
-  // both the base piece and the boot loader append path.
-  static ClassPathEntry* _first_entry;
-  // Last entry in linked list of ClassPathEntry instances
-  static ClassPathEntry* _last_entry;
-  static int _num_entries;
+  // 2. the base piece
+  //    Contains the ClassPathEntry of the modular java runtime image.
+  //    If no java runtime image is present, this indicates a
+  //    build with exploded modules is being used instead.
+  static ClassPathEntry* _jrt_entry;
+  static GrowableArray<ModuleClassPathList*>* _exploded_entries;
+  enum { EXPLODED_ENTRY_SIZE = 80 }; // Initial number of exploded modules
 
-  // Marks the start of:
-  //   - the boot loader's append path
-  //     [-Xbootclasspath/a]; [jvmti appended entries]
-  // within the linked list of ClassPathEntry instances.
+  // 3. the boot loader's append path
+  //    [-Xbootclasspath/a]; [jvmti appended entries]
+  //    Note: boot loader append path does not support named modules.
   static ClassPathEntry* _first_append_entry;
+  // Last entry in linked list of appended ClassPathEntry instances
+  static ClassPathEntry* _last_append_entry;
 
-  static const char* _shared_archive;
-
-  // True if the boot path has a "modules" jimage
-  static bool _has_jimage;
+  // Note: _num_entries includes the java runtime image and all
+  //       the entries on the _first_append_entry linked list.
+  static int _num_entries;
 
   // Array of module names associated with the boot class loader
   CDS_ONLY(static GrowableArray<char*>* _boot_modules_array;)
@@ -253,9 +254,14 @@
   // Info used by CDS
   CDS_ONLY(static SharedPathsMiscInfo * _shared_paths_misc_info;)
 
-  // Initialization
+  // Initialization:
+  //   - setup the boot loader's system class path
+  //   - setup the boot loader's xpatch entries, if present
+  //   - create the ModuleEntry for java.base
   static void setup_bootstrap_search_path();
   static void setup_search_path(const char *class_path, bool setting_bootstrap);
+  static void setup_xpatch_entries();
+  static void create_javabase();
 
   static void load_zip_library();
   static void load_jimage_library();
@@ -285,8 +291,6 @@
   static int crc32(int crc, const char* buf, int len);
   static bool update_class_path_entry_list(const char *path,
                                            bool check_for_duplicates,
-                                           bool mark_append_entry,
-                                           bool prepend_entry,
                                            bool is_boot_append,
                                            bool throw_exception=true);
   static void print_bootclasspath();
@@ -352,15 +356,17 @@
     return _load_instance_class_failCounter;
   }
 
-  // Set up the module/path pairs as specified to -Xpatch
-  static void setup_xpatch_entries();
+  // Modular java runtime image is present vs. a build with exploded modules
+  static bool has_jrt_entry() { return (_jrt_entry != NULL); }
+  static ClassPathEntry* get_jrt_entry() { return _jrt_entry; }
 
-  // Sets _has_jimage to TRUE if "modules" jimage file exists
-  static void set_has_jimage();
-  static bool has_jimage() { return _has_jimage; }
+  // Add a module's exploded directory to the boot loader's exploded module build list
+  static void add_to_exploded_build_list(Symbol* module_name, TRAPS);
 
-  // Create the ModuleEntry for java.base
-  static void create_javabase();
+  // Attempt load of individual class from either the xpatch or exploded modules build lists
+  static ClassFileStream* search_module_entries(const GrowableArray<ModuleClassPathList*>* const module_list,
+                                                const char* const class_name,
+                                                const char* const file_name, TRAPS);
 
   // Load individual .class file
   static instanceKlassHandle load_class(Symbol* class_name, bool search_append_only, TRAPS);
@@ -381,17 +387,28 @@
 
   // Initialization
   static void initialize();
+  static void classLoader_init2(TRAPS);
   CDS_ONLY(static void initialize_shared_path();)
 
   static int compute_Object_vtable();
 
   static ClassPathEntry* classpath_entry(int n) {
-    ClassPathEntry* e = ClassLoader::_first_entry;
-    while (--n >= 0) {
-      assert(e != NULL, "Not that many classpath entries.");
-      e = e->next();
+    if (n == 0) {
+      assert(has_jrt_entry(), "No class path entry at 0 for exploded module builds");
+      return ClassLoader::_jrt_entry;
+    } else {
+      // The java runtime image is always the first entry
+      // in the FileMapInfo::_classpath_entry_table. Even though
+      // the _jrt_entry is not included in the _first_append_entry
+      // linked list, it must be accounted for when comparing the
+      // class path vs. the shared archive class path.
+      ClassPathEntry* e = ClassLoader::_first_append_entry;
+      while (--n >= 1) {
+        assert(e != NULL, "Not that many classpath entries.");
+        e = e->next();
+      }
+      return e;
     }
-    return e;
   }
 
 #if INCLUDE_CDS
@@ -429,18 +446,12 @@
   // adds a class path list
   static void add_to_list(ClassPathEntry* new_entry);
 
-  // prepends a class path list
-  static void prepend_to_list(ClassPathEntry* new_entry);
-
   // creates a class path zip entry (returns NULL if JAR file cannot be opened)
   static ClassPathZipEntry* create_class_path_zip_entry(const char *apath, bool is_boot_append);
 
   // add a path to class path list
   static void add_to_list(const char* apath);
 
-  // prepend a path to class path list
-  static void prepend_to_list(const char* apath);
-
   static bool string_ends_with(const char* str, const char* str_to_find);
 
   // obtain package name from a fully qualified class name
diff --git a/src/share/vm/classfile/classLoaderExt.hpp b/src/share/vm/classfile/classLoaderExt.hpp
index 6ce2275..1f0b1b6 100644
--- a/src/share/vm/classfile/classLoaderExt.hpp
+++ b/src/share/vm/classfile/classLoaderExt.hpp
@@ -71,22 +71,11 @@
 
 
   static void add_class_path_entry(const char* path, bool check_for_duplicates,
-                                   ClassPathEntry* new_entry, bool prepend_entry) {
-    if (prepend_entry) {
-      ClassLoader::prepend_to_list(new_entry);
-    } else {
-      ClassLoader::add_to_list(new_entry);
-    }
+                                   ClassPathEntry* new_entry) {
+    ClassLoader::add_to_list(new_entry);
   }
   static void append_boot_classpath(ClassPathEntry* new_entry) {
     ClassLoader::add_to_list(new_entry);
-    // During jvmti live phase an entry can be appended to the boot
-    // loader's ClassPathEntry instances.  Need to mark the start
-    // of the boot loader's append path in case there was no reason
-    // to mark it initially in setup_bootstrap_search_path.
-    if (ClassLoader::_first_append_entry == NULL) {
-      ClassLoader::set_first_append_entry(new_entry);
-    }
   }
   static void setup_search_paths() {}
   static bool is_boot_classpath(int classpath_index) {
diff --git a/src/share/vm/classfile/dictionary.cpp b/src/share/vm/classfile/dictionary.cpp
index c7ea145..56d59d2 100644
--- a/src/share/vm/classfile/dictionary.cpp
+++ b/src/share/vm/classfile/dictionary.cpp
@@ -396,14 +396,15 @@
 DictionaryEntry* Dictionary::get_entry(int index, unsigned int hash,
                                        Symbol* class_name,
                                        ClassLoaderData* loader_data) {
-  debug_only(_lookup_count++);
+  DEBUG_ONLY(_lookup_count++);
   for (DictionaryEntry* entry = bucket(index);
                         entry != NULL;
                         entry = entry->next()) {
     if (entry->hash() == hash && entry->equals(class_name, loader_data)) {
+      DEBUG_ONLY(bucket_count_hit(index));
       return entry;
     }
-    debug_only(_lookup_length++);
+    DEBUG_ONLY(_lookup_length++);
   }
   return NULL;
 }
@@ -596,7 +597,7 @@
   }
   guarantee(number_of_entries() == element_count,
             "Verify of protection domain cache table failed");
-  debug_only(verify_lookup_length((double)number_of_entries() / table_size()));
+  DEBUG_ONLY(verify_lookup_length((double)number_of_entries() / table_size()));
 }
 
 void ProtectionDomainCacheEntry::verify() {
@@ -737,19 +738,65 @@
                    table_size(), number_of_entries());
     tty->print_cr("^ indicates that initiating loader is different from "
                   "defining loader");
+    tty->print_cr("1st number: th bucket index");
+    tty->print_cr("2nd number: the entry's index within this bucket");
+#ifdef ASSERT
+    tty->print_cr("3rd number: the hit percentage of this entry");
+    tty->print_cr("4th number: the hash index of this entry");
+#endif
   }
 
+#ifdef ASSERT
+  // find top buckets with highest lookup count
+  #define TOP_COUNT 16
+  int topItemsIndicies[TOP_COUNT];
+  for (int i = 0; i < TOP_COUNT; i++) {
+    topItemsIndicies[i] = i;
+  }
+  double total = 0.0;
+  for (int i = 0; i < table_size(); i++) {
+    // find the total count number, so later on we can
+    // express bucket lookup count as a percentage of all lookups
+    unsigned value = bucket_hits(i);
+    total += value;
+
+    // find the entry with min value
+    int index = 0;
+    unsigned min = bucket_hits(topItemsIndicies[index]);
+    for (int j = 1; j < TOP_COUNT; j++) {
+      if (bucket_hits(topItemsIndicies[j]) < min) {
+        min = bucket_hits(topItemsIndicies[j]);
+        index = j;
+      }
+    }
+    // if the bucket loookup value is bigger than the current min
+    // move that bucket index into the top list
+    if (value > min) {
+      topItemsIndicies[index] = i;
+    }
+  }
+#endif
+
   for (int index = 0; index < table_size(); index++) {
+#ifdef ASSERT
+    double percentage = 100.0 * (double)bucket_hits(index)/total;
+#endif
+    int chain = 0;
     for (DictionaryEntry* probe = bucket(index);
                           probe != NULL;
                           probe = probe->next()) {
-      if (Verbose) tty->print("%4d: ", index);
       Klass* e = probe->klass();
       ClassLoaderData* loader_data =  probe->loader_data();
       bool is_defining_class =
          (loader_data == e->class_loader_data());
+      if (details) {
+        tty->print("%4d: %3d: ", index, chain);
+#ifdef ASSERT
+        tty->print("%5.2f%%: %10u:", percentage, probe->hash());
+#endif
+      }
       tty->print("%s%s", ((!details) || is_defining_class) ? " " : "^",
-                   e->external_name());
+                 e->external_name());
 
       if (details) {
         tty->print(", loader ");
@@ -760,9 +807,30 @@
         }
       }
       tty->cr();
+
+      chain++;
+    }
+    if (details && (chain == 0)) {
+      tty->print("%4d:", index);
+      tty->cr();
     }
   }
 
+#ifdef ASSERT
+  // print out the TOP_COUNT of buckets with highest lookup count (unsorted)
+  if (details) {
+    tty->cr();
+    tty->print("Top %d buckets:", TOP_COUNT);
+    tty->cr();
+    for (int i = 0; i < TOP_COUNT; i++) {
+      tty->print("%4d: hits %5.2f%%",
+                 topItemsIndicies[i],
+                 100.0*(double)bucket_hits(topItemsIndicies[i])/total);
+      tty->cr();
+    }
+  }
+#endif
+
   if (details) {
     tty->cr();
     _pd_cache_table->print();
@@ -795,7 +863,7 @@
   }
   guarantee(number_of_entries() == element_count,
             "Verify of system dictionary failed");
-  debug_only(verify_lookup_length((double)number_of_entries() / table_size()));
+  DEBUG_ONLY(if (!verify_lookup_length((double)number_of_entries() / table_size())) this->print(true));
 
   _pd_cache_table->verify();
 }
diff --git a/src/share/vm/classfile/javaClasses.cpp b/src/share/vm/classfile/javaClasses.cpp
index d6cdf2e..6df74ae 100644
--- a/src/share/vm/classfile/javaClasses.cpp
+++ b/src/share/vm/classfile/javaClasses.cpp
@@ -3243,15 +3243,6 @@
   mname->address_field_put(_vmindex_offset, (address) index);
 }
 
-bool java_lang_invoke_MemberName::equals(oop mn1, oop mn2) {
-  if (mn1 == mn2) {
-     return true;
-  }
-  return (vmtarget(mn1) == vmtarget(mn2) && flags(mn1) == flags(mn2) &&
-          vmindex(mn1) == vmindex(mn2) &&
-          clazz(mn1) == clazz(mn2));
-}
-
 oop java_lang_invoke_LambdaForm::vmentry(oop lform) {
   assert(is_instance(lform), "wrong type");
   return lform->obj_field(_vmentry_offset);
diff --git a/src/share/vm/classfile/javaClasses.hpp b/src/share/vm/classfile/javaClasses.hpp
index fbf68e6..7d101b8 100644
--- a/src/share/vm/classfile/javaClasses.hpp
+++ b/src/share/vm/classfile/javaClasses.hpp
@@ -777,9 +777,6 @@
     static Handle create(Handle loader, Handle module_name, TRAPS);
 
     // Testers
-    static bool is_subclass(Klass* klass) {
-      return klass->is_subclass_of(SystemDictionary::reflect_Module_klass());
-    }
     static bool is_instance(oop obj);
 
     // Accessors
@@ -1110,8 +1107,6 @@
   static int flags_offset_in_bytes()            { return _flags_offset; }
   static int vmtarget_offset_in_bytes()         { return _vmtarget_offset; }
   static int vmindex_offset_in_bytes()          { return _vmindex_offset; }
-
-  static bool equals(oop mt1, oop mt2);
 };
 
 
diff --git a/src/share/vm/classfile/javaClasses.inline.hpp b/src/share/vm/classfile/javaClasses.inline.hpp
index 180bc5b..b1c4a3f 100644
--- a/src/share/vm/classfile/javaClasses.inline.hpp
+++ b/src/share/vm/classfile/javaClasses.inline.hpp
@@ -168,11 +168,8 @@
   return obj != NULL && is_subclass(obj->klass());
 }
 
-
-
-
 inline bool java_lang_reflect_Module::is_instance(oop obj) {
-  return obj != NULL && is_subclass(obj->klass());
+  return obj != NULL && obj->klass() == SystemDictionary::reflect_Module_klass();
 }
 
 inline int Backtrace::merge_bci_and_version(int bci, int version) {
diff --git a/src/share/vm/classfile/klassFactory.cpp b/src/share/vm/classfile/klassFactory.cpp
index 11b07f6..6eb6ccc 100644
--- a/src/share/vm/classfile/klassFactory.cpp
+++ b/src/share/vm/classfile/klassFactory.cpp
@@ -96,7 +96,6 @@
                                                      Handle protection_domain,
                                                      const Klass* host_klass,
                                                      GrowableArray<Handle>* cp_patches,
-                                                     TempNewSymbol* parsed_name,
                                                      TRAPS) {
 
   assert(stream != NULL, "invariant");
@@ -123,7 +122,6 @@
                          name,
                          loader_data,
                          protection_domain,
-                         parsed_name,
                          host_klass,
                          cp_patches,
                          ClassFileParser::BROADCAST, // publicity level
diff --git a/src/share/vm/classfile/klassFactory.hpp b/src/share/vm/classfile/klassFactory.hpp
index 107c8d3..6783f27 100644
--- a/src/share/vm/classfile/klassFactory.hpp
+++ b/src/share/vm/classfile/klassFactory.hpp
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2015, 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
@@ -74,7 +74,6 @@
                                                 Handle protection_domain,
                                                 const Klass* host_klass,
                                                 GrowableArray<Handle>* cp_patches,
-                                                TempNewSymbol* parsed_name,
                                                 TRAPS);
 };
 
diff --git a/src/share/vm/classfile/modules.cpp b/src/share/vm/classfile/modules.cpp
index d9d086a..8986eb6 100644
--- a/src/share/vm/classfile/modules.cpp
+++ b/src/share/vm/classfile/modules.cpp
@@ -102,7 +102,8 @@
 static ModuleEntry* get_module_entry(jobject module, TRAPS) {
   Handle module_h(THREAD, JNIHandles::resolve(module));
   if (!java_lang_reflect_Module::is_instance(module_h())) {
-    THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(), "Bad module object");
+    THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
+                   "module is not an instance of type java.lang.reflect.Module");
   }
   return java_lang_reflect_Module::module_entry(module_h(), CHECK_NULL);
 }
@@ -133,36 +134,6 @@
   return NULL;
 }
 
-// If using exploded build, append <java.home>/modules/module_name, if it exists,
-// to the system boot class path in order for the boot loader to locate class files.
-static void add_to_exploded_build_list(char *module_name, TRAPS) {
-  assert(!ClassLoader::has_jimage(), "Exploded build not applicable");
-  // java.base is handled by os::set_boot_path
-  assert(strcmp(module_name, "java.base") != 0, "Unexpected java.base module name");
-
-  char file_sep = os::file_separator()[0];
-  size_t module_len = strlen(module_name);
-
-  const char* home = Arguments::get_java_home();
-  size_t len = strlen(home) + module_len + 32;
-  char* path = NEW_C_HEAP_ARRAY(char, len, mtModule);
-  jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name);
-  struct stat st;
-  // See if exploded module path exists
-  if ((os::stat(path, &st) != 0)) {
-    FREE_C_HEAP_ARRAY(char, path);
-    path = NULL;
-  }
-
-  if (path != NULL) {
-    HandleMark hm;
-    Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock());
-    ObjectLocker ol(loader_lock, THREAD);
-    log_info(class, load)("opened: %s", path);
-    ClassLoader::add_to_list(path);
-  }
-}
-
 bool Modules::is_package_defined(Symbol* package, Handle h_loader, TRAPS) {
   PackageEntry* res = get_package_entry_by_name(package, h_loader, CHECK_false);
   return res != NULL;
@@ -297,9 +268,9 @@
     THROW_MSG(vmSymbols::java_lang_NullPointerException(), "Null module object");
   }
   Handle module_handle(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_subclass(module_handle->klass())) {
+  if (!java_lang_reflect_Module::is_instance(module_handle())) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-              "module is not a subclass of java.lang.reflect.Module");
+              "module is not an instance of type java.lang.reflect.Module");
   }
 
   char* module_name = get_module_name(module_handle(), CHECK);
@@ -470,8 +441,8 @@
   // used, prepend <java.home>/modules/modules_name, if it exists, to the system boot class path.
   if (loader == NULL &&
       !Universe::is_module_initialized() &&
-      !ClassLoader::has_jimage()) {
-    add_to_exploded_build_list(module_name, CHECK);
+      !ClassLoader::has_jrt_entry()) {
+    ClassLoader::add_to_exploded_build_list(module_symbol, CHECK);
   }
 }
 
@@ -482,9 +453,9 @@
     THROW_MSG(vmSymbols::java_lang_NullPointerException(), "Null module object");
   }
   Handle module_handle(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_subclass(module_handle->klass())) {
+  if (!java_lang_reflect_Module::is_instance(module_handle())) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-              "module is not a subclass of java.lang.reflect.Module");
+              "module is not an instance of type java.lang.reflect.Module");
   }
 
   // Ensure that this is an unnamed module
@@ -758,7 +729,7 @@
   oop module = java_lang_Class::module(mirror);
 
   assert(module != NULL, "java.lang.Class module field not set");
-  assert(java_lang_reflect_Module::is_subclass(module->klass()), "Module is not a java.lang.reflect.Module");
+  assert(java_lang_reflect_Module::is_instance(module), "module is not an instance of type java.lang.reflect.Module");
 
   if (log_is_enabled(Debug, modules)) {
     ResourceMark rm(THREAD);
diff --git a/src/share/vm/classfile/sharedPathsMiscInfo.hpp b/src/share/vm/classfile/sharedPathsMiscInfo.hpp
index 435630f..77de03b 100644
--- a/src/share/vm/classfile/sharedPathsMiscInfo.hpp
+++ b/src/share/vm/classfile/sharedPathsMiscInfo.hpp
@@ -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
@@ -29,7 +29,7 @@
 #include "runtime/os.hpp"
 
 // During dumping time, when processing class paths, we build up the dump-time
-// classpath. The JAR files that exist are stored in the list ClassLoader::_first_entry.
+// classpath. The JAR files that exist are stored in the list ClassLoader::_first_append_entry.
 // However, we need to store other "misc" information for run-time checking, such as
 //
 // + The values of Arguments::get_sysclasspath() used during dumping.
diff --git a/src/share/vm/classfile/systemDictionary.cpp b/src/share/vm/classfile/systemDictionary.cpp
index b747fae..033980e 100644
--- a/src/share/vm/classfile/systemDictionary.cpp
+++ b/src/share/vm/classfile/systemDictionary.cpp
@@ -70,7 +70,6 @@
 #include "services/threadService.hpp"
 #include "trace/traceMacros.hpp"
 #include "utilities/macros.hpp"
-#include "utilities/stringUtils.hpp"
 #include "utilities/ticks.hpp"
 #if INCLUDE_CDS
 #include "classfile/sharedClassUtil.hpp"
@@ -140,24 +139,6 @@
 }
 
 // ----------------------------------------------------------------------------
-// debugging
-
-#ifdef ASSERT
-
-// return true if class_name contains no '.' (internal format is '/')
-bool SystemDictionary::is_internal_format(Symbol* class_name) {
-  if (class_name != NULL) {
-    ResourceMark rm;
-    char* name = class_name->as_C_string();
-    return strchr(name, '.') == NULL;
-  } else {
-    return true;
-  }
-}
-
-#endif
-
-// ----------------------------------------------------------------------------
 // Parallel class loading check
 
 bool SystemDictionary::is_parallelCapable(Handle class_loader) {
@@ -335,6 +316,10 @@
 // Must be called, even if superclass is null, since this is
 // where the placeholder entry is created which claims this
 // thread is loading this class/classloader.
+// Be careful when modifying this code: once you have run
+// placeholders()->find_and_add(PlaceholderTable::LOAD_SUPER),
+// you need to find_and_remove it before returning.
+// So be careful to not exit with a CHECK_ macro betweeen these calls.
 Klass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
                                                  Symbol* class_name,
                                                  Handle class_loader,
@@ -399,6 +384,7 @@
       }
     }
     if (!throw_circularity_error) {
+      // Be careful not to exit resolve_super
       PlaceholderEntry* newprobe = placeholders()->find_and_add(p_index, p_hash, child_name, loader_data, PlaceholderTable::LOAD_SUPER, class_name, THREAD);
     }
   }
@@ -655,6 +641,24 @@
 #endif // INCLUDE_TRACE
 }
 
+// utility function for class define event
+static void class_define_event(instanceKlassHandle k) {
+#if INCLUDE_TRACE
+  EventClassDefine event(UNTIMED);
+  if (event.should_commit()) {
+    event.set_definedClass(k());
+    oop defining_class_loader = k->class_loader();
+    event.set_definingClassLoader(defining_class_loader != NULL ?
+      defining_class_loader->klass() : (Klass*)NULL);
+    event.commit();
+  }
+#endif // INCLUDE_TRACE
+}
+
+// Be careful when modifying this code: once you have run
+// placeholders()->find_and_add(PlaceholderTable::LOAD_INSTANCE),
+// you need to find_and_remove it before returning.
+// So be careful to not exit with a CHECK_ macro betweeen these calls.
 Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
                                                         Handle class_loader,
                                                         Handle protection_domain,
@@ -1016,8 +1020,9 @@
 }
 
 // Note: this method is much like resolve_from_stream, but
-// updates no supplemental data structures.
-// TODO consolidate the two methods with a helper routine?
+// does not publish the classes via the SystemDictionary.
+// Handles unsafe_DefineAnonymousClass and redefineclasses
+// RedefinedClasses do not add to the class hierarchy
 Klass* SystemDictionary::parse_stream(Symbol* class_name,
                                       Handle class_loader,
                                       Handle protection_domain,
@@ -1054,8 +1059,7 @@
                                                            protection_domain,
                                                            host_klass,
                                                            cp_patches,
-                                                           NULL, // parsed_name
-                                                           THREAD);
+                                                           CHECK_NULL);
 
   if (host_klass != NULL && k.not_null()) {
     // If it's anonymous, initialize it now, since nobody else will.
@@ -1126,8 +1130,6 @@
   // already be present in the SystemDictionary, otherwise we would not
   // throw potential ClassFormatErrors.
   //
-  // Note: "parsed_name" is updated.
-  TempNewSymbol parsed_name = NULL;
 
  instanceKlassHandle k;
 
@@ -1139,9 +1141,7 @@
                                                  CHECK_NULL);
 #endif
 
-  if (k.not_null()) {
-    parsed_name = k->name();
-  } else {
+  if (k.is_null()) {
     if (st->buffer() == NULL) {
       return NULL;
     }
@@ -1151,64 +1151,28 @@
                                          protection_domain,
                                          NULL, // host_klass
                                          NULL, // cp_patches
-                                         &parsed_name,
-                                         THREAD);
+                                         CHECK_NULL);
   }
 
-  const char* pkg = "java/";
-  if (!HAS_PENDING_EXCEPTION &&
-      !class_loader.is_null() &&
-      !SystemDictionary::is_platform_class_loader(class_loader) &&
-      parsed_name != NULL &&
-      !strncmp((const char*)parsed_name->bytes(), pkg, strlen(pkg))) {
-    // It is illegal to define classes in the "java." package from
-    // JVM_DefineClass or jni_DefineClass unless you're the bootclassloader
-    ResourceMark rm(THREAD);
-    TempNewSymbol pkg_name = InstanceKlass::package_from_name(parsed_name, CHECK_NULL);
-    assert(pkg_name != NULL, "Error in parsing package name starting with 'java/'");
-    char* name = pkg_name->as_C_string();
-    StringUtils::replace_no_expand(name, "/", ".");
-    const char* msg_text = "Prohibited package name: ";
-    size_t len = strlen(msg_text) + strlen(name) + 1;
-    char* message = NEW_RESOURCE_ARRAY(char, len);
-    jio_snprintf(message, len, "%s%s", msg_text, name);
-    Exceptions::_throw_msg(THREAD_AND_LOCATION,
-      vmSymbols::java_lang_SecurityException(), message);
-  }
+  assert(k.not_null(), "no klass created");
+  Symbol* h_name = k->name();
+  assert(class_name == NULL || class_name == h_name, "name mismatch");
 
-  if (!HAS_PENDING_EXCEPTION) {
-    assert(parsed_name != NULL, "Sanity");
-    assert(class_name == NULL || class_name == parsed_name, "name mismatch");
-    // Verification prevents us from creating names with dots in them, this
-    // asserts that that's the case.
-    assert(is_internal_format(parsed_name),
-           "external class name format used internally");
-
-    // Add class just loaded
-    // If a class loader supports parallel classloading handle parallel define requests
-    // find_or_define_instance_class may return a different InstanceKlass
-    if (is_parallelCapable(class_loader)) {
-      k = find_or_define_instance_class(class_name, class_loader, k, THREAD);
-    } else {
-      define_instance_class(k, THREAD);
-    }
+  // Add class just loaded
+  // If a class loader supports parallel classloading handle parallel define requests
+  // find_or_define_instance_class may return a different InstanceKlass
+  if (is_parallelCapable(class_loader)) {
+    k = find_or_define_instance_class(h_name, class_loader, k, CHECK_NULL);
+  } else {
+    define_instance_class(k, CHECK_NULL);
   }
 
   // Make sure we have an entry in the SystemDictionary on success
   debug_only( {
-    if (!HAS_PENDING_EXCEPTION) {
-      assert(parsed_name != NULL, "parsed_name is still null?");
-      Symbol*  h_name    = k->name();
-      ClassLoaderData *defining_loader_data = k->class_loader_data();
+    MutexLocker mu(SystemDictionary_lock, THREAD);
 
-      MutexLocker mu(SystemDictionary_lock, THREAD);
-
-      Klass* check = find_class(parsed_name, loader_data);
-      assert(check == k(), "should be present in the dictionary");
-
-      Klass* check2 = find_class(h_name, defining_loader_data);
-      assert(check == check2, "name inconsistancy in SystemDictionary");
-    }
+    Klass* check = find_class(h_name, k->class_loader_data());
+    assert(check == k(), "should be present in the dictionary");
   } );
 
   return k();
@@ -1246,12 +1210,16 @@
 
 instanceKlassHandle SystemDictionary::load_shared_class(
                  Symbol* class_name, Handle class_loader, TRAPS) {
-  instanceKlassHandle ik (THREAD, find_shared_class(class_name));
-  // Make sure we only return the boot class for the NULL classloader.
-  if (ik.not_null() &&
-      ik->is_shared_boot_class() && class_loader.is_null()) {
-    Handle protection_domain;
-    return load_shared_class(ik, class_loader, protection_domain, THREAD);
+  // Don't load shared class when JvmtiExport::should_post_class_file_load_hook()
+  // is enabled since posting CFLH is not supported when loading shared class.
+  if (!JvmtiExport::should_post_class_file_load_hook()) {
+    instanceKlassHandle ik (THREAD, find_shared_class(class_name));
+    // Make sure we only return the boot class for the NULL classloader.
+    if (ik.not_null() &&
+        ik->is_shared_boot_class() && class_loader.is_null()) {
+      Handle protection_domain;
+      return load_shared_class(ik, class_loader, protection_domain, THREAD);
+    }
   }
   return instanceKlassHandle();
 }
@@ -1334,8 +1302,14 @@
 instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
                                                         Handle class_loader,
                                                         Handle protection_domain, TRAPS) {
+  instanceKlassHandle nh = instanceKlassHandle(); // null Handle
+  if (JvmtiExport::should_post_class_file_load_hook()) {
+    // Don't load shared class when JvmtiExport::should_post_class_file_load_hook()
+    // is enabled since posting CFLH is not supported when loading shared class.
+    return nh;
+  }
+
   if (ik.not_null()) {
-    instanceKlassHandle nh = instanceKlassHandle(); // null Handle
     Symbol* class_name = ik->name();
 
     bool visible = is_shared_class_visible(
@@ -1400,6 +1374,8 @@
       Handle lockObject = compute_loader_lock_object(class_loader, THREAD);
       check_loader_lock_contention(lockObject, THREAD);
       ObjectLocker ol(lockObject, THREAD, true);
+      // prohibited package check assumes all classes loaded from archive call
+      // restore_unshareable_info which calls ik->set_package()
       ik->restore_unshareable_info(loader_data, protection_domain, CHECK_(nh));
     }
 
@@ -1665,9 +1641,8 @@
       JvmtiExport::post_class_load((JavaThread *) THREAD, k());
 
   }
-
   TRACE_KLASS_DEFINITION(k, THREAD);
-
+  class_define_event(k);
 }
 
 // Support parallel classloading
@@ -1686,6 +1661,10 @@
 // findClass(), i.e. FindLoadedClass/DefineClassIfAbsent or they
 // potentially waste time reading and parsing the bytestream.
 // Note: VM callers should ensure consistency of k/class_name,class_loader
+// Be careful when modifying this code: once you have run
+// placeholders()->find_and_add(PlaceholderTable::DEFINE_CLASS),
+// you need to find_and_remove it before returning.
+// So be careful to not exit with a CHECK_ macro betweeen these calls.
 instanceKlassHandle SystemDictionary::find_or_define_instance_class(Symbol* class_name, Handle class_loader, instanceKlassHandle k, TRAPS) {
 
   instanceKlassHandle nh = instanceKlassHandle(); // null Handle
@@ -2125,7 +2104,7 @@
 
   // Create the ModuleEntry for java.base.  This call needs to be done here,
   // after vmSymbols::initialize() is called but before any classes are pre-loaded.
-  ClassLoader::create_javabase();
+  ClassLoader::classLoader_init2(CHECK);
 
   // Preload commonly used klasses
   WKID scan = FIRST_WKID;
diff --git a/src/share/vm/classfile/systemDictionary.hpp b/src/share/vm/classfile/systemDictionary.hpp
index 76a0b07..6dd7d20 100644
--- a/src/share/vm/classfile/systemDictionary.hpp
+++ b/src/share/vm/classfile/systemDictionary.hpp
@@ -281,6 +281,7 @@
 
   // Parse new stream. This won't update the system dictionary or
   // class hierarchy, simply parse the stream. Used by JVMTI RedefineClasses.
+  // Also used by Unsafe_DefineAnonymousClass
   static Klass* parse_stream(Symbol* class_name,
                              Handle class_loader,
                              Handle protection_domain,
@@ -413,10 +414,6 @@
   // Verification
   static void verify();
 
-#ifdef ASSERT
-  static bool is_internal_format(Symbol* class_name);
-#endif
-
   // Initialization
   static void initialize(TRAPS);
 
diff --git a/src/share/vm/code/nativeInst.hpp b/src/share/vm/code/nativeInst.hpp
index 7917a64..dd8f7ee 100644
--- a/src/share/vm/code/nativeInst.hpp
+++ b/src/share/vm/code/nativeInst.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 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,23 +25,8 @@
 #ifndef SHARE_VM_CODE_NATIVEINST_HPP
 #define SHARE_VM_CODE_NATIVEINST_HPP
 
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "nativeInst_aarch64.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(nativeInst)
 
 #endif // SHARE_VM_CODE_NATIVEINST_HPP
diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp
index e15e732..d09518c 100644
--- a/src/share/vm/code/nmethod.cpp
+++ b/src/share/vm/code/nmethod.cpp
@@ -51,21 +51,6 @@
 #include "utilities/events.hpp"
 #include "utilities/xmlstream.hpp"
 #include "logging/log.hpp"
-#ifdef TARGET_ARCH_x86
-# include "nativeInst_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "nativeInst_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "nativeInst_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "nativeInst_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "nativeInst_ppc.hpp"
-#endif
 #ifdef SHARK
 #include "shark/sharkCompiler.hpp"
 #endif
diff --git a/src/share/vm/code/relocInfo.hpp b/src/share/vm/code/relocInfo.hpp
index deaa38c..de22f48 100644
--- a/src/share/vm/code/relocInfo.hpp
+++ b/src/share/vm/code/relocInfo.hpp
@@ -27,6 +27,7 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/os.hpp"
+#include "utilities/macros.hpp"
 
 class nmethod;
 class CompiledMethod;
@@ -423,24 +424,7 @@
   static void remove_reloc_info_for_address(RelocIterator *itr, address pc, relocType old_type);
 
   // Machine dependent stuff
-#ifdef TARGET_ARCH_x86
-# include "relocInfo_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "relocInfo_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "relocInfo_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "relocInfo_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "relocInfo_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "relocInfo_aarch64.hpp"
-#endif
+#include CPU_HEADER(relocInfo)
 
  protected:
   // Derived constant, based on format_width which is PD:
diff --git a/src/share/vm/code/vmreg.hpp b/src/share/vm/code/vmreg.hpp
index e6bc343..5ff4656 100644
--- a/src/share/vm/code/vmreg.hpp
+++ b/src/share/vm/code/vmreg.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, 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
@@ -28,6 +28,7 @@
 #include "asm/register.hpp"
 #include "memory/allocation.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/ostream.hpp"
 #ifdef COMPILER2
 #include "opto/adlcVMDeps.hpp"
@@ -139,25 +140,7 @@
 
   static void set_regName();
 
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "vmreg_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(vmreg)
 
 };
 
diff --git a/src/share/vm/code/vmreg.inline.hpp b/src/share/vm/code/vmreg.inline.hpp
index 314e14a..1124e66 100644
--- a/src/share/vm/code/vmreg.inline.hpp
+++ b/src/share/vm/code/vmreg.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 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
@@ -27,23 +27,6 @@
 
 #include "asm/register.hpp"
 #include "code/vmreg.hpp"
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "vmreg_aarch64.inline.hpp"
-#endif
+#include CPU_HEADER_INLINE(vmreg)
 
 #endif // SHARE_VM_CODE_VMREG_INLINE_HPP
diff --git a/src/share/vm/compiler/compileBroker.cpp b/src/share/vm/compiler/compileBroker.cpp
index d49c080..f9768b5 100644
--- a/src/share/vm/compiler/compileBroker.cpp
+++ b/src/share/vm/compiler/compileBroker.cpp
@@ -551,17 +551,6 @@
       } else {
         c1_count = JVMCIHostThreads;
       }
-
-      if (!UseInterpreter || !BackgroundCompilation) {
-        // Force initialization of JVMCI compiler otherwise JVMCI
-        // compilations will not block until JVMCI is initialized
-        ResourceMark rm;
-        TempNewSymbol getCompiler = SymbolTable::new_symbol("getCompiler", CHECK);
-        TempNewSymbol sig = SymbolTable::new_symbol("()Ljdk/vm/ci/runtime/JVMCICompiler;", CHECK);
-        Handle jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK);
-        JavaValue result(T_OBJECT);
-        JavaCalls::call_virtual(&result, jvmciRuntime, HotSpotJVMCIRuntime::klass(), getCompiler, sig, CHECK);
-      }
     }
   }
 #endif // INCLUDE_JVMCI
@@ -1079,6 +1068,12 @@
     return NULL;
   }
 
+#if INCLUDE_JVMCI
+  if (comp->is_jvmci() && !JVMCIRuntime::can_initialize_JVMCI()) {
+    return NULL;
+  }
+#endif
+
   if (osr_bci == InvocationEntryBci) {
     // standard compilation
     CompiledMethod* method_code = method->code();
diff --git a/src/share/vm/compiler/compileTask.cpp b/src/share/vm/compiler/compileTask.cpp
index 9c3ea04..b5af75d 100644
--- a/src/share/vm/compiler/compileTask.cpp
+++ b/src/share/vm/compiler/compileTask.cpp
@@ -186,8 +186,10 @@
 void CompileTask::print_tty() {
   ttyLocker ttyl;  // keep the following output all in one block
   // print compiler name if requested
-  if (CIPrintCompilerName) tty->print("%s:", CompileBroker::compiler_name(comp_level()));
-    print(tty);
+  if (CIPrintCompilerName) {
+    tty->print("%s:", CompileBroker::compiler_name(comp_level()));
+  }
+  print(tty);
 }
 
 // ------------------------------------------------------------------
diff --git a/src/share/vm/compiler/compilerOracle.cpp b/src/share/vm/compiler/compilerOracle.cpp
index 4e5b240..3327dea 100644
--- a/src/share/vm/compiler/compilerOracle.cpp
+++ b/src/share/vm/compiler/compilerOracle.cpp
@@ -819,7 +819,6 @@
 
       if (className == NULL) {
         className = newName;
-        c_match = MethodMatcher::Prefix;
       } else {
         methodName = newName;
       }
@@ -829,26 +828,15 @@
       if (className == NULL) {
         className = "";
         c_match = MethodMatcher::Any;
-      } else {
-        // foo/bar.blah is an exact match on foo/bar, bar.blah is a suffix match on bar
-        if (strchr(className, '/') != NULL) {
-          c_match = MethodMatcher::Exact;
-        } else {
-          c_match = MethodMatcher::Suffix;
-        }
       }
     } else {
       // got foo or foo/bar
       if (className == NULL) {
         ShouldNotReachHere();
       } else {
-        // got foo or foo/bar
-        if (strchr(className, '/') != NULL) {
-          c_match = MethodMatcher::Prefix;
-        } else if (className[0] == '\0') {
+        // missing class name handled as "Any" class match
+        if (className[0] == '\0') {
           c_match = MethodMatcher::Any;
-        } else {
-          c_match = MethodMatcher::Substring;
         }
       }
     }
diff --git a/src/share/vm/compiler/disassembler.cpp b/src/share/vm/compiler/disassembler.cpp
index 8d443b7..4cc15c6 100644
--- a/src/share/vm/compiler/disassembler.cpp
+++ b/src/share/vm/compiler/disassembler.cpp
@@ -35,24 +35,7 @@
 #include "runtime/os.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
-#ifdef TARGET_ARCH_x86
-# include "depChecker_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "depChecker_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "depChecker_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "depChecker_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "depChecker_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "depChecker_aarch64.hpp"
-#endif
+#include CPU_HEADER(depChecker)
 #ifdef SHARK
 #include "shark/sharkEntry.hpp"
 #endif
diff --git a/src/share/vm/compiler/disassembler.hpp b/src/share/vm/compiler/disassembler.hpp
index eca47a7..4755ce7 100644
--- a/src/share/vm/compiler/disassembler.hpp
+++ b/src/share/vm/compiler/disassembler.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -27,6 +27,7 @@
 
 #include "asm/codeBuffer.hpp"
 #include "runtime/globals.hpp"
+#include "utilities/macros.hpp"
 
 class decode_env;
 
@@ -63,25 +64,7 @@
   static bool load_library();
 
   // Machine dependent stuff
-#ifdef TARGET_ARCH_x86
-# include "disassembler_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "disassembler_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "disassembler_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "disassembler_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "disassembler_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "disassembler_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(disassembler)
 
  public:
   static bool can_decode() {
diff --git a/src/share/vm/compiler/oopMap.cpp b/src/share/vm/compiler/oopMap.cpp
index 197324a..378198e 100644
--- a/src/share/vm/compiler/oopMap.cpp
+++ b/src/share/vm/compiler/oopMap.cpp
@@ -273,14 +273,9 @@
 static DoNothingClosure do_nothing;
 
 static void add_derived_oop(oop* base, oop* derived) {
-#ifndef TIERED
+#if !defined(TIERED) && !defined(INCLUDE_JVMCI)
   COMPILER1_PRESENT(ShouldNotReachHere();)
-#if INCLUDE_JVMCI
-  if (UseJVMCICompiler) {
-    ShouldNotReachHere();
-  }
-#endif
-#endif // TIERED
+#endif // !defined(TIERED) && !defined(INCLUDE_JVMCI)
 #if defined(COMPILER2) || INCLUDE_JVMCI
   DerivedPointerTable::add(derived, base);
 #endif // COMPILER2 || INCLUDE_JVMCI
@@ -473,13 +468,8 @@
 #ifndef PRODUCT
 
 bool ImmutableOopMap::has_derived_pointer() const {
-#ifndef TIERED
+#if !defined(TIERED) && !defined(INCLUDE_JVMCI)
   COMPILER1_PRESENT(return false);
-#if INCLUDE_JVMCI
-  if (UseJVMCICompiler) {
-    return false;
-  }
-#endif
 #endif // !TIERED
 #if defined(COMPILER2) || INCLUDE_JVMCI
   OopMapStream oms(this,OopMapValue::derived_oop_value);
diff --git a/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
index 1df96bd..cbbbfbd 100644
--- a/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
+++ b/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
@@ -2888,7 +2888,10 @@
 
       CMSParInitialMarkTask tsk(this, &srs, n_workers);
       initialize_sequential_subtasks_for_young_gen_rescan(n_workers);
-      if (n_workers > 1) {
+      // If the total workers is greater than 1, then multiple workers
+      // may be used at some time and the initialization has been set
+      // such that the single threaded path cannot be used.
+      if (workers->total_workers() > 1) {
         workers->run_task(&tsk);
       } else {
         tsk.work(0);
@@ -3507,7 +3510,7 @@
   uint num_workers = AdaptiveSizePolicy::calc_active_conc_workers(conc_workers()->total_workers(),
                                                                   conc_workers()->active_workers(),
                                                                   Threads::number_of_non_daemon_threads());
-  conc_workers()->set_active_workers(num_workers);
+  num_workers = conc_workers()->update_active_workers(num_workers);
 
   CompactibleFreeListSpace* cms_space  = _cmsGen->cmsSpace();
 
diff --git a/src/share/vm/gc/cms/parNewGeneration.cpp b/src/share/vm/gc/cms/parNewGeneration.cpp
index adf5156..da6b6d6 100644
--- a/src/share/vm/gc/cms/parNewGeneration.cpp
+++ b/src/share/vm/gc/cms/parNewGeneration.cpp
@@ -898,7 +898,7 @@
        AdaptiveSizePolicy::calc_active_workers(workers->total_workers(),
                                                workers->active_workers(),
                                                Threads::number_of_non_daemon_threads());
-  workers->set_active_workers(active_workers);
+  active_workers = workers->update_active_workers(active_workers);
   _old_gen = gch->old_gen();
 
   // If the next generation is too full to accommodate worst-case promotion
@@ -952,7 +952,9 @@
     // separate thread causes wide variance in run times.  We can't help this
     // in the multi-threaded case, but we special-case n=1 here to get
     // repeatable measurements of the 1-thread overhead of the parallel code.
-    if (active_workers > 1) {
+    // Might multiple workers ever be used?  If yes, initialization
+    // has been done such that the single threaded path should not be used.
+    if (workers->total_workers() > 1) {
       workers->run_task(&tsk);
     } else {
       tsk.work(0);
diff --git a/src/share/vm/gc/g1/dirtyCardQueue.cpp b/src/share/vm/gc/g1/dirtyCardQueue.cpp
index f95c29a..b16ccc6 100644
--- a/src/share/vm/gc/g1/dirtyCardQueue.cpp
+++ b/src/share/vm/gc/g1/dirtyCardQueue.cpp
@@ -122,7 +122,7 @@
 
 // Determines how many mutator threads can process the buffers in parallel.
 uint DirtyCardQueueSet::num_par_ids() {
-  return (uint)os::processor_count();
+  return (uint)os::initial_active_processor_count();
 }
 
 void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl,
diff --git a/src/share/vm/gc/g1/g1CollectedHeap.cpp b/src/share/vm/gc/g1/g1CollectedHeap.cpp
index 1369a3e..d84e100 100644
--- a/src/share/vm/gc/g1/g1CollectedHeap.cpp
+++ b/src/share/vm/gc/g1/g1CollectedHeap.cpp
@@ -1331,7 +1331,7 @@
         AdaptiveSizePolicy::calc_active_workers(workers()->total_workers(),
                                                 workers()->active_workers(),
                                                 Threads::number_of_non_daemon_threads());
-      workers()->set_active_workers(n_workers);
+      workers()->update_active_workers(n_workers);
 
       ParRebuildRSTask rebuild_rs_task(this);
       workers()->run_task(&rebuild_rs_task);
@@ -3067,7 +3067,7 @@
     uint active_workers = AdaptiveSizePolicy::calc_active_workers(workers()->total_workers(),
                                                                   workers()->active_workers(),
                                                                   Threads::number_of_non_daemon_threads());
-    workers()->set_active_workers(active_workers);
+    workers()->update_active_workers(active_workers);
 
     TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
     TraceMemoryManagerStats tms(false /* fullGC */, gc_cause());
@@ -4524,7 +4524,8 @@
 
 void G1CollectedHeap::free_region(HeapRegion* hr,
                                   FreeRegionList* free_list,
-                                  bool par,
+                                  bool skip_remset,
+                                  bool skip_hot_card_cache,
                                   bool locked) {
   assert(!hr->is_free(), "the region should not be free");
   assert(!hr->is_empty(), "the region should not be empty");
@@ -4539,20 +4540,20 @@
   // Clear the card counts for this region.
   // Note: we only need to do this if the region is not young
   // (since we don't refine cards in young regions).
-  if (!hr->is_young()) {
+  if (!skip_hot_card_cache && !hr->is_young()) {
     _hot_card_cache->reset_card_counts(hr);
   }
-  hr->hr_clear(par, true /* clear_space */, locked /* locked */);
+  hr->hr_clear(skip_remset, true /* clear_space */, locked /* locked */);
   free_list->add_ordered(hr);
 }
 
 void G1CollectedHeap::free_humongous_region(HeapRegion* hr,
                                             FreeRegionList* free_list,
-                                            bool par) {
+                                            bool skip_remset) {
   assert(hr->is_humongous(), "this is only for humongous regions");
   assert(free_list != NULL, "pre-condition");
   hr->clear_humongous();
-  free_region(hr, free_list, par);
+  free_region(hr, free_list, skip_remset);
 }
 
 void G1CollectedHeap::remove_from_old_sets(const uint old_regions_removed,
@@ -4600,137 +4601,280 @@
   workers()->run_task(&g1_par_scrub_rs_task);
 }
 
-class G1FreeCollectionSetClosure : public HeapRegionClosure {
+class G1FreeCollectionSetTask : public AbstractGangTask {
 private:
+
+  // Closure applied to all regions in the collection set to do work that needs to
+  // be done serially in a single thread.
+  class G1SerialFreeCollectionSetClosure : public HeapRegionClosure {
+  private:
+    EvacuationInfo* _evacuation_info;
+    const size_t* _surviving_young_words;
+
+    // Bytes used in successfully evacuated regions before the evacuation.
+    size_t _before_used_bytes;
+    // Bytes used in unsucessfully evacuated regions before the evacuation
+    size_t _after_used_bytes;
+
+    size_t _bytes_allocated_in_old_since_last_gc;
+
+    size_t _failure_used_words;
+    size_t _failure_waste_words;
+
+    FreeRegionList _local_free_list;
+  public:
+    G1SerialFreeCollectionSetClosure(EvacuationInfo* evacuation_info, const size_t* surviving_young_words) :
+      HeapRegionClosure(),
+      _evacuation_info(evacuation_info),
+      _surviving_young_words(surviving_young_words),
+      _before_used_bytes(0),
+      _after_used_bytes(0),
+      _bytes_allocated_in_old_since_last_gc(0),
+      _failure_used_words(0),
+      _failure_waste_words(0),
+      _local_free_list("Local Region List for CSet Freeing") {
+    }
+
+    virtual bool doHeapRegion(HeapRegion* r) {
+      G1CollectedHeap* g1h = G1CollectedHeap::heap();
+
+      assert(r->in_collection_set(), "Region %u should be in collection set.", r->hrm_index());
+      g1h->clear_in_cset(r);
+
+      if (r->is_young()) {
+        assert(r->young_index_in_cset() != -1 && (uint)r->young_index_in_cset() < g1h->collection_set()->young_region_length(),
+               "Young index %d is wrong for region %u of type %s with %u young regions",
+               r->young_index_in_cset(),
+               r->hrm_index(),
+               r->get_type_str(),
+               g1h->collection_set()->young_region_length());
+        size_t words_survived = _surviving_young_words[r->young_index_in_cset()];
+        r->record_surv_words_in_group(words_survived);
+      }
+
+      if (!r->evacuation_failed()) {
+        assert(r->not_empty(), "Region %u is an empty region in the collection set.", r->hrm_index());
+        _before_used_bytes += r->used();
+        g1h->free_region(r,
+                         &_local_free_list,
+                         true, /* skip_remset */
+                         true, /* skip_hot_card_cache */
+                         true  /* locked */);
+      } else {
+        r->uninstall_surv_rate_group();
+        r->set_young_index_in_cset(-1);
+        r->set_evacuation_failed(false);
+        // When moving a young gen region to old gen, we "allocate" that whole region
+        // there. This is in addition to any already evacuated objects. Notify the
+        // policy about that.
+        // Old gen regions do not cause an additional allocation: both the objects
+        // still in the region and the ones already moved are accounted for elsewhere.
+        if (r->is_young()) {
+          _bytes_allocated_in_old_since_last_gc += HeapRegion::GrainBytes;
+        }
+        // The region is now considered to be old.
+        r->set_old();
+        // Do some allocation statistics accounting. Regions that failed evacuation
+        // are always made old, so there is no need to update anything in the young
+        // gen statistics, but we need to update old gen statistics.
+        size_t used_words = r->marked_bytes() / HeapWordSize;
+
+        _failure_used_words += used_words;
+        _failure_waste_words += HeapRegion::GrainWords - used_words;
+
+        g1h->old_set_add(r);
+        _after_used_bytes += r->used();
+      }
+      return false;
+    }
+
+    void complete_work() {
+      G1CollectedHeap* g1h = G1CollectedHeap::heap();
+
+      _evacuation_info->set_regions_freed(_local_free_list.length());
+      _evacuation_info->increment_collectionset_used_after(_after_used_bytes);
+
+      g1h->prepend_to_freelist(&_local_free_list);
+      g1h->decrement_summary_bytes(_before_used_bytes);
+
+      G1Policy* policy = g1h->g1_policy();
+      policy->add_bytes_allocated_in_old_since_last_gc(_bytes_allocated_in_old_since_last_gc);
+
+      g1h->alloc_buffer_stats(InCSetState::Old)->add_failure_used_and_waste(_failure_used_words, _failure_waste_words);
+    }
+  };
+
+  G1CollectionSet* _collection_set;
+  G1SerialFreeCollectionSetClosure _cl;
   const size_t* _surviving_young_words;
 
-  FreeRegionList _local_free_list;
   size_t _rs_lengths;
-  // Bytes used in successfully evacuated regions before the evacuation.
-  size_t _before_used_bytes;
-  // Bytes used in unsucessfully evacuated regions before the evacuation
-  size_t _after_used_bytes;
 
-  size_t _bytes_allocated_in_old_since_last_gc;
+  volatile jint _serial_work_claim;
 
-  size_t _failure_used_words;
-  size_t _failure_waste_words;
+  struct WorkItem {
+    uint region_idx;
+    bool is_young;
+    bool evacuation_failed;
 
-  double _young_time;
-  double _non_young_time;
-public:
-  G1FreeCollectionSetClosure(const size_t* surviving_young_words) :
-    HeapRegionClosure(),
-    _surviving_young_words(surviving_young_words),
-    _local_free_list("Local Region List for CSet Freeing"),
-    _rs_lengths(0),
-    _before_used_bytes(0),
-    _after_used_bytes(0),
-    _bytes_allocated_in_old_since_last_gc(0),
-    _failure_used_words(0),
-    _failure_waste_words(0),
-    _young_time(0.0),
-    _non_young_time(0.0) {
+    WorkItem(HeapRegion* r) {
+      region_idx = r->hrm_index();
+      is_young = r->is_young();
+      evacuation_failed = r->evacuation_failed();
+    }
+  };
+
+  volatile size_t _parallel_work_claim;
+  size_t _num_work_items;
+  WorkItem* _work_items;
+
+  void do_serial_work() {
+    // Need to grab the lock to be allowed to modify the old region list.
+    MutexLockerEx x(OldSets_lock, Mutex::_no_safepoint_check_flag);
+    _collection_set->iterate(&_cl);
   }
 
-  virtual bool doHeapRegion(HeapRegion* r) {
-    double start_time = os::elapsedTime();
-
-    bool is_young = r->is_young();
-
+  void do_parallel_work_for_region(uint region_idx, bool is_young, bool evacuation_failed) {
     G1CollectedHeap* g1h = G1CollectedHeap::heap();
+
+    HeapRegion* r = g1h->region_at(region_idx);
     assert(!g1h->is_on_master_free_list(r), "sanity");
 
-    _rs_lengths += r->rem_set()->occupied_locked();
+    Atomic::add(r->rem_set()->occupied_locked(), &_rs_lengths);
 
-    assert(r->in_collection_set(), "Region %u should be in collection set.", r->hrm_index());
-    g1h->clear_in_cset(r);
-
-    if (is_young) {
-      int index = r->young_index_in_cset();
-      assert(index != -1, "Young index in collection set must not be -1 for region %u", r->hrm_index());
-      assert((uint) index < g1h->collection_set()->young_region_length(), "invariant");
-      size_t words_survived = _surviving_young_words[index];
-      r->record_surv_words_in_group(words_survived);
-    } else {
-      assert(r->young_index_in_cset() == -1, "Young index for old region %u in collection set must be -1", r->hrm_index());
+    if (!is_young) {
+      g1h->_hot_card_cache->reset_card_counts(r);
     }
 
-    if (!r->evacuation_failed()) {
-      assert(r->not_empty(), "Region %u is an empty region in the collection set.", r->hrm_index());
-      _before_used_bytes += r->used();
-      g1h->free_region(r, &_local_free_list, false /* par */, true /* locked */);
-    } else {
-      r->uninstall_surv_rate_group();
-      r->set_young_index_in_cset(-1);
-      r->set_evacuation_failed(false);
-      // When moving a young gen region to old gen, we "allocate" that whole region
-      // there. This is in addition to any already evacuated objects. Notify the
-      // policy about that.
-      // Old gen regions do not cause an additional allocation: both the objects
-      // still in the region and the ones already moved are accounted for elsewhere.
-      if (is_young) {
-        _bytes_allocated_in_old_since_last_gc += HeapRegion::GrainBytes;
-      }
-      // The region is now considered to be old.
-      r->set_old();
-      // Do some allocation statistics accounting. Regions that failed evacuation
-      // are always made old, so there is no need to update anything in the young
-      // gen statistics, but we need to update old gen statistics.
-      size_t used_words = r->marked_bytes() / HeapWordSize;
-
-      _failure_used_words += used_words;
-      _failure_waste_words += HeapRegion::GrainWords - used_words;
-
-      g1h->old_set_add(r);
-      _after_used_bytes += r->used();
+    if (!evacuation_failed) {
+      r->rem_set()->clear_locked();
     }
-
-    if (is_young) {
-      _young_time += os::elapsedTime() - start_time;
-    } else {
-      _non_young_time += os::elapsedTime() - start_time;
-    }
-    return false;
   }
 
-  FreeRegionList* local_free_list() { return &_local_free_list; }
-  size_t rs_lengths() const { return _rs_lengths; }
-  size_t before_used_bytes() const { return _before_used_bytes; }
-  size_t after_used_bytes() const { return _after_used_bytes; }
+  class G1PrepareFreeCollectionSetClosure : public HeapRegionClosure {
+  private:
+    size_t _cur_idx;
+    WorkItem* _work_items;
+  public:
+    G1PrepareFreeCollectionSetClosure(WorkItem* work_items) : HeapRegionClosure(), _cur_idx(0), _work_items(work_items) { }
 
-  size_t bytes_allocated_in_old_since_last_gc() const { return _bytes_allocated_in_old_since_last_gc; }
+    virtual bool doHeapRegion(HeapRegion* r) {
+      _work_items[_cur_idx++] = WorkItem(r);
+      return false;
+    }
+  };
 
-  size_t failure_used_words() const { return _failure_used_words; }
-  size_t failure_waste_words() const { return _failure_waste_words; }
+  void prepare_work() {
+    G1PrepareFreeCollectionSetClosure cl(_work_items);
+    _collection_set->iterate(&cl);
+  }
 
-  double young_time() const { return _young_time; }
-  double non_young_time() const { return _non_young_time; }
+  void complete_work() {
+    _cl.complete_work();
+
+    G1Policy* policy = G1CollectedHeap::heap()->g1_policy();
+    policy->record_max_rs_lengths(_rs_lengths);
+    policy->cset_regions_freed();
+  }
+public:
+  G1FreeCollectionSetTask(G1CollectionSet* collection_set, EvacuationInfo* evacuation_info, const size_t* surviving_young_words) :
+    AbstractGangTask("G1 Free Collection Set"),
+    _cl(evacuation_info, surviving_young_words),
+    _collection_set(collection_set),
+    _surviving_young_words(surviving_young_words),
+    _serial_work_claim(0),
+    _rs_lengths(0),
+    _parallel_work_claim(0),
+    _num_work_items(collection_set->region_length()),
+    _work_items(NEW_C_HEAP_ARRAY(WorkItem, _num_work_items, mtGC)) {
+    prepare_work();
+  }
+
+  ~G1FreeCollectionSetTask() {
+    complete_work();
+    FREE_C_HEAP_ARRAY(WorkItem, _work_items);
+  }
+
+  // Chunk size for work distribution. The chosen value has been determined experimentally
+  // to be a good tradeoff between overhead and achievable parallelism.
+  static uint chunk_size() { return 32; }
+
+  virtual void work(uint worker_id) {
+    G1GCPhaseTimes* timer = G1CollectedHeap::heap()->g1_policy()->phase_times();
+
+    // Claim serial work.
+    if (_serial_work_claim == 0) {
+      jint value = Atomic::add(1, &_serial_work_claim) - 1;
+      if (value == 0) {
+        double serial_time = os::elapsedTime();
+        do_serial_work();
+        timer->record_serial_free_cset_time_ms((os::elapsedTime() - serial_time) * 1000.0);
+      }
+    }
+
+    // Start parallel work.
+    double young_time = 0.0;
+    bool has_young_time = false;
+    double non_young_time = 0.0;
+    bool has_non_young_time = false;
+
+    while (true) {
+      size_t end = Atomic::add(chunk_size(), &_parallel_work_claim);
+      size_t cur = end - chunk_size();
+
+      if (cur >= _num_work_items) {
+        break;
+      }
+
+      double start_time = os::elapsedTime();
+
+      end = MIN2(end, _num_work_items);
+
+      for (; cur < end; cur++) {
+        bool is_young = _work_items[cur].is_young;
+
+        do_parallel_work_for_region(_work_items[cur].region_idx, is_young, _work_items[cur].evacuation_failed);
+
+        double end_time = os::elapsedTime();
+        double time_taken = end_time - start_time;
+        if (is_young) {
+          young_time += time_taken;
+          has_young_time = true;
+        } else {
+          non_young_time += time_taken;
+          has_non_young_time = true;
+        }
+        start_time = end_time;
+      }
+    }
+
+    if (has_young_time) {
+      timer->record_time_secs(G1GCPhaseTimes::YoungFreeCSet, worker_id, young_time);
+    }
+    if (has_non_young_time) {
+      timer->record_time_secs(G1GCPhaseTimes::NonYoungFreeCSet, worker_id, young_time);
+    }
+  }
 };
 
 void G1CollectedHeap::free_collection_set(G1CollectionSet* collection_set, EvacuationInfo& evacuation_info, const size_t* surviving_young_words) {
   _eden.clear();
 
-  G1FreeCollectionSetClosure cl(surviving_young_words);
-  collection_set_iterate(&cl);
+  double free_cset_start_time = os::elapsedTime();
 
-  evacuation_info.set_regions_freed(cl.local_free_list()->length());
-  evacuation_info.increment_collectionset_used_after(cl.after_used_bytes());
+  {
+    uint const num_chunks = MAX2(_collection_set.region_length() / G1FreeCollectionSetTask::chunk_size(), 1U);
+    uint const num_workers = MIN2(workers()->active_workers(), num_chunks);
 
-  G1Policy* policy = g1_policy();
+    G1FreeCollectionSetTask cl(collection_set, &evacuation_info, surviving_young_words);
 
-  policy->record_max_rs_lengths(cl.rs_lengths());
-  policy->cset_regions_freed();
-
-  prepend_to_freelist(cl.local_free_list());
-  decrement_summary_bytes(cl.before_used_bytes());
-
-  policy->add_bytes_allocated_in_old_since_last_gc(cl.bytes_allocated_in_old_since_last_gc());
-
-  _old_evac_stats.add_failure_used_and_waste(cl.failure_used_words(), cl.failure_waste_words());
-
-  policy->phase_times()->record_young_free_cset_time_ms(cl.young_time() * 1000.0);
-  policy->phase_times()->record_non_young_free_cset_time_ms(cl.non_young_time() * 1000.0);
+    log_debug(gc, ergo)("Running %s using %u workers for collection set length %u",
+                        cl.name(),
+                        num_workers,
+                        _collection_set.region_length());
+    workers()->run_task(&cl, num_workers);
+  }
+  g1_policy()->phase_times()->record_total_free_cset_time_ms((os::elapsedTime() - free_cset_start_time) * 1000.0);
 
   collection_set->clear();
 }
@@ -4825,7 +4969,7 @@
       _freed_bytes += r->used();
       r->set_containing_set(NULL);
       _humongous_regions_removed++;
-      g1h->free_humongous_region(r, _free_region_list, false);
+      g1h->free_humongous_region(r, _free_region_list, false /* skip_remset */ );
       r = next;
     } while (r != NULL);
 
diff --git a/src/share/vm/gc/g1/g1CollectedHeap.hpp b/src/share/vm/gc/g1/g1CollectedHeap.hpp
index 134f388..b477783 100644
--- a/src/share/vm/gc/g1/g1CollectedHeap.hpp
+++ b/src/share/vm/gc/g1/g1CollectedHeap.hpp
@@ -118,6 +118,7 @@
 };
 
 class G1CollectedHeap : public CollectedHeap {
+  friend class G1FreeCollectionSetTask;
   friend class VM_CollectForMetadataAllocation;
   friend class VM_G1CollectForAllocation;
   friend class VM_G1CollectFull;
@@ -642,13 +643,15 @@
   // adding it to the free list that's passed as a parameter (this is
   // usually a local list which will be appended to the master free
   // list later). The used bytes of freed regions are accumulated in
-  // pre_used. If par is true, the region's RSet will not be freed
-  // up. The assumption is that this will be done later.
+  // pre_used. If skip_remset is true, the region's RSet will not be freed
+  // up. If skip_hot_card_cache is true, the region's hot card cache will not
+  // be freed up. The assumption is that this will be done later.
   // The locked parameter indicates if the caller has already taken
   // care of proper synchronization. This may allow some optimizations.
   void free_region(HeapRegion* hr,
                    FreeRegionList* free_list,
-                   bool par,
+                   bool skip_remset,
+                   bool skip_hot_card_cache = false,
                    bool locked = false);
 
   // It dirties the cards that cover the block so that the post
@@ -662,11 +665,11 @@
   // will be added to the free list that's passed as a parameter (this
   // is usually a local list which will be appended to the master free
   // list later). The used bytes of freed regions are accumulated in
-  // pre_used. If par is true, the region's RSet will not be freed
+  // pre_used. If skip_remset is true, the region's RSet will not be freed
   // up. The assumption is that this will be done later.
   void free_humongous_region(HeapRegion* hr,
                              FreeRegionList* free_list,
-                             bool par);
+                             bool skip_remset);
 
   // Facility for allocating in 'archive' regions in high heap memory and
   // recording the allocated ranges. These should all be called from the
diff --git a/src/share/vm/gc/g1/g1ConcurrentMark.cpp b/src/share/vm/gc/g1/g1ConcurrentMark.cpp
index e61175a..454c598 100644
--- a/src/share/vm/gc/g1/g1ConcurrentMark.cpp
+++ b/src/share/vm/gc/g1/g1ConcurrentMark.cpp
@@ -132,109 +132,114 @@
                    heapWordToOffset(mr.end()), false);
 }
 
-G1CMMarkStack::G1CMMarkStack(G1ConcurrentMark* cm) :
-  _base(NULL), _cm(cm)
-{}
+G1CMMarkStack::G1CMMarkStack() :
+  _reserved_space(),
+  _base(NULL),
+  _capacity(0),
+  _saved_index((size_t)AllBits),
+  _should_expand(false) {
+  set_empty();
+}
 
-bool G1CMMarkStack::allocate(size_t capacity) {
-  // allocate a stack of the requisite depth
-  ReservedSpace rs(ReservedSpace::allocation_align_size_up(capacity * sizeof(oop)));
+bool G1CMMarkStack::resize(size_t new_capacity) {
+  assert(is_empty(), "Only resize when stack is empty.");
+  assert(new_capacity <= MarkStackSizeMax,
+         "Trying to resize stack to " SIZE_FORMAT " elements when the maximum is " SIZE_FORMAT, new_capacity, MarkStackSizeMax);
+
+  size_t reservation_size = ReservedSpace::allocation_align_size_up(new_capacity * sizeof(oop));
+
+  ReservedSpace rs(reservation_size);
   if (!rs.is_reserved()) {
-    log_warning(gc)("ConcurrentMark MarkStack allocation failure");
+    log_warning(gc)("Failed to reserve memory for new overflow mark stack with " SIZE_FORMAT " elements and size " SIZE_FORMAT "B.", new_capacity, reservation_size);
     return false;
   }
-  MemTracker::record_virtual_memory_type((address)rs.base(), mtGC);
-  if (!_virtual_space.initialize(rs, rs.size())) {
-    log_warning(gc)("ConcurrentMark MarkStack backing store failure");
-    // Release the virtual memory reserved for the marking stack
+
+  VirtualSpace vs;
+
+  if (!vs.initialize(rs, rs.size())) {
     rs.release();
+    log_warning(gc)("Failed to commit memory for new overflow mark stack of size " SIZE_FORMAT "B.", rs.size());
     return false;
   }
-  assert(_virtual_space.committed_size() == rs.size(),
-         "Didn't reserve backing store for all of G1ConcurrentMark stack?");
-  _base = (oop*) _virtual_space.low();
-  setEmpty();
-  _capacity = (jint) capacity;
-  _saved_index = -1;
+
+  assert(vs.committed_size() == rs.size(), "Failed to commit all of the mark stack.");
+
+  // Release old mapping.
+  _reserved_space.release();
+
+  // Save new mapping for future unmapping.
+  _reserved_space = rs;
+
+  MemTracker::record_virtual_memory_type((address)_reserved_space.base(), mtGC);
+
+  _base = (oop*) vs.low();
+  _capacity = new_capacity;
+  set_empty();
   _should_expand = false;
+
   return true;
 }
 
-void G1CMMarkStack::expand() {
-  // Called, during remark, if we've overflown the marking stack during marking.
-  assert(isEmpty(), "stack should been emptied while handling overflow");
-  assert(_capacity <= (jint) MarkStackSizeMax, "stack bigger than permitted");
-  // Clear expansion flag
-  _should_expand = false;
-  if (_capacity == (jint) MarkStackSizeMax) {
-    log_trace(gc)("(benign) Can't expand marking stack capacity, at max size limit");
-    return;
-  }
-  // Double capacity if possible
-  jint new_capacity = MIN2(_capacity*2, (jint) MarkStackSizeMax);
-  // Do not give up existing stack until we have managed to
-  // get the double capacity that we desired.
-  ReservedSpace rs(ReservedSpace::allocation_align_size_up(new_capacity *
-                                                           sizeof(oop)));
-  if (rs.is_reserved()) {
-    // Release the backing store associated with old stack
-    _virtual_space.release();
-    // Reinitialize virtual space for new stack
-    if (!_virtual_space.initialize(rs, rs.size())) {
-      fatal("Not enough swap for expanded marking stack capacity");
-    }
-    _base = (oop*)(_virtual_space.low());
-    _index = 0;
-    _capacity = new_capacity;
-  } else {
-    // Failed to double capacity, continue;
-    log_trace(gc)("(benign) Failed to expand marking stack capacity from " SIZE_FORMAT "K to " SIZE_FORMAT "K",
-                  _capacity / K, new_capacity / K);
-  }
+bool G1CMMarkStack::allocate(size_t capacity) {
+  return resize(capacity);
 }
 
-void G1CMMarkStack::set_should_expand() {
-  // If we're resetting the marking state because of an
-  // marking stack overflow, record that we should, if
-  // possible, expand the stack.
-  _should_expand = _cm->has_overflown();
+void G1CMMarkStack::expand() {
+  // Clear expansion flag
+  _should_expand = false;
+
+  if (_capacity == MarkStackSizeMax) {
+    log_debug(gc)("Can not expand overflow mark stack further, already at maximum capacity of " SIZE_FORMAT " elements.", _capacity);
+    return;
+  }
+  size_t old_capacity = _capacity;
+  // Double capacity if possible
+  size_t new_capacity = MIN2(old_capacity * 2, MarkStackSizeMax);
+
+  if (resize(new_capacity)) {
+    log_debug(gc)("Expanded marking stack capacity from " SIZE_FORMAT " to " SIZE_FORMAT " elements",
+                  old_capacity, new_capacity);
+  } else {
+    log_warning(gc)("Failed to expand marking stack capacity from " SIZE_FORMAT " to " SIZE_FORMAT " elements",
+                    old_capacity, new_capacity);
+  }
 }
 
 G1CMMarkStack::~G1CMMarkStack() {
   if (_base != NULL) {
     _base = NULL;
-    _virtual_space.release();
+    _reserved_space.release();
   }
 }
 
-void G1CMMarkStack::par_push_arr(oop* ptr_arr, int n) {
+void G1CMMarkStack::par_push_arr(oop* buffer, size_t n) {
   MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
-  jint start = _index;
-  jint next_index = start + n;
+  size_t start = _index;
+  size_t next_index = start + n;
   if (next_index > _capacity) {
     _overflow = true;
     return;
   }
   // Otherwise.
   _index = next_index;
-  for (int i = 0; i < n; i++) {
-    int ind = start + i;
+  for (size_t i = 0; i < n; i++) {
+    size_t ind = start + i;
     assert(ind < _capacity, "By overflow test above.");
-    _base[ind] = ptr_arr[i];
+    _base[ind] = buffer[i];
   }
 }
 
-bool G1CMMarkStack::par_pop_arr(oop* ptr_arr, int max, int* n) {
+bool G1CMMarkStack::par_pop_arr(oop* buffer, size_t max, size_t* n) {
   MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
-  jint index = _index;
+  size_t index = _index;
   if (index == 0) {
     *n = 0;
     return false;
   } else {
-    int k = MIN2(max, index);
-    jint  new_ind = index - k;
-    for (int j = 0; j < k; j++) {
-      ptr_arr[j] = _base[new_ind + j];
+    size_t k = MIN2(max, index);
+    size_t new_ind = index - k;
+    for (size_t j = 0; j < k; j++) {
+      buffer[j] = _base[new_ind + j];
     }
     _index = new_ind;
     *n = k;
@@ -243,20 +248,14 @@
 }
 
 void G1CMMarkStack::note_start_of_gc() {
-  assert(_saved_index == -1,
-         "note_start_of_gc()/end_of_gc() bracketed incorrectly");
+  assert(_saved_index == (size_t)AllBits, "note_start_of_gc()/end_of_gc() calls bracketed incorrectly");
   _saved_index = _index;
 }
 
 void G1CMMarkStack::note_end_of_gc() {
-  // This is intentionally a guarantee, instead of an assert. If we
-  // accidentally add something to the mark stack during GC, it
-  // will be a correctness issue so it's better if we crash. we'll
-  // only check this once per GC anyway, so it won't be a performance
-  // issue in any way.
-  guarantee(_saved_index == _index,
-            "saved index: %d index: %d", _saved_index, _index);
-  _saved_index = -1;
+  guarantee(!stack_modified(), "Saved index " SIZE_FORMAT " must be the same as " SIZE_FORMAT, _saved_index, _index);
+
+  _saved_index = (size_t)AllBits;
 }
 
 G1CMRootRegions::G1CMRootRegions() :
@@ -351,7 +350,7 @@
   _prevMarkBitMap(&_markBitMap1),
   _nextMarkBitMap(&_markBitMap2),
 
-  _markStack(this),
+  _global_mark_stack(),
   // _finger set in set_non_marking_state
 
   _max_worker_id(ParallelGCThreads),
@@ -417,11 +416,10 @@
     double overall_cm_overhead =
       (double) MaxGCPauseMillis * marking_overhead /
       (double) GCPauseIntervalMillis;
-    double cpu_ratio = 1.0 / (double) os::processor_count();
+    double cpu_ratio = 1.0 / os::initial_active_processor_count();
     double marking_thread_num = ceil(overall_cm_overhead / cpu_ratio);
     double marking_task_overhead =
-      overall_cm_overhead / marking_thread_num *
-                                              (double) os::processor_count();
+      overall_cm_overhead / marking_thread_num * os::initial_active_processor_count();
     double sleep_factor =
                        (1.0 - marking_task_overhead) / marking_task_overhead;
 
@@ -485,8 +483,8 @@
     }
   }
 
-  if (!_markStack.allocate(MarkStackSize)) {
-    log_warning(gc)("Failed to allocate CM marking stack");
+  if (!_global_mark_stack.allocate(MarkStackSize)) {
+    vm_exit_during_initialization("Failed to allocate initial concurrent mark overflow mark stack.");
     return;
   }
 
@@ -541,8 +539,8 @@
 
 
 void G1ConcurrentMark::reset_marking_state(bool clear_overflow) {
-  _markStack.set_should_expand();
-  _markStack.setEmpty();        // Also clears the _markStack overflow flag
+  _global_mark_stack.set_should_expand(has_overflown());
+  _global_mark_stack.set_empty();        // Also clears the overflow stack's overflow flag
   if (clear_overflow) {
     clear_has_overflown();
   } else {
@@ -1033,11 +1031,14 @@
   uint active_workers = MAX2(1U, parallel_marking_threads());
   assert(active_workers > 0, "Should have been set");
 
+  // Setting active workers is not guaranteed since fewer
+  // worker threads may currently exist and more may not be
+  // available.
+  active_workers = _parallel_workers->update_active_workers(active_workers);
   // Parallel task terminator is set in "set_concurrency_and_phase()"
   set_concurrency_and_phase(active_workers, true /* concurrent */);
 
   G1CMConcurrentMarkingTask markingTask(this, cmThread());
-  _parallel_workers->set_active_workers(active_workers);
   _parallel_workers->run_task(&markingTask);
   print_stats();
 }
@@ -1076,7 +1077,7 @@
   weakRefsWork(clear_all_soft_refs);
 
   if (has_overflown()) {
-    // Oops.  We overflowed.  Restart concurrent marking.
+    // We overflowed.  Restart concurrent marking.
     _restart_for_overflow = true;
 
     // Verify the heap w.r.t. the previous marking bitmap.
@@ -1109,8 +1110,8 @@
   }
 
   // Expand the marking stack, if we have to and if we can.
-  if (_markStack.should_expand()) {
-    _markStack.expand();
+  if (_global_mark_stack.should_expand()) {
+    _global_mark_stack.expand();
   }
 
   // Statistics
@@ -1160,10 +1161,10 @@
       hr->set_containing_set(NULL);
       if (hr->is_humongous()) {
         _humongous_regions_removed++;
-        _g1->free_humongous_region(hr, _local_cleanup_list, true);
+        _g1->free_humongous_region(hr, _local_cleanup_list, true /* skip_remset */);
       } else {
         _old_regions_removed++;
-        _g1->free_region(hr, _local_cleanup_list, true);
+        _g1->free_region(hr, _local_cleanup_list, true /* skip_remset */);
       }
     } else {
       hr->rem_set()->do_cleanup_work(_hrrs_cleanup_task);
@@ -1637,7 +1638,7 @@
 
     // Set the soft reference policy
     rp->setup_policy(clear_all_soft_refs);
-    assert(_markStack.isEmpty(), "mark stack should be empty");
+    assert(_global_mark_stack.is_empty(), "mark stack should be empty");
 
     // Instances of the 'Keep Alive' and 'Complete GC' closures used
     // in serial reference processing. Note these closures are also
@@ -1692,10 +1693,10 @@
     // oop closures will set the has_overflown flag if we overflow the
     // global marking stack.
 
-    assert(_markStack.overflow() || _markStack.isEmpty(),
+    assert(_global_mark_stack.overflow() || _global_mark_stack.is_empty(),
             "mark stack should be empty (unless it overflowed)");
 
-    if (_markStack.overflow()) {
+    if (_global_mark_stack.overflow()) {
       // This should have been done already when we tried to push an
       // entry on to the global mark stack. But let's do it again.
       set_has_overflown();
@@ -1714,7 +1715,7 @@
     return;
   }
 
-  assert(_markStack.isEmpty(), "Marking should have completed");
+  assert(_global_mark_stack.is_empty(), "Marking should have completed");
 
   // Unload Klasses, String, Symbols, Code Cache, etc.
   if (ClassUnloadingWithConcurrentMark) {
@@ -1967,7 +1968,7 @@
   }
 
   // Verify entries on the global mark stack
-  _markStack.iterate(VerifyNoCSetOops("Stack"));
+  _global_mark_stack.iterate(VerifyNoCSetOops("Stack"));
 
   // Verify entries on the task queues
   for (uint i = 0; i < _max_worker_id; ++i) {
@@ -2366,13 +2367,13 @@
   // local array where we'll store the entries that will be popped
   // from the global stack.
   oop buffer[global_stack_transfer_size];
-  int n;
+  size_t n;
   _cm->mark_stack_pop(buffer, global_stack_transfer_size, &n);
   assert(n <= global_stack_transfer_size,
          "we should not pop more than the given limit");
   if (n > 0) {
     // yes, we did actually pop at least one entry
-    for (int i = 0; i < n; ++i) {
+    for (size_t i = 0; i < n; ++i) {
       bool success = _task_queue->push(buffer[i]);
       // We only call this when the local queue is empty or under a
       // given target limit. So, we do not expect this push to fail.
diff --git a/src/share/vm/gc/g1/g1ConcurrentMark.hpp b/src/share/vm/gc/g1/g1ConcurrentMark.hpp
index 03e3346..0331976 100644
--- a/src/share/vm/gc/g1/g1ConcurrentMark.hpp
+++ b/src/share/vm/gc/g1/g1ConcurrentMark.hpp
@@ -145,53 +145,56 @@
   void clear_range(MemRegion mr);
 };
 
-// Represents a marking stack used by ConcurrentMarking in the G1 collector.
+// Represents the overflow mark stack used by concurrent marking.
+//
+// Stores oops in a huge buffer in virtual memory that is always fully committed.
+// Resizing may only happen during a STW pause when the stack is empty.
 class G1CMMarkStack VALUE_OBJ_CLASS_SPEC {
-  VirtualSpace _virtual_space;   // Underlying backing store for actual stack
-  G1ConcurrentMark* _cm;
-  oop* _base;        // bottom of stack
-  jint _index;       // one more than last occupied index
-  jint _capacity;    // max #elements
-  jint _saved_index; // value of _index saved at start of GC
+  ReservedSpace _reserved_space; // Space currently reserved for the mark stack.
+
+  oop* _base;                    // Bottom address of allocated memory area.
+  size_t _capacity;              // Maximum number of elements.
+  size_t _index;                 // One more than last occupied index.
+
+  size_t _saved_index;           // Value of _index saved at start of GC to detect mark stack modifications during that time.
 
   bool  _overflow;
   bool  _should_expand;
 
+  // Resizes the mark stack to the given new capacity. Releases any previous
+  // memory if successful.
+  bool resize(size_t new_capacity);
+
+  bool stack_modified() const { return _index != _saved_index; }
  public:
-  G1CMMarkStack(G1ConcurrentMark* cm);
+  G1CMMarkStack();
   ~G1CMMarkStack();
 
   bool allocate(size_t capacity);
 
-  // Pushes the first "n" elements of "ptr_arr" on the stack.
-  // Locking impl: concurrency is allowed only with
-  // "par_push_arr" and/or "par_pop_arr" operations, which use the same
-  // locking strategy.
-  void par_push_arr(oop* ptr_arr, int n);
+  // Pushes the first "n" elements of the given buffer on the stack.
+  void par_push_arr(oop* buffer, size_t n);
 
-  // If returns false, the array was empty.  Otherwise, removes up to "max"
-  // elements from the stack, and transfers them to "ptr_arr" in an
-  // unspecified order.  The actual number transferred is given in "n" ("n
-  // == 0" is deliberately redundant with the return value.)  Locking impl:
-  // concurrency is allowed only with "par_push_arr" and/or "par_pop_arr"
-  // operations, which use the same locking strategy.
-  bool par_pop_arr(oop* ptr_arr, int max, int* n);
+  // Moves up to max elements from the stack into the given buffer. Returns
+  // the number of elements pushed, and false if the array has been empty.
+  // Returns true if the buffer contains at least one element.
+  bool par_pop_arr(oop* buffer, size_t max, size_t* n);
 
-  bool isEmpty()    { return _index == 0; }
-  int  maxElems()   { return _capacity; }
+  bool is_empty() const { return _index == 0; }
+  size_t capacity() const  { return _capacity; }
 
-  bool overflow() { return _overflow; }
+  bool overflow() const { return _overflow; }
   void clear_overflow() { _overflow = false; }
 
   bool should_expand() const { return _should_expand; }
-  void set_should_expand();
+  void set_should_expand(bool value) { _should_expand = value; }
 
   // Expand the stack, typically in response to an overflow condition
   void expand();
 
-  int  size() { return _index; }
+  size_t size() const { return _index; }
 
-  void setEmpty()   { _index = 0; clear_overflow(); }
+  void set_empty() { _index = 0; clear_overflow(); }
 
   // Record the current index.
   void note_start_of_gc();
@@ -308,7 +311,7 @@
   G1CMRootRegions         _root_regions;
 
   // For gray objects
-  G1CMMarkStack           _markStack; // Grey objects behind global finger
+  G1CMMarkStack           _global_mark_stack; // Grey objects behind global finger
   HeapWord* volatile      _finger;  // The global finger, region aligned,
                                     // always points to the end of the
                                     // last claimed region
@@ -478,21 +481,21 @@
   // The push and pop operations are used by tasks for transfers
   // between task-local queues and the global mark stack, and use
   // locking for concurrency safety.
-  bool mark_stack_push(oop* arr, int n) {
-    _markStack.par_push_arr(arr, n);
-    if (_markStack.overflow()) {
+  bool mark_stack_push(oop* arr, size_t n) {
+    _global_mark_stack.par_push_arr(arr, n);
+    if (_global_mark_stack.overflow()) {
       set_has_overflown();
       return false;
     }
     return true;
   }
-  void mark_stack_pop(oop* arr, int max, int* n) {
-    _markStack.par_pop_arr(arr, max, n);
+  void mark_stack_pop(oop* arr, size_t max, size_t* n) {
+    _global_mark_stack.par_pop_arr(arr, max, n);
   }
-  size_t mark_stack_size()                { return _markStack.size(); }
-  size_t partial_mark_stack_size_target() { return _markStack.maxElems()/3; }
-  bool mark_stack_overflow()              { return _markStack.overflow(); }
-  bool mark_stack_empty()                 { return _markStack.isEmpty(); }
+  size_t mark_stack_size()                { return _global_mark_stack.size(); }
+  size_t partial_mark_stack_size_target() { return _global_mark_stack.capacity()/3; }
+  bool mark_stack_overflow()              { return _global_mark_stack.overflow(); }
+  bool mark_stack_empty()                 { return _global_mark_stack.is_empty(); }
 
   G1CMRootRegions* root_regions() { return &_root_regions; }
 
@@ -598,12 +601,12 @@
 
   // Notify data structures that a GC has started.
   void note_start_of_gc() {
-    _markStack.note_start_of_gc();
+    _global_mark_stack.note_start_of_gc();
   }
 
   // Notify data structures that a GC is finished.
   void note_end_of_gc() {
-    _markStack.note_end_of_gc();
+    _global_mark_stack.note_end_of_gc();
   }
 
   // Verify that there are no CSet oops on the stacks (taskqueues /
@@ -660,17 +663,17 @@
 class G1CMTask : public TerminatorTerminator {
 private:
   enum PrivateConstants {
-    // the regular clock call is called once the scanned words reaches
+    // The regular clock call is called once the scanned words reaches
     // this limit
     words_scanned_period          = 12*1024,
-    // the regular clock call is called once the number of visited
+    // The regular clock call is called once the number of visited
     // references reaches this limit
     refs_reached_period           = 384,
-    // initial value for the hash seed, used in the work stealing code
+    // Initial value for the hash seed, used in the work stealing code
     init_hash_seed                = 17,
-    // how many entries will be transferred between global stack and
-    // local queues
-    global_stack_transfer_size    = 16
+    // How many entries will be transferred between global stack and
+    // local queues at once.
+    global_stack_transfer_size    = 1024
   };
 
   uint                        _worker_id;
diff --git a/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp b/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
index b0401d3..40336ae 100644
--- a/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
+++ b/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
@@ -91,8 +91,9 @@
 
 template<typename Fn>
 inline void G1CMMarkStack::iterate(Fn fn) {
-  assert(_saved_index == _index, "saved index: %d index: %d", _saved_index, _index);
-  for (int i = 0; i < _index; ++i) {
+  assert_at_safepoint(true);
+  assert(!stack_modified(), "Saved index " SIZE_FORMAT " must be the same as " SIZE_FORMAT, _saved_index, _index);
+  for (size_t i = 0; i < _index; ++i) {
     fn(_base[i]);
   }
 }
diff --git a/src/share/vm/gc/g1/g1DefaultPolicy.cpp b/src/share/vm/gc/g1/g1DefaultPolicy.cpp
index c15a382..454f73b 100644
--- a/src/share/vm/gc/g1/g1DefaultPolicy.cpp
+++ b/src/share/vm/gc/g1/g1DefaultPolicy.cpp
@@ -97,47 +97,64 @@
   phase_times()->note_gc_start();
 }
 
-bool G1DefaultPolicy::predict_will_fit(uint young_length,
-                                       double base_time_ms,
-                                       uint base_free_regions,
-                                       double target_pause_time_ms) const {
-  if (young_length >= base_free_regions) {
-    // end condition 1: not enough space for the young regions
-    return false;
+class G1YoungLengthPredictor VALUE_OBJ_CLASS_SPEC {
+  const bool _during_cm;
+  const double _base_time_ms;
+  const double _base_free_regions;
+  const double _target_pause_time_ms;
+  const G1DefaultPolicy* const _policy;
+
+ public:
+  G1YoungLengthPredictor(bool during_cm,
+                         double base_time_ms,
+                         double base_free_regions,
+                         double target_pause_time_ms,
+                         const G1DefaultPolicy* policy) :
+    _during_cm(during_cm),
+    _base_time_ms(base_time_ms),
+    _base_free_regions(base_free_regions),
+    _target_pause_time_ms(target_pause_time_ms),
+    _policy(policy) {}
+
+  bool will_fit(uint young_length) const {
+    if (young_length >= _base_free_regions) {
+      // end condition 1: not enough space for the young regions
+      return false;
+    }
+
+    const double accum_surv_rate = _policy->accum_yg_surv_rate_pred((int) young_length - 1);
+    const size_t bytes_to_copy =
+                 (size_t) (accum_surv_rate * (double) HeapRegion::GrainBytes);
+    const double copy_time_ms =
+      _policy->analytics()->predict_object_copy_time_ms(bytes_to_copy, _during_cm);
+    const double young_other_time_ms = _policy->analytics()->predict_young_other_time_ms(young_length);
+    const double pause_time_ms = _base_time_ms + copy_time_ms + young_other_time_ms;
+    if (pause_time_ms > _target_pause_time_ms) {
+      // end condition 2: prediction is over the target pause time
+      return false;
+    }
+
+    const size_t free_bytes = (_base_free_regions - young_length) * HeapRegion::GrainBytes;
+
+    // When copying, we will likely need more bytes free than is live in the region.
+    // Add some safety margin to factor in the confidence of our guess, and the
+    // natural expected waste.
+    // (100.0 / G1ConfidencePercent) is a scale factor that expresses the uncertainty
+    // of the calculation: the lower the confidence, the more headroom.
+    // (100 + TargetPLABWastePct) represents the increase in expected bytes during
+    // copying due to anticipated waste in the PLABs.
+    const double safety_factor = (100.0 / G1ConfidencePercent) * (100 + TargetPLABWastePct) / 100.0;
+    const size_t expected_bytes_to_copy = (size_t)(safety_factor * bytes_to_copy);
+
+    if (expected_bytes_to_copy > free_bytes) {
+      // end condition 3: out-of-space
+      return false;
+    }
+
+    // success!
+    return true;
   }
-
-  double accum_surv_rate = accum_yg_surv_rate_pred((int) young_length - 1);
-  size_t bytes_to_copy =
-               (size_t) (accum_surv_rate * (double) HeapRegion::GrainBytes);
-  double copy_time_ms = _analytics->predict_object_copy_time_ms(bytes_to_copy,
-                                                                collector_state()->during_concurrent_mark());
-  double young_other_time_ms = _analytics->predict_young_other_time_ms(young_length);
-  double pause_time_ms = base_time_ms + copy_time_ms + young_other_time_ms;
-  if (pause_time_ms > target_pause_time_ms) {
-    // end condition 2: prediction is over the target pause time
-    return false;
-  }
-
-  size_t free_bytes = (base_free_regions - young_length) * HeapRegion::GrainBytes;
-
-  // When copying, we will likely need more bytes free than is live in the region.
-  // Add some safety margin to factor in the confidence of our guess, and the
-  // natural expected waste.
-  // (100.0 / G1ConfidencePercent) is a scale factor that expresses the uncertainty
-  // of the calculation: the lower the confidence, the more headroom.
-  // (100 + TargetPLABWastePct) represents the increase in expected bytes during
-  // copying due to anticipated waste in the PLABs.
-  double safety_factor = (100.0 / G1ConfidencePercent) * (100 + TargetPLABWastePct) / 100.0;
-  size_t expected_bytes_to_copy = (size_t)(safety_factor * bytes_to_copy);
-
-  if (expected_bytes_to_copy > free_bytes) {
-    // end condition 3: out-of-space
-    return false;
-  }
-
-  // success!
-  return true;
-}
+};
 
 void G1DefaultPolicy::record_new_heap_size(uint new_number_of_regions) {
   // re-calculate the necessary reserve
@@ -279,31 +296,32 @@
   assert(desired_max_length > base_min_length, "invariant");
   uint max_young_length = desired_max_length - base_min_length;
 
-  double target_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0;
-  double survivor_regions_evac_time = predict_survivor_regions_evac_time();
-  size_t pending_cards = _analytics->predict_pending_cards();
-  size_t adj_rs_lengths = rs_lengths + _analytics->predict_rs_length_diff();
-  size_t scanned_cards = _analytics->predict_card_num(adj_rs_lengths, /* gcs_are_young */ true);
-  double base_time_ms =
+  const double target_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0;
+  const double survivor_regions_evac_time = predict_survivor_regions_evac_time();
+  const size_t pending_cards = _analytics->predict_pending_cards();
+  const size_t adj_rs_lengths = rs_lengths + _analytics->predict_rs_length_diff();
+  const size_t scanned_cards = _analytics->predict_card_num(adj_rs_lengths, /* gcs_are_young */ true);
+  const double base_time_ms =
     predict_base_elapsed_time_ms(pending_cards, scanned_cards) +
     survivor_regions_evac_time;
-  uint available_free_regions = _free_regions_at_end_of_collection;
-  uint base_free_regions = 0;
-  if (available_free_regions > _reserve_regions) {
-    base_free_regions = available_free_regions - _reserve_regions;
-  }
+  const uint available_free_regions = _free_regions_at_end_of_collection;
+  const uint base_free_regions =
+    available_free_regions > _reserve_regions ? available_free_regions - _reserve_regions : 0;
 
   // Here, we will make sure that the shortest young length that
   // makes sense fits within the target pause time.
 
-  if (predict_will_fit(min_young_length, base_time_ms,
-                       base_free_regions, target_pause_time_ms)) {
+  G1YoungLengthPredictor p(collector_state()->during_concurrent_mark(),
+                           base_time_ms,
+                           base_free_regions,
+                           target_pause_time_ms,
+                           this);
+  if (p.will_fit(min_young_length)) {
     // The shortest young length will fit into the target pause time;
     // we'll now check whether the absolute maximum number of young
     // regions will fit in the target pause time. If not, we'll do
     // a binary search between min_young_length and max_young_length.
-    if (predict_will_fit(max_young_length, base_time_ms,
-                         base_free_regions, target_pause_time_ms)) {
+    if (p.will_fit(max_young_length)) {
       // The maximum young length will fit into the target pause time.
       // We are done so set min young length to the maximum length (as
       // the result is assumed to be returned in min_young_length).
@@ -328,8 +346,7 @@
       uint diff = (max_young_length - min_young_length) / 2;
       while (diff > 0) {
         uint young_length = min_young_length + diff;
-        if (predict_will_fit(young_length, base_time_ms,
-                             base_free_regions, target_pause_time_ms)) {
+        if (p.will_fit(young_length)) {
           min_young_length = young_length;
         } else {
           max_young_length = young_length;
@@ -344,12 +361,10 @@
       assert(min_young_length < max_young_length,
              "otherwise we should have discovered that max_young_length "
              "fits into the pause target and not done the binary search");
-      assert(predict_will_fit(min_young_length, base_time_ms,
-                              base_free_regions, target_pause_time_ms),
+      assert(p.will_fit(min_young_length),
              "min_young_length, the result of the binary search, should "
              "fit into the pause target");
-      assert(!predict_will_fit(min_young_length + 1, base_time_ms,
-                               base_free_regions, target_pause_time_ms),
+      assert(!p.will_fit(min_young_length + 1),
              "min_young_length, the result of the binary search, should be "
              "optimal, so no larger length should fit into the pause target");
     }
@@ -501,13 +516,12 @@
 
 double G1DefaultPolicy::young_other_time_ms() const {
   return phase_times()->young_cset_choice_time_ms() +
-         phase_times()->young_free_cset_time_ms();
+         phase_times()->average_time_ms(G1GCPhaseTimes::YoungFreeCSet);
 }
 
 double G1DefaultPolicy::non_young_other_time_ms() const {
   return phase_times()->non_young_cset_choice_time_ms() +
-         phase_times()->non_young_free_cset_time_ms();
-
+         phase_times()->average_time_ms(G1GCPhaseTimes::NonYoungFreeCSet);
 }
 
 double G1DefaultPolicy::other_time_ms(double pause_time_ms) const {
@@ -515,7 +529,7 @@
 }
 
 double G1DefaultPolicy::constant_other_time_ms(double pause_time_ms) const {
-  return other_time_ms(pause_time_ms) - young_other_time_ms() - non_young_other_time_ms();
+  return other_time_ms(pause_time_ms) - phase_times()->total_free_cset_time_ms();
 }
 
 CollectionSetChooser* G1DefaultPolicy::cset_chooser() const {
diff --git a/src/share/vm/gc/g1/g1GCPhaseTimes.cpp b/src/share/vm/gc/g1/g1GCPhaseTimes.cpp
index f7e8b1d..a5dac2a 100644
--- a/src/share/vm/gc/g1/g1GCPhaseTimes.cpp
+++ b/src/share/vm/gc/g1/g1GCPhaseTimes.cpp
@@ -91,6 +91,9 @@
   _redirtied_cards = new WorkerDataArray<size_t>(max_gc_threads, "Redirtied Cards:");
   _gc_par_phases[RedirtyCards]->link_thread_work_items(_redirtied_cards);
 
+  _gc_par_phases[YoungFreeCSet] = new WorkerDataArray<double>(max_gc_threads, "Young Free Collection Set (ms):");
+  _gc_par_phases[NonYoungFreeCSet] = new WorkerDataArray<double>(max_gc_threads, "Non-Young Free Collection Set (ms):");
+
   _gc_par_phases[PreserveCMReferents] = new WorkerDataArray<double>(max_gc_threads, "Parallel Preserve CM Refs (ms):");
 }
 
@@ -278,10 +281,11 @@
   info_line_and_account("Clear Card Table", _cur_clear_ct_time_ms);
   info_line_and_account("Expand Heap After Collection", _cur_expand_heap_time_ms);
 
-  double free_cset_time = _recorded_young_free_cset_time_ms + _recorded_non_young_free_cset_time_ms;
-  info_line_and_account("Free Collection Set", free_cset_time);
-  debug_line("Young Free Collection Set", _recorded_young_free_cset_time_ms);
-  debug_line("Non-Young Free Collection Set", _recorded_non_young_free_cset_time_ms);
+  info_line_and_account("Free Collection Set", _recorded_total_free_cset_time_ms);
+  debug_line("Free Collection Set Serial", _recorded_serial_free_cset_time_ms);
+  debug_phase(_gc_par_phases[YoungFreeCSet]);
+  debug_phase(_gc_par_phases[NonYoungFreeCSet]);
+
   info_line_and_account("Merge Per-Thread State", _recorded_merge_pss_time_ms);
 
   info_line("Other", _gc_pause_time_ms - accounted_time_ms);
diff --git a/src/share/vm/gc/g1/g1GCPhaseTimes.hpp b/src/share/vm/gc/g1/g1GCPhaseTimes.hpp
index 88deb79..87fed3f 100644
--- a/src/share/vm/gc/g1/g1GCPhaseTimes.hpp
+++ b/src/share/vm/gc/g1/g1GCPhaseTimes.hpp
@@ -67,6 +67,8 @@
     StringDedupTableFixup,
     RedirtyCards,
     PreserveCMReferents,
+    YoungFreeCSet,
+    NonYoungFreeCSet,
     GCParPhasesSentinel
   };
 
@@ -110,8 +112,9 @@
 
   double _recorded_merge_pss_time_ms;
 
-  double _recorded_young_free_cset_time_ms;
-  double _recorded_non_young_free_cset_time_ms;
+  double _recorded_total_free_cset_time_ms;
+
+  double _recorded_serial_free_cset_time_ms;
 
   double _cur_fast_reclaim_humongous_time_ms;
   double _cur_fast_reclaim_humongous_register_time_ms;
@@ -199,12 +202,12 @@
     _root_region_scan_wait_time_ms = time_ms;
   }
 
-  void record_young_free_cset_time_ms(double time_ms) {
-    _recorded_young_free_cset_time_ms = time_ms;
+  void record_total_free_cset_time_ms(double time_ms) {
+    _recorded_total_free_cset_time_ms = time_ms;
   }
 
-  void record_non_young_free_cset_time_ms(double time_ms) {
-    _recorded_non_young_free_cset_time_ms = time_ms;
+  void record_serial_free_cset_time_ms(double time_ms) {
+    _recorded_serial_free_cset_time_ms = time_ms;
   }
 
   void record_fast_reclaim_humongous_stats(double time_ms, size_t total, size_t candidates) {
@@ -278,18 +281,14 @@
     return _recorded_young_cset_choice_time_ms;
   }
 
-  double young_free_cset_time_ms() {
-    return _recorded_young_free_cset_time_ms;
+  double total_free_cset_time_ms() {
+    return _recorded_total_free_cset_time_ms;
   }
 
   double non_young_cset_choice_time_ms() {
     return _recorded_non_young_cset_choice_time_ms;
   }
 
-  double non_young_free_cset_time_ms() {
-    return _recorded_non_young_free_cset_time_ms;
-  }
-
   double fast_reclaim_humongous_time_ms() {
     return _cur_fast_reclaim_humongous_time_ms;
   }
diff --git a/src/share/vm/gc/g1/g1MarkSweep.cpp b/src/share/vm/gc/g1/g1MarkSweep.cpp
index 80aaad3..3d8866d 100644
--- a/src/share/vm/gc/g1/g1MarkSweep.cpp
+++ b/src/share/vm/gc/g1/g1MarkSweep.cpp
@@ -340,7 +340,7 @@
   hr->set_containing_set(NULL);
   _humongous_regions_removed++;
 
-  _g1h->free_humongous_region(hr, &dummy_free_list, false /* par */);
+  _g1h->free_humongous_region(hr, &dummy_free_list, false /* skip_remset */);
   prepare_for_compaction(hr, end);
   dummy_free_list.remove_all();
 }
diff --git a/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp b/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp
index 46cd63f..7f419bd 100644
--- a/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp
+++ b/src/share/vm/gc/g1/g1PageBasedVirtualSpace.cpp
@@ -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
@@ -26,22 +26,8 @@
 #include "gc/g1/g1PageBasedVirtualSpace.hpp"
 #include "oops/markOop.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/memTracker.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 #include "utilities/bitMap.inline.hpp"
 
 G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size) :
diff --git a/src/share/vm/gc/g1/g1YoungGenSizer.cpp b/src/share/vm/gc/g1/g1YoungGenSizer.cpp
index d06d712..df0c761 100644
--- a/src/share/vm/gc/g1/g1YoungGenSizer.cpp
+++ b/src/share/vm/gc/g1/g1YoungGenSizer.cpp
@@ -45,7 +45,7 @@
                             "A new max generation size of " SIZE_FORMAT "k will be used.",
                             NewSize/K, MaxNewSize/K, NewSize/K);
     }
-    MaxNewSize = NewSize;
+    FLAG_SET_ERGO(size_t, MaxNewSize, NewSize);
   }
 
   if (FLAG_IS_CMDLINE(NewSize)) {
diff --git a/src/share/vm/gc/g1/heapRegion.cpp b/src/share/vm/gc/g1/heapRegion.cpp
index 52ad443..13143a3 100644
--- a/src/share/vm/gc/g1/heapRegion.cpp
+++ b/src/share/vm/gc/g1/heapRegion.cpp
@@ -167,7 +167,7 @@
   init_top_at_mark_start();
 }
 
-void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
+void HeapRegion::hr_clear(bool keep_remset, bool clear_space, bool locked) {
   assert(_humongous_start_region == NULL,
          "we should have already filtered out humongous regions");
   assert(!in_collection_set(),
@@ -179,15 +179,14 @@
   set_free();
   reset_pre_dummy_top();
 
-  if (!par) {
-    // If this is parallel, this will be done later.
-    HeapRegionRemSet* hrrs = rem_set();
+  if (!keep_remset) {
     if (locked) {
-      hrrs->clear_locked();
+      rem_set()->clear_locked();
     } else {
-      hrrs->clear();
+      rem_set()->clear();
     }
   }
+
   zero_marked_bytes();
 
   init_top_at_mark_start();
diff --git a/src/share/vm/gc/g1/heapRegion.hpp b/src/share/vm/gc/g1/heapRegion.hpp
index a020792..f4bf95e 100644
--- a/src/share/vm/gc/g1/heapRegion.hpp
+++ b/src/share/vm/gc/g1/heapRegion.hpp
@@ -512,8 +512,11 @@
 #endif // ASSERT
 
 
-  // Reset HR stuff to default values.
-  void hr_clear(bool par, bool clear_space, bool locked = false);
+  // Reset the HeapRegion to default values.
+  // If skip_remset is true, do not clear the remembered set.
+  void hr_clear(bool skip_remset, bool clear_space, bool locked = false);
+  // Clear the parts skipped by skip_remset in hr_clear() in the HeapRegion during
+  // a concurrent phase.
   void par_clear();
 
   // Get the start of the unmarked area in this region.
diff --git a/src/share/vm/gc/parallel/gcTaskManager.cpp b/src/share/vm/gc/parallel/gcTaskManager.cpp
index 4b47eef..8045027 100644
--- a/src/share/vm/gc/parallel/gcTaskManager.cpp
+++ b/src/share/vm/gc/parallel/gcTaskManager.cpp
@@ -537,7 +537,7 @@
         created_workers() - active_workers() - idle_workers();
       if (more_inactive_workers < 0) {
         int reduced_active_workers = active_workers() + more_inactive_workers;
-        set_active_workers(reduced_active_workers);
+        update_active_workers(reduced_active_workers);
         more_inactive_workers = 0;
       }
       log_trace(gc, task)("JT: %d  workers %d  active  %d  idle %d  more %d",
diff --git a/src/share/vm/gc/parallel/gcTaskManager.hpp b/src/share/vm/gc/parallel/gcTaskManager.hpp
index d05869a..5bc5d4c 100644
--- a/src/share/vm/gc/parallel/gcTaskManager.hpp
+++ b/src/share/vm/gc/parallel/gcTaskManager.hpp
@@ -457,11 +457,12 @@
   uint workers() const {
     return _workers;
   }
-  void set_active_workers(uint v) {
+  uint update_active_workers(uint v) {
     assert(v <= _workers, "Trying to set more workers active than there are");
     _active_workers = MIN2(v, _workers);
     assert(v != 0, "Trying to set active workers to 0");
     _active_workers = MAX2(1U, _active_workers);
+    return _active_workers;
   }
   // Sets the number of threads that will be used in a collection
   void set_active_gang();
diff --git a/src/share/vm/gc/parallel/psScavenge.cpp b/src/share/vm/gc/parallel/psScavenge.cpp
index 82caad3..a80d3ec 100644
--- a/src/share/vm/gc/parallel/psScavenge.cpp
+++ b/src/share/vm/gc/parallel/psScavenge.cpp
@@ -391,11 +391,15 @@
       ParallelTaskTerminator terminator(
         active_workers,
                   (TaskQueueSetSuper*) promotion_manager->stack_array_depth());
-      if (active_workers > 1) {
-        for (uint j = 0; j < active_workers; j++) {
-          q->enqueue(new StealTask(&terminator));
+        // If active_workers can exceed 1, add a StrealTask.
+        // PSPromotionManager::drain_stacks_depth() does not fully drain its
+        // stacks and expects a StealTask to complete the draining if
+        // ParallelGCThreads is > 1.
+        if (gc_task_manager()->workers() > 1) {
+          for (uint j = 0; j < active_workers; j++) {
+            q->enqueue(new StealTask(&terminator));
+          }
         }
-      }
 
       gc_task_manager()->execute_and_wait(q);
     }
diff --git a/src/share/vm/gc/shared/collectorPolicy.cpp b/src/share/vm/gc/shared/collectorPolicy.cpp
index 1cb0597..fd44924 100644
--- a/src/share/vm/gc/shared/collectorPolicy.cpp
+++ b/src/share/vm/gc/shared/collectorPolicy.cpp
@@ -50,7 +50,6 @@
     _initial_heap_byte_size(InitialHeapSize),
     _max_heap_byte_size(MaxHeapSize),
     _min_heap_byte_size(Arguments::min_heap_size()),
-    _max_heap_size_cmdline(false),
     _size_policy(NULL),
     _should_clear_all_soft_refs(false),
     _all_soft_refs_clear(false)
@@ -92,7 +91,6 @@
     if (_min_heap_byte_size != 0 && MaxHeapSize < _min_heap_byte_size) {
       vm_exit_during_initialization("Incompatible minimum and maximum heap sizes specified");
     }
-    _max_heap_size_cmdline = true;
   }
 
   // Check heap parameter properties
@@ -285,7 +283,7 @@
          "heap_alignment: " SIZE_FORMAT " not aligned by gen_alignment: " SIZE_FORMAT,
          _heap_alignment, _gen_alignment);
 
-  // All generational heaps have a youngest gen; handle those flags here
+  // All generational heaps have a young gen; handle those flags here
 
   // Make sure the heap is large enough for two generations
   size_t smallest_new_size = young_gen_size_lower_bound();
@@ -307,7 +305,7 @@
   // Make sure NewSize allows an old generation to fit even if set on the command line
   if (FLAG_IS_CMDLINE(NewSize) && NewSize >= _initial_heap_byte_size) {
     log_warning(gc, ergo)("NewSize was set larger than initial heap size, will use initial heap size.");
-    NewSize = bound_minus_alignment(NewSize, _initial_heap_byte_size);
+    FLAG_SET_ERGO(size_t, NewSize, bound_minus_alignment(NewSize, _initial_heap_byte_size));
   }
 
   // Now take the actual NewSize into account. We will silently increase NewSize
@@ -315,10 +313,7 @@
   size_t bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize);
   bounded_new_size = MAX2(smallest_new_size, (size_t)align_size_down(bounded_new_size, _gen_alignment));
   if (bounded_new_size != NewSize) {
-    // Do not use FLAG_SET_ERGO to update NewSize here, since this will override
-    // if NewSize was set on the command line or not. This information is needed
-    // later when setting the initial and minimum young generation size.
-    NewSize = bounded_new_size;
+    FLAG_SET_ERGO(size_t, NewSize, bounded_new_size);
   }
   _min_young_size = smallest_new_size;
   _initial_young_size = NewSize;
@@ -361,11 +356,11 @@
     vm_exit_during_initialization("Invalid young gen ratio specified");
   }
 
-  OldSize = MAX2(OldSize, old_gen_size_lower_bound());
+  if (OldSize < old_gen_size_lower_bound()) {
+    FLAG_SET_ERGO(size_t, OldSize, old_gen_size_lower_bound());
+  }
   if (!is_size_aligned(OldSize, _gen_alignment)) {
-    // Setting OldSize directly to preserve information about the possible
-    // setting of OldSize on the command line.
-    OldSize = align_size_down(OldSize, _gen_alignment);
+    FLAG_SET_ERGO(size_t, OldSize, align_size_down(OldSize, _gen_alignment));
   }
 
   if (FLAG_IS_CMDLINE(OldSize) && FLAG_IS_DEFAULT(MaxHeapSize)) {
@@ -384,7 +379,7 @@
 
   // Adjust NewSize and OldSize or MaxHeapSize to match each other
   if (NewSize + OldSize > MaxHeapSize) {
-    if (_max_heap_size_cmdline) {
+    if (FLAG_IS_CMDLINE(MaxHeapSize)) {
       // Somebody has set a maximum heap size with the intention that we should not
       // exceed it. Adjust New/OldSize as necessary.
       size_t calculated_size = NewSize + OldSize;
@@ -927,8 +922,23 @@
 
     save_flags();
 
+    // If NewSize has been ergonomically set, the collector policy
+    // should use it for min but calculate the initial young size
+    // using NewRatio.
+    flag_value = 20 * M;
+    set_basic_flag_values();
+    FLAG_SET_ERGO(size_t, NewSize, flag_value);
+    verify_young_min(flag_value);
+
+    set_basic_flag_values();
+    FLAG_SET_ERGO(size_t, NewSize, flag_value);
+    verify_scaled_young_initial(InitialHeapSize);
+
     // If NewSize is set on the command line, it should be used
     // for both min and initial young size if less than min heap.
+    // Note that once a flag has been set with FLAG_SET_CMDLINE it
+    // will be treated as it have been set on the command line for
+    // the rest of the VM lifetime. This is an irreversible change.
     flag_value = 20 * M;
     set_basic_flag_values();
     FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
@@ -945,18 +955,6 @@
     FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
     verify_young_initial(flag_value);
 
-    // If NewSize has been ergonomically set, the collector policy
-    // should use it for min but calculate the initial young size
-    // using NewRatio.
-    flag_value = 20 * M;
-    set_basic_flag_values();
-    FLAG_SET_ERGO(size_t, NewSize, flag_value);
-    verify_young_min(flag_value);
-
-    set_basic_flag_values();
-    FLAG_SET_ERGO(size_t, NewSize, flag_value);
-    verify_scaled_young_initial(InitialHeapSize);
-
     restore_flags();
   }
 
diff --git a/src/share/vm/gc/shared/collectorPolicy.hpp b/src/share/vm/gc/shared/collectorPolicy.hpp
index 8c9b65e..5e8e235 100644
--- a/src/share/vm/gc/shared/collectorPolicy.hpp
+++ b/src/share/vm/gc/shared/collectorPolicy.hpp
@@ -72,10 +72,6 @@
   size_t _space_alignment;
   size_t _heap_alignment;
 
-  // Needed to keep information if MaxHeapSize was set on the command line
-  // when the flag value is aligned etc by ergonomics.
-  bool _max_heap_size_cmdline;
-
   // The sizing of the heap is controlled by a sizing policy.
   AdaptiveSizePolicy* _size_policy;
 
diff --git a/src/share/vm/gc/shared/concurrentGCThread.cpp b/src/share/vm/gc/shared/concurrentGCThread.cpp
index 322931e..df72f04 100644
--- a/src/share/vm/gc/shared/concurrentGCThread.cpp
+++ b/src/share/vm/gc/shared/concurrentGCThread.cpp
@@ -43,7 +43,7 @@
     // unless "aggressive mode" set; priority
     // should be just less than that of VMThread.
     os::set_priority(this, prio);
-    if (!_should_terminate && !DisableStartThread) {
+    if (!_should_terminate) {
       os::start_thread(this);
     }
   }
diff --git a/src/share/vm/gc/shared/gcTraceSend.cpp b/src/share/vm/gc/shared/gcTraceSend.cpp
index db538eb..e51e8fe 100644
--- a/src/share/vm/gc/shared/gcTraceSend.cpp
+++ b/src/share/vm/gc/shared/gcTraceSend.cpp
@@ -278,7 +278,7 @@
     evt.set_gcId(GCId::current());
     evt.set_threshold(threshold);
     evt.set_targetOccupancy(target_occupancy);
-    evt.set_thresholdPercentage(target_occupancy > 0 ? (threshold * 100 / target_occupancy) : 0);
+    evt.set_thresholdPercentage(target_occupancy > 0 ? ((double)threshold / target_occupancy) : 0.0);
     evt.set_currentOccupancy(current_occupancy);
     evt.set_lastAllocationSize(last_allocation_size);
     evt.set_lastAllocationDuration(last_allocation_duration);
@@ -299,7 +299,7 @@
   if (evt.should_commit()) {
     evt.set_gcId(GCId::current());
     evt.set_threshold(threshold);
-    evt.set_thresholdPercentage(internal_target_occupancy > 0 ? (threshold * 100 / internal_target_occupancy) : 0);
+    evt.set_thresholdPercentage(internal_target_occupancy > 0 ? ((double)threshold / internal_target_occupancy) : 0.0);
     evt.set_internalTargetOccupancy(internal_target_occupancy);
     evt.set_currentOccupancy(current_occupancy);
     evt.set_additionalBufferSize(additional_buffer_size);
diff --git a/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp b/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp
index 43deac7..4d7dc2b 100644
--- a/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp
+++ b/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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,9 +25,10 @@
 #ifndef SRC_SHARE_VM_GC_SHARED_MEMSETWITHCONCURRENTREADERS_HPP
 #define SRC_SHARE_VM_GC_SHARED_MEMSETWITHCONCURRENTREADERS_HPP
 
+#include "utilities/macros.hpp"
+
 #include <stddef.h>
 #include <string.h>
-#include "utilities/macros.hpp"
 
 // Only used by concurrent collectors.
 #if INCLUDE_ALL_GCS
@@ -36,7 +37,7 @@
 // understanding that there may be concurrent readers of that memory.
 void memset_with_concurrent_readers(void* to, int value, size_t size);
 
-#ifdef TARGET_ARCH_sparc
+#ifdef SPARC
 
 // SPARC requires special handling.  See SPARC-specific definition.
 
@@ -51,4 +52,4 @@
 
 #endif // INCLUDE_ALL_GCS
 
-#endif // include guard
+#endif // SRC_SHARE_VM_GC_SHARED_MEMSETWITHCONCURRENTREADERS_HPP
diff --git a/src/share/vm/gc/shared/workerManager.hpp b/src/share/vm/gc/shared/workerManager.hpp
index e4ac465..6758c08 100644
--- a/src/share/vm/gc/shared/workerManager.hpp
+++ b/src/share/vm/gc/shared/workerManager.hpp
@@ -55,18 +55,29 @@
     uint start = created_workers;
     uint end = MIN2(active_workers, total_workers);
     for (uint worker_id = start; worker_id < end; worker_id += 1) {
-      WorkerThread* new_worker = holder->install_worker(worker_id);
-      assert(new_worker != NULL, "Failed to allocate GangWorker");
+      WorkerThread* new_worker = NULL;
+      if (initializing || !InjectGCWorkerCreationFailure) {
+        new_worker = holder->install_worker(worker_id);
+      }
       if (new_worker == NULL || !os::create_thread(new_worker, worker_type)) {
-        if (initializing) {
-          vm_exit_out_of_memory(0, OOM_MALLOC_ERROR,
-                  "Cannot create worker GC thread. Out of system resources.");
+        log_trace(gc, task)("WorkerManager::add_workers() : "
+                            "creation failed due to failed allocation of native %s",
+                            new_worker == NULL ?  "memory" : "thread");
+        if (new_worker != NULL) {
+           delete new_worker;
         }
+        if (initializing) {
+          vm_exit_out_of_memory(0, OOM_MALLOC_ERROR, "Cannot create worker GC thread. Out of system resources.");
+        }
+        break;
       }
       created_workers++;
       os::start_thread(new_worker);
     }
 
+    log_trace(gc, task)("WorkerManager::add_workers() : "
+                        "created_workers: %u", created_workers);
+
     return created_workers;
   }
 
diff --git a/src/share/vm/gc/shared/workgroup.cpp b/src/share/vm/gc/shared/workgroup.cpp
index 42334dc..84016fe 100644
--- a/src/share/vm/gc/shared/workgroup.cpp
+++ b/src/share/vm/gc/shared/workgroup.cpp
@@ -274,8 +274,10 @@
             "Trying to execute task %s with %u workers which is more than the amount of total workers %u.",
             task->name(), num_workers, total_workers());
   guarantee(num_workers > 0, "Trying to execute task %s with zero workers", task->name());
-  add_workers(num_workers, false);
+  uint old_num_workers = _active_workers;
+  update_active_workers(num_workers);
   _dispatcher->coordinator_execute_on_workers(task, num_workers);
+  update_active_workers(old_num_workers);
 }
 
 AbstractGangWorker::AbstractGangWorker(AbstractWorkGang* gang, uint id) {
diff --git a/src/share/vm/gc/shared/workgroup.hpp b/src/share/vm/gc/shared/workgroup.hpp
index 1208d42..00eb705 100644
--- a/src/share/vm/gc/shared/workgroup.hpp
+++ b/src/share/vm/gc/shared/workgroup.hpp
@@ -156,15 +156,14 @@
     return _active_workers;
   }
 
-  void set_active_workers(uint v) {
+  uint update_active_workers(uint v) {
     assert(v <= _total_workers,
            "Trying to set more workers active than there are");
     _active_workers = MIN2(v, _total_workers);
     add_workers(false /* exit_on_failure */);
     assert(v != 0, "Trying to set active workers to 0");
-    assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
-           "Unless dynamic should use total workers");
     log_info(gc, task)("GC Workers: using %d out of %d", _active_workers, _total_workers);
+    return _active_workers;
   }
 
   // Add GC workers as needed.
diff --git a/src/share/vm/interpreter/bytecodeInterpreter.hpp b/src/share/vm/interpreter/bytecodeInterpreter.hpp
index 5adbe46..93f22cc 100644
--- a/src/share/vm/interpreter/bytecodeInterpreter.hpp
+++ b/src/share/vm/interpreter/bytecodeInterpreter.hpp
@@ -32,6 +32,7 @@
 #include "runtime/frame.hpp"
 #include "runtime/globals.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 #ifdef CC_INTERP
 
@@ -572,7 +573,7 @@
 void print();
 #endif // PRODUCT
 
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "bytecodeInterpreter_zero.hpp"
 #else
 #error "Only Zero Bytecode Interpreter is supported"
diff --git a/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
index fcc8f5e..6ec8f11 100644
--- a/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
+++ b/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -27,6 +27,7 @@
 
 #include "interpreter/bytecodeInterpreter.hpp"
 #include "runtime/stubRoutines.hpp"
+#include "utilities/macros.hpp"
 
 // This file holds platform-independent bodies of inline functions for the C++ based interpreter
 
@@ -42,7 +43,7 @@
 #define VERIFY_OOP(o)
 #endif
 
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "bytecodeInterpreter_zero.inline.hpp"
 #else
 #error "Only Zero Bytecode Interpreter is supported"
diff --git a/src/share/vm/interpreter/cppInterpreter.hpp b/src/share/vm/interpreter/cppInterpreter.hpp
index 3d90155..98970b5 100644
--- a/src/share/vm/interpreter/cppInterpreter.hpp
+++ b/src/share/vm/interpreter/cppInterpreter.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -26,6 +26,8 @@
 #define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP
 
 #include "interpreter/abstractInterpreter.hpp"
+#include "utilities/macros.hpp"
+
 #ifdef CC_INTERP
 
 class InterpreterCodelet;
@@ -60,7 +62,7 @@
                          address   entry_point,
                          address   osr_buf,
                          TRAPS);
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "cppInterpreter_zero.hpp"
 #endif
 
diff --git a/src/share/vm/interpreter/interp_masm.hpp b/src/share/vm/interpreter/interp_masm.hpp
index dddbbe5..1705e34 100644
--- a/src/share/vm/interpreter/interp_masm.hpp
+++ b/src/share/vm/interpreter/interp_masm.hpp
@@ -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
@@ -26,19 +26,8 @@
 #define SHARE_VM_INTERPRETER_INTERP_MASM_HPP
 
 #include "asm/macroAssembler.hpp"
+#include "utilities/macros.hpp"
 
-#if defined INTERP_MASM_MD_HPP
-# include INTERP_MASM_MD_HPP
-#elif defined TARGET_ARCH_x86
-# include "interp_masm_x86.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "interp_masm_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_zero
-# include "interp_masm_zero.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "interp_masm_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "interp_masm_aarch64.hpp"
-#endif
+#include CPU_HEADER(interp_masm)
 
 #endif // SHARE_VM_INTERPRETER_INTERP_MASM_HPP
diff --git a/src/share/vm/interpreter/interpreterRuntime.hpp b/src/share/vm/interpreter/interpreterRuntime.hpp
index d8ef297..b70ab5e 100644
--- a/src/share/vm/interpreter/interpreterRuntime.hpp
+++ b/src/share/vm/interpreter/interpreterRuntime.hpp
@@ -32,6 +32,7 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/thread.hpp"
+#include "utilities/macros.hpp"
 
 // The InterpreterRuntime is called by the interpreter for everything
 // that cannot/should not be dealt with in assembly and needs C support.
@@ -167,24 +168,7 @@
   static intptr_t trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2) PRODUCT_RETURN0;
 
   // Platform dependent stuff
-#ifdef TARGET_ARCH_x86
-# include "interpreterRT_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "interpreterRT_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "interpreterRT_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "interpreterRT_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "interpreterRT_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "interpreterRT_aarch64.hpp"
-#endif
+#include CPU_HEADER(interpreterRT)
 
   // optional normalization of fingerprints to reduce the number of adapters
   static uint64_t normalize_fast_native_fingerprint(uint64_t fingerprint);
diff --git a/src/share/vm/interpreter/templateInterpreterGenerator.cpp b/src/share/vm/interpreter/templateInterpreterGenerator.cpp
index a2c427f..d57eb46 100644
--- a/src/share/vm/interpreter/templateInterpreterGenerator.cpp
+++ b/src/share/vm/interpreter/templateInterpreterGenerator.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -476,7 +476,7 @@
   case Interpreter::java_lang_Double_doubleToRawLongBits:
     native = true;
     break;
-#endif // defined(TARGET_ARCH_x86) && !defined(_LP64)
+#endif // !IA32
   default:
     fatal("unexpected method kind: %d", kind);
     break;
diff --git a/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/src/share/vm/interpreter/templateInterpreterGenerator.hpp
index 38bad18..6f8972e 100644
--- a/src/share/vm/interpreter/templateInterpreterGenerator.hpp
+++ b/src/share/vm/interpreter/templateInterpreterGenerator.hpp
@@ -101,14 +101,16 @@
   address generate_Double_longBitsToDouble_entry();
   address generate_Double_doubleToRawLongBits_entry();
 #endif // IA32
+  // Some platforms don't need registers, other need two. Unused function is
+  // left unimplemented.
   void generate_stack_overflow_check(void);
+  void generate_stack_overflow_check(Register Rframe_size, Register Rscratch);
 
   void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue);
   void generate_counter_overflow(Label& continue_entry);
 
   void generate_fixed_frame(bool native_call);
 #ifdef SPARC
-  void generate_stack_overflow_check(Register Rframe_size, Register Rscratch);
   void save_native_result(void);
   void restore_native_result(void);
 #endif // SPARC
@@ -119,10 +121,7 @@
 
 #ifdef PPC
   void lock_method(Register Rflags, Register Rscratch1, Register Rscratch2, bool flags_preloaded=false);
-  void unlock_method(bool check_exceptions = true);
-
   void generate_fixed_frame(bool native_call, Register Rsize_of_parameters, Register Rsize_of_locals);
-  void generate_stack_overflow_check(Register Rframe_size, Register Rscratch1);
 #endif // PPC
 
  public:
diff --git a/src/share/vm/interpreter/templateTable.hpp b/src/share/vm/interpreter/templateTable.hpp
index e32b37a..5ffe249 100644
--- a/src/share/vm/interpreter/templateTable.hpp
+++ b/src/share/vm/interpreter/templateTable.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -28,6 +28,7 @@
 #include "interpreter/bytecodes.hpp"
 #include "memory/allocation.hpp"
 #include "runtime/frame.hpp"
+#include "utilities/macros.hpp"
 
 #ifndef CC_INTERP
 // All the necessary definitions used for (bytecode) template generation. Instead of
@@ -349,17 +350,7 @@
   static Template* template_for_wide(Bytecodes::Code code)  { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
 
   // Platform specifics
-#if defined TEMPLATETABLE_MD_HPP
-# include TEMPLATETABLE_MD_HPP
-#elif defined (TARGET_ARCH_MODEL_x86_32) || defined (TARGET_ARCH_MODEL_x86_64)
-# include "templateTable_x86.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "templateTable_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "templateTable_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "templateTable_aarch64.hpp"
-#endif
+#include CPU_HEADER(templateTable)
 
 };
 #endif /* !CC_INTERP */
diff --git a/src/share/vm/jvmci/jvmciCodeInstaller.cpp b/src/share/vm/jvmci/jvmciCodeInstaller.cpp
index 979be2a..6ec47c9 100644
--- a/src/share/vm/jvmci/jvmciCodeInstaller.cpp
+++ b/src/share/vm/jvmci/jvmciCodeInstaller.cpp
@@ -22,38 +22,21 @@
  */
 
 #include "precompiled.hpp"
+#include "asm/register.hpp"
+#include "classfile/vmSymbols.hpp"
 #include "code/compiledIC.hpp"
+#include "code/vmreg.inline.hpp"
 #include "compiler/compileBroker.hpp"
 #include "compiler/disassembler.hpp"
-#include "oops/oop.inline.hpp"
-#include "oops/objArrayOop.inline.hpp"
-#include "runtime/javaCalls.hpp"
 #include "jvmci/jvmciEnv.hpp"
 #include "jvmci/jvmciCompiler.hpp"
 #include "jvmci/jvmciCodeInstaller.hpp"
 #include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciCompilerToVM.hpp"
 #include "jvmci/jvmciRuntime.hpp"
-#include "asm/register.hpp"
-#include "classfile/vmSymbols.hpp"
-#include "code/vmreg.hpp"
-
-#ifdef TARGET_ARCH_x86
-# include "vmreg_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmreg_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmreg_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmreg_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmreg_ppc.inline.hpp"
-#endif
-
+#include "oops/oop.inline.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "runtime/javaCalls.hpp"
 
 // frequently used constants
 // Allocate them with new so they are never destroyed (otherwise, a
@@ -782,7 +765,7 @@
     }
     last_pc_offset = pc_offset;
 
-    if (CodeInstallSafepointChecks && SafepointSynchronize::do_call_back()) {
+    if (SafepointSynchronize::do_call_back()) {
       // this is a hacky way to force a safepoint check but nothing else was jumping out at me.
       ThreadToNativeFromVM ttnfv(JavaThread::current());
     }
diff --git a/src/share/vm/jvmci/jvmciRuntime.cpp b/src/share/vm/jvmci/jvmciRuntime.cpp
index 6bb862e..ce6e8b5 100644
--- a/src/share/vm/jvmci/jvmciRuntime.cpp
+++ b/src/share/vm/jvmci/jvmciRuntime.cpp
@@ -44,6 +44,7 @@
 #include "runtime/sharedRuntime.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/defaultStream.hpp"
+#include "utilities/macros.hpp"
 
 #if defined(_MSC_VER)
 #define strtoll _strtoi64
@@ -612,6 +613,17 @@
   return value;
 JRT_END
 
+void JVMCIRuntime::force_initialization(TRAPS) {
+  JVMCIRuntime::initialize_well_known_classes(CHECK);
+
+  ResourceMark rm;
+  TempNewSymbol getCompiler = SymbolTable::new_symbol("getCompiler", CHECK);
+  TempNewSymbol sig = SymbolTable::new_symbol("()Ljdk/vm/ci/runtime/JVMCICompiler;", CHECK);
+  Handle jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK);
+  JavaValue result(T_OBJECT);
+  JavaCalls::call_virtual(&result, jvmciRuntime, HotSpotJVMCIRuntime::klass(), getCompiler, sig, CHECK);
+}
+
 // private static JVMCIRuntime JVMCI.initializeRuntime()
 JVM_ENTRY(jobject, JVM_GetJVMCIRuntime(JNIEnv *env, jclass c))
   if (!EnableJVMCI) {
@@ -686,8 +698,21 @@
   assert(_HotSpotJVMCIRuntime_initialized == true, "what?");
 }
 
+bool JVMCIRuntime::can_initialize_JVMCI() {
+  // Initializing JVMCI requires the module system to be initialized past phase 3.
+  // The JVMCI API itself isn't available until phase 2 and ServiceLoader (which
+  // JVMCI initialization requires) isn't usable until after phase 3. Testing
+  // whether the system loader is initialized satisfies all these invariants.
+  if (SystemDictionary::java_system_loader() == NULL) {
+    return false;
+  }
+  assert(Universe::is_module_initialized(), "must be");
+  return true;
+}
+
 void JVMCIRuntime::initialize_well_known_classes(TRAPS) {
   if (JVMCIRuntime::_well_known_classes_initialized == false) {
+    guarantee(can_initialize_JVMCI(), "VM is not yet sufficiently booted to initialize JVMCI");
     SystemDictionary::WKID scan = SystemDictionary::FIRST_JVMCI_WKID;
     SystemDictionary::initialize_wk_klasses_through(SystemDictionary::LAST_JVMCI_WKID, scan, CHECK);
     JVMCIJavaClasses::compute_offsets(CHECK);
@@ -770,14 +795,14 @@
   }
 
 #ifdef _LP64
-#ifndef TARGET_ARCH_sparc
+#ifndef SPARC
   uintptr_t heap_end = (uintptr_t) Universe::heap()->reserved_region().end();
   uintptr_t allocation_end = heap_end + ((uintptr_t)16) * 1024 * 1024 * 1024;
   guarantee(heap_end < allocation_end, "heap end too close to end of address space (might lead to erroneous TLAB allocations)");
-#endif // TARGET_ARCH_sparc
+#endif // !SPARC
 #else
   fatal("check TLAB allocation code for address space conflicts");
-#endif
+#endif // _LP64
 
   JVMCIRuntime::initialize_well_known_classes(CHECK);
 
diff --git a/src/share/vm/jvmci/jvmciRuntime.hpp b/src/share/vm/jvmci/jvmciRuntime.hpp
index bf7b59e..0aa9bca 100644
--- a/src/share/vm/jvmci/jvmciRuntime.hpp
+++ b/src/share/vm/jvmci/jvmciRuntime.hpp
@@ -87,6 +87,11 @@
   static Handle callStatic(const char* className, const char* methodName, const char* returnType, JavaCallArguments* args, TRAPS);
 
   /**
+   * Determines if the VM is sufficiently booted to initialize JVMCI.
+   */
+  static bool can_initialize_JVMCI();
+
+  /**
    * Trigger initialization of HotSpotJVMCIRuntime through JVMCI.getRuntime()
    */
   static void initialize_JVMCI(TRAPS);
@@ -157,6 +162,9 @@
   static void throw_klass_external_name_exception(JavaThread* thread, const char* exception, Klass* klass);
   static void throw_class_cast_exception(JavaThread* thread, const char* exception, Klass* caster_klass, Klass* target_klass);
 
+  // Forces initialization of the JVMCI runtime.
+  static void force_initialization(TRAPS);
+
   // Test only function
   static int test_deoptimize_call_int(JavaThread* thread, int value);
 };
diff --git a/src/share/vm/jvmci/jvmci_globals.cpp b/src/share/vm/jvmci/jvmci_globals.cpp
index 12dd0c1..7308935 100644
--- a/src/share/vm/jvmci/jvmci_globals.cpp
+++ b/src/share/vm/jvmci/jvmci_globals.cpp
@@ -39,196 +39,65 @@
             IGNORE_CONSTRAINT, \
             IGNORE_WRITEABLE)
 
-#define JVMCI_IGNORE_FLAG_FOUR_PARAM(type, name, value, doc)
-#define JVMCI_IGNORE_FLAG_THREE_PARAM(type, name, doc)
-
 // Return true if jvmci flags are consistent.
 bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
-  if (EnableJVMCI) {
-    return true;
-  }
-
-  // "FLAG_IS_DEFAULT" fail count.
-  int fail_count = 0;
-  // Number of "FLAG_IS_DEFAULT" fails that should be skipped before code
-  // detect real consistency failure.
-  int skip_fail_count;
-
-  // EnableJVMCI flag is false here.
-  // If any other flag is changed, consistency check should fail.
-  // JVMCI_FLAGS macros added below can handle all JVMCI flags automatically.
-  // But it contains check for EnableJVMCI flag too, which is required to be
-  // skipped. This can't be handled easily!
-  // So the code looks for at-least two flag changes to detect consistency
-  // failure when EnableJVMCI flag is changed.
-  // Otherwise one flag change is sufficient to detect consistency failure.
-  // Set skip_fail_count to 0 if EnableJVMCI flag is default.
-  // Set skip_fail_count to 1 if EnableJVMCI flag is changed.
-  // This value will be used to skip fails in macro expanded code later.
-  if (!FLAG_IS_DEFAULT(EnableJVMCI)) {
-    skip_fail_count = 1;
-  } else {
-    skip_fail_count = 0;
-  }
-
-#define EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(FLAG)  \
-  if (!FLAG_IS_DEFAULT(FLAG)) {                   \
-    fail_count++;                                 \
-    if (fail_count > skip_fail_count) {           \
-      return false;                               \
-    }                                             \
-  }
-
-#define JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, value, doc)     EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
-#define JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, value, doc)   EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
-
-  // Check consistency of diagnostic flags if UnlockDiagnosticVMOptions is true
-  // or not default. UnlockDiagnosticVMOptions is default true in debug builds.
-  if (UnlockDiagnosticVMOptions || !FLAG_IS_DEFAULT(UnlockDiagnosticVMOptions)) {
-    JVMCI_FLAGS(JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECK_CODE, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                IGNORE_RANGE, \
-                IGNORE_CONSTRAINT, \
-                IGNORE_WRITEABLE)
-  }
-
-  // Check consistency of experimental flags if UnlockExperimentalVMOptions is
-  // true or not default.
-  if (UnlockExperimentalVMOptions || !FLAG_IS_DEFAULT(UnlockExperimentalVMOptions)) {
-    JVMCI_FLAGS(JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECK_CODE, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                IGNORE_RANGE, \
-                IGNORE_CONSTRAINT, \
-                IGNORE_WRITEABLE)
-  }
 
 #ifndef PRODUCT
-#define JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, value, doc)        EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
-#define JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, doc)            EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
-#define JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, value, doc)     EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+#define APPLY_JVMCI_FLAGS(params3, params4) \
+  JVMCI_FLAGS(params4, params3, params4, params3, params4, params3, params4, params4, IGNORE_RANGE, IGNORE_CONSTRAINT, IGNORE_WRITEABLE)
+#define JVMCI_DECLARE_CHECK4(type, name, value, doc) bool name##checked = false;
+#define JVMCI_DECLARE_CHECK3(type, name, doc)        bool name##checked = false;
+#define JVMCI_FLAG_CHECKED(name)                          name##checked = true;
+  APPLY_JVMCI_FLAGS(JVMCI_DECLARE_CHECK3, JVMCI_DECLARE_CHECK4)
 #else
-#define JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, value, doc)
-#define JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, doc)
-#define JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, value, doc)
+#define JVMCI_FLAG_CHECKED(name)
 #endif
 
-#define JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, doc)            EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
-#define JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE(type, name, value, doc)        EMIT_FLAG_VALUE_CHANGED_CHECK_CODE(name)
+  // Checks that a given flag is not set if a given guard flag is false.
+#define CHECK_NOT_SET(FLAG, GUARD)                     \
+  JVMCI_FLAG_CHECKED(FLAG)                             \
+  if (!GUARD && !FLAG_IS_DEFAULT(FLAG)) {              \
+    jio_fprintf(defaultStream::error_stream(),         \
+        "Improperly specified VM option '%s': '%s' must be enabled\n", #FLAG, #GUARD); \
+    return false;                                      \
+  }
 
-  JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECK_CODE, \
-              JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECK_CODE, \
-              JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE, \
-              JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE, \
-              JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-              JVMCI_IGNORE_FLAG_THREE_PARAM, \
-              JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-              JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE, \
-              IGNORE_RANGE, \
-              IGNORE_CONSTRAINT, \
-              IGNORE_WRITEABLE)
+  JVMCI_FLAG_CHECKED(UseJVMCICompiler)
+  JVMCI_FLAG_CHECKED(EnableJVMCI)
 
-#undef EMIT_FLAG_VALUE_CHANGED_CHECK_CODE
-#undef JVMCI_DEVELOP_FLAG_VALUE_CHANGED_CHECK_CODE
-#undef JVMCI_PD_DEVELOP_FLAG_VALUE_CHANGED_CHECK_CODE
-#undef JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE
-#undef JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECK_CODE
-#undef JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE
-#undef JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE
-#undef JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECK_CODE
+  CHECK_NOT_SET(BootstrapJVMCI,   UseJVMCICompiler)
+  CHECK_NOT_SET(PrintBootstrap,   UseJVMCICompiler)
+  CHECK_NOT_SET(JVMCIThreads,     UseJVMCICompiler)
+  CHECK_NOT_SET(JVMCIHostThreads, UseJVMCICompiler)
 
+  if (UseJVMCICompiler) {
+    if (!FLAG_IS_DEFAULT(EnableJVMCI) && !EnableJVMCI) {
+      jio_fprintf(defaultStream::error_stream(),
+          "Improperly specified VM option UseJVMCICompiler: EnableJVMCI cannot be disabled\n");
+      return false;
+    }
+    FLAG_SET_DEFAULT(EnableJVMCI, true);
+  }
+
+  CHECK_NOT_SET(JVMCITraceLevel,              EnableJVMCI)
+  CHECK_NOT_SET(JVMCICounterSize,             EnableJVMCI)
+  CHECK_NOT_SET(JVMCICountersExcludeCompiler, EnableJVMCI)
+  CHECK_NOT_SET(JVMCIUseFastLocking,          EnableJVMCI)
+  CHECK_NOT_SET(JVMCINMethodSizeLimit,        EnableJVMCI)
+  CHECK_NOT_SET(TraceUncollectedSpeculations, EnableJVMCI)
+
+#ifndef PRODUCT
+#define JVMCI_CHECK4(type, name, value, doc) assert(name##checked, #name " flag not checked");
+#define JVMCI_CHECK3(type, name, doc)        assert(name##checked, #name " flag not checked");
+  // Ensures that all JVMCI flags are checked by this method.
+  APPLY_JVMCI_FLAGS(JVMCI_CHECK3, JVMCI_CHECK4)
+#undef APPLY_JVMCI_FLAGS
+#undef JVMCI_DECLARE_CHECK3
+#undef JVMCI_DECLARE_CHECK4
+#undef JVMCI_CHECK3
+#undef JVMCI_CHECK4
+#undef JVMCI_FLAG_CHECKED
+#endif
+#undef CHECK_NOT_SET
   return true;
 }
-
-// Print jvmci arguments inconsistency error message.
-void JVMCIGlobals::print_jvmci_args_inconsistency_error_message() {
-  const char* error_msg = "Improperly specified VM option '%s'\n";
-  jio_fprintf(defaultStream::error_stream(), "EnableJVMCI must be enabled\n");
-
-#define EMIT_CHECK_PRINT_ERR_MSG_CODE(FLAG)                         \
-  if (!FLAG_IS_DEFAULT(FLAG)) {                                     \
-    if (strcmp(#FLAG, "EnableJVMCI")) {                             \
-      jio_fprintf(defaultStream::error_stream(), error_msg, #FLAG); \
-    }                                                               \
-  }
-
-#define JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, value, doc)     EMIT_CHECK_PRINT_ERR_MSG_CODE(name)
-#define JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, value, doc)   EMIT_CHECK_PRINT_ERR_MSG_CODE(name)
-
-  if (UnlockDiagnosticVMOptions || !FLAG_IS_DEFAULT(UnlockDiagnosticVMOptions)) {
-    JVMCI_FLAGS(JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                IGNORE_RANGE, \
-                IGNORE_CONSTRAINT, \
-                IGNORE_WRITEABLE)
-  }
-
-  if (UnlockExperimentalVMOptions || !FLAG_IS_DEFAULT(UnlockExperimentalVMOptions)) {
-    JVMCI_FLAGS(JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                JVMCI_IGNORE_FLAG_THREE_PARAM, \
-                JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
-                JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-                IGNORE_RANGE, \
-                IGNORE_CONSTRAINT, \
-                IGNORE_WRITEABLE)
-  }
-
-#ifndef PRODUCT
-#define JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, value, doc)        EMIT_CHECK_PRINT_ERR_MSG_CODE(name)
-#define JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, doc)            EMIT_CHECK_PRINT_ERR_MSG_CODE(name)
-#define JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, value, doc)     EMIT_CHECK_PRINT_ERR_MSG_CODE(name)
-#else
-#define JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, value, doc)
-#define JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, doc)
-#define JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, value, doc)
-#endif
-
-#define JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, doc)            EMIT_CHECK_PRINT_ERR_MSG_CODE(name)
-#define JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE(type, name, value, doc)        EMIT_CHECK_PRINT_ERR_MSG_CODE(name)
-
-  JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
-              JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
-              JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
-              JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
-              JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-              JVMCI_IGNORE_FLAG_THREE_PARAM, \
-              JVMCI_IGNORE_FLAG_FOUR_PARAM, \
-              JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
-              IGNORE_RANGE, \
-              IGNORE_CONSTRAINT, \
-              IGNORE_WRITEABLE)
-
-#undef EMIT_CHECK_PRINT_ERR_MSG_CODE
-#undef JVMCI_DEVELOP_FLAG_CHECK_PRINT_ERR_MSG_CODE
-#undef JVMCI_PD_DEVELOP_FLAG_CHECK_PRINT_ERR_MSG_CODE
-#undef JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE
-#undef JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE
-#undef JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE
-#undef JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERR_MSG_CODE
-#undef JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERR_MSG_CODE
-
-}
-
-#undef JVMCI_IGNORE_FLAG_FOUR_PARAM
-#undef JVMCI_IGNORE_FLAG_THREE_PARAM
diff --git a/src/share/vm/jvmci/jvmci_globals.hpp b/src/share/vm/jvmci/jvmci_globals.hpp
index 0a19e61..c2905f5 100644
--- a/src/share/vm/jvmci/jvmci_globals.hpp
+++ b/src/share/vm/jvmci/jvmci_globals.hpp
@@ -29,8 +29,7 @@
 
 //
 // Defines all global flags used by the JVMCI compiler. Only flags that need
-// to be accessible to the JVMCI C++ code should be defined here. All other
-// JVMCI flags should be defined in JVMCIOptions.java.
+// to be accessible to the JVMCI C++ code should be defined here.
 //
 #define JVMCI_FLAGS(develop, \
                     develop_pd, \
@@ -64,9 +63,6 @@
           "Force number of compiler threads for JVMCI host compiler")       \
           range(1, max_jint)                                                \
                                                                             \
-  experimental(bool, CodeInstallSafepointChecks, true,                      \
-          "Perform explicit safepoint checks while installing code")        \
-                                                                            \
   NOT_COMPILER2(product(intx, MaxVectorSize, 64,                            \
           "Max vector size in bytes, "                                      \
           "actual size could be less depending on elements type"))          \
@@ -112,9 +108,9 @@
 
 class JVMCIGlobals {
  public:
-  // Return true if jvmci flags are consistent.
+  // Return true if jvmci flags are consistent. If not consistent,
+  // an error message describing the inconsistency is printed before
+  // returning false.
   static bool check_jvmci_flags_are_consistent();
-  // Print jvmci arguments inconsistency error message.
-  static void print_jvmci_args_inconsistency_error_message();
 };
 #endif // SHARE_VM_JVMCI_JVMCIGLOBALS_HPP
diff --git a/src/share/vm/jvmci/vmStructs_jvmci.cpp b/src/share/vm/jvmci/vmStructs_jvmci.cpp
index 9244cd4..90f5cf1 100644
--- a/src/share/vm/jvmci/vmStructs_jvmci.cpp
+++ b/src/share/vm/jvmci/vmStructs_jvmci.cpp
@@ -550,7 +550,7 @@
   declare_function(os::javaTimeNanos)                                     \
                                                                           \
   declare_function(Deoptimization::fetch_unroll_info)                     \
-  COMPILER2_PRESENT(declare_function(Deoptimization::uncommon_trap))      \
+  declare_function(Deoptimization::uncommon_trap)                         \
   declare_function(Deoptimization::unpack_frames)                         \
                                                                           \
   declare_function(JVMCIRuntime::new_instance) \
@@ -591,31 +591,31 @@
 #endif // INCLUDE_ALL_GCS
 
 
-#ifdef TARGET_OS_FAMILY_linux
+#ifdef LINUX
 
 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \
   declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT)
 
-#endif // TARGET_OS_FAMILY_linux
+#endif
 
 
-#ifdef TARGET_OS_FAMILY_bsd
+#ifdef BSD
 
 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \
   declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT)
 
-#endif // TARGET_OS_FAMILY_bsd
+#endif
 
-
+// AARCH64 is defined in closed port, too. TARGET_ARCH_aarch64 is not.
 #ifdef TARGET_ARCH_aarch64
 
 #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
   volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*)
 
-#endif // TARGET_ARCH_aarch64
+#endif
 
 
-#ifdef TARGET_ARCH_x86
+#ifdef X86
 
 #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
   volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*)
@@ -661,10 +661,10 @@
   declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL) \
   declare_preprocessor_constant("VM_Version::CPU_SHA", CPU_SHA)
 
-#endif // TARGET_ARCH_x86
+#endif
 
 
-#ifdef TARGET_ARCH_sparc
+#ifdef SPARC
 
 #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
   volatile_nonstatic_field(JavaFrameAnchor, _flags, int)
@@ -694,7 +694,7 @@
   declare_constant(VM_Version::sha256_instruction_m)                      \
   declare_constant(VM_Version::sha512_instruction_m)
 
-#endif // TARGET_ARCH_sparc
+#endif
 
 
 /*
diff --git a/src/share/vm/memory/filemap.cpp b/src/share/vm/memory/filemap.cpp
index b442f4c..e4ec1c1 100644
--- a/src/share/vm/memory/filemap.cpp
+++ b/src/share/vm/memory/filemap.cpp
@@ -199,11 +199,45 @@
   size_t entry_size = SharedClassUtil::shared_class_path_entry_size();
 
   for (int pass=0; pass<2; pass++) {
-    ClassPathEntry *cpe = ClassLoader::classpath_entry(0);
 
-    for (int cur_entry = 0 ; cpe != NULL; cpe = cpe->next(), cur_entry++) {
+    // Process the modular java runtime image first
+    ClassPathEntry* jrt_entry = ClassLoader::get_jrt_entry();
+    assert(jrt_entry != NULL,
+           "No modular java runtime image present when allocating the CDS classpath entry table");
+    const char *name = jrt_entry->name();
+    int name_bytes = (int)(strlen(name) + 1);
+    if (pass == 0) {
+      count++;
+      bytes += (int)entry_size;
+      bytes += name_bytes;
+      log_info(class, path)("add main shared path for modular java runtime image %s", name);
+    } else {
+      // The java runtime image is always in slot 0 on the shared class path.
+      SharedClassPathEntry* ent = shared_classpath(0);
+      struct stat st;
+      if (os::stat(name, &st) == 0) {
+        ent->_timestamp = st.st_mtime;
+        ent->_filesize = st.st_size;
+      }
+      if (ent->_filesize == 0) {
+        // unknown
+        ent->_filesize = -2;
+      }
+      ent->_name = strptr;
+      assert(strptr + name_bytes <= strptr_max, "miscalculated buffer size");
+      strncpy(strptr, name, (size_t)name_bytes); // name_bytes includes trailing 0.
+      strptr += name_bytes;
+    }
+
+    // Walk the appended entries, which includes the entries added for the classpath.
+    ClassPathEntry *cpe = ClassLoader::classpath_entry(1);
+
+    // Since the java runtime image is always in slot 0 on the shared class path, the
+    // appended entries are started at slot 1 immediately after.
+    for (int cur_entry = 1 ; cpe != NULL; cpe = cpe->next(), cur_entry++) {
       const char *name = cpe->name();
       int name_bytes = (int)(strlen(name) + 1);
+      assert(!cpe->is_jrt(), "A modular java runtime image is present on the list of appended entries");
 
       if (pass == 0) {
         count ++;
@@ -228,11 +262,7 @@
         } else {
           struct stat st;
           if (os::stat(name, &st) == 0) {
-            if (cpe->is_jrt()) {
-              // it's the "modules" jimage
-              ent->_timestamp = st.st_mtime;
-              ent->_filesize = st.st_size;
-            } else if ((st.st_mode & S_IFDIR) == S_IFDIR) {
+            if ((st.st_mode & S_IFDIR) == S_IFDIR) {
               if (!os::dir_is_empty(name)) {
                 ClassLoader::exit_with_path_failure(
                   "Cannot have non-empty directory in archived classpaths", name);
@@ -886,6 +916,11 @@
     return false;
   }
 
+  if (!Arguments::has_jimage()) {
+    FileMapInfo::fail_continue("The shared archive file cannot be used with an exploded module build.");
+    return false;
+  }
+
   if (_version != current_version()) {
     FileMapInfo::fail_continue("The shared archive file is the wrong version.");
     return false;
diff --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.cpp
index 5dce267..ac7d0f8 100644
--- a/src/share/vm/memory/metaspace.cpp
+++ b/src/share/vm/memory/metaspace.cpp
@@ -3164,39 +3164,47 @@
 #endif // _LP64
 #endif // INCLUDE_CDS
   } else {
-    // If using shared space, open the file that contains the shared space
-    // and map in the memory before initializing the rest of metaspace (so
-    // the addresses don't conflict)
-    address cds_address = NULL;
-    if (UseSharedSpaces) {
 #if INCLUDE_CDS
+    if (UseSharedSpaces) {
+      // If using shared space, open the file that contains the shared space
+      // and map in the memory before initializing the rest of metaspace (so
+      // the addresses don't conflict)
+      address cds_address = NULL;
       FileMapInfo* mapinfo = new FileMapInfo();
 
-      // Open the shared archive file, read and validate the header. If
-      // initialization fails, shared spaces [UseSharedSpaces] are
-      // disabled and the file is closed.
-      // Map in spaces now also
-      if (mapinfo->initialize() && MetaspaceShared::map_shared_spaces(mapinfo)) {
-        cds_total = FileMapInfo::shared_spaces_size();
-        cds_address = (address)mapinfo->header()->region_addr(0);
-#ifdef _LP64
-        if (using_class_space()) {
-          char* cds_end = (char*)(cds_address + cds_total);
-          cds_end = (char *)align_ptr_up(cds_end, _reserve_alignment);
-          // If UseCompressedClassPointers is set then allocate the metaspace area
-          // above the heap and above the CDS area (if it exists).
-          allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address);
-          // Map the shared string space after compressed pointers
-          // because it relies on compressed class pointers setting to work
-          mapinfo->map_string_regions();
-        }
-#endif // _LP64
+      if (JvmtiExport::should_post_class_file_load_hook()) {
+        // Currently CDS does not support JVMTI CFLH when loading shared class.
+        // If JvmtiExport::should_post_class_file_load_hook is already enabled,
+        // just disable UseSharedSpaces.
+        FileMapInfo::fail_continue("Tool agent requires sharing to be disabled.");
+        delete mapinfo;
       } else {
-        assert(!mapinfo->is_open() && !UseSharedSpaces,
-               "archive file not closed or shared spaces not disabled.");
+        // Open the shared archive file, read and validate the header. If
+        // initialization fails, shared spaces [UseSharedSpaces] are
+        // disabled and the file is closed.
+        // Map in spaces now also
+        if (mapinfo->initialize() && MetaspaceShared::map_shared_spaces(mapinfo)) {
+          cds_total = FileMapInfo::shared_spaces_size();
+          cds_address = (address)mapinfo->header()->region_addr(0);
+#ifdef _LP64
+          if (using_class_space()) {
+            char* cds_end = (char*)(cds_address + cds_total);
+            cds_end = (char *)align_ptr_up(cds_end, _reserve_alignment);
+            // If UseCompressedClassPointers is set then allocate the metaspace area
+            // above the heap and above the CDS area (if it exists).
+            allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address);
+            // Map the shared string space after compressed pointers
+            // because it relies on compressed class pointers setting to work
+            mapinfo->map_string_regions();
+          }
+#endif // _LP64
+        } else {
+          assert(!mapinfo->is_open() && !UseSharedSpaces,
+                 "archive file not closed or shared spaces not disabled.");
+        }
       }
-#endif // INCLUDE_CDS
     }
+#endif // INCLUDE_CDS
 
 #ifdef _LP64
     if (!UseSharedSpaces && using_class_space()) {
diff --git a/src/share/vm/memory/virtualspace.cpp b/src/share/vm/memory/virtualspace.cpp
index 3cb6d21..63c1b92 100644
--- a/src/share/vm/memory/virtualspace.cpp
+++ b/src/share/vm/memory/virtualspace.cpp
@@ -676,7 +676,7 @@
 
 
 void VirtualSpace::release() {
-  // This does not release memory it never reserved.
+  // This does not release memory it reserved.
   // Caller must release via rs.release();
   _low_boundary           = NULL;
   _high_boundary          = NULL;
diff --git a/src/share/vm/oops/instanceKlass.cpp b/src/share/vm/oops/instanceKlass.cpp
index 0310d28..1e7b1b1 100644
--- a/src/share/vm/oops/instanceKlass.cpp
+++ b/src/share/vm/oops/instanceKlass.cpp
@@ -67,6 +67,7 @@
 #include "services/threadService.hpp"
 #include "utilities/dtrace.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/stringUtils.hpp"
 #include "logging/log.hpp"
 #ifdef COMPILER1
 #include "c1/c1_Compiler.hpp"
@@ -2225,9 +2226,14 @@
 }
 
 void InstanceKlass::set_package(ClassLoaderData* loader_data, TRAPS) {
+
+  // ensure java/ packages only loaded by boot or platform builtin loaders
+  check_prohibited_package(name(), loader_data->class_loader(), CHECK);
+
   TempNewSymbol pkg_name = package_from_name(name(), CHECK);
 
   if (pkg_name != NULL && loader_data != NULL) {
+
     // Find in class loader's package entry table.
     _package_entry = loader_data->packages()->lookup_only(pkg_name);
 
@@ -2376,6 +2382,31 @@
 }
 */
 
+// Only boot and platform class loaders can define classes in "java/" packages.
+void InstanceKlass::check_prohibited_package(Symbol* class_name,
+                                                Handle class_loader,
+                                                TRAPS) {
+  const char* javapkg = "java/";
+  ResourceMark rm(THREAD);
+  if (!class_loader.is_null() &&
+      !SystemDictionary::is_platform_class_loader(class_loader) &&
+      class_name != NULL &&
+      strncmp(class_name->as_C_string(), javapkg, strlen(javapkg)) == 0) {
+    TempNewSymbol pkg_name = InstanceKlass::package_from_name(class_name, CHECK);
+    assert(pkg_name != NULL, "Error in parsing package name starting with 'java/'");
+    char* name = pkg_name->as_C_string();
+    const char* class_loader_name = InstanceKlass::cast(class_loader()->klass())->name()->as_C_string();
+    StringUtils::replace_no_expand(name, "/", ".");
+    const char* msg_text1 = "Class loader (instance of): ";
+    const char* msg_text2 = " tried to load prohibited package name: ";
+    size_t len = strlen(msg_text1) + strlen(class_loader_name) + strlen(msg_text2) + strlen(name) + 1;
+    char* message = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, len);
+    jio_snprintf(message, len, "%s%s%s%s", msg_text1, class_loader_name, msg_text2, name);
+    THROW_MSG(vmSymbols::java_lang_SecurityException(), message);
+  }
+  return;
+}
+
 // tell if two classes have the same enclosing class (at package level)
 bool InstanceKlass::is_same_package_member_impl(const InstanceKlass* class1,
                                                 const Klass* class2,
@@ -2706,7 +2737,7 @@
   return NULL;
 }
 
-oop InstanceKlass::add_member_name(Handle mem_name, bool intern) {
+bool InstanceKlass::add_member_name(Handle mem_name) {
   jweak mem_name_wref = JNIHandles::make_weak_global(mem_name);
   MutexLocker ml(MemberNameTable_lock);
   DEBUG_ONLY(NoSafepointVerifier nsv);
@@ -2716,7 +2747,7 @@
   // is called!
   Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name());
   if (method->is_obsolete()) {
-    return NULL;
+    return false;
   } else if (method->is_old()) {
     // Replace method with redefined version
     java_lang_invoke_MemberName::set_vmtarget(mem_name(), method_with_idnum(method->method_idnum()));
@@ -2725,11 +2756,8 @@
   if (_member_names == NULL) {
     _member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable(idnum_allocated_count());
   }
-  if (intern) {
-    return _member_names->find_or_add_member_name(mem_name_wref);
-  } else {
-    return _member_names->add_member_name(mem_name_wref);
-  }
+  _member_names->add_member_name(mem_name_wref);
+  return true;
 }
 
 // -----------------------------------------------------------------------------------------------------
diff --git a/src/share/vm/oops/instanceKlass.hpp b/src/share/vm/oops/instanceKlass.hpp
index 9a69039..24da186 100644
--- a/src/share/vm/oops/instanceKlass.hpp
+++ b/src/share/vm/oops/instanceKlass.hpp
@@ -470,6 +470,12 @@
   static bool find_inner_classes_attr(instanceKlassHandle k,
                                       int* ooff, int* noff, TRAPS);
 
+ private:
+  // Check prohibited package ("java/" only loadable by boot or platform loaders)
+  static void check_prohibited_package(Symbol* class_name,
+                                       Handle class_loader,
+                                       TRAPS);
+ public:
   // tell if two classes have the same enclosing class (at package level)
   bool is_same_package_member(const Klass* class2, TRAPS) const {
     return is_same_package_member_impl(this, class2, THREAD);
@@ -786,7 +792,9 @@
   static void purge_previous_versions(InstanceKlass* ik) { return; };
   static bool has_previous_versions() { return false; }
 
-  void set_cached_class_file(JvmtiCachedClassFileData *data) { ShouldNotReachHere(); }
+  void set_cached_class_file(JvmtiCachedClassFileData *data) {
+    assert(data == NULL, "unexpected call with JVMTI disabled");
+  }
   JvmtiCachedClassFileData * get_cached_class_file() { return (JvmtiCachedClassFileData *)NULL; }
 
 #endif // INCLUDE_JVMTI
@@ -1298,7 +1306,7 @@
   // JSR-292 support
   MemberNameTable* member_names() { return _member_names; }
   void set_member_names(MemberNameTable* member_names) { _member_names = member_names; }
-  oop add_member_name(Handle member_name, bool intern);
+  bool add_member_name(Handle member_name);
 
 public:
   // JVMTI support
diff --git a/src/share/vm/oops/symbol.hpp b/src/share/vm/oops/symbol.hpp
index b2d71d5..b6801f0 100644
--- a/src/share/vm/oops/symbol.hpp
+++ b/src/share/vm/oops/symbol.hpp
@@ -91,12 +91,6 @@
 // The allocation (or lookup) of K increments the reference count for K
 // and the destructor decrements the reference count.
 //
-// Another example of TempNewSymbol usage is parsed_name used in
-// ClassFileParser::parseClassFile() where parsed_name is used in the cleanup
-// after a failed attempt to load a class.  Here parsed_name is a
-// TempNewSymbol (passed in as a parameter) so the reference count on its symbol
-// will be decremented when it goes out of scope.
-
 // This cannot be inherited from ResourceObj because it cannot have a vtable.
 // Since sometimes this is allocated from Metadata, pick a base allocation
 // type without virtual functions.
diff --git a/src/share/vm/opto/ad.hpp b/src/share/vm/opto/ad.hpp
index 7bd84eb..b2bf4d5 100644
--- a/src/share/vm/opto/ad.hpp
+++ b/src/share/vm/opto/ad.hpp
@@ -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,20 +25,9 @@
 #ifndef SHARE_VM_OPTO_AD_HPP
 #define SHARE_VM_OPTO_AD_HPP
 
-#if defined AD_MD_HPP
-# include AD_MD_HPP
-#elif defined TARGET_ARCH_MODEL_x86_32
-# include "adfiles/ad_x86_32.hpp"
-#elif defined TARGET_ARCH_MODEL_x86_64
-# include "adfiles/ad_x86_64.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "adfiles/ad_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_zero
-# include "adfiles/ad_zero.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/ad_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "adfiles/ad_aarch64.hpp"
-#endif
+
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(adfiles/ad)
 
 #endif // SHARE_VM_OPTO_AD_HPP
diff --git a/src/share/vm/opto/c2_globals.hpp b/src/share/vm/opto/c2_globals.hpp
index 686615a..3ba603d 100644
--- a/src/share/vm/opto/c2_globals.hpp
+++ b/src/share/vm/opto/c2_globals.hpp
@@ -26,36 +26,10 @@
 #define SHARE_VM_OPTO_C2_GLOBALS_HPP
 
 #include "runtime/globals.hpp"
-#ifdef TARGET_ARCH_x86
-# include "c2_globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c2_globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c2_globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c2_globals_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c2_globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "c2_globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "c2_globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "c2_globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "c2_globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "c2_globals_bsd.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(c2_globals)
+#include OS_HEADER(c2_globals)
 
 //
 // Defines all globals flags used by the server compiler.
diff --git a/src/share/vm/opto/compile.cpp b/src/share/vm/opto/compile.cpp
index 9946071..7824b11 100644
--- a/src/share/vm/opto/compile.cpp
+++ b/src/share/vm/opto/compile.cpp
@@ -3814,6 +3814,7 @@
   if (can_be_reused() != other.can_be_reused())  return false;
   // For floating point values we compare the bit pattern.
   switch (type()) {
+  case T_INT:
   case T_FLOAT:   return (_v._value.i == other._v._value.i);
   case T_LONG:
   case T_DOUBLE:  return (_v._value.j == other._v._value.j);
@@ -3828,6 +3829,7 @@
 
 static int type_to_size_in_bytes(BasicType t) {
   switch (t) {
+  case T_INT:     return sizeof(jint   );
   case T_LONG:    return sizeof(jlong  );
   case T_FLOAT:   return sizeof(jfloat );
   case T_DOUBLE:  return sizeof(jdouble);
@@ -3896,6 +3898,7 @@
     Constant con = _constants.at(i);
     address constant_addr = NULL;
     switch (con.type()) {
+    case T_INT:    constant_addr = _masm.int_constant(   con.get_jint()   ); break;
     case T_LONG:   constant_addr = _masm.long_constant(  con.get_jlong()  ); break;
     case T_FLOAT:  constant_addr = _masm.float_constant( con.get_jfloat() ); break;
     case T_DOUBLE: constant_addr = _masm.double_constant(con.get_jdouble()); break;
diff --git a/src/share/vm/opto/compile.hpp b/src/share/vm/opto/compile.hpp
index 79575dc..f2f8c46 100644
--- a/src/share/vm/opto/compile.hpp
+++ b/src/share/vm/opto/compile.hpp
@@ -264,6 +264,7 @@
 
     BasicType type()      const    { return _type; }
 
+    jint    get_jint()    const    { return _v._value.i; }
     jlong   get_jlong()   const    { return _v._value.j; }
     jfloat  get_jfloat()  const    { return _v._value.f; }
     jdouble get_jdouble() const    { return _v._value.d; }
@@ -320,6 +321,14 @@
     Constant add(MachConstantNode* n, BasicType type, jvalue value);
     Constant add(Metadata* metadata);
     Constant add(MachConstantNode* n, MachOper* oper);
+    Constant add(MachConstantNode* n, jint i) {
+      jvalue value; value.i = i;
+      return add(n, T_INT, value);
+    }
+    Constant add(MachConstantNode* n, jlong j) {
+      jvalue value; value.j = j;
+      return add(n, T_LONG, value);
+    }
     Constant add(MachConstantNode* n, jfloat f) {
       jvalue value; value.f = f;
       return add(n, T_FLOAT, value);
diff --git a/src/share/vm/opto/doCall.cpp b/src/share/vm/opto/doCall.cpp
index ce7e6d1..97af80e 100644
--- a/src/share/vm/opto/doCall.cpp
+++ b/src/share/vm/opto/doCall.cpp
@@ -209,16 +209,22 @@
 
       int morphism = profile.morphism();
       if (speculative_receiver_type != NULL) {
-        // We have a speculative type, we should be able to resolve
-        // the call. We do that before looking at the profiling at
-        // this invoke because it may lead to bimorphic inlining which
-        // a speculative type should help us avoid.
-        receiver_method = callee->resolve_invoke(jvms->method()->holder(),
-                                                 speculative_receiver_type);
-        if (receiver_method == NULL) {
-          speculative_receiver_type = NULL;
+        if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) {
+          // We have a speculative type, we should be able to resolve
+          // the call. We do that before looking at the profiling at
+          // this invoke because it may lead to bimorphic inlining which
+          // a speculative type should help us avoid.
+          receiver_method = callee->resolve_invoke(jvms->method()->holder(),
+                                                   speculative_receiver_type);
+          if (receiver_method == NULL) {
+            speculative_receiver_type = NULL;
+          } else {
+            morphism = 1;
+          }
         } else {
-          morphism = 1;
+          // speculation failed before. Use profiling at the call
+          // (could allow bimorphic inlining for instance).
+          speculative_receiver_type = NULL;
         }
       }
       if (receiver_method == NULL &&
@@ -255,7 +261,7 @@
           Deoptimization::DeoptReason reason = morphism == 2 ?
             Deoptimization::Reason_bimorphic : Deoptimization::reason_class_check(speculative_receiver_type != NULL);
           if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) &&
-              !too_many_traps(jvms->method(), jvms->bci(), reason)
+              !too_many_traps(caller, bci, reason)
              ) {
             // Generate uncommon trap for class check failure path
             // in case of monomorphic or bimorphic virtual call site.
diff --git a/src/share/vm/opto/escape.cpp b/src/share/vm/opto/escape.cpp
index 892a0d3..47bab94 100644
--- a/src/share/vm/opto/escape.cpp
+++ b/src/share/vm/opto/escape.cpp
@@ -2067,7 +2067,9 @@
         bt = field->layout_type();
       } else {
         // Check for unsafe oop field access
-        if (n->has_out_with(Op_StoreP, Op_LoadP, Op_StoreN, Op_LoadN)) {
+        if (n->has_out_with(Op_StoreP, Op_LoadP, Op_StoreN, Op_LoadN) ||
+            n->has_out_with(Op_GetAndSetP, Op_GetAndSetN, Op_CompareAndExchangeP, Op_CompareAndExchangeN) ||
+            n->has_out_with(Op_CompareAndSwapP, Op_CompareAndSwapN, Op_WeakCompareAndSwapP, Op_WeakCompareAndSwapN)) {
           bt = T_OBJECT;
           (*unsafe) = true;
         }
@@ -2083,7 +2085,9 @@
       }
     } else if (adr_type->isa_rawptr() || adr_type->isa_klassptr()) {
       // Allocation initialization, ThreadLocal field access, unsafe access
-      if (n->has_out_with(Op_StoreP, Op_LoadP, Op_StoreN, Op_LoadN)) {
+      if (n->has_out_with(Op_StoreP, Op_LoadP, Op_StoreN, Op_LoadN) ||
+          n->has_out_with(Op_GetAndSetP, Op_GetAndSetN, Op_CompareAndExchangeP, Op_CompareAndExchangeN) ||
+          n->has_out_with(Op_CompareAndSwapP, Op_CompareAndSwapN, Op_WeakCompareAndSwapP, Op_WeakCompareAndSwapN)) {
         bt = T_OBJECT;
       }
     }
@@ -3134,8 +3138,8 @@
         }
       } else {
         uint op = use->Opcode();
-        if ((use->in(MemNode::Memory) == n) &&
-            (op == Op_StrCompressedCopy || op == Op_StrInflatedCopy)) {
+        if ((op == Op_StrCompressedCopy || op == Op_StrInflatedCopy) &&
+            (use->in(MemNode::Memory) == n)) {
           // They overwrite memory edge corresponding to destination array,
           memnode_worklist.append_if_missing(use);
         } else if (!(op == Op_CmpP || op == Op_Conv2B ||
diff --git a/src/share/vm/opto/lcm.cpp b/src/share/vm/opto/lcm.cpp
index 431bba1..aabb17a 100644
--- a/src/share/vm/opto/lcm.cpp
+++ b/src/share/vm/opto/lcm.cpp
@@ -1293,11 +1293,12 @@
     Block *sb = block->_succs[i];
     // Clone the entire area; ignoring the edge fixup for now.
     for( uint j = end; j > beg; j-- ) {
-      // It is safe here to clone a node with anti_dependence
-      // since clones dominate on each path.
       Node *clone = block->get_node(j-1)->clone();
       sb->insert_node(clone, 1);
       map_node_to_block(clone, sb);
+      if (clone->needs_anti_dependence_check()) {
+        insert_anti_dependences(sb, clone);
+      }
     }
   }
 
diff --git a/src/share/vm/opto/library_call.cpp b/src/share/vm/opto/library_call.cpp
index af27b91..5de8f72 100644
--- a/src/share/vm/opto/library_call.cpp
+++ b/src/share/vm/opto/library_call.cpp
@@ -222,7 +222,6 @@
   Node* round_double_node(Node* n);
   bool runtime_math(const TypeFunc* call_type, address funcAddr, const char* funcName);
   bool inline_math_native(vmIntrinsics::ID id);
-  bool inline_trig(vmIntrinsics::ID id);
   bool inline_math(vmIntrinsics::ID id);
   template <typename OverflowOp>
   bool inline_math_overflow(Node* arg1, Node* arg2);
@@ -1404,18 +1403,20 @@
          (!compress && src_elem == T_BYTE && (dst_elem == T_BYTE || dst_elem == T_CHAR)),
          "Unsupported array types for inline_string_copy");
 
-  // Range checks
-  generate_string_range_check(src, src_offset, length, compress && src_elem == T_BYTE);
-  generate_string_range_check(dst, dst_offset, length, !compress && dst_elem == T_BYTE);
-  if (stopped()) {
-    return true;
+  // Convert char[] offsets to byte[] offsets
+  bool convert_src = (compress && src_elem == T_BYTE);
+  bool convert_dst = (!compress && dst_elem == T_BYTE);
+  if (convert_src) {
+    src_offset = _gvn.transform(new LShiftINode(src_offset, intcon(1)));
+  } else if (convert_dst) {
+    dst_offset = _gvn.transform(new LShiftINode(dst_offset, intcon(1)));
   }
 
-  // Convert char[] offsets to byte[] offsets
-  if (compress && src_elem == T_BYTE) {
-    src_offset = _gvn.transform(new LShiftINode(src_offset, intcon(1)));
-  } else if (!compress && dst_elem == T_BYTE) {
-    dst_offset = _gvn.transform(new LShiftINode(dst_offset, intcon(1)));
+  // Range checks
+  generate_string_range_check(src, src_offset, length, convert_src);
+  generate_string_range_check(dst, dst_offset, length, convert_dst);
+  if (stopped()) {
+    return true;
   }
 
   Node* src_start = array_element_address(src, src_offset, src_elem);
@@ -1691,94 +1692,6 @@
   return true;
 }
 
-//------------------------------inline_trig----------------------------------
-// Inline sin/cos/tan instructions, if possible.  If rounding is required, do
-// argument reduction which will turn into a fast/slow diamond.
-bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) {
-  Node* arg = round_double_node(argument(0));
-  Node* n = NULL;
-
-  n = _gvn.transform(n);
-
-  // Rounding required?  Check for argument reduction!
-  if (Matcher::strict_fp_requires_explicit_rounding) {
-    static const double     pi_4 =  0.7853981633974483;
-    static const double neg_pi_4 = -0.7853981633974483;
-    // pi/2 in 80-bit extended precision
-    // static const unsigned char pi_2_bits_x[] = {0x35,0xc2,0x68,0x21,0xa2,0xda,0x0f,0xc9,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00};
-    // -pi/2 in 80-bit extended precision
-    // static const unsigned char neg_pi_2_bits_x[] = {0x35,0xc2,0x68,0x21,0xa2,0xda,0x0f,0xc9,0xff,0xbf,0x00,0x00,0x00,0x00,0x00,0x00};
-    // Cutoff value for using this argument reduction technique
-    //static const double    pi_2_minus_epsilon =  1.564660403643354;
-    //static const double neg_pi_2_plus_epsilon = -1.564660403643354;
-
-    // Pseudocode for sin:
-    // if (x <= Math.PI / 4.0) {
-    //   if (x >= -Math.PI / 4.0) return  fsin(x);
-    //   if (x >= -Math.PI / 2.0) return -fcos(x + Math.PI / 2.0);
-    // } else {
-    //   if (x <=  Math.PI / 2.0) return  fcos(x - Math.PI / 2.0);
-    // }
-    // return StrictMath.sin(x);
-
-    // Pseudocode for cos:
-    // if (x <= Math.PI / 4.0) {
-    //   if (x >= -Math.PI / 4.0) return  fcos(x);
-    //   if (x >= -Math.PI / 2.0) return  fsin(x + Math.PI / 2.0);
-    // } else {
-    //   if (x <=  Math.PI / 2.0) return -fsin(x - Math.PI / 2.0);
-    // }
-    // return StrictMath.cos(x);
-
-    // Actually, sticking in an 80-bit Intel value into C2 will be tough; it
-    // requires a special machine instruction to load it.  Instead we'll try
-    // the 'easy' case.  If we really need the extra range +/- PI/2 we'll
-    // probably do the math inside the SIN encoding.
-
-    // Make the merge point
-    RegionNode* r = new RegionNode(3);
-    Node* phi = new PhiNode(r, Type::DOUBLE);
-
-    // Flatten arg so we need only 1 test
-    Node *abs = _gvn.transform(new AbsDNode(arg));
-    // Node for PI/4 constant
-    Node *pi4 = makecon(TypeD::make(pi_4));
-    // Check PI/4 : abs(arg)
-    Node *cmp = _gvn.transform(new CmpDNode(pi4,abs));
-    // Check: If PI/4 < abs(arg) then go slow
-    Node *bol = _gvn.transform(new BoolNode( cmp, BoolTest::lt ));
-    // Branch either way
-    IfNode *iff = create_and_xform_if(control(),bol, PROB_STATIC_FREQUENT, COUNT_UNKNOWN);
-    set_control(opt_iff(r,iff));
-
-    // Set fast path result
-    phi->init_req(2, n);
-
-    // Slow path - non-blocking leaf call
-    Node* call = NULL;
-    switch (id) {
-    case vmIntrinsics::_dtan:
-      call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(),
-                               CAST_FROM_FN_PTR(address, SharedRuntime::dtan),
-                               "Tan", NULL, arg, top());
-      break;
-    }
-    assert(control()->in(0) == call, "");
-    Node* slow_result = _gvn.transform(new ProjNode(call, TypeFunc::Parms));
-    r->init_req(1, control());
-    phi->init_req(1, slow_result);
-
-    // Post-merge
-    set_control(_gvn.transform(r));
-    record_for_igvn(r);
-    n = _gvn.transform(phi);
-
-    C->set_has_split_ifs(true); // Has chance for split-if optimization
-  }
-  set_result(n);
-  return true;
-}
-
 //------------------------------runtime_math-----------------------------
 bool LibraryCallKit::runtime_math(const TypeFunc* call_type, address funcAddr, const char* funcName) {
   assert(call_type == OptoRuntime::Math_DD_D_Type() || call_type == OptoRuntime::Math_D_D_Type(),
@@ -2429,6 +2342,8 @@
       return false;
     }
     mismatched = (bt != type);
+  } else if (alias_type->adr_type() == TypeOopPtr::BOTTOM) {
+    mismatched = true; // conservatively mark all "wide" on-heap accesses as mismatched
   }
 
   // First guess at the value type.
@@ -3304,7 +3219,7 @@
   // drop through to next case
   set_control( _gvn.transform(new IfTrueNode(iff_bit)));
 
-#ifndef TARGET_OS_FAMILY_windows
+#ifndef _WINDOWS
   // (c) Or, if interrupt bit is set and clear_int is false, use 2nd fast path.
   Node* clr_arg = argument(1);
   Node* cmp_arg = _gvn.transform(new CmpINode(clr_arg, intcon(0)));
@@ -3321,7 +3236,7 @@
 #else
   // To return true on Windows you must read the _interrupted field
   // and check the event state i.e. take the slow path.
-#endif // TARGET_OS_FAMILY_windows
+#endif // _WINDOWS
 
   // (d) Otherwise, go to the slow path.
   slow_region->add_req(control());
diff --git a/src/share/vm/opto/loopTransform.cpp b/src/share/vm/opto/loopTransform.cpp
index 282c5c1..b9368b4 100644
--- a/src/share/vm/opto/loopTransform.cpp
+++ b/src/share/vm/opto/loopTransform.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -70,9 +70,9 @@
 }
 
 //------------------------------compute_exact_trip_count-----------------------
-// Compute loop exact trip count if possible. Do not recalculate trip count for
+// Compute loop trip count if possible. Do not recalculate trip count for
 // split loops (pre-main-post) which have their limits and inits behind Opaque node.
-void IdealLoopTree::compute_exact_trip_count( PhaseIdealLoop *phase ) {
+void IdealLoopTree::compute_trip_count(PhaseIdealLoop* phase) {
   if (!_head->as_Loop()->is_valid_counted_loop()) {
     return;
   }
@@ -94,17 +94,21 @@
 
   Node* init_n = cl->init_trip();
   Node* limit_n = cl->limit();
-  if (init_n  != NULL &&  init_n->is_Con() &&
-      limit_n != NULL && limit_n->is_Con()) {
+  if (init_n != NULL && limit_n != NULL) {
     // Use longs to avoid integer overflow.
-    int stride_con  = cl->stride_con();
-    jlong init_con   = cl->init_trip()->get_int();
-    jlong limit_con  = cl->limit()->get_int();
-    int stride_m    = stride_con - (stride_con > 0 ? 1 : -1);
+    int stride_con = cl->stride_con();
+    jlong init_con = phase->_igvn.type(init_n)->is_int()->_lo;
+    jlong limit_con = phase->_igvn.type(limit_n)->is_int()->_hi;
+    int stride_m   = stride_con - (stride_con > 0 ? 1 : -1);
     jlong trip_count = (limit_con - init_con + stride_m)/stride_con;
     if (trip_count > 0 && (julong)trip_count < (julong)max_juint) {
-      // Set exact trip count.
-      cl->set_exact_trip_count((uint)trip_count);
+      if (init_n->is_Con() && limit_n->is_Con()) {
+        // Set exact trip count.
+        cl->set_exact_trip_count((uint)trip_count);
+      } else if (cl->unrolled_count() == 1) {
+        // Set maximum trip count before unrolling.
+        cl->set_trip_count((uint)trip_count);
+      }
     }
   }
 }
@@ -1305,7 +1309,7 @@
   assert(main_exit->Opcode() == Op_IfFalse, "");
   int dd_main_exit = dom_depth(main_exit);
 
-  // Step A1: Clone the loop body of main.  The clone becomes the vector post-loop.
+  // Step A1: Clone the loop body of main. The clone becomes the post-loop.
   // The main loop pre-header illegally has 2 control users (old & new loops).
   clone_loop(loop, old_new, dd_main_exit);
   assert(old_new[main_end->_idx]->Opcode() == Op_CountedLoopEnd, "");
@@ -2095,8 +2099,7 @@
   // the loop is in canonical form to multiversion.
   closed_range_checks = 0;
 
-  // Check loop body for tests of trip-counter plus loop-invariant vs
-  // loop-invariant.
+  // Check loop body for tests of trip-counter plus loop-invariant vs loop-variant.
   for( uint i = 0; i < loop->_body.size(); i++ ) {
     Node *iff = loop->_body[i];
     if (iff->Opcode() == Op_If ||
@@ -2298,7 +2301,7 @@
   // skip this loop if it is already checked
   if (cl->has_been_range_checked()) return;
 
-  // Now check for existance of range checks
+  // Now check for existence of range checks
   for (uint i = 0; i < loop->_body.size(); i++) {
     Node *iff = loop->_body[i];
     int iff_opc = iff->Opcode();
@@ -2319,7 +2322,7 @@
   CountedLoopNode *legacy_cl = legacy_loop->_head->as_CountedLoop();
   assert(legacy_cl->is_post_loop(), "");
 
-  // Check for existance of range checks using the unique instance to make a guard with
+  // Check for existence of range checks using the unique instance to make a guard with
   Unique_Node_List worklist;
   for (uint i = 0; i < legacy_loop->_body.size(); i++) {
     Node *iff = legacy_loop->_body[i];
@@ -2422,7 +2425,7 @@
 }
 
 //-------------------------poison_rce_post_loop--------------------------------
-// Causes the rce'd post loop to be optimized away if multiverioning fails
+// Causes the rce'd post loop to be optimized away if multiversioning fails
 void PhaseIdealLoop::poison_rce_post_loop(IdealLoopTree *rce_loop) {
   CountedLoopNode *rce_cl = rce_loop->_head->as_CountedLoop();
   Node* ctrl = rce_cl->in(LoopNode::EntryControl);
@@ -2710,8 +2713,8 @@
 //=============================================================================
 //------------------------------iteration_split_impl---------------------------
 bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_new ) {
-  // Compute exact loop trip count if possible.
-  compute_exact_trip_count(phase);
+  // Compute loop trip count if possible.
+  compute_trip_count(phase);
 
   // Convert one iteration loop into normal code.
   if (policy_do_one_iteration_loop(phase))
diff --git a/src/share/vm/opto/loopnode.cpp b/src/share/vm/opto/loopnode.cpp
index 7862a71..727e0b9 100644
--- a/src/share/vm/opto/loopnode.cpp
+++ b/src/share/vm/opto/loopnode.cpp
@@ -279,8 +279,16 @@
     return false;
 
   // Allow funny placement of Safepoint
-  if (back_control->Opcode() == Op_SafePoint)
+  if (back_control->Opcode() == Op_SafePoint) {
+    if (UseCountedLoopSafepoints) {
+      // Leaving the safepoint on the backedge and creating a
+      // CountedLoop will confuse optimizations. We can't move the
+      // safepoint around because its jvm state wouldn't match a new
+      // location. Give up on that loop.
+      return false;
+    }
     back_control = back_control->in(TypeFunc::Control);
+  }
 
   // Controlling test for loop
   Node *iftrue = back_control;
diff --git a/src/share/vm/opto/loopnode.hpp b/src/share/vm/opto/loopnode.hpp
index 1e21509..3419b78 100644
--- a/src/share/vm/opto/loopnode.hpp
+++ b/src/share/vm/opto/loopnode.hpp
@@ -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
@@ -520,8 +520,8 @@
   // Return TRUE if "iff" is a range check.
   bool is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invariance& invar) const;
 
-  // Compute loop exact trip count if possible
-  void compute_exact_trip_count( PhaseIdealLoop *phase );
+  // Compute loop trip count if possible
+  void compute_trip_count(PhaseIdealLoop* phase);
 
   // Compute loop trip count from profile data
   void compute_profile_trip_cnt( PhaseIdealLoop *phase );
diff --git a/src/share/vm/opto/macro.cpp b/src/share/vm/opto/macro.cpp
index 993f60f..653d20f 100644
--- a/src/share/vm/opto/macro.cpp
+++ b/src/share/vm/opto/macro.cpp
@@ -1596,8 +1596,12 @@
         // All nodes that depended on the InitializeNode for control
         // and memory must now depend on the MemBarNode that itself
         // depends on the InitializeNode
-        _igvn.replace_node(init_ctrl, ctrl);
-        _igvn.replace_node(init_mem, mem);
+        if (init_ctrl != NULL) {
+          _igvn.replace_node(init_ctrl, ctrl);
+        }
+        if (init_mem != NULL) {
+          _igvn.replace_node(init_mem, mem);
+        }
       }
     }
 
diff --git a/src/share/vm/opto/memnode.cpp b/src/share/vm/opto/memnode.cpp
index f0d588a..1ea3bd2 100644
--- a/src/share/vm/opto/memnode.cpp
+++ b/src/share/vm/opto/memnode.cpp
@@ -1713,9 +1713,6 @@
       }
     }
   } else if (tp->base() == Type::InstPtr) {
-    ciEnv* env = C->env();
-    const TypeInstPtr* tinst = tp->is_instptr();
-    ciKlass* klass = tinst->klass();
     assert( off != Type::OffsetBot ||
             // arrays can be cast to Objects
             tp->is_oopptr()->klass()->is_java_lang_Object() ||
@@ -1723,9 +1720,11 @@
             C->has_unsafe_access(),
             "Field accesses must be precise" );
     // For oop loads, we expect the _type to be precise.
-    // Optimizations for constant objects
+
+    // Optimize loads from constant fields.
+    const TypeInstPtr* tinst = tp->is_instptr();
     ciObject* const_oop = tinst->const_oop();
-    if (const_oop != NULL && const_oop->is_instance()) {
+    if (!is_mismatched_access() && off != Type::OffsetBot && const_oop != NULL && const_oop->is_instance()) {
       const Type* con_type = Type::make_constant_from_field(const_oop->as_instance(), off, is_unsigned(), memory_type());
       if (con_type != NULL) {
         return con_type;
diff --git a/src/share/vm/opto/node.cpp b/src/share/vm/opto/node.cpp
index 6d8b13a..833b760 100644
--- a/src/share/vm/opto/node.cpp
+++ b/src/share/vm/opto/node.cpp
@@ -295,9 +295,6 @@
   if (req > 0) {
     // Allocate space for _in array to have double alignment.
     _in = (Node **) ((char *) (C->node_arena()->Amalloc_D(req * sizeof(void*))));
-#ifdef ASSERT
-    _in[req-1] = this; // magic cookie for assertion check
-#endif
   }
   // If there are default notes floating around, capture them:
   Node_Notes* nn = C->default_node_notes();
@@ -326,10 +323,8 @@
   debug_only( verify_construction() );
   NOT_PRODUCT(nodes_created++);
   if (req == 0) {
-    assert( _in == (Node**)this, "Must not pass arg count to 'new'" );
     _in = NULL;
   } else {
-    assert( _in[req-1] == this, "Must pass arg count to 'new'" );
     Node** to = _in;
     for(uint i = 0; i < req; i++) {
       to[i] = NULL;
@@ -346,8 +341,6 @@
 {
   debug_only( verify_construction() );
   NOT_PRODUCT(nodes_created++);
-  // Assert we allocated space for input array already
-  assert( _in[0] == this, "Must pass arg count to 'new'" );
   assert( is_not_dead(n0), "can not use dead node");
   _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this);
 }
@@ -361,8 +354,6 @@
 {
   debug_only( verify_construction() );
   NOT_PRODUCT(nodes_created++);
-  // Assert we allocated space for input array already
-  assert( _in[1] == this, "Must pass arg count to 'new'" );
   assert( is_not_dead(n0), "can not use dead node");
   assert( is_not_dead(n1), "can not use dead node");
   _in[0] = n0; if (n0 != NULL) n0->add_out((Node *)this);
@@ -378,8 +369,6 @@
 {
   debug_only( verify_construction() );
   NOT_PRODUCT(nodes_created++);
-  // Assert we allocated space for input array already
-  assert( _in[2] == this, "Must pass arg count to 'new'" );
   assert( is_not_dead(n0), "can not use dead node");
   assert( is_not_dead(n1), "can not use dead node");
   assert( is_not_dead(n2), "can not use dead node");
@@ -397,8 +386,6 @@
 {
   debug_only( verify_construction() );
   NOT_PRODUCT(nodes_created++);
-  // Assert we allocated space for input array already
-  assert( _in[3] == this, "Must pass arg count to 'new'" );
   assert( is_not_dead(n0), "can not use dead node");
   assert( is_not_dead(n1), "can not use dead node");
   assert( is_not_dead(n2), "can not use dead node");
@@ -418,8 +405,6 @@
 {
   debug_only( verify_construction() );
   NOT_PRODUCT(nodes_created++);
-  // Assert we allocated space for input array already
-  assert( _in[4] == this, "Must pass arg count to 'new'" );
   assert( is_not_dead(n0), "can not use dead node");
   assert( is_not_dead(n1), "can not use dead node");
   assert( is_not_dead(n2), "can not use dead node");
@@ -442,8 +427,6 @@
 {
   debug_only( verify_construction() );
   NOT_PRODUCT(nodes_created++);
-  // Assert we allocated space for input array already
-  assert( _in[5] == this, "Must pass arg count to 'new'" );
   assert( is_not_dead(n0), "can not use dead node");
   assert( is_not_dead(n1), "can not use dead node");
   assert( is_not_dead(n2), "can not use dead node");
@@ -468,8 +451,6 @@
 {
   debug_only( verify_construction() );
   NOT_PRODUCT(nodes_created++);
-  // Assert we allocated space for input array already
-  assert( _in[6] == this, "Must pass arg count to 'new'" );
   assert( is_not_dead(n0), "can not use dead node");
   assert( is_not_dead(n1), "can not use dead node");
   assert( is_not_dead(n2), "can not use dead node");
diff --git a/src/share/vm/opto/node.hpp b/src/share/vm/opto/node.hpp
index e368e62..658b54f 100644
--- a/src/share/vm/opto/node.hpp
+++ b/src/share/vm/opto/node.hpp
@@ -217,9 +217,6 @@
   inline void* operator new(size_t x) throw() {
     Compile* C = Compile::current();
     Node* n = (Node*)C->node_arena()->Amalloc_D(x);
-#ifdef ASSERT
-    n->_in = (Node**)n; // magic cookie for assertion check
-#endif
     return (void*)n;
   }
 
diff --git a/src/share/vm/opto/optoreg.hpp b/src/share/vm/opto/optoreg.hpp
index 53f5afe..3ec88f0 100644
--- a/src/share/vm/opto/optoreg.hpp
+++ b/src/share/vm/opto/optoreg.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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,23 +25,11 @@
 #ifndef SHARE_VM_OPTO_OPTOREG_HPP
 #define SHARE_VM_OPTO_OPTOREG_HPP
 
+#include "utilities/macros.hpp"
+
 // AdGlobals contains c2 specific register handling code as specified
 // in the .ad files.
-#if defined ADGLOBALS_MD_HPP
-# include ADGLOBALS_MD_HPP
-#elif defined TARGET_ARCH_MODEL_x86_32
-# include "adfiles/adGlobals_x86_32.hpp"
-#elif defined TARGET_ARCH_MODEL_x86_64
-# include "adfiles/adGlobals_x86_64.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "adfiles/adGlobals_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_zero
-# include "adfiles/adGlobals_zero.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "adfiles/adGlobals_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "adfiles/adGlobals_aarch64.hpp"
-#endif
+#include CPU_HEADER(adfiles/adGlobals)
 
 //------------------------------OptoReg----------------------------------------
 // We eventually need Registers for the Real World.  Registers are essentially
diff --git a/src/share/vm/opto/output.cpp b/src/share/vm/opto/output.cpp
index 39f4abd..312bbf8 100644
--- a/src/share/vm/opto/output.cpp
+++ b/src/share/vm/opto/output.cpp
@@ -952,7 +952,7 @@
   // Set the initially allocated size
   int  code_req   = initial_code_capacity;
   int  locs_req   = initial_locs_capacity;
-  int  stub_req   = TraceJumps ? initial_stub_capacity * 10 : initial_stub_capacity;
+  int  stub_req   = initial_stub_capacity;
   int  const_req  = initial_const_capacity;
 
   int  pad_req    = NativeCall::instruction_size;
diff --git a/src/share/vm/opto/runtime.cpp b/src/share/vm/opto/runtime.cpp
index 53db5ec..3626009 100644
--- a/src/share/vm/opto/runtime.cpp
+++ b/src/share/vm/opto/runtime.cpp
@@ -59,6 +59,7 @@
 #include "opto/mulnode.hpp"
 #include "opto/runtime.hpp"
 #include "opto/subnode.hpp"
+#include "prims/jvmtiThreadState.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.inline.hpp"
@@ -1451,6 +1452,11 @@
   }
 #endif
 
+  JvmtiThreadState *state = thread->jvmti_thread_state();
+  if (state != NULL) {
+    state->set_exception_detected();
+  }
+
   thread->set_vm_result(exception);
   // Frame not compiled (handles deoptimization blob)
   return SharedRuntime::raw_exception_handler_for_return_address(thread, ret_pc);
diff --git a/src/share/vm/opto/type.hpp b/src/share/vm/opto/type.hpp
index 4c79e90..07b91cb 100644
--- a/src/share/vm/opto/type.hpp
+++ b/src/share/vm/opto/type.hpp
@@ -936,7 +936,7 @@
 };
 
 //------------------------------TypeOopPtr-------------------------------------
-// Some kind of oop (Java pointer), either klass or instance or array.
+// Some kind of oop (Java pointer), either instance or array.
 class TypeOopPtr : public TypePtr {
 protected:
   TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id,
diff --git a/src/share/vm/prims/jni_md.h b/src/share/vm/prims/jni_md.h
index 3bd4e31..6a078ed 100644
--- a/src/share/vm/prims/jni_md.h
+++ b/src/share/vm/prims/jni_md.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -23,26 +23,10 @@
  * questions.
  */
 
-/* Switch to the correct jni_md.h file without reliance on -I options. */
-#ifdef TARGET_ARCH_x86
-# include "jni_x86.h"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "jni_sparc.h"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "jni_zero.h"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "jni_arm.h"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "jni_ppc.h"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "jni_aarch64.h"
-#endif
+#include "utilities/macros.hpp"
 
+/* Switch to the correct jni_md.h file without reliance on -I options. */
+#include CPU_HEADER_H(jni)
 
 /*
   The local copies of JNI header files may be refreshed
diff --git a/src/share/vm/prims/jvm.cpp b/src/share/vm/prims/jvm.cpp
index 4da3a64..79c450b 100644
--- a/src/share/vm/prims/jvm.cpp
+++ b/src/share/vm/prims/jvm.cpp
@@ -84,21 +84,6 @@
 #include "classfile/sharedClassUtil.hpp"
 #include "classfile/systemDictionaryShared.hpp"
 #endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "jvm_linux.h"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "jvm_solaris.h"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "jvm_windows.h"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "jvm_aix.h"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "jvm_bsd.h"
-#endif
 
 #include <errno.h>
 
@@ -695,7 +680,7 @@
       // This can safepoint and redefine method, so need both new_obj and method
       // in a handle, for two different reasons.  new_obj can move, method can be
       // deleted if nothing is using it on the stack.
-      m->method_holder()->add_member_name(new_obj(), false);
+      m->method_holder()->add_member_name(new_obj());
     }
   }
 
diff --git a/src/share/vm/prims/jvm.h b/src/share/vm/prims/jvm.h
index 5a05599..58a8fbf 100644
--- a/src/share/vm/prims/jvm.h
+++ b/src/share/vm/prims/jvm.h
@@ -26,21 +26,9 @@
 #define SHARE_VM_PRIMS_JVM_H
 
 #include "prims/jni.h"
-#ifdef TARGET_OS_FAMILY_linux
-# include "jvm_linux.h"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "jvm_solaris.h"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "jvm_windows.h"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "jvm_aix.h"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "jvm_bsd.h"
-#endif
+#include "utilities/macros.hpp"
+
+#include OS_HEADER_H(jvm)
 
 #ifndef _JAVASOFT_JVM_H_
 #define _JAVASOFT_JVM_H_
diff --git a/src/share/vm/prims/methodHandles.cpp b/src/share/vm/prims/methodHandles.cpp
index f91cf0d..d21c0fa 100644
--- a/src/share/vm/prims/methodHandles.cpp
+++ b/src/share/vm/prims/methodHandles.cpp
@@ -178,7 +178,7 @@
   return NULL;
 }
 
-oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info, bool intern) {
+oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
   assert(info.resolved_appendix().is_null(), "only normal methods here");
   methodHandle m = info.resolved_method();
   assert(m.not_null(), "null method handle");
@@ -279,7 +279,13 @@
   // If relevant, the vtable or itable value is stored as vmindex.
   // This is done eagerly, since it is readily available without
   // constructing any new objects.
-  return m->method_holder()->add_member_name(mname, intern);
+  // TO DO: maybe intern mname_oop
+  if (m->method_holder()->add_member_name(mname)) {
+    return mname();
+  } else {
+    // Redefinition caused this to fail.  Return NULL (and an exception?)
+    return NULL;
+  }
 }
 
 oop MethodHandles::init_field_MemberName(Handle mname, fieldDescriptor& fd, bool is_setter) {
@@ -969,9 +975,7 @@
         if (!java_lang_invoke_MemberName::is_instance(result()))
           return -99;  // caller bug!
         CallInfo info(m);
-        // Since this is going through the methods to create MemberNames, don't search
-        // for matching methods already in the table
-        oop saved = MethodHandles::init_method_MemberName(result, info, /*intern*/false);
+        oop saved = MethodHandles::init_method_MemberName(result, info);
         if (saved != result())
           results->obj_at_put(rfill-1, saved);  // show saved instance to user
       } else if (++overflow >= overflow_limit) {
@@ -1052,34 +1056,9 @@
   }
 }
 
-oop MemberNameTable::add_member_name(jweak mem_name_wref) {
+void MemberNameTable::add_member_name(jweak mem_name_wref) {
   assert_locked_or_safepoint(MemberNameTable_lock);
   this->push(mem_name_wref);
-  return JNIHandles::resolve(mem_name_wref);
-}
-
-oop MemberNameTable::find_or_add_member_name(jweak mem_name_wref) {
-  assert_locked_or_safepoint(MemberNameTable_lock);
-  oop new_mem_name = JNIHandles::resolve(mem_name_wref);
-
-  // Find matching member name in the list.
-  // This is linear because these because these are short lists.
-  int len = this->length();
-  int new_index = len;
-  for (int idx = 0; idx < len; idx++) {
-    oop mname = JNIHandles::resolve(this->at(idx));
-    if (mname == NULL) {
-      new_index = idx;
-      continue;
-    }
-    if (java_lang_invoke_MemberName::equals(new_mem_name, mname)) {
-      JNIHandles::destroy_weak_global(mem_name_wref);
-      return mname;
-    }
-  }
-  // Not found, push the new one, or reuse empty slot
-  this->at_put_grow(new_index, mem_name_wref);
-  return new_mem_name;
 }
 
 #if INCLUDE_JVMTI
diff --git a/src/share/vm/prims/methodHandles.hpp b/src/share/vm/prims/methodHandles.hpp
index b6bc97e..4a82546 100644
--- a/src/share/vm/prims/methodHandles.hpp
+++ b/src/share/vm/prims/methodHandles.hpp
@@ -30,13 +30,13 @@
 #include "runtime/frame.inline.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/interfaceSupport.hpp"
+#include "utilities/macros.hpp"
 
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "entry_zero.hpp"
 #endif
 
 
-
 class MacroAssembler;
 class Label;
 
@@ -66,7 +66,7 @@
   static Handle new_MemberName(TRAPS);  // must be followed by init_MemberName
   static oop init_MemberName(Handle mname_h, Handle target_h); // compute vmtarget/vmindex from target
   static oop init_field_MemberName(Handle mname_h, fieldDescriptor& fd, bool is_setter = false);
-  static oop init_method_MemberName(Handle mname_h, CallInfo& info, bool intern = true);
+  static oop init_method_MemberName(Handle mname_h, CallInfo& info);
   static int method_ref_kind(Method* m, bool do_dispatch_if_possible = true);
   static int find_MemberNames(KlassHandle k, Symbol* name, Symbol* sig,
                               int mflags, KlassHandle caller,
@@ -192,25 +192,7 @@
             ref_kind == JVM_REF_invokeInterface);
   }
 
-
-#ifdef TARGET_ARCH_x86
-# include "methodHandles_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "methodHandles_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "methodHandles_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "methodHandles_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "methodHandles_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "methodHandles_aarch64.hpp"
-#endif
+#include CPU_HEADER(methodHandles)
 
   // Tracing
   static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
@@ -253,8 +235,7 @@
  public:
   MemberNameTable(int methods_cnt);
   ~MemberNameTable();
-  oop add_member_name(jweak mem_name_ref);
-  oop find_or_add_member_name(jweak mem_name_ref);
+  void add_member_name(jweak mem_name_ref);
 
 #if INCLUDE_JVMTI
   // RedefineClasses() API support:
diff --git a/src/share/vm/prims/stackwalk.cpp b/src/share/vm/prims/stackwalk.cpp
index 70f46f7..3cce63b 100644
--- a/src/share/vm/prims/stackwalk.cpp
+++ b/src/share/vm/prims/stackwalk.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
diff --git a/src/share/vm/prims/stackwalk.hpp b/src/share/vm/prims/stackwalk.hpp
index e222e62..cbc4405 100644
--- a/src/share/vm/prims/stackwalk.hpp
+++ b/src/share/vm/prims/stackwalk.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
diff --git a/src/share/vm/prims/whitebox.cpp b/src/share/vm/prims/whitebox.cpp
index e1a83af..6a6389d 100644
--- a/src/share/vm/prims/whitebox.cpp
+++ b/src/share/vm/prims/whitebox.cpp
@@ -350,6 +350,11 @@
   return (jlong)alignment;
 WB_END
 
+WB_ENTRY(jlong, WB_GetHeapAlignment(JNIEnv* env, jobject o))
+  size_t alignment = Universe::heap()->collector_policy()->heap_alignment();
+  return (jlong)alignment;
+WB_END
+
 #if INCLUDE_ALL_GCS
 WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj))
   G1CollectedHeap* g1 = G1CollectedHeap::heap();
@@ -401,14 +406,21 @@
 WB_END
 
 WB_ENTRY(jlong, WB_PSVirtualSpaceAlignment(JNIEnv* env, jobject o))
-  ParallelScavengeHeap* ps = ParallelScavengeHeap::heap();
-  size_t alignment = ps->gens()->virtual_spaces()->alignment();
-  return (jlong)alignment;
+#if INCLUDE_ALL_GCS
+  if (UseParallelGC) {
+    return ParallelScavengeHeap::heap()->gens()->virtual_spaces()->alignment();
+  }
+#endif // INCLUDE_ALL_GCS
+  THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "WB_PSVirtualSpaceAlignment: Parallel GC is not enabled");
 WB_END
 
 WB_ENTRY(jlong, WB_PSHeapGenerationAlignment(JNIEnv* env, jobject o))
-  size_t alignment = ParallelScavengeHeap::heap()->generation_alignment();
-  return (jlong)alignment;
+#if INCLUDE_ALL_GCS
+  if (UseParallelGC) {
+    return ParallelScavengeHeap::heap()->generation_alignment();
+  }
+#endif // INCLUDE_ALL_GCS
+  THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "WB_PSHeapGenerationAlignment: Parallel GC is not enabled");
 WB_END
 
 WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
@@ -1693,6 +1705,7 @@
   {CC"getVMAllocationGranularity",       CC"()J",                   (void*)&WB_GetVMAllocationGranularity },
   {CC"getVMLargePageSize",               CC"()J",                   (void*)&WB_GetVMLargePageSize},
   {CC"getHeapSpaceAlignment",            CC"()J",                   (void*)&WB_GetHeapSpaceAlignment},
+  {CC"getHeapAlignment",                 CC"()J",                   (void*)&WB_GetHeapAlignment},
   {CC"isClassAlive0",                    CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive      },
   {CC"parseCommandLine0",
       CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
index a9e944e..45d1de2 100644
--- a/src/share/vm/runtime/arguments.cpp
+++ b/src/share/vm/runtime/arguments.cpp
@@ -85,7 +85,6 @@
 const char*  Arguments::_sun_java_launcher      = DEFAULT_JAVA_LAUNCHER;
 int    Arguments::_sun_java_launcher_pid        = -1;
 bool   Arguments::_sun_java_launcher_is_altjvm  = false;
-int    Arguments::_bootclassloader_append_index = -1;
 
 // These parameters are reset in method parse_vm_init_args()
 bool   Arguments::_AlwaysCompileLoopMethods     = AlwaysCompileLoopMethods;
@@ -113,6 +112,7 @@
 
 GrowableArray<ModuleXPatchPath*> *Arguments::_xpatchprefix = NULL;
 PathString *Arguments::_system_boot_class_path = NULL;
+bool Arguments::_has_jimage = false;
 
 char* Arguments::_ext_dirs = NULL;
 
@@ -1305,6 +1305,11 @@
     }
     sp = sp->next();
   }
+
+  // Check for an exploded module build in use with -Xshare:dump.
+  if (!has_jimage()) {
+    vm_exit_during_initialization("Dumping the shared archive is not supported with an exploded module build");
+  }
 }
 #endif
 
@@ -1779,11 +1784,7 @@
     if (should_auto_select_low_pause_collector()) {
       FLAG_SET_ERGO_IF_DEFAULT(bool, UseConcMarkSweepGC, true);
     } else {
-#if defined(JAVASE_EMBEDDED)
-      FLAG_SET_ERGO_IF_DEFAULT(bool, UseParallelGC, true);
-#else
       FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
-#endif
     }
   } else {
     FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
@@ -2276,11 +2277,7 @@
 #if INCLUDE_JVMCI
 // Check consistency of jvmci vm argument settings.
 bool Arguments::check_jvmci_args_consistency() {
-  if (!EnableJVMCI && !JVMCIGlobals::check_jvmci_flags_are_consistent()) {
-    JVMCIGlobals::print_jvmci_args_inconsistency_error_message();
-    return false;
-  }
-  return true;
+   return JVMCIGlobals::check_jvmci_flags_are_consistent();
 }
 #endif //INCLUDE_JVMCI
 
@@ -2676,7 +2673,6 @@
         return JNI_EINVAL;
     // -bootclasspath/a:
     } else if (match_option(option, "-Xbootclasspath/a:", &tail)) {
-      Arguments::set_bootclassloader_append_index((int)strlen(Arguments::get_sysclasspath())+1);
       Arguments::append_sysclasspath(tail);
     // -bootclasspath/p:
     } else if (match_option(option, "-Xbootclasspath/p:", &tail)) {
@@ -3323,18 +3319,6 @@
   _xpatchprefix->push(new ModuleXPatchPath(module_name, path));
 }
 
-// Set property jdk.boot.class.path.append to the contents of the bootclasspath
-// that follows either the jimage file or exploded module directories.  The
-// property will contain -Xbootclasspath/a and/or jvmti appended additions.
-void Arguments::set_jdkbootclasspath_append() {
-  char *sysclasspath = get_sysclasspath();
-  assert(sysclasspath != NULL, "NULL sysclasspath");
-  int bcp_a_idx = bootclassloader_append_index();
-  if (bcp_a_idx != -1 && bcp_a_idx < (int)strlen(sysclasspath)) {
-    _jdk_boot_class_path_append->set_value(sysclasspath + bcp_a_idx);
-  }
-}
-
 // Remove all empty paths from the app classpath (if IgnoreEmptyClassPaths is enabled)
 //
 // This is necessary because some apps like to specify classpath like -cp foo.jar:${XYZ}:bar.jar
@@ -3457,8 +3441,6 @@
     return JNI_ERR;
   }
 
-  Arguments::set_bootclassloader_append_index(((int)strlen(Arguments::get_sysclasspath()))+1);
-
   // This must be done after all arguments have been processed.
   // java_compiler() true means set to "NONE" or empty.
   if (java_compiler() && !xdebug_mode()) {
diff --git a/src/share/vm/runtime/arguments.hpp b/src/share/vm/runtime/arguments.hpp
index 8c8399d..e72c492 100644
--- a/src/share/vm/runtime/arguments.hpp
+++ b/src/share/vm/runtime/arguments.hpp
@@ -363,6 +363,9 @@
   // -Xbootclasspath/p was supported.
   static PathString *_system_boot_class_path;
 
+  // Set if a modular java runtime image is present vs. a build with exploded modules
+  static bool _has_jimage;
+
   // temporary: to emit warning if the default ext dirs are not empty.
   // remove this variable when the warning is no longer needed.
   static char* _ext_dirs;
@@ -411,11 +414,6 @@
   static void set_java_compiler(bool arg) { _java_compiler = arg; }
   static bool java_compiler()   { return _java_compiler; }
 
-  // Capture the index location of -Xbootclasspath\a within sysclasspath.
-  // Used when setting up the bootstrap search path in order to
-  // mark the boot loader's append path observability boundary.
-  static int _bootclassloader_append_index;
-
   // -Xdebug flag
   static bool _xdebug_mode;
   static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; }
@@ -669,17 +667,6 @@
   static size_t min_heap_size()             { return _min_heap_size; }
   static void  set_min_heap_size(size_t v)  { _min_heap_size = v;  }
 
-  // -Xbootclasspath/a
-  static int  bootclassloader_append_index() {
-    return _bootclassloader_append_index;
-  }
-  static void set_bootclassloader_append_index(int value) {
-    // Set only if the index has not been set yet
-    if (_bootclassloader_append_index == -1) {
-      _bootclassloader_append_index = value;
-    }
-  }
-
   // -Xrun
   static AgentLibrary* libraries()          { return _libraryList.first(); }
   static bool init_libraries_at_startup()   { return !_libraryList.is_empty(); }
@@ -739,19 +726,21 @@
 
   // Set up the underlying pieces of the system boot class path
   static void add_xpatchprefix(const char *module_name, const char *path, bool* xpatch_javabase);
-  static void set_sysclasspath(const char *value) {
+  static void set_sysclasspath(const char *value, bool has_jimage) {
+    // During start up, set by os::set_boot_path()
+    assert(get_sysclasspath() == NULL, "System boot class path previously set");
     _system_boot_class_path->set_value(value);
-    set_jdkbootclasspath_append();
+    _has_jimage = has_jimage;
   }
   static void append_sysclasspath(const char *value) {
     _system_boot_class_path->append_value(value);
-    set_jdkbootclasspath_append();
+    _jdk_boot_class_path_append->append_value(value);
   }
-  static void set_jdkbootclasspath_append();
 
   static GrowableArray<ModuleXPatchPath*>* get_xpatchprefix() { return _xpatchprefix; }
   static char* get_sysclasspath() { return _system_boot_class_path->value(); }
   static char* get_jdk_boot_class_path_append() { return _jdk_boot_class_path_append->value(); }
+  static bool has_jimage() { return _has_jimage; }
 
   static char* get_java_home()    { return _java_home->value(); }
   static char* get_dll_dir()      { return _sun_boot_library_path->value(); }
diff --git a/src/share/vm/runtime/atomic.inline.hpp b/src/share/vm/runtime/atomic.inline.hpp
index 8abc729..690be7d 100644
--- a/src/share/vm/runtime/atomic.inline.hpp
+++ b/src/share/vm/runtime/atomic.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,52 +26,9 @@
 #define SHARE_VM_RUNTIME_ATOMIC_INLINE_HPP
 
 #include "runtime/atomic.hpp"
+#include "utilities/macros.hpp"
 
-// Linux
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "atomic_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "atomic_linux_sparc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "atomic_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "atomic_linux_arm.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "atomic_linux_ppc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "atomic_linux_aarch64.inline.hpp"
-#endif
-
-// Solaris
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "atomic_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "atomic_solaris_sparc.inline.hpp"
-#endif
-
-// Windows
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "atomic_windows_x86.inline.hpp"
-#endif
-
-// AIX
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "atomic_aix_ppc.inline.hpp"
-#endif
-
-// BSD
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "atomic_bsd_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "atomic_bsd_zero.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(atomic)
 
 // size_t casts...
 #if (SIZE_MAX != UINTPTR_MAX)
diff --git a/src/share/vm/runtime/frame.hpp b/src/share/vm/runtime/frame.hpp
index b71585a..d3974d7 100644
--- a/src/share/vm/runtime/frame.hpp
+++ b/src/share/vm/runtime/frame.hpp
@@ -29,7 +29,8 @@
 #include "runtime/basicLock.hpp"
 #include "runtime/monitorChunk.hpp"
 #include "runtime/registerMap.hpp"
-#ifdef TARGET_ARCH_zero
+#include "utilities/macros.hpp"
+#ifdef ZERO
 # include "stack_zero.hpp"
 #endif
 
@@ -415,24 +416,7 @@
 
   int pd_oop_map_offset_adjustment() const;
 
-#ifdef TARGET_ARCH_x86
-# include "frame_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "frame_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "frame_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "frame_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "frame_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "frame_aarch64.hpp"
-#endif
+#include CPU_HEADER(frame)
 
 };
 
diff --git a/src/share/vm/runtime/frame.inline.hpp b/src/share/vm/runtime/frame.inline.hpp
index 79ba0f9..1ac6302 100644
--- a/src/share/vm/runtime/frame.inline.hpp
+++ b/src/share/vm/runtime/frame.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,13 +31,16 @@
 #include "oops/method.hpp"
 #include "runtime/frame.hpp"
 #include "runtime/signature.hpp"
-#ifdef TARGET_ARCH_zero
+#include "utilities/macros.hpp"
+#ifdef ZERO
 # include "entryFrame_zero.hpp"
 # include "fakeStubFrame_zero.hpp"
 # include "interpreterFrame_zero.hpp"
 # include "sharkFrame_zero.hpp"
 #endif
 
+#include CPU_HEADER_INLINE(frame)
+
 inline bool frame::is_entry_frame() const {
   return StubRoutines::returns_to_call_stub(pc());
 }
@@ -50,26 +53,4 @@
   return is_entry_frame() && entry_frame_is_first();
 }
 
-// here are the platform-dependent bodies:
-
-#ifdef TARGET_ARCH_x86
-# include "frame_x86.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "frame_sparc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "frame_zero.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "frame_arm.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "frame_ppc.inline.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "frame_aarch64.inline.hpp"
-#endif
-
-
 #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP
diff --git a/src/share/vm/runtime/globals.cpp b/src/share/vm/runtime/globals.cpp
index c878da3..b0a0d79 100644
--- a/src/share/vm/runtime/globals.cpp
+++ b/src/share/vm/runtime/globals.cpp
@@ -334,7 +334,8 @@
 
 void Flag::set_origin(Flags origin) {
   assert((origin & VALUE_ORIGIN_MASK) == origin, "sanity");
-  _flags = Flags((_flags & ~VALUE_ORIGIN_MASK) | origin);
+  Flags new_origin = Flags((origin == COMMAND_LINE) ? Flags(origin | ORIG_COMMAND_LINE) : origin);
+  _flags = Flags((_flags & ~VALUE_ORIGIN_MASK) | new_origin);
 }
 
 bool Flag::is_default() {
@@ -346,7 +347,11 @@
 }
 
 bool Flag::is_command_line() {
-  return (get_origin() == COMMAND_LINE);
+  return (_flags & ORIG_COMMAND_LINE) != 0;
+}
+
+void Flag::set_command_line() {
+  _flags = Flags(_flags | ORIG_COMMAND_LINE);
 }
 
 bool Flag::is_product() const {
@@ -464,25 +469,31 @@
   }
 
   if (!printRanges) {
-
-    st->print("%9s %-40s %c= ", _type, _name, (!is_default() ? ':' : ' '));
+    // The print below assumes that the flag name is 40 characters or less.
+    // This works for most flags, but there are exceptions. Our longest flag
+    // name right now is UseAdaptiveGenerationSizePolicyAtMajorCollection and
+    // its minor collection buddy. These are 48 characters. We use a buffer of
+    // 10 spaces below to adjust the space between the flag value and the
+    // column of flag type and origin that is printed in the end of the line.
+    char spaces[10 + 1] = "          ";
+    st->print("%9s %-40s = ", _type, _name);
 
     if (is_bool()) {
-      st->print("%-16s", get_bool() ? "true" : "false");
+      st->print("%-20s", get_bool() ? "true" : "false");
     } else if (is_int()) {
-      st->print("%-16d", get_int());
+      st->print("%-20d", get_int());
     } else if (is_uint()) {
-      st->print("%-16u", get_uint());
+      st->print("%-20u", get_uint());
     } else if (is_intx()) {
-      st->print(INTX_FORMAT_W(-16), get_intx());
+      st->print(INTX_FORMAT_W(-20), get_intx());
     } else if (is_uintx()) {
-      st->print(UINTX_FORMAT_W(-16), get_uintx());
+      st->print(UINTX_FORMAT_W(-20), get_uintx());
     } else if (is_uint64_t()) {
-      st->print(UINT64_FORMAT_W(-16), get_uint64_t());
+      st->print(UINT64_FORMAT_W(-20), get_uint64_t());
     } else if (is_size_t()) {
-      st->print(SIZE_FORMAT_W(-16), get_size_t());
+      st->print(SIZE_FORMAT_W(-20), get_size_t());
     } else if (is_double()) {
-      st->print("%-16f", get_double());
+      st->print("%-20f", get_double());
     } else if (is_ccstr()) {
       const char* cp = get_ccstr();
       if (cp != NULL) {
@@ -494,13 +505,14 @@
           cp = eol+1;
           st->print("%5s %-35s += ", "", _name);
         }
-        st->print("%-16s", cp);
+        st->print("%-20s", cp);
       }
-      else st->print("%-16s", "");
+      else st->print("%-20s", "");
     }
-
-    st->print("%-20s", " ");
-    print_kind(st);
+    assert(strlen(_name) < 50, "Flag name is longer than expected");
+    spaces[50 - MAX2((size_t)40, strlen(_name))] = '\0';
+    st->print("%s", spaces);
+    print_kind_and_origin(st);
 
 #ifndef PRODUCT
     if (withComments) {
@@ -533,8 +545,8 @@
     }
     CommandLineFlagRangeList::print(st, _name, func);
 
-    st->print(" %-20s", " ");
-    print_kind(st);
+    st->print(" %-16s", " ");
+    print_kind_and_origin(st);
 
 #ifndef PRODUCT
     if (withComments) {
@@ -546,7 +558,7 @@
   }
 }
 
-void Flag::print_kind(outputStream* st) {
+void Flag::print_kind_and_origin(outputStream* st) {
   struct Data {
     int flag;
     const char* name;
@@ -572,23 +584,58 @@
   };
 
   if ((_flags & KIND_MASK) != 0) {
-    st->print("{");
     bool is_first = true;
+    const size_t buffer_size = 64;
+    size_t buffer_used = 0;
+    char kind[buffer_size];
 
+    jio_snprintf(kind, buffer_size, "{");
+    buffer_used++;
     for (int i = 0; data[i].flag != -1; i++) {
       Data d = data[i];
       if ((_flags & d.flag) != 0) {
         if (is_first) {
           is_first = false;
         } else {
-          st->print(" ");
+          assert(buffer_used + 1 < buffer_size, "Too small buffer");
+          jio_snprintf(kind + buffer_used, buffer_size - buffer_used, " ");
+          buffer_used++;
         }
-        st->print("%s", d.name);
+        size_t length = strlen(d.name);
+        assert(buffer_used + length < buffer_size, "Too small buffer");
+        jio_snprintf(kind + buffer_used, buffer_size - buffer_used, "%s", d.name);
+        buffer_used += length;
       }
     }
-
-    st->print("}");
+    assert(buffer_used + 2 <= buffer_size, "Too small buffer");
+    jio_snprintf(kind + buffer_used, buffer_size - buffer_used, "}");
+    st->print("%20s", kind);
   }
+
+  int origin = _flags & VALUE_ORIGIN_MASK;
+  st->print(" {");
+  switch(origin) {
+    case DEFAULT:
+      st->print("default"); break;
+    case COMMAND_LINE:
+      st->print("command line"); break;
+    case ENVIRON_VAR:
+      st->print("environment"); break;
+    case CONFIG_FILE:
+      st->print("config file"); break;
+    case MANAGEMENT:
+      st->print("management"); break;
+    case ERGONOMIC:
+      if (_flags & ORIG_COMMAND_LINE) {
+        st->print("command line, ");
+      }
+      st->print("ergonomic"); break;
+    case ATTACH_ON_DEMAND:
+      st->print("attach"); break;
+    case INTERNAL:
+      st->print("internal"); break;
+  }
+  st->print("}");
 }
 
 void Flag::print_as_flag(outputStream* st) {
@@ -918,6 +965,12 @@
   return true;
 }
 
+void CommandLineFlagsEx::setOnCmdLine(CommandLineFlagWithType flag) {
+  Flag* faddr = address_of_flag(flag);
+  assert(faddr != NULL, "Unknown flag");
+  faddr->set_command_line();
+}
+
 template<class E, class T>
 static void trace_flag_changed(const char* name, const T old_value, const T new_value, const Flag::Flags origin) {
   E e;
diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp
index e54ea9a..930c51a 100644
--- a/src/share/vm/runtime/globals.hpp
+++ b/src/share/vm/runtime/globals.hpp
@@ -26,6 +26,8 @@
 #define SHARE_VM_RUNTIME_GLOBALS_HPP
 
 #include "utilities/debug.hpp"
+#include "utilities/macros.hpp"
+
 #include <float.h> // for DBL_MAX
 
 // use this for flags that are true per default in the tiered build
@@ -38,141 +40,19 @@
 #define falseInTiered true
 #endif
 
-#ifdef TARGET_ARCH_x86
-# include "globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "globals_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "globals_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "globals_bsd.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "globals_linux_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "globals_linux_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "globals_linux_zero.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "globals_solaris_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "globals_solaris_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "globals_windows_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "globals_linux_arm.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "globals_linux_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "globals_linux_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "globals_aix_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "globals_bsd_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "globals_bsd_zero.hpp"
-#endif
+#include CPU_HEADER(globals)
+#include OS_HEADER(globals)
+#include OS_CPU_HEADER(globals)
 #ifdef COMPILER1
-#ifdef TARGET_ARCH_x86
-# include "c1_globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c1_globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c1_globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c1_globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "c1_globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "c1_globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "c1_globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "c1_globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "c1_globals_bsd.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c1_globals_ppc.hpp"
-#endif
+#include CPU_HEADER(c1_globals)
+#include OS_HEADER(c1_globals)
 #endif
 #ifdef COMPILER2
-#ifdef TARGET_ARCH_x86
-# include "c2_globals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "c2_globals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "c2_globals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "c2_globals_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "c2_globals_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "c2_globals_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "c2_globals_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "c2_globals_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "c2_globals_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "c2_globals_bsd.hpp"
-#endif
+#include CPU_HEADER(c2_globals)
+#include OS_HEADER(c2_globals)
 #endif
 #ifdef SHARK
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "shark_globals_zero.hpp"
 #endif
 #endif
@@ -229,7 +109,7 @@
 
 struct Flag {
   enum Flags {
-    // value origin
+    // latest value origin
     DEFAULT          = 0,
     COMMAND_LINE     = 1,
     ENVIRON_VAR      = 2,
@@ -260,7 +140,10 @@
     KIND_COMMERCIAL         = 1 << 17,
     KIND_JVMCI              = 1 << 18,
 
-    KIND_MASK = ~VALUE_ORIGIN_MASK
+    // set this bit if the flag was set on the command line
+    ORIG_COMMAND_LINE       = 1 << 19,
+
+    KIND_MASK = ~(VALUE_ORIGIN_MASK | ORIG_COMMAND_LINE)
   };
 
   enum Error {
@@ -272,7 +155,7 @@
     MISSING_VALUE,
     // error parsing the textual form of the value
     WRONG_FORMAT,
-    // flag is not writeable
+    // flag is not writable
     NON_WRITABLE,
     // flag value is outside of its bounds
     OUT_OF_BOUNDS,
@@ -367,6 +250,7 @@
   bool is_default();
   bool is_ergonomic();
   bool is_command_line();
+  void set_command_line();
 
   bool is_product() const;
   bool is_manageable() const;
@@ -396,7 +280,7 @@
 
   // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
   void print_on(outputStream* st, bool withComments = false, bool printRanges = false);
-  void print_kind(outputStream* st);
+  void print_kind_and_origin(outputStream* st);
   void print_as_flag(outputStream* st);
 
   static const char* flag_error_str(Flag::Error error);
@@ -574,12 +458,6 @@
 #define falseInProduct true
 #endif
 
-#ifdef JAVASE_EMBEDDED
-#define falseInEmbedded false
-#else
-#define falseInEmbedded true
-#endif
-
 // develop flags are settable / visible only during development and are constant in the PRODUCT version
 // product flags are always settable / visible
 // notproduct flags are settable / visible only during development and are not declared in the PRODUCT version
@@ -708,7 +586,7 @@
   product_pd(bool, UseMembar,                                               \
           "(Unstable) Issues membars on thread state transitions")          \
                                                                             \
-  develop(bool, CleanChunkPoolAsync, falseInEmbedded,                       \
+  develop(bool, CleanChunkPoolAsync, true,                                  \
           "Clean the chunk pool asynchronously")                            \
                                                                             \
   experimental(bool, AlwaysSafeConstructors, false,                         \
@@ -802,9 +680,6 @@
   develop(bool, TracePcPatching, false,                                     \
           "Trace usage of frame::patch_pc")                                 \
                                                                             \
-  develop(bool, TraceJumps, false,                                          \
-          "Trace assembly jumps in thread ring buffer")                     \
-                                                                            \
   develop(bool, TraceRelocator, false,                                      \
           "Trace the bytecode relocator")                                   \
                                                                             \
@@ -1563,6 +1438,10 @@
           "Dynamically choose the number of parallel threads "              \
           "parallel gc will use")                                           \
                                                                             \
+  diagnostic(bool, InjectGCWorkerCreationFailure, false,                    \
+             "Inject thread creation failures for "                         \
+             "UseDynamicNumberOfGCThreads")                                 \
+                                                                            \
   diagnostic(bool, ForceDynamicNumberOfGCThreads, false,                    \
           "Force dynamic selection of the number of "                       \
           "parallel threads parallel gc will use to aid debugging")         \
@@ -3006,15 +2885,10 @@
                                                                             \
   /* notice: the max range value here is max_jint, not max_intx  */         \
   /* because of overflow issue                                   */         \
-  NOT_EMBEDDED(diagnostic(intx, GuaranteedSafepointInterval, 1000,          \
+  diagnostic(intx, GuaranteedSafepointInterval, 1000,                       \
           "Guarantee a safepoint (at least) every so many milliseconds "    \
-          "(0 means none)"))                                                \
-  NOT_EMBEDDED(range(0, max_jint))                                          \
-                                                                            \
-  EMBEDDED_ONLY(product(intx, GuaranteedSafepointInterval, 0,               \
-          "Guarantee a safepoint (at least) every so many milliseconds "    \
-          "(0 means none)"))                                                \
-  EMBEDDED_ONLY(range(0, max_jint))                                         \
+          "(0 means none)")                                                 \
+          range(0, max_jint)                                                \
                                                                             \
   product(intx, SafepointTimeoutDelay, 10000,                               \
           "Delay in milliseconds for option SafepointTimeout")              \
@@ -3916,7 +3790,7 @@
                                                                             \
   /* flags for performance data collection */                               \
                                                                             \
-  product(bool, UsePerfData, falseInEmbedded,                               \
+  product(bool, UsePerfData, true,                                          \
           "Flag to disable jvmstat instrumentation for performance testing "\
           "and problem isolation purposes")                                 \
                                                                             \
diff --git a/src/share/vm/runtime/globals_extension.hpp b/src/share/vm/runtime/globals_extension.hpp
index 881d3ef..f38723d 100644
--- a/src/share/vm/runtime/globals_extension.hpp
+++ b/src/share/vm/runtime/globals_extension.hpp
@@ -334,8 +334,9 @@
 
 #define FLAG_SET_DEFAULT(name, value) ((name) = (value))
 
-#define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::COMMAND_LINE))
-#define FLAG_SET_ERGO(type, name, value)    (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::ERGONOMIC))
+#define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::setOnCmdLine(FLAG_MEMBER_WITH_TYPE(name, type)), \
+                                             CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name, type), (type)(value), Flag::COMMAND_LINE))
+#define FLAG_SET_ERGO(type, name, value)    (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name, type), (type)(value), Flag::ERGONOMIC))
 #define FLAG_SET_ERGO_IF_DEFAULT(type, name, value) \
   do {                                              \
     if (FLAG_IS_DEFAULT(name)) {                    \
@@ -361,6 +362,8 @@
   static bool is_default(CommandLineFlag flag);
   static bool is_ergo(CommandLineFlag flag);
   static bool is_cmdline(CommandLineFlag flag);
+
+  static void setOnCmdLine(CommandLineFlagWithType flag);
 };
 
 #endif // SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
diff --git a/src/share/vm/runtime/icache.hpp b/src/share/vm/runtime/icache.hpp
index 9a3b9c8..637ea13 100644
--- a/src/share/vm/runtime/icache.hpp
+++ b/src/share/vm/runtime/icache.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -27,6 +27,7 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/stubCodeGenerator.hpp"
+#include "utilities/macros.hpp"
 
 // Interface for updating the instruction cache.  Whenever the VM modifies
 // code, part of the processor instruction cache potentially has to be flushed.
@@ -68,26 +69,7 @@
 // Must be included before the definition of ICacheStubGenerator
 // because ICacheStubGenerator uses ICache definitions.
 
-#ifdef TARGET_ARCH_x86
-# include "icache_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "icache_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "icache_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "icache_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "icache_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "icache_aarch64.hpp"
-#endif
-
-
+#include CPU_HEADER(icache)
 
 class ICacheStubGenerator : public StubCodeGenerator {
  public:
diff --git a/src/share/vm/runtime/init.cpp b/src/share/vm/runtime/init.cpp
index b74a3da..939dae7 100644
--- a/src/share/vm/runtime/init.cpp
+++ b/src/share/vm/runtime/init.cpp
@@ -53,7 +53,6 @@
 void management_init();
 void bytecodes_init();
 void classLoader_init1();
-void classLoader_init2(); // note: ClassLoader need 2-phase init
 void compilationPolicy_init();
 void codeCache_init();
 void VM_Version_init();
@@ -117,7 +116,6 @@
   if (status != JNI_OK)
     return status;
 
-  classLoader_init2();  // after SymbolTable creation, set up -Xpatch entries
   CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Universe);
   interpreter_init();  // before any methods loaded
   CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Interpreter);
diff --git a/src/share/vm/runtime/interfaceSupport.hpp b/src/share/vm/runtime/interfaceSupport.hpp
index de3ef8f..4d4d51b 100644
--- a/src/share/vm/runtime/interfaceSupport.hpp
+++ b/src/share/vm/runtime/interfaceSupport.hpp
@@ -34,6 +34,7 @@
 #include "runtime/thread.inline.hpp"
 #include "runtime/vmThread.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/preserveException.hpp"
 
 // Wrapper for all entry points to the virtual machine.
@@ -90,21 +91,8 @@
 
  public:
   // OS dependent stuff
-#ifdef TARGET_OS_FAMILY_linux
-# include "interfaceSupport_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "interfaceSupport_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "interfaceSupport_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "interfaceSupport_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "interfaceSupport_bsd.hpp"
-#endif
+
+#include OS_HEADER(interfaceSupport)
 
 };
 
diff --git a/src/share/vm/runtime/javaCalls.hpp b/src/share/vm/runtime/javaCalls.hpp
index 0d88568..dd67b7e 100644
--- a/src/share/vm/runtime/javaCalls.hpp
+++ b/src/share/vm/runtime/javaCalls.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,24 +31,9 @@
 #include "runtime/javaFrameAnchor.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/vmThread.hpp"
-#ifdef TARGET_ARCH_x86
-# include "jniTypes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "jniTypes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "jniTypes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "jniTypes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "jniTypes_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "jniTypes_aarch64.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(jniTypes)
 
 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call.
 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last
diff --git a/src/share/vm/runtime/javaFrameAnchor.hpp b/src/share/vm/runtime/javaFrameAnchor.hpp
index 777698c..64565a2 100644
--- a/src/share/vm/runtime/javaFrameAnchor.hpp
+++ b/src/share/vm/runtime/javaFrameAnchor.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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,8 +25,9 @@
 #ifndef SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
 #define SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
 
-#include "utilities/globalDefinitions.hpp"
 #include "runtime/orderAccess.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 //
 // An object for encapsulating the machine/os dependent part of a JavaThread frame state
@@ -77,25 +78,7 @@
   // and no one should look at the other fields.
   void zap(void)                                     { _last_Java_sp = NULL; }
 
-#ifdef TARGET_ARCH_x86
-# include "javaFrameAnchor_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "javaFrameAnchor_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "javaFrameAnchor_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "javaFrameAnchor_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "javaFrameAnchor_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "javaFrameAnchor_aarch64.hpp"
-#endif
-
+#include CPU_HEADER(javaFrameAnchor)
 
 public:
   JavaFrameAnchor()                              { clear(); }
diff --git a/src/share/vm/runtime/mutex.cpp b/src/share/vm/runtime/mutex.cpp
index a065fb1..f24e2a0 100644
--- a/src/share/vm/runtime/mutex.cpp
+++ b/src/share/vm/runtime/mutex.cpp
@@ -30,18 +30,7 @@
 #include "runtime/osThread.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/events.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "mutex_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "mutex_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "mutex_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "mutex_bsd.inline.hpp"
-#endif
+#include "utilities/macros.hpp"
 
 // o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
 //
diff --git a/src/share/vm/runtime/orderAccess.inline.hpp b/src/share/vm/runtime/orderAccess.inline.hpp
index bc32373..0907a43 100644
--- a/src/share/vm/runtime/orderAccess.inline.hpp
+++ b/src/share/vm/runtime/orderAccess.inline.hpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2014 SAP SE. All rights reserved.
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016 SAP SE. 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
@@ -28,52 +28,9 @@
 
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.hpp"
+#include "utilities/macros.hpp"
 
-// Linux
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "orderAccess_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "orderAccess_linux_sparc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "orderAccess_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "orderAccess_linux_arm.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "orderAccess_linux_aarch64.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "orderAccess_linux_ppc.inline.hpp"
-#endif
-
-// Solaris
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "orderAccess_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "orderAccess_solaris_sparc.inline.hpp"
-#endif
-
-// Windows
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "orderAccess_windows_x86.inline.hpp"
-#endif
-
-// AIX
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "orderAccess_aix_ppc.inline.hpp"
-#endif
-
-// BSD
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "orderAccess_bsd_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "orderAccess_bsd_zero.inline.hpp"
-#endif
+#include OS_CPU_HEADER_INLINE(orderAccess)
 
 #ifdef VM_HAS_GENERALIZED_ORDER_ACCESS
 
diff --git a/src/share/vm/runtime/os.cpp b/src/share/vm/runtime/os.cpp
index 554a183..e9ff778 100644
--- a/src/share/vm/runtime/os.cpp
+++ b/src/share/vm/runtime/os.cpp
@@ -71,6 +71,7 @@
 uintptr_t         os::_serialize_page_mask = 0;
 long              os::_rand_seed          = 1;
 int               os::_processor_count    = 0;
+int               os::_initial_active_processor_count = 0;
 size_t            os::_page_sizes[os::page_sizes_max];
 
 #ifndef PRODUCT
@@ -315,6 +316,7 @@
 }
 
 void os::init_before_ergo() {
+  initialize_initial_active_processor_count();
   // We need to initialize large page support here because ergonomics takes some
   // decisions depending on large page support and the calculated large page size.
   large_page_init();
@@ -829,7 +831,11 @@
   st->print("CPU:");
   st->print("total %d", os::processor_count());
   // It's not safe to query number of active processors after crash
-  // st->print("(active %d)", os::active_processor_count());
+  // st->print("(active %d)", os::active_processor_count()); but we can
+  // print the initial number of active processors.
+  // We access the raw value here because the assert in the accessor will
+  // fail if the crash occurs before initialization of this value.
+  st->print(" (initial active %d)", _initial_active_processor_count);
   st->print(" %s", VM_Version::features_string());
   st->cr();
   pd_print_cpu_info(st, buf, buflen);
@@ -1207,7 +1213,7 @@
   if (jimage == NULL) return false;
   bool has_jimage = (os::stat(jimage, &st) == 0);
   if (has_jimage) {
-    Arguments::set_sysclasspath(jimage);
+    Arguments::set_sysclasspath(jimage, true);
     FREE_C_HEAP_ARRAY(char, jimage);
     return true;
   }
@@ -1217,7 +1223,7 @@
   char* base_classes = format_boot_path("%/modules/java.base", home, home_len, fileSep, pathSep);
   if (base_classes == NULL) return false;
   if (os::stat(base_classes, &st) == 0) {
-    Arguments::set_sysclasspath(base_classes);
+    Arguments::set_sysclasspath(base_classes, false);
     FREE_C_HEAP_ARRAY(char, base_classes);
     return true;
   }
@@ -1597,6 +1603,12 @@
   return result;
 }
 
+void os::initialize_initial_active_processor_count() {
+  assert(_initial_active_processor_count == 0, "Initial active processor count already set.");
+  _initial_active_processor_count = active_processor_count();
+  log_debug(os)("Initial active processor count set to %d" , _initial_active_processor_count);
+}
+
 void os::SuspendedThreadTask::run() {
   assert(Threads_lock->owned_by_self() || (_thread == VMThread::vm_thread()), "must have threads lock to call this");
   internal_do_task();
@@ -1742,7 +1754,7 @@
   pd_realign_memory(addr, bytes, alignment_hint);
 }
 
-#ifndef TARGET_OS_FAMILY_windows
+#ifndef _WINDOWS
 /* try to switch state from state "from" to state "to"
  * returns the state set after the method is complete
  */
diff --git a/src/share/vm/runtime/os.hpp b/src/share/vm/runtime/os.hpp
index f99088b..0cf1bd6 100644
--- a/src/share/vm/runtime/os.hpp
+++ b/src/share/vm/runtime/os.hpp
@@ -26,29 +26,15 @@
 #define SHARE_VM_RUNTIME_OS_HPP
 
 #include "jvmtifiles/jvmti.h"
+#include "prims/jvm.h"
 #include "runtime/extendedPC.hpp"
 #include "runtime/handles.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "jvm_linux.h"
+#include "utilities/macros.hpp"
+#ifndef _WINDOWS
 # include <setjmp.h>
 #endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "jvm_solaris.h"
-# include <setjmp.h>
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "jvm_windows.h"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "jvm_aix.h"
-# include <setjmp.h>
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "jvm_bsd.h"
-# include <setjmp.h>
-# ifdef __APPLE__
-#  include <mach/mach_time.h>
-# endif
+#ifdef __APPLE__
+# include <mach/mach_time.h>
 #endif
 
 class AgentLibrary;
@@ -154,6 +140,7 @@
   static void  get_summary_cpu_info(char* buf, size_t buflen);
   static void  get_summary_os_info(char* buf, size_t buflen);
 
+  static void initialize_initial_active_processor_count();
  public:
   static void init(void);                      // Called before command line parsing
   static void init_before_ergo(void);          // Called after command line parsing
@@ -241,6 +228,13 @@
   // Note that on some OSes this can change dynamically.
   static int active_processor_count();
 
+  // At startup the number of active CPUs this process is allowed to run on.
+  // This value does not change dynamically. May be different from active_processor_count().
+  static int initial_active_processor_count() {
+    assert(_initial_active_processor_count > 0, "Initial active processor count not set yet.");
+    return _initial_active_processor_count;
+  }
+
   // Bind processes to processors.
   //     This is a two step procedure:
   //     first you generate a distribution of processes to processors,
@@ -816,61 +810,11 @@
   };
 
   // Platform dependent stuff
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.hpp"
+#ifndef _WINDOWS
 # include "os_posix.hpp"
 #endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.hpp"
-# include "os_posix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.hpp"
-# include "os_posix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_posix.hpp"
-# include "os_bsd.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "os_linux_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "os_linux_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "os_linux_zero.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "os_solaris_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "os_solaris_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "os_windows_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "os_linux_arm.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "os_linux_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "os_aix_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "os_linux_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "os_bsd_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "os_bsd_zero.hpp"
-#endif
+#include OS_CPU_HEADER(os)
+#include OS_HEADER(os)
 
 #ifndef OS_NATIVE_THREAD_CREATION_FAILED_MSG
 #define OS_NATIVE_THREAD_CREATION_FAILED_MSG "unable to create native thread: possibly out of memory or process/resource limits reached"
@@ -937,7 +881,7 @@
     bool _done;
   };
 
-#ifndef TARGET_OS_FAMILY_windows
+#ifndef _WINDOWS
   // Suspend/resume support
   // Protocol:
   //
@@ -1008,12 +952,13 @@
       return _state == SR_SUSPENDED;
     }
   };
-#endif
+#endif // !WINDOWS
 
 
  protected:
-  static long _rand_seed;                   // seed for random number generator
-  static int _processor_count;              // number of processors
+  static long _rand_seed;                     // seed for random number generator
+  static int _processor_count;                // number of processors
+  static int _initial_active_processor_count; // number of active processors during initialization.
 
   static char* format_boot_path(const char* format_string,
                                 const char* home,
diff --git a/src/share/vm/runtime/os.inline.hpp b/src/share/vm/runtime/os.inline.hpp
index 392e44d..3814b56 100644
--- a/src/share/vm/runtime/os.inline.hpp
+++ b/src/share/vm/runtime/os.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 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
@@ -27,20 +27,6 @@
 
 #include "runtime/os.hpp"
 
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
+#include OS_HEADER_INLINE(os)
 
 #endif // SHARE_VM_RUNTIME_OS_INLINE_HPP
diff --git a/src/share/vm/runtime/osThread.hpp b/src/share/vm/runtime/osThread.hpp
index 16cc2e8..1e8bcf0 100644
--- a/src/share/vm/runtime/osThread.hpp
+++ b/src/share/vm/runtime/osThread.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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,6 +29,7 @@
 #include "runtime/handles.hpp"
 #include "runtime/javaFrameAnchor.hpp"
 #include "runtime/objectMonitor.hpp"
+#include "utilities/macros.hpp"
 
 // The OSThread class holds OS-specific thread information.  It is equivalent
 // to the sys_thread_t structure of the classic JVM implementation.
@@ -96,21 +97,7 @@
   static ByteSize interrupted_offset()            { return byte_offset_of(OSThread, _interrupted); }
 
   // Platform dependent stuff
-#ifdef TARGET_OS_FAMILY_linux
-# include "osThread_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "osThread_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "osThread_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "osThread_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "osThread_bsd.hpp"
-#endif
+#include OS_HEADER(osThread)
 
  public:
   static ByteSize thread_id_offset()              { return byte_offset_of(OSThread, _thread_id); }
diff --git a/src/share/vm/runtime/prefetch.inline.hpp b/src/share/vm/runtime/prefetch.inline.hpp
index f4e30de..1ff1671 100644
--- a/src/share/vm/runtime/prefetch.inline.hpp
+++ b/src/share/vm/runtime/prefetch.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 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
@@ -26,51 +26,7 @@
 #define SHARE_VM_RUNTIME_PREFETCH_INLINE_HPP
 
 #include "runtime/prefetch.hpp"
-
-// Linux
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "prefetch_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "prefetch_linux_sparc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "prefetch_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "prefetch_linux_arm.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "prefetch_linux_aarch64.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "prefetch_linux_ppc.inline.hpp"
-#endif
-
-// Solaris
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "prefetch_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "prefetch_solaris_sparc.inline.hpp"
-#endif
-
-// Windows
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "prefetch_windows_x86.inline.hpp"
-#endif
-
-// AIX
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "prefetch_aix_ppc.inline.hpp"
-#endif
-
-// BSD
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "prefetch_bsd_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "prefetch_bsd_zero.inline.hpp"
-#endif
+#include "utilities/macros.hpp"
+#include OS_CPU_HEADER_INLINE(prefetch)
 
 #endif // SHARE_VM_RUNTIME_PREFETCH_INLINE_HPP
diff --git a/src/share/vm/runtime/registerMap.hpp b/src/share/vm/runtime/registerMap.hpp
index 0b2d410..046e9fe 100644
--- a/src/share/vm/runtime/registerMap.hpp
+++ b/src/share/vm/runtime/registerMap.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -27,6 +27,7 @@
 
 #include "code/vmreg.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
 
 class JavaThread;
 
@@ -120,24 +121,7 @@
   void print() const;
 
   // the following contains the definition of pd_xxx methods
-#ifdef TARGET_ARCH_x86
-# include "registerMap_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "registerMap_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "registerMap_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "registerMap_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "registerMap_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "registerMap_aarch64.hpp"
-#endif
+#include CPU_HEADER(registerMap)
 
 };
 
diff --git a/src/share/vm/runtime/semaphore.hpp b/src/share/vm/runtime/semaphore.hpp
index 8a282d4..ecf8e8a 100644
--- a/src/share/vm/runtime/semaphore.hpp
+++ b/src/share/vm/runtime/semaphore.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -27,11 +27,11 @@
 
 #include "memory/allocation.hpp"
 
-#if defined(TARGET_OS_FAMILY_linux) || defined(TARGET_OS_FAMILY_solaris) || defined(TARGET_OS_FAMILY_aix)
+#if defined(LINUX) || defined(SOLARIS) || defined(AIX)
 # include "semaphore_posix.hpp"
-#elif defined(TARGET_OS_FAMILY_bsd)
+#elif defined(BSD)
 # include "semaphore_bsd.hpp"
-#elif defined(TARGET_OS_FAMILY_windows)
+#elif defined(_WINDOWS)
 # include "semaphore_windows.hpp"
 #else
 # error "No semaphore implementation provided for this OS"
diff --git a/src/share/vm/runtime/sharedRuntime.hpp b/src/share/vm/runtime/sharedRuntime.hpp
index eb9797f..02824bb 100644
--- a/src/share/vm/runtime/sharedRuntime.hpp
+++ b/src/share/vm/runtime/sharedRuntime.hpp
@@ -388,16 +388,6 @@
   static int c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, VMRegPair *regs2,
                                   int total_args_passed);
 
-  // Compute the new number of arguments in the signature if 32 bit ints
-  // must be converted to longs. Needed if CCallingConventionRequiresIntsAsLongs
-  // is true.
-  static int  convert_ints_to_longints_argcnt(int in_args_count, BasicType* in_sig_bt);
-  // Adapt a method's signature if it contains 32 bit integers that must
-  // be converted to longs. Needed if CCallingConventionRequiresIntsAsLongs
-  // is true.
-  static void convert_ints_to_longints(int i2l_argcnt, int& in_args_count,
-                                       BasicType*& in_sig_bt, VMRegPair*& in_regs);
-
   static size_t trampoline_size();
 
   static void generate_trampoline(MacroAssembler *masm, address destination);
diff --git a/src/share/vm/runtime/simpleThresholdPolicy.cpp b/src/share/vm/runtime/simpleThresholdPolicy.cpp
index 4fbfd00..e38c692 100644
--- a/src/share/vm/runtime/simpleThresholdPolicy.cpp
+++ b/src/share/vm/runtime/simpleThresholdPolicy.cpp
@@ -237,13 +237,6 @@
     return;
   }
 
-#if INCLUDE_JVMCI
-  // We can't compile with a JVMCI compiler until the module system is initialized.
-  if (level == CompLevel_full_optimization && UseJVMCICompiler && !Universe::is_module_initialized()) {
-    return;
-  }
-#endif
-
   // Check if the method can be compiled. If it cannot be compiled with C1, continue profiling
   // in the interpreter and then compile with C2 (the transition function will request that,
   // see common() ). If the method cannot be compiled with C2 but still can with C1, compile it with
diff --git a/src/share/vm/runtime/stubRoutines.hpp b/src/share/vm/runtime/stubRoutines.hpp
index 729886f..0ec3219 100644
--- a/src/share/vm/runtime/stubRoutines.hpp
+++ b/src/share/vm/runtime/stubRoutines.hpp
@@ -30,6 +30,7 @@
 #include "runtime/frame.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/stubCodeGenerator.hpp"
+#include "utilities/macros.hpp"
 
 // StubRoutines provides entry points to assembly routines used by
 // compiled code and the run-time system. Platform-specific entry
@@ -83,21 +84,8 @@
 
   // Dependencies
   friend class StubGenerator;
-#if defined STUBROUTINES_MD_HPP
-# include STUBROUTINES_MD_HPP
-#elif defined TARGET_ARCH_MODEL_x86_32
-# include "stubRoutines_x86_32.hpp"
-#elif defined TARGET_ARCH_MODEL_x86_64
-# include "stubRoutines_x86_64.hpp"
-#elif defined TARGET_ARCH_MODEL_sparc
-# include "stubRoutines_sparc.hpp"
-#elif defined TARGET_ARCH_MODEL_zero
-# include "stubRoutines_zero.hpp"
-#elif defined TARGET_ARCH_MODEL_ppc_64
-# include "stubRoutines_ppc_64.hpp"
-#elif defined TARGET_ARCH_MODEL_aarch64
-# include "stubRoutines_aarch64.hpp"
-#endif
+
+#include CPU_HEADER(stubRoutines)
 
   static jint    _verify_oop_count;
   static address _verify_oop_subroutine_entry;
diff --git a/src/share/vm/runtime/thread.cpp b/src/share/vm/runtime/thread.cpp
index 588c263..26c7e87 100644
--- a/src/share/vm/runtime/thread.cpp
+++ b/src/share/vm/runtime/thread.cpp
@@ -3773,6 +3773,14 @@
   // cache the system class loader
   SystemDictionary::compute_java_system_loader(CHECK_(JNI_ERR));
 
+#if INCLUDE_JVMCI
+  if (EnableJVMCI && UseJVMCICompiler && (!UseInterpreter || !BackgroundCompilation)) {
+    // 8145270: Force initialization of JVMCI runtime otherwise requests for blocking
+    // compilations via JVMCI will not actually block until JVMCI is initialized.
+    JVMCIRuntime::force_initialization(CHECK_JNI_ERR);
+  }
+#endif
+
   // Always call even when there are not JVMTI environments yet, since environments
   // may be attached late and JVMTI must track phases of VM execution
   JvmtiExport::enter_live_phase();
diff --git a/src/share/vm/runtime/thread.hpp b/src/share/vm/runtime/thread.hpp
index 46828d4..37e6ed3 100644
--- a/src/share/vm/runtime/thread.hpp
+++ b/src/share/vm/runtime/thread.hpp
@@ -50,7 +50,7 @@
 #include "gc/g1/dirtyCardQueue.hpp"
 #include "gc/g1/satbMarkQueue.hpp"
 #endif // INCLUDE_ALL_GCS
-#ifdef TARGET_ARCH_zero
+#ifdef ZERO
 # include "stack_zero.hpp"
 #endif
 
@@ -1905,43 +1905,7 @@
 #endif // INCLUDE_ALL_GCS
 
   // Machine dependent stuff
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "thread_linux_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "thread_linux_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "thread_linux_zero.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "thread_solaris_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "thread_solaris_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "thread_windows_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "thread_linux_arm.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "thread_linux_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "thread_linux_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "thread_aix_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "thread_bsd_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "thread_bsd_zero.hpp"
-#endif
-
+#include OS_CPU_HEADER(thread)
 
  public:
   void set_blocked_on_compilation(bool value) {
diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp
index 610dc13..a068753 100644
--- a/src/share/vm/runtime/vmStructs.cpp
+++ b/src/share/vm/runtime/vmStructs.cpp
@@ -107,77 +107,9 @@
 #include "utilities/hashtable.hpp"
 #include "utilities/macros.hpp"
 
-#ifdef TARGET_OS_FAMILY_linux
-# include "vmStructs_linux.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "vmStructs_solaris.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "vmStructs_windows.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "vmStructs_aix.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "vmStructs_bsd.hpp"
-#endif
-
-#ifdef TARGET_ARCH_x86
-# include "vmStructs_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vmStructs_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vmStructs_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vmStructs_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vmStructs_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "vmStructs_aarch64.hpp"
-#endif
-
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "vmStructs_linux_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "vmStructs_linux_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "vmStructs_linux_zero.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "vmStructs_solaris_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "vmStructs_solaris_sparc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "vmStructs_windows_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "vmStructs_linux_arm.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "vmStructs_linux_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_aarch64
-# include "vmStructs_linux_aarch64.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_aix_ppc
-# include "vmStructs_aix_ppc.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "vmStructs_bsd_x86.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "vmStructs_bsd_zero.hpp"
-#endif
+#include CPU_HEADER(vmStructs)
+#include OS_HEADER(vmStructs)
+#include OS_CPU_HEADER(vmStructs)
 
 #if INCLUDE_ALL_GCS
 #include "gc/cms/compactibleFreeListSpace.hpp"
diff --git a/src/share/vm/runtime/vm_version.cpp b/src/share/vm/runtime/vm_version.cpp
index 98e90d5..942feb1 100644
--- a/src/share/vm/runtime/vm_version.cpp
+++ b/src/share/vm/runtime/vm_version.cpp
@@ -110,7 +110,7 @@
 #ifndef HOTSPOT_VM_DISTRO
   #error HOTSPOT_VM_DISTRO must be defined
 #endif
-#define VMNAME HOTSPOT_VM_DISTRO " " VMLP EMBEDDED_ONLY("Embedded ") VMTYPE " VM"
+#define VMNAME HOTSPOT_VM_DISTRO " " VMLP VMTYPE " VM"
 
 const char* Abstract_VM_Version::vm_name() {
   return VMNAME;
@@ -295,7 +295,7 @@
     // processor after the first 8.  For example, on a 72 cpu machine
     // and a chosen fraction of 5/8
     // use 8 + (72 - 8) * (5/8) == 48 worker threads.
-    unsigned int ncpus = (unsigned int) os::active_processor_count();
+    unsigned int ncpus = (unsigned int) os::initial_active_processor_count();
     threads = (ncpus <= switch_pt) ?
              ncpus :
              (switch_pt + ((ncpus - switch_pt) * num) / den);
diff --git a/src/share/vm/runtime/vm_version.hpp b/src/share/vm/runtime/vm_version.hpp
index a9e5733..e0f89ea 100644
--- a/src/share/vm/runtime/vm_version.hpp
+++ b/src/share/vm/runtime/vm_version.hpp
@@ -27,6 +27,7 @@
 
 #include "memory/allocation.hpp"
 #include "utilities/ostream.hpp"
+#include "utilities/macros.hpp"
 
 // VM_Version provides information about the VM.
 
@@ -160,20 +161,6 @@
   static bool supports_on_spin_wait() { return false; }
 };
 
-#ifdef TARGET_ARCH_x86
-# include "vm_version_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "vm_version_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "vm_version_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "vm_version_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "vm_version_ppc.hpp"
-#endif
+#include CPU_HEADER(vm_version)
 
 #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP
diff --git a/src/share/vm/services/diagnosticArgument.cpp b/src/share/vm/services/diagnosticArgument.cpp
index 0c51a70..abd8349 100644
--- a/src/share/vm/services/diagnosticArgument.cpp
+++ b/src/share/vm/services/diagnosticArgument.cpp
@@ -98,7 +98,7 @@
     strncpy(buf, str, len);
     buf[len] = '\0';
     Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalArgumentException(),
-      "Integer parsing error in command argument '%s'. Could not parse: %s.", _name, buf);
+      "Integer parsing error in command argument '%s'. Could not parse: %s.\n", _name, buf);
   }
 }
 
@@ -132,7 +132,7 @@
       strncpy(buf, str, len);
       buf[len] = '\0';
       Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalArgumentException(),
-        "Boolean parsing error in command argument '%s'. Could not parse: %s.", _name, buf);
+        "Boolean parsing error in command argument '%s'. Could not parse: %s.\n", _name, buf);
     }
   }
 }
@@ -183,13 +183,13 @@
                                                  size_t len, TRAPS) {
   if (str == NULL) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-              "Integer parsing error nanotime value: syntax error, value is null");
+              "Integer parsing error nanotime value: syntax error, value is null\n");
   }
 
   int argc = sscanf(str, JLONG_FORMAT, &_value._time);
   if (argc != 1) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-              "Integer parsing error nanotime value: syntax error");
+              "Integer parsing error nanotime value: syntax error\n");
   }
   size_t idx = 0;
   while(idx < len && isdigit(str[idx])) {
@@ -199,7 +199,7 @@
     // only accept missing unit if the value is 0
     if (_value._time != 0) {
       THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-                "Integer parsing error nanotime value: unit required");
+                "Integer parsing error nanotime value: unit required\n");
     } else {
       _value._nanotime = 0;
       strcpy(_value._unit, "ns");
@@ -207,7 +207,7 @@
     }
   } else if(len - idx > 2) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-              "Integer parsing error nanotime value: illegal unit");
+              "Integer parsing error nanotime value: illegal unit\n");
   } else {
     strncpy(_value._unit, &str[idx], len - idx);
     /*Write an extra null termination. This is safe because _value._unit
@@ -234,7 +234,7 @@
     _value._nanotime = _value._time * 24 * 60 * 60 * 1000 * 1000 * 1000;
   } else {
      THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-               "Integer parsing error nanotime value: illegal unit");
+               "Integer parsing error nanotime value: illegal unit\n");
   }
 }
 
@@ -280,12 +280,11 @@
                                                   size_t len, TRAPS) {
   if (str == NULL) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-               "Parsing error memory size value: syntax error, value is null");
+               "Parsing error memory size value: syntax error, value is null\n");
   }
-
   if (*str == '-') {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-               "Parsing error memory size value: negative values not allowed");
+               "Parsing error memory size value: negative values not allowed\n");
   }
   int res = sscanf(str, UINT64_FORMAT "%c", &_value._val, &_value._multiplier);
   if (res == 2) {
@@ -310,7 +309,7 @@
      _value._size = _value._val;
    } else {
      THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-               "Parsing error memory size value: invalid value");
+               "Parsing error memory size value: invalid value\n");
    }
 }
 
diff --git a/src/share/vm/services/lowMemoryDetector.cpp b/src/share/vm/services/lowMemoryDetector.cpp
index 6fbfc9a..33e1f45 100644
--- a/src/share/vm/services/lowMemoryDetector.cpp
+++ b/src/share/vm/services/lowMemoryDetector.cpp
@@ -281,8 +281,6 @@
 }
 
 void SensorInfo::process_pending_requests(TRAPS) {
-  assert(has_pending_requests(), "Must have pending request");
-
   int pending_count = pending_trigger_count();
   if (pending_clear_count() > 0) {
     clear(pending_count, CHECK);
diff --git a/src/share/vm/shark/sharkRuntime.cpp b/src/share/vm/shark/sharkRuntime.cpp
index c6fd028..454c87f 100644
--- a/src/share/vm/shark/sharkRuntime.cpp
+++ b/src/share/vm/shark/sharkRuntime.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -30,7 +30,8 @@
 #include "runtime/thread.hpp"
 #include "shark/llvmHeaders.hpp"
 #include "shark/sharkRuntime.hpp"
-#ifdef TARGET_ARCH_zero
+#include "utilities/macros.hpp"
+#ifdef ZERO
 # include "stack_zero.inline.hpp"
 #endif
 
diff --git a/src/share/vm/shark/shark_globals.hpp b/src/share/vm/shark/shark_globals.hpp
index 1c33fd3..3ee0b9a 100644
--- a/src/share/vm/shark/shark_globals.hpp
+++ b/src/share/vm/shark/shark_globals.hpp
@@ -27,7 +27,8 @@
 #define SHARE_VM_SHARK_SHARK_GLOBALS_HPP
 
 #include "runtime/globals.hpp"
-#ifdef TARGET_ARCH_zero
+#include "utilities/macros.hpp"
+#ifdef ZERO
 # include "shark_globals_zero.hpp"
 #endif
 
diff --git a/src/share/vm/trace/traceevents.xml b/src/share/vm/trace/traceevents.xml
index 83bb051..10671cf 100644
--- a/src/share/vm/trace/traceevents.xml
+++ b/src/share/vm/trace/traceevents.xml
@@ -116,6 +116,12 @@
     <value type="CLASS" field="initiatingClassLoader" label="Initiating Class Loader"/>
   </event>
 
+  <event id="ClassDefine" path="vm/class/define" label="Class Define"
+          has_thread="true" has_stacktrace="true" is_instant="true">
+    <value type="CLASS" field="definedClass" label="Defined Class"/>
+    <value type="CLASS" field="definingClassLoader" label="Defining Class Loader"/>
+  </event>
+
   <event id="ClassUnload" path="vm/class/unload" label="Class Unload"
       has_thread="true" is_instant="true">
     <value type="CLASS" field="unloadedClass" label="Unloaded Class"/>
@@ -374,7 +380,7 @@
          description="Basic statistics related to current IHOP calculation">
     <value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/>
     <value type="BYTES64" field="threshold" label="Current IHOP threshold" description="Current IHOP threshold in bytes"/>
-    <value type="BYTES64" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of old gen"/>
+    <value type="PERCENTAGE" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of old gen"/>
     <value type="BYTES64" field="targetOccupancy" label="Target occupancy" description="Target old gen occupancy to reach at the start of mixed GC in bytes"/>
     <value type="BYTES64" field="currentOccupancy" label="Current occupancy" description="Current old gen occupancy in bytes"/>
     <value type="BYTES64" field="lastAllocationSize" label="Last mutator allocation size" description="Mutator allocation during mutator operation since last GC in bytes"/>
@@ -387,7 +393,7 @@
          description="Statistics related to current adaptive IHOP calculation">
     <value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/>
     <value type="BYTES64" field="threshold" label="Current IHOP threshold" description="Current IHOP threshold in bytes"/>
-    <value type="BYTES64" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of the internal target occupancy"/>
+    <value type="PERCENTAGE" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of the internal target occupancy"/>
     <value type="BYTES64" field="internalTargetOccupancy" label="Target occupancy" description="Internal target old gen occupancy to reach at the start of mixed GC in bytes"/>
     <value type="BYTES64" field="currentOccupancy" label="Current occupancy" description="Current old gen occupancy in bytes"/>
     <value type="BYTES64" field="additionalBufferSize" label="Additional buffer size" description="Additional buffer size in bytes"/>
diff --git a/src/share/vm/utilities/bytes.hpp b/src/share/vm/utilities/bytes.hpp
index 8b5aa9b..9ea1782 100644
--- a/src/share/vm/utilities/bytes.hpp
+++ b/src/share/vm/utilities/bytes.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 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,23 +25,8 @@
 #ifndef SHARE_VM_UTILITIES_BYTES_HPP
 #define SHARE_VM_UTILITIES_BYTES_HPP
 
-#ifdef TARGET_ARCH_x86
-# include "bytes_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "bytes_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "bytes_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "bytes_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "bytes_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "bytes_aarch64.hpp"
-#endif
+#include "utilities/macros.hpp"
+
+#include CPU_HEADER(bytes)
 
 #endif // SHARE_VM_UTILITIES_BYTES_HPP
diff --git a/src/share/vm/utilities/copy.hpp b/src/share/vm/utilities/copy.hpp
index 242867e..e8d733b 100644
--- a/src/share/vm/utilities/copy.hpp
+++ b/src/share/vm/utilities/copy.hpp
@@ -26,6 +26,7 @@
 #define SHARE_VM_UTILITIES_COPY_HPP
 
 #include "runtime/stubRoutines.hpp"
+#include "utilities/macros.hpp"
 
 // Assembly code for platforms that need it.
 extern "C" {
@@ -332,24 +333,7 @@
   }
 
   // Platform dependent implementations of the above methods.
-#ifdef TARGET_ARCH_x86
-# include "copy_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "copy_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "copy_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "copy_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "copy_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "copy_aarch64.hpp"
-#endif
+#include CPU_HEADER(copy)
 
 };
 
diff --git a/src/share/vm/utilities/globalDefinitions.hpp b/src/share/vm/utilities/globalDefinitions.hpp
index 4c9e513..aec8ab9 100644
--- a/src/share/vm/utilities/globalDefinitions.hpp
+++ b/src/share/vm/utilities/globalDefinitions.hpp
@@ -73,7 +73,6 @@
 #define ATTRIBUTE_SCANF(fmt, vargs)
 #endif
 
-
 #include "utilities/macros.hpp"
 
 // This file holds all globally used constants & types, class (forward)
@@ -456,24 +455,7 @@
 // Allow targets to reduce the default size of the code cache.
 #define CODE_CACHE_DEFAULT_LIMIT CODE_CACHE_SIZE_LIMIT
 
-#ifdef TARGET_ARCH_x86
-# include "globalDefinitions_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "globalDefinitions_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_zero
-# include "globalDefinitions_zero.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "globalDefinitions_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "globalDefinitions_ppc.hpp"
-#endif
-#ifdef TARGET_ARCH_aarch64
-# include "globalDefinitions_aarch64.hpp"
-#endif
+#include CPU_HEADER(globalDefinitions)
 
 #ifndef INCLUDE_RTM_OPT
 #define INCLUDE_RTM_OPT 0
@@ -951,7 +933,7 @@
   CompLevel_full_profile      = 3,         // C1, invocation & backedge counters + mdo
   CompLevel_full_optimization = 4,         // C2, Shark or JVMCI
 
-#if defined(COMPILER2) || defined(SHARK) || INCLUDE_JVMCI
+#if defined(COMPILER2) || defined(SHARK)
   CompLevel_highest_tier      = CompLevel_full_optimization,  // pure C2 and tiered or JVMCI and tiered
 #elif defined(COMPILER1)
   CompLevel_highest_tier      = CompLevel_simple,             // pure C1 or JVMCI
diff --git a/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp b/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp
index 755eba0..22f8b4e 100644
--- a/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp
+++ b/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp
@@ -33,9 +33,6 @@
 
 
 # include <ctype.h>
-#define __USE_LEGACY_PROTOTYPES__
-# include <dirent.h>
-#undef __USE_LEGACY_PROTOTYPES__
 # include <string.h>
 # include <strings.h>     // for bsd'isms
 # include <stdarg.h>
diff --git a/src/share/vm/utilities/hashtable.cpp b/src/share/vm/utilities/hashtable.cpp
index 2d4bd0b..da3cfde 100644
--- a/src/share/vm/utilities/hashtable.cpp
+++ b/src/share/vm/utilities/hashtable.cpp
@@ -342,13 +342,18 @@
 
 #ifdef ASSERT
 
-template <MEMFLAGS F> void BasicHashtable<F>::verify_lookup_length(double load) {
-  if ((double)_lookup_length / (double)_lookup_count > load * 2.0) {
+template <MEMFLAGS F> bool BasicHashtable<F>::verify_lookup_length(double load) {
+  if ((!_lookup_warning) && (_lookup_count != 0)
+      && ((double)_lookup_length / (double)_lookup_count > load * 2.0)) {
     warning("Performance bug: SystemDictionary lookup_count=%d "
             "lookup_length=%d average=%lf load=%f",
             _lookup_count, _lookup_length,
-            (double) _lookup_length / _lookup_count, load);
+            (double)_lookup_length / _lookup_count, load);
+    _lookup_warning = true;
+
+    return false;
   }
+  return true;
 }
 
 #endif
diff --git a/src/share/vm/utilities/hashtable.hpp b/src/share/vm/utilities/hashtable.hpp
index 09c5d58..be8203c 100644
--- a/src/share/vm/utilities/hashtable.hpp
+++ b/src/share/vm/utilities/hashtable.hpp
@@ -124,9 +124,17 @@
   // Instance variable
   BasicHashtableEntry<F>*       _entry;
 
+#ifdef ASSERT
+private:
+  unsigned _hits;
+public:
+  unsigned hits()   { return _hits; }
+  void count_hit()  { _hits++; }
+#endif
+
 public:
   // Accessing
-  void clear()                        { _entry = NULL; }
+  void clear()                        { _entry = NULL; DEBUG_ONLY(_hits = 0); }
 
   // The following methods use order access methods to avoid race
   // conditions in multiprocessor systems.
@@ -135,6 +143,7 @@
 
   // The following method is not MT-safe and must be done under lock.
   BasicHashtableEntry<F>** entry_addr()  { return &_entry; }
+
 };
 
 
@@ -173,9 +182,10 @@
 protected:
 
 #ifdef ASSERT
+  bool              _lookup_warning;
   mutable int       _lookup_count;
   mutable int       _lookup_length;
-  void verify_lookup_length(double load);
+  bool verify_lookup_length(double load);
 #endif
 
   void initialize(int table_size, int entry_size, int number_of_entries);
@@ -226,6 +236,15 @@
   int number_of_entries() { return _number_of_entries; }
 
   void verify() PRODUCT_RETURN;
+
+#ifdef ASSERT
+  void bucket_count_hit(int i) const {
+    _buckets[i].count_hit();
+  }
+  unsigned bucket_hits(int i) const {
+    return _buckets[i].hits();
+  }
+#endif
 };
 
 
diff --git a/src/share/vm/utilities/hashtable.inline.hpp b/src/share/vm/utilities/hashtable.inline.hpp
index ee22ba8..8497193 100644
--- a/src/share/vm/utilities/hashtable.inline.hpp
+++ b/src/share/vm/utilities/hashtable.inline.hpp
@@ -65,6 +65,7 @@
   _end_block = NULL;
   _number_of_entries = number_of_entries;
 #ifdef ASSERT
+  _lookup_warning = false;
   _lookup_count = 0;
   _lookup_length = 0;
 #endif
diff --git a/src/share/vm/utilities/macros.hpp b/src/share/vm/utilities/macros.hpp
index 62b117e..ebcaaee 100644
--- a/src/share/vm/utilities/macros.hpp
+++ b/src/share/vm/utilities/macros.hpp
@@ -316,6 +316,7 @@
 #endif
 
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#define BSD
 #define BSD_ONLY(code) code
 #define NOT_BSD(code)
 #else
@@ -429,6 +430,10 @@
 #define NOT_E500V2(code) code
 #endif
 
+// Note: There are three ARM ports. They set the following in the makefiles:
+// 1. Closed 32-bit port:   -DARM -DARM32           -DTARGET_ARCH_arm
+// 2. Closed 64-bit port:   -DARM -DAARCH64 -D_LP64 -DTARGET_ARCH_arm
+// 3. Open   64-bit port:         -DAARCH64 -D_LP64 -DTARGET_ARCH_aaarch64
 #ifdef ARM
 #define ARM_ONLY(code) code
 #define NOT_ARM(code)
@@ -453,14 +458,32 @@
 #define NOT_AARCH64(code) code
 #endif
 
-#ifdef JAVASE_EMBEDDED
-#define EMBEDDED_ONLY(code) code
-#define NOT_EMBEDDED(code)
-#else
-#define EMBEDDED_ONLY(code)
-#define NOT_EMBEDDED(code) code
-#endif
-
 #define define_pd_global(type, name, value) const type pd_##name = value;
 
+// Helper macros for constructing file names for includes.
+#define CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_CPU)
+#define OS_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_OS)
+#define OS_CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, PASTE_TOKENS(INCLUDE_SUFFIX_OS, INCLUDE_SUFFIX_CPU))
+
+// Include platform dependent files.
+//
+// This macro constructs from basename and INCLUDE_SUFFIX_OS /
+// INCLUDE_SUFFIX_CPU, which are set on the command line, the name of
+// platform dependent files to be included.
+// Example: INCLUDE_SUFFIX_OS=_linux / INCLUDE_SUFFIX_CPU=_sparc
+//   CPU_HEADER_INLINE(macroAssembler) --> macroAssembler_sparc.inline.hpp
+//   OS_CPU_HEADER(vmStructs)          --> vmStructs_linux_sparc.hpp
+//
+// basename<cpu>.hpp / basename<cpu>.inline.hpp
+#define CPU_HEADER_H(basename)         XSTR(CPU_HEADER_STEM(basename).h)
+#define CPU_HEADER(basename)           XSTR(CPU_HEADER_STEM(basename).hpp)
+#define CPU_HEADER_INLINE(basename)    XSTR(CPU_HEADER_STEM(basename).inline.hpp)
+// basename<os>.hpp / basename<os>.inline.hpp
+#define OS_HEADER_H(basename)          XSTR(OS_HEADER_STEM(basename).h)
+#define OS_HEADER(basename)            XSTR(OS_HEADER_STEM(basename).hpp)
+#define OS_HEADER_INLINE(basename)     XSTR(OS_HEADER_STEM(basename).inline.hpp)
+// basename<os><cpu>.hpp / basename<os><cpu>.inline.hpp
+#define OS_CPU_HEADER(basename)        XSTR(OS_CPU_HEADER_STEM(basename).hpp)
+#define OS_CPU_HEADER_INLINE(basename) XSTR(OS_CPU_HEADER_STEM(basename).inline.hpp)
+
 #endif // SHARE_VM_UTILITIES_MACROS_HPP
diff --git a/src/share/vm/utilities/resourceHash.cpp b/src/share/vm/utilities/resourceHash.cpp
index 36088ac..7365c0c 100644
--- a/src/share/vm/utilities/resourceHash.cpp
+++ b/src/share/vm/utilities/resourceHash.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
diff --git a/src/share/vm/utilities/resourceHash.hpp b/src/share/vm/utilities/resourceHash.hpp
index bfd0a1f..6941d40 100644
--- a/src/share/vm/utilities/resourceHash.hpp
+++ b/src/share/vm/utilities/resourceHash.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
diff --git a/test/TEST.groups b/test/TEST.groups
index b46499f..e1bdec2 100644
--- a/test/TEST.groups
+++ b/test/TEST.groups
@@ -130,8 +130,8 @@
 # Tests that require the full JRE
 #
 needs_jre = \
-  compiler/c2/6852078/Test6852078.java \
-  compiler/c2/7047069/Test7047069.java \
+  compiler/c2/Test6852078.java \
+  compiler/c2/Test7047069.java \
   runtime/6294277/SourceDebugExtension.java \
   runtime/ClassFile/JsrRewriting.java \
   runtime/ClassFile/OomWhileParsingRepeatedJsr.java \
@@ -277,16 +277,16 @@
   compiler/arraycopy/ \
   compiler/c1/ \
   compiler/c2/ \
-  -compiler/c2/5091921/Test6850611.java \
-  -compiler/c2/5091921/Test6890943.java \
-  -compiler/c2/5091921/Test6905845.java \
-  -compiler/c2/6340864 \
-  -compiler/c2/6589834 \
-  -compiler/c2/6603011 \
-  -compiler/c2/6912517 \
-  -compiler/c2/6792161 \
-  -compiler/c2/7070134 \
-  -compiler/c2/8004867
+  -compiler/c2/Test6850611.java \
+  -compiler/c2/cr6890943/Test6890943.java \
+  -compiler/c2/Test6905845.java \
+  -compiler/c2/cr6340864 \
+  -compiler/c2/cr6589834 \
+  -compiler/c2/cr8004867
+  -compiler/c2/stemmer \
+  -compiler/c2/Test6792161.java \
+  -compiler/c2/Test6603011.java \
+  -compiler/c2/Test6912517.java \
 
 hotspot_fast_compiler_2 = \
   compiler/classUnloading/ \
@@ -303,7 +303,7 @@
   compiler/integerArithmetic/ \
   compiler/interpreter/ \
   compiler/jvmci/ \
-  -compiler/codegen/7184394 \
+  -compiler/codegen/aes \
   -compiler/codecache/stress \
   -compiler/gcbarriers/PreserveFPRegistersTest.java
 
@@ -320,13 +320,13 @@
   compiler/types/ \
   compiler/uncommontrap/ \
   compiler/unsafe/ \
-  -compiler/intrinsics/adler32 \
   -compiler/intrinsics/bmi \
   -compiler/intrinsics/mathexact \
-  -compiler/intrinsics/multiplytolen \
   -compiler/intrinsics/sha \
-  -compiler/loopopts/7052494 \
-  -compiler/runtime/6826736
+  -compiler/intrinsics/bigInteger/TestMultiplyToLen.java \
+  -compiler/intrinsics/zip/TestAdler32.java \
+  -compiler/loopopts/Test7052494.java \
+  -compiler/runtime/Test6826736.java
 
 hotspot_fast_compiler_closed = \
   sanity/ExecuteInternalVMTests.java
diff --git a/test/compiler/arguments/BMICommandLineOptionTestBase.java b/test/compiler/arguments/BMICommandLineOptionTestBase.java
index ae65188..089679d 100644
--- a/test/compiler/arguments/BMICommandLineOptionTestBase.java
+++ b/test/compiler/arguments/BMICommandLineOptionTestBase.java
@@ -21,7 +21,10 @@
  * questions.
  */
 
-import jdk.test.lib.cli.*;
+package compiler.arguments;
+
+import jdk.test.lib.cli.CPUSpecificCommandLineOptionTest;
+import jdk.test.lib.cli.CommandLineOptionTest;
 
 /**
  * Base class for all X86 bit manipulation related command line options.
diff --git a/test/compiler/arguments/BMISupportedCPUTest.java b/test/compiler/arguments/BMISupportedCPUTest.java
index 6e73c1a..9582e8f 100644
--- a/test/compiler/arguments/BMISupportedCPUTest.java
+++ b/test/compiler/arguments/BMISupportedCPUTest.java
@@ -21,8 +21,10 @@
  * questions.
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
+package compiler.arguments;
+
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
 
 /**
  * Test on bit manipulation related command line options,
diff --git a/test/compiler/arguments/BMIUnsupportedCPUTest.java b/test/compiler/arguments/BMIUnsupportedCPUTest.java
index 0cb554c..103d2a9 100644
--- a/test/compiler/arguments/BMIUnsupportedCPUTest.java
+++ b/test/compiler/arguments/BMIUnsupportedCPUTest.java
@@ -21,8 +21,11 @@
  * questions.
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
+package compiler.arguments;
+
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
 
 /**
  * Test on bit manipulation related command line options,
diff --git a/test/compiler/arguments/CheckCICompilerCount.java b/test/compiler/arguments/CheckCICompilerCount.java
index f568dbe..1c361cf 100644
--- a/test/compiler/arguments/CheckCICompilerCount.java
+++ b/test/compiler/arguments/CheckCICompilerCount.java
@@ -21,19 +21,22 @@
  * questions.
  */
 
-import jdk.test.lib.*;
-
 /*
  * @test CheckCheckCICompilerCount
  * @bug 8130858
  * @bug 8132525
  * @summary Check that correct range of values for CICompilerCount are allowed depending on whether tiered is enabled or not
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main CheckCICompilerCount
+ * @run driver compiler.arguments.CheckCICompilerCount
  */
 
+package compiler.arguments;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
 public class CheckCICompilerCount {
     private static final String[][] NON_TIERED_ARGUMENTS = {
         {
@@ -72,14 +75,14 @@
             "Improperly specified VM option 'CICompilerCount=0'"
         },
         {
-            "intx CICompilerCount                          := 1                                   {product}"
+            "intx CICompilerCount                          = 1                                        {product} {command line}"
         },
         {
             "CICompilerCount (0) must be at least 1",
             "Improperly specified VM option 'CICompilerCount=0'"
         },
         {
-            "intx CICompilerCount                          := 1                                   {product}"
+            "intx CICompilerCount                          = 1                                        {product} {command line}"
         }
     };
 
@@ -127,14 +130,14 @@
             "Improperly specified VM option 'CICompilerCount=1'"
         },
         {
-            "intx CICompilerCount                          := 2                                   {product}"
+            "intx CICompilerCount                          = 2                                        {product} {command line, ergonomic}"
         },
         {
             "CICompilerCount (1) must be at least 2",
             "Improperly specified VM option 'CICompilerCount=1'"
         },
         {
-            "intx CICompilerCount                          := 2                                   {product}"
+            "intx CICompilerCount                          = 2                                        {product} {command line, ergonomic}"
         }
     };
 
diff --git a/test/compiler/arguments/CheckCompileThresholdScaling.java b/test/compiler/arguments/CheckCompileThresholdScaling.java
index 653536f..ecfe31d 100644
--- a/test/compiler/arguments/CheckCompileThresholdScaling.java
+++ b/test/compiler/arguments/CheckCompileThresholdScaling.java
@@ -21,18 +21,21 @@
  * questions.
  */
 
-import jdk.test.lib.*;
-
 /*
  * @test CheckCompileThresholdScaling
  * @bug 8059604
- * @summary "Add CompileThresholdScaling flag to control when methods are first compiled (with +/-TieredCompilation)"
+ * @summary Add CompileThresholdScaling flag to control when methods are first compiled (with +/-TieredCompilation)
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main CheckCompileThresholdScaling
+ * @run driver compiler.arguments.CheckCompileThresholdScaling
  */
 
+package compiler.arguments;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
 public class CheckCompileThresholdScaling {
 
     // The flag CompileThresholdScaling scales compilation thresholds
@@ -105,25 +108,25 @@
 
     private static final String[][] NON_TIERED_EXPECTED_OUTPUTS = {
         {
-            "intx CompileThreshold                         := 1000                                {pd product}",
-            "double CompileThresholdScaling                   = 1.000000                            {product}"
+            "intx CompileThreshold                         = 1000                                  {pd product} {command line}",
+            "double CompileThresholdScaling                  = 1.000000                                 {product} {default}"
         },
         {
-            "intx CompileThreshold                         := 1250                                {pd product}",
-            "double CompileThresholdScaling                  := 1.250000                            {product}"
+            "intx CompileThreshold                         = 1250                                  {pd product} {command line, ergonomic}",
+            "double CompileThresholdScaling                  = 1.250000                                 {product} {command line}"
         },
         {
-            "intx CompileThreshold                         := 750                                 {pd product}",
-            "double CompileThresholdScaling                  := 0.750000                            {product}"
+            "intx CompileThreshold                         = 750                                   {pd product} {command line, ergonomic}",
+            "double CompileThresholdScaling                  = 0.750000                                 {product} {command line}"
         },
         {
-            "intx CompileThreshold                         := 1000                                {pd product}",
-            "double CompileThresholdScaling                  := 0.000000                            {product}",
+            "intx CompileThreshold                         = 1000                                  {pd product} {command line}",
+            "double CompileThresholdScaling                  = 0.000000                                 {product} {command line}",
             "interpreted mode"
         },
         {
-            "intx CompileThreshold                         := 0                                   {pd product}",
-            "double CompileThresholdScaling                  := 0.750000                            {product}",
+            "intx CompileThreshold                         = 0                                     {pd product} {command line, ergonomic}",
+            "double CompileThresholdScaling                  = 0.750000                                 {product} {command line}",
             "interpreted mode"
         }
     };
@@ -237,94 +240,94 @@
 
     private static final String[][] TIERED_EXPECTED_OUTPUTS = {
         {
-            "intx Tier0BackedgeNotifyFreqLog               := 10                                  {product}",
-            "intx Tier0InvokeNotifyFreqLog                 := 7                                   {product}",
-            "intx Tier23InlineeNotifyFreqLog               := 20                                  {product}",
-            "intx Tier2BackedgeNotifyFreqLog               := 14                                  {product}",
-            "intx Tier2InvokeNotifyFreqLog                 := 11                                  {product}",
-            "intx Tier3BackEdgeThreshold                   := 60000                               {product}",
-            "intx Tier3BackedgeNotifyFreqLog               := 13                                  {product}",
-            "intx Tier3CompileThreshold                    := 2000                                {product}",
-            "intx Tier3InvocationThreshold                 := 200                                 {product}",
-            "intx Tier3InvokeNotifyFreqLog                 := 10                                  {product}",
-            "intx Tier3MinInvocationThreshold              := 100                                 {product}",
-            "intx Tier4BackEdgeThreshold                   := 40000                               {product}",
-            "intx Tier4CompileThreshold                    := 15000                               {product}",
-            "intx Tier4InvocationThreshold                 := 5000                                {product}",
-            "intx Tier4MinInvocationThreshold              := 600                                 {product}",
-            "double CompileThresholdScaling                   = 1.000000                            {product}"
+            "intx Tier0BackedgeNotifyFreqLog               = 10                                       {product} {command line}",
+            "intx Tier0InvokeNotifyFreqLog                 = 7                                        {product} {command line}",
+            "intx Tier23InlineeNotifyFreqLog               = 20                                       {product} {command line}",
+            "intx Tier2BackedgeNotifyFreqLog               = 14                                       {product} {command line}",
+            "intx Tier2InvokeNotifyFreqLog                 = 11                                       {product} {command line}",
+            "intx Tier3BackEdgeThreshold                   = 60000                                    {product} {command line}",
+            "intx Tier3BackedgeNotifyFreqLog               = 13                                       {product} {command line}",
+            "intx Tier3CompileThreshold                    = 2000                                     {product} {command line}",
+            "intx Tier3InvocationThreshold                 = 200                                      {product} {command line}",
+            "intx Tier3InvokeNotifyFreqLog                 = 10                                       {product} {command line}",
+            "intx Tier3MinInvocationThreshold              = 100                                      {product} {command line}",
+            "intx Tier4BackEdgeThreshold                   = 40000                                    {product} {command line}",
+            "intx Tier4CompileThreshold                    = 15000                                    {product} {command line}",
+            "intx Tier4InvocationThreshold                 = 5000                                     {product} {command line}",
+            "intx Tier4MinInvocationThreshold              = 600                                      {product} {command line}",
+            "double CompileThresholdScaling                  = 1.000000                                 {product} {default}"
         },
         {
-            "intx Tier0BackedgeNotifyFreqLog               := 9                                   {product}",
-            "intx Tier0InvokeNotifyFreqLog                 := 6                                   {product}",
-            "intx Tier23InlineeNotifyFreqLog               := 19                                  {product}",
-            "intx Tier2BackedgeNotifyFreqLog               := 13                                  {product}",
-            "intx Tier2InvokeNotifyFreqLog                 := 10                                  {product}",
-            "intx Tier3BackEdgeThreshold                   := 45000                               {product}",
-            "intx Tier3BackedgeNotifyFreqLog               := 12                                  {product}",
-            "intx Tier3CompileThreshold                    := 1500                                {product}",
-            "intx Tier3InvocationThreshold                 := 150                                 {product}",
-            "intx Tier3InvokeNotifyFreqLog                 := 9                                   {product}",
-            "intx Tier3MinInvocationThreshold              := 75                                  {product}",
-            "intx Tier4BackEdgeThreshold                   := 30000                               {product}",
-            "intx Tier4CompileThreshold                    := 11250                               {product}",
-            "intx Tier4InvocationThreshold                 := 3750                                {product}",
-            "intx Tier4MinInvocationThreshold              := 450                                 {product}",
-            "double CompileThresholdScaling                  := 0.750000                            {product}"
+            "intx Tier0BackedgeNotifyFreqLog               = 9                                        {product} {command line, ergonomic}",
+            "intx Tier0InvokeNotifyFreqLog                 = 6                                        {product} {command line, ergonomic}",
+            "intx Tier23InlineeNotifyFreqLog               = 19                                       {product} {command line, ergonomic}",
+            "intx Tier2BackedgeNotifyFreqLog               = 13                                       {product} {command line, ergonomic}",
+            "intx Tier2InvokeNotifyFreqLog                 = 10                                       {product} {command line, ergonomic}",
+            "intx Tier3BackEdgeThreshold                   = 45000                                    {product} {command line, ergonomic}",
+            "intx Tier3BackedgeNotifyFreqLog               = 12                                       {product} {command line, ergonomic}",
+            "intx Tier3CompileThreshold                    = 1500                                     {product} {command line, ergonomic}",
+            "intx Tier3InvocationThreshold                 = 150                                      {product} {command line, ergonomic}",
+            "intx Tier3InvokeNotifyFreqLog                 = 9                                        {product} {command line, ergonomic}",
+            "intx Tier3MinInvocationThreshold              = 75                                       {product} {command line, ergonomic}",
+            "intx Tier4BackEdgeThreshold                   = 30000                                    {product} {command line, ergonomic}",
+            "intx Tier4CompileThreshold                    = 11250                                    {product} {command line, ergonomic}",
+            "intx Tier4InvocationThreshold                 = 3750                                     {product} {command line, ergonomic}",
+            "intx Tier4MinInvocationThreshold              = 450                                      {product} {command line, ergonomic}",
+            "double CompileThresholdScaling                  = 0.750000                                 {product} {command line}"
         },
         {
-            "intx Tier0BackedgeNotifyFreqLog               := 10                                  {product}",
-            "intx Tier0InvokeNotifyFreqLog                 := 7                                   {product}",
-            "intx Tier23InlineeNotifyFreqLog               := 20                                  {product}",
-            "intx Tier2BackedgeNotifyFreqLog               := 14                                  {product}",
-            "intx Tier2InvokeNotifyFreqLog                 := 11                                  {product}",
-            "intx Tier3BackEdgeThreshold                   := 75000                               {product}",
-            "intx Tier3BackedgeNotifyFreqLog               := 13                                  {product}",
-            "intx Tier3CompileThreshold                    := 2500                                {product}",
-            "intx Tier3InvocationThreshold                 := 250                                 {product}",
-            "intx Tier3InvokeNotifyFreqLog                 := 10                                  {product}",
-            "intx Tier3MinInvocationThreshold              := 125                                 {product}",
-            "intx Tier4BackEdgeThreshold                   := 50000                               {product}",
-            "intx Tier4CompileThreshold                    := 18750                               {product}",
-            "intx Tier4InvocationThreshold                 := 6250                                {product}",
-            "intx Tier4MinInvocationThreshold              := 750                                 {product}",
-            "double CompileThresholdScaling                  := 1.250000                            {product}"
+            "intx Tier0BackedgeNotifyFreqLog               = 10                                       {product} {command line, ergonomic}",
+            "intx Tier0InvokeNotifyFreqLog                 = 7                                        {product} {command line, ergonomic}",
+            "intx Tier23InlineeNotifyFreqLog               = 20                                       {product} {command line, ergonomic}",
+            "intx Tier2BackedgeNotifyFreqLog               = 14                                       {product} {command line, ergonomic}",
+            "intx Tier2InvokeNotifyFreqLog                 = 11                                       {product} {command line, ergonomic}",
+            "intx Tier3BackEdgeThreshold                   = 75000                                    {product} {command line, ergonomic}",
+            "intx Tier3BackedgeNotifyFreqLog               = 13                                       {product} {command line, ergonomic}",
+            "intx Tier3CompileThreshold                    = 2500                                     {product} {command line, ergonomic}",
+            "intx Tier3InvocationThreshold                 = 250                                      {product} {command line, ergonomic}",
+            "intx Tier3InvokeNotifyFreqLog                 = 10                                       {product} {command line, ergonomic}",
+            "intx Tier3MinInvocationThreshold              = 125                                      {product} {command line, ergonomic}",
+            "intx Tier4BackEdgeThreshold                   = 50000                                    {product} {command line, ergonomic}",
+            "intx Tier4CompileThreshold                    = 18750                                    {product} {command line, ergonomic}",
+            "intx Tier4InvocationThreshold                 = 6250                                     {product} {command line, ergonomic}",
+            "intx Tier4MinInvocationThreshold              = 750                                      {product} {command line, ergonomic}",
+            "double CompileThresholdScaling                  = 1.250000                                 {product} {command line}"
         },
         {
-            "intx Tier0BackedgeNotifyFreqLog               := 11                                  {product}",
-            "intx Tier0InvokeNotifyFreqLog                 := 8                                   {product}",
-            "intx Tier23InlineeNotifyFreqLog               := 21                                  {product}",
-            "intx Tier2BackedgeNotifyFreqLog               := 15                                  {product}",
-            "intx Tier2InvokeNotifyFreqLog                 := 12                                  {product}",
-            "intx Tier3BackEdgeThreshold                   := 120000                              {product}",
-            "intx Tier3BackedgeNotifyFreqLog               := 14                                  {product}",
-            "intx Tier3CompileThreshold                    := 4000                                {product}",
-            "intx Tier3InvocationThreshold                 := 400                                 {product}",
-            "intx Tier3InvokeNotifyFreqLog                 := 11                                  {product}",
-            "intx Tier3MinInvocationThreshold              := 200                                 {product}",
-            "intx Tier4BackEdgeThreshold                   := 80000                               {product}",
-            "intx Tier4CompileThreshold                    := 30000                               {product}",
-            "intx Tier4InvocationThreshold                 := 10000                               {product}",
-            "intx Tier4MinInvocationThreshold              := 1200                                {product}",
-            "double CompileThresholdScaling                  := 2.000000                            {product}"
+            "intx Tier0BackedgeNotifyFreqLog               = 11                                       {product} {command line, ergonomic}",
+            "intx Tier0InvokeNotifyFreqLog                 = 8                                        {product} {command line, ergonomic}",
+            "intx Tier23InlineeNotifyFreqLog               = 21                                       {product} {command line, ergonomic}",
+            "intx Tier2BackedgeNotifyFreqLog               = 15                                       {product} {command line, ergonomic}",
+            "intx Tier2InvokeNotifyFreqLog                 = 12                                       {product} {command line, ergonomic}",
+            "intx Tier3BackEdgeThreshold                   = 120000                                   {product} {command line, ergonomic}",
+            "intx Tier3BackedgeNotifyFreqLog               = 14                                       {product} {command line, ergonomic}",
+            "intx Tier3CompileThreshold                    = 4000                                     {product} {command line, ergonomic}",
+            "intx Tier3InvocationThreshold                 = 400                                      {product} {command line, ergonomic}",
+            "intx Tier3InvokeNotifyFreqLog                 = 11                                       {product} {command line, ergonomic}",
+            "intx Tier3MinInvocationThreshold              = 200                                      {product} {command line, ergonomic}",
+            "intx Tier4BackEdgeThreshold                   = 80000                                    {product} {command line, ergonomic}",
+            "intx Tier4CompileThreshold                    = 30000                                    {product} {command line, ergonomic}",
+            "intx Tier4InvocationThreshold                 = 10000                                    {product} {command line, ergonomic}",
+            "intx Tier4MinInvocationThreshold              = 1200                                     {product} {command line, ergonomic}",
+            "double CompileThresholdScaling                  = 2.000000                                 {product} {command line}"
         },
         {
-            "intx Tier0BackedgeNotifyFreqLog               := 10                                  {product}",
-            "intx Tier0InvokeNotifyFreqLog                 := 7                                   {product}",
-            "intx Tier23InlineeNotifyFreqLog               := 20                                  {product}",
-            "intx Tier2BackedgeNotifyFreqLog               := 14                                  {product}",
-            "intx Tier2InvokeNotifyFreqLog                 := 11                                  {product}",
-            "intx Tier3BackEdgeThreshold                   := 60000                               {product}",
-            "intx Tier3BackedgeNotifyFreqLog               := 13                                  {product}",
-            "intx Tier3CompileThreshold                    := 2000                                {product}",
-            "intx Tier3InvocationThreshold                 := 200                                 {product}",
-            "intx Tier3InvokeNotifyFreqLog                 := 10                                  {product}",
-            "intx Tier3MinInvocationThreshold              := 100                                 {product}",
-            "intx Tier4BackEdgeThreshold                   := 40000                               {product}",
-            "intx Tier4CompileThreshold                    := 15000                               {product}",
-            "intx Tier4InvocationThreshold                 := 5000                                {product}",
-            "intx Tier4MinInvocationThreshold              := 600                                 {product}",
-            "double CompileThresholdScaling                  := 0.000000                            {product}",
+            "intx Tier0BackedgeNotifyFreqLog               = 10                                       {product} {command line}",
+            "intx Tier0InvokeNotifyFreqLog                 = 7                                        {product} {command line}",
+            "intx Tier23InlineeNotifyFreqLog               = 20                                       {product} {command line}",
+            "intx Tier2BackedgeNotifyFreqLog               = 14                                       {product} {command line}",
+            "intx Tier2InvokeNotifyFreqLog                 = 11                                       {product} {command line}",
+            "intx Tier3BackEdgeThreshold                   = 60000                                    {product} {command line}",
+            "intx Tier3BackedgeNotifyFreqLog               = 13                                       {product} {command line}",
+            "intx Tier3CompileThreshold                    = 2000                                     {product} {command line}",
+            "intx Tier3InvocationThreshold                 = 200                                      {product} {command line}",
+            "intx Tier3InvokeNotifyFreqLog                 = 10                                       {product} {command line}",
+            "intx Tier3MinInvocationThreshold              = 100                                      {product} {command line}",
+            "intx Tier4BackEdgeThreshold                   = 40000                                    {product} {command line}",
+            "intx Tier4CompileThreshold                    = 15000                                    {product} {command line}",
+            "intx Tier4InvocationThreshold                 = 5000                                     {product} {command line}",
+            "intx Tier4MinInvocationThreshold              = 600                                      {product} {command line}",
+            "double CompileThresholdScaling                  = 0.000000                                 {product} {command line}",
             "interpreted mode"
         }
     };
diff --git a/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java b/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java
index d05a24e..5d7f9fc 100644
--- a/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java
+++ b/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java
@@ -26,19 +26,19 @@
  * @bug 8031321
  * @summary Verify processing of UseBMI1Instructions option on CPU with
  *          BMI1 feature support.
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseBMI1InstructionsOnSupportedCPU
- *        BMISupportedCPUTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build compiler.arguments.TestUseBMI1InstructionsOnSupportedCPU
+ *        compiler.arguments.BMISupportedCPUTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseBMI1InstructionsOnSupportedCPU
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.arguments.TestUseBMI1InstructionsOnSupportedCPU
  */
 
-import sun.hotspot.cpuinfo.CPUInfo;
-import jdk.test.lib.*;
+package compiler.arguments;
 
 public class TestUseBMI1InstructionsOnSupportedCPU
      extends BMISupportedCPUTest {
diff --git a/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java b/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java
index 716e069..4fd996f 100644
--- a/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java
+++ b/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java
@@ -26,20 +26,19 @@
  * @bug 8031321
  * @summary Verify processing of UseBMI1Instructions option on CPU without
  *          BMI1 feature support.
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseBMI1InstructionsOnUnsupportedCPU
- *        BMIUnsupportedCPUTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build compiler.arguments.TestUseBMI1InstructionsOnUnsupportedCPU
+ *        compiler.arguments.BMIUnsupportedCPUTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseBMI1InstructionsOnUnsupportedCPU
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.arguments.TestUseBMI1InstructionsOnUnsupportedCPU
  */
 
-import sun.hotspot.cpuinfo.CPUInfo;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
+package compiler.arguments;
 
 public class TestUseBMI1InstructionsOnUnsupportedCPU
       extends BMIUnsupportedCPUTest {
diff --git a/test/compiler/arguments/TestUseCompiler.java b/test/compiler/arguments/TestUseCompiler.java
index edf3540..75f229e 100644
--- a/test/compiler/arguments/TestUseCompiler.java
+++ b/test/compiler/arguments/TestUseCompiler.java
@@ -25,10 +25,13 @@
  * @test TestUseCompiler
  * @bug 8086068
  * @summary Tests execution with inconsistent UseCompiler flag combination.
- * @run main/othervm -Xint -XX:+UseCompiler TestUseCompiler
- * @run main/othervm -XX:+UseCompiler -Xint TestUseCompiler
+ *
+ * @run main/othervm -Xint -XX:+UseCompiler compiler.arguments.TestUseCompiler
+ * @run main/othervm -XX:+UseCompiler -Xint compiler.arguments.TestUseCompiler
  */
 
+package compiler.arguments;
+
 public class TestUseCompiler {
 
     public static void main(String args[]) {
diff --git a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java
index 0ffa6ea..3ebd44d 100644
--- a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java
+++ b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java
@@ -26,20 +26,19 @@
  * @bug 8031321
  * @summary Verify processing of UseCountLeadingZerosInstruction option
  *          on CPU with LZCNT support.
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseCountLeadingZerosInstructionOnSupportedCPU
- *        BMISupportedCPUTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.arguments.TestUseCountLeadingZerosInstructionOnSupportedCPU
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseCountLeadingZerosInstructionOnSupportedCPU
+ *                   compiler.arguments.TestUseCountLeadingZerosInstructionOnSupportedCPU
  */
 
-import sun.hotspot.cpuinfo.CPUInfo;
-import jdk.test.lib.*;
+package compiler.arguments;
 
 public class TestUseCountLeadingZerosInstructionOnSupportedCPU
      extends BMISupportedCPUTest {
diff --git a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java
index 1209315..4285c27 100644
--- a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java
+++ b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java
@@ -26,20 +26,19 @@
  * @bug 8031321
  * @summary Verify processing of UseCountLeadingZerosInstruction option
  *          on CPU without LZCNT support.
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseCountLeadingZerosInstructionOnUnsupportedCPU
- *        BMIUnsupportedCPUTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.arguments.TestUseCountLeadingZerosInstructionOnUnsupportedCPU
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseCountLeadingZerosInstructionOnUnsupportedCPU
+ *                   compiler.arguments.TestUseCountLeadingZerosInstructionOnUnsupportedCPU
  */
 
-import sun.hotspot.cpuinfo.CPUInfo;
-import jdk.test.lib.*;
+package compiler.arguments;
 
 public class TestUseCountLeadingZerosInstructionOnUnsupportedCPU
      extends BMIUnsupportedCPUTest {
diff --git a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
index 397bdc9..3e988e6 100644
--- a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
+++ b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
@@ -26,21 +26,21 @@
  * @bug 8031321
  * @summary Verify processing of UseCountTrailingZerosInstruction option
  *          on CPU with TZCNT (BMI1 feature) support.
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseCountTrailingZerosInstructionOnSupportedCPU
- *        BMISupportedCPUTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.arguments.TestUseCountTrailingZerosInstructionOnSupportedCPU
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseCountTrailingZerosInstructionOnSupportedCPU
+ *                   compiler.arguments.TestUseCountTrailingZerosInstructionOnSupportedCPU
  */
 
-import sun.hotspot.cpuinfo.CPUInfo;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
+package compiler.arguments;
+
+import jdk.test.lib.cli.CommandLineOptionTest;
 
 public class TestUseCountTrailingZerosInstructionOnSupportedCPU
         extends BMISupportedCPUTest {
diff --git a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java
index 73aad61..96ccd67 100644
--- a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java
+++ b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java
@@ -26,21 +26,21 @@
  * @bug 8031321
  * @summary Verify processing of UseCountTrailingZerosInstruction option
  *          on CPU without TZCNT instruction (BMI1 feature) support.
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU
- *        BMIUnsupportedCPUTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.arguments.TestUseCountTrailingZerosInstructionOnUnsupportedCPU
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseCountTrailingZerosInstructionOnUnsupportedCPU
+ *                   compiler.arguments.TestUseCountTrailingZerosInstructionOnUnsupportedCPU
  */
 
-import sun.hotspot.cpuinfo.CPUInfo;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
+package compiler.arguments;
+
+import jdk.test.lib.cli.CommandLineOptionTest;
 
 public class TestUseCountTrailingZerosInstructionOnUnsupportedCPU
         extends BMIUnsupportedCPUTest {
diff --git a/test/compiler/arraycopy/TestArrayCloneBadAssert.java b/test/compiler/arraycopy/TestArrayCloneBadAssert.java
index a603333..7203ca2 100644
--- a/test/compiler/arraycopy/TestArrayCloneBadAssert.java
+++ b/test/compiler/arraycopy/TestArrayCloneBadAssert.java
@@ -25,10 +25,14 @@
  * @test
  * @bug 8073792
  * @summary assert broken when array size becomes known during igvn
- * @run main/othervm -Xcomp -XX:CompileOnly=TestArrayCloneBadAssert.m TestArrayCloneBadAssert
  *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.arraycopy.TestArrayCloneBadAssert::m
+ *      compiler.arraycopy.TestArrayCloneBadAssert
  */
 
+package compiler.arraycopy;
+
 public class TestArrayCloneBadAssert {
 
     static final int[] array = new int[5];
diff --git a/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java b/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java
index 6a1b4e6..4c4c388 100644
--- a/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java
+++ b/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java
@@ -25,13 +25,22 @@
  * @test
  * @bug 6912521
  * @summary small array copy as loads/stores
- * @compile TestArrayCopyAsLoadsStores.java TestArrayCopyUtils.java
- * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestArrayCopyAsLoadsStores::m* -XX:TypeProfileLevel=200 TestArrayCopyAsLoadsStores
- * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestArrayCopyAsLoadsStores::m* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode -XX:TypeProfileLevel=200 TestArrayCopyAsLoadsStores
+ * @library /
  *
+ * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:CompileCommand=dontinline,compiler.arraycopy.TestArrayCopyAsLoadsStores::m*
+ *                   -XX:TypeProfileLevel=200
+ *                   compiler.arraycopy.TestArrayCopyAsLoadsStores
+ * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:CompileCommand=dontinline,compiler.arraycopy.TestArrayCopyAsLoadsStores::m*
+ *                   -XX:TypeProfileLevel=200
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode
+ *                   compiler.arraycopy.TestArrayCopyAsLoadsStores
  */
 
-import java.util.*;
+package compiler.arraycopy;
+
+import java.util.Arrays;
 
 public class TestArrayCopyAsLoadsStores extends TestArrayCopyUtils {
 
diff --git a/test/compiler/arraycopy/TestArrayCopyBadReexec.java b/test/compiler/arraycopy/TestArrayCopyBadReexec.java
index 09b0332..93eb1b2 100644
--- a/test/compiler/arraycopy/TestArrayCopyBadReexec.java
+++ b/test/compiler/arraycopy/TestArrayCopyBadReexec.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8073866
  * @summary Fix for 8064703 may also cause stores between the allocation and arraycopy to be rexecuted after a deoptimization
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyBadReexec
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.arraycopy.TestArrayCopyBadReexec
  */
 
+package compiler.arraycopy;
+
 public class TestArrayCopyBadReexec {
 
     static int val;
diff --git a/test/compiler/arraycopy/TestArrayCopyMacro.java b/test/compiler/arraycopy/TestArrayCopyMacro.java
index 9a451af..15b2e73 100644
--- a/test/compiler/arraycopy/TestArrayCopyMacro.java
+++ b/test/compiler/arraycopy/TestArrayCopyMacro.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 7173584
  * @summary arraycopy as macro node
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyMacro
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.arraycopy.TestArrayCopyMacro
  */
 
+package compiler.arraycopy;
+
 public class TestArrayCopyMacro {
     static class A {
     }
diff --git a/test/compiler/arraycopy/TestArrayCopyNoInit.java b/test/compiler/arraycopy/TestArrayCopyNoInit.java
index 8d9978a..828fb5a 100644
--- a/test/compiler/arraycopy/TestArrayCopyNoInit.java
+++ b/test/compiler/arraycopy/TestArrayCopyNoInit.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8064703
  * @summary Deoptimization between array allocation and arraycopy may result in non initialized array
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020 TestArrayCopyNoInit
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020
+ *                   compiler.arraycopy.TestArrayCopyNoInit
  */
 
+package compiler.arraycopy;
+
 public class TestArrayCopyNoInit {
 
     static int[] m1(int[] src) {
diff --git a/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java b/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
index 6451b38..c3ee9a4 100644
--- a/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
+++ b/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
@@ -25,22 +25,26 @@
  * @test
  * @bug 8072016
  * @summary Infinite deoptimization/recompilation cycles in case of arraycopy with tightly coupled allocation
+ * @requires vm.flavor == "server"
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestArrayCopyNoInitDeopt
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *
+ * @build compiler.arraycopy.TestArrayCopyNoInitDeopt
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  *                                jdk.test.lib.Platform
  * @run main/othervm -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020
- *                   TestArrayCopyNoInitDeopt
+ *                   compiler.arraycopy.TestArrayCopyNoInitDeopt
  */
 
-import sun.hotspot.WhiteBox;
-import sun.hotspot.code.NMethod;
-import jdk.test.lib.Platform;
-import java.lang.reflect.*;
+package compiler.arraycopy;
+
 import compiler.whitebox.CompilerWhiteBoxTest;
+import jdk.test.lib.Platform;
+import sun.hotspot.WhiteBox;
+
+import java.lang.reflect.Method;
 
 public class TestArrayCopyNoInitDeopt {
 
@@ -83,9 +87,11 @@
     }
 
     static public void main(String[] args) throws Exception {
+        if (!Platform.isServer()) {
+            throw new Error("TESTBUG: Not server VM");
+        }
         // Only execute if C2 is available
-        if (Platform.isServer() &&
-            TIERED_STOP_AT_LEVEL == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) {
+        if (TIERED_STOP_AT_LEVEL == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) {
             int[] src = new int[10];
             Object src_obj = new Object();
             Method method_m1 = TestArrayCopyNoInitDeopt.class.getMethod("m1", Object.class);
diff --git a/test/compiler/arraycopy/TestArrayCopyOfStopped.java b/test/compiler/arraycopy/TestArrayCopyOfStopped.java
index 1d60235..d2a9d45 100644
--- a/test/compiler/arraycopy/TestArrayCopyOfStopped.java
+++ b/test/compiler/arraycopy/TestArrayCopyOfStopped.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8074676
  * @summary after guards in Arrays.copyOf() intrinsic, control may become top
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOfStopped
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.arraycopy.TestArrayCopyOfStopped
  */
 
+package compiler.arraycopy;
+
 import java.util.Arrays;
 
 public class TestArrayCopyOfStopped {
diff --git a/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java b/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java
index 1bfaa35..bc23717 100644
--- a/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java
+++ b/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java
@@ -28,10 +28,13 @@
  *          are properly sign extended to 64 bit (e.g., PPC64, s390x). This can fail
  *          if slow_arraycopy_C() is commpiled by the C compiler without any imlicit
  *          casts (as spill stores to the stack that are done with 4-byte instruction).
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOverflowArguments
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.arraycopy.TestArrayCopyOverflowArguments
  */
 
+package compiler.arraycopy;
+
 public class TestArrayCopyOverflowArguments {
 
     // Without volatile the overflowing computation was moved up and then
diff --git a/test/compiler/arraycopy/TestArrayCopyOverflowInBoundChecks.java b/test/compiler/arraycopy/TestArrayCopyOverflowInBoundChecks.java
index 883df96..b45bbce 100644
--- a/test/compiler/arraycopy/TestArrayCopyOverflowInBoundChecks.java
+++ b/test/compiler/arraycopy/TestArrayCopyOverflowInBoundChecks.java
@@ -25,9 +25,13 @@
  * @test
  * @bug 8134468
  * @summary test that checks whether an array load falls into the range of an arraycopy is incorrect on 32bits
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOverflowInBoundChecks
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                    compiler.arraycopy.TestArrayCopyOverflowInBoundChecks
  */
+
+package compiler.arraycopy;
+
 public class TestArrayCopyOverflowInBoundChecks {
 
     static byte[] src_array = { 'a', 'b', 'c', 'd', 'e' };
diff --git a/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java b/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java
index c75a696..05f1c24 100644
--- a/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java
+++ b/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java
@@ -25,10 +25,16 @@
  * @test
  * @bug 8075921
  * @summary control becomes top after arraycopy guards and confuses tighly coupled allocation logic
- * @run main/othervm -Xcomp -XX:CompileOnly=TestArrayCopyStoppedAfterGuards.test,System.arraycopy TestArrayCopyStoppedAfterGuards
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,java.lang.System::arraycopy
+ *      -XX:CompileCommand=compileonly,compiler.arraycopy.TestArrayCopyStoppedAfterGuards::test
+ *      compiler.arraycopy.TestArrayCopyStoppedAfterGuards
  *
  */
 
+package compiler.arraycopy;
+
 public class TestArrayCopyStoppedAfterGuards {
 
     static void test() {
diff --git a/test/compiler/arraycopy/TestArrayCopyUtils.java b/test/compiler/arraycopy/TestArrayCopyUtils.java
index de6af41..990400d 100644
--- a/test/compiler/arraycopy/TestArrayCopyUtils.java
+++ b/test/compiler/arraycopy/TestArrayCopyUtils.java
@@ -21,9 +21,13 @@
  * questions.
  */
 
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
+package compiler.arraycopy;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
 
 abstract class TestArrayCopyUtils {
     public enum ArraySrc {
diff --git a/test/compiler/arraycopy/TestArraysCopyOfNoTypeCheck.java b/test/compiler/arraycopy/TestArraysCopyOfNoTypeCheck.java
index b24bc3b..f78e3e2 100644
--- a/test/compiler/arraycopy/TestArraysCopyOfNoTypeCheck.java
+++ b/test/compiler/arraycopy/TestArraysCopyOfNoTypeCheck.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8055910
  * @summary Arrays.copyOf doesn't perform subtype check
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArraysCopyOfNoTypeCheck
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.arraycopy.TestArraysCopyOfNoTypeCheck
  */
 
+package compiler.arraycopy;
+
 import java.util.Arrays;
 
 public class TestArraysCopyOfNoTypeCheck {
diff --git a/test/compiler/arraycopy/TestDeadArrayCopyOnMemChain.java b/test/compiler/arraycopy/TestDeadArrayCopyOnMemChain.java
index 1492254..d175182 100644
--- a/test/compiler/arraycopy/TestDeadArrayCopyOnMemChain.java
+++ b/test/compiler/arraycopy/TestDeadArrayCopyOnMemChain.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8080699
  * @summary eliminated arraycopy node still reachable through exception edges
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestDeadArrayCopyOnMemChain
  *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *                   compiler.arraycopy.TestDeadArrayCopyOnMemChain
  */
 
+package compiler.arraycopy;
+
 public class TestDeadArrayCopyOnMemChain {
     static class A {
         int f;
diff --git a/test/compiler/arraycopy/TestEliminateArrayCopy.java b/test/compiler/arraycopy/TestEliminateArrayCopy.java
index 624a65c..3364ffa 100644
--- a/test/compiler/arraycopy/TestEliminateArrayCopy.java
+++ b/test/compiler/arraycopy/TestEliminateArrayCopy.java
@@ -25,11 +25,16 @@
  * @test
  * @bug 8076188
  * @summary arraycopy to non escaping destination may be eliminated
- * @compile TestEliminateArrayCopy.java TestArrayCopyUtils.java
- * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestEliminateArrayCopy*::m* TestEliminateArrayCopy
+ * @library /
+ *
+ * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:CompileCommand=dontinline,compiler.arraycopy.TestEliminateArrayCopy*::m*
+ *                   compiler.arraycopy.TestEliminateArrayCopy
  *
  */
 
+package compiler.arraycopy;
+
 public class TestEliminateArrayCopy {
 
     static class CloneTests extends TestInstanceCloneUtils {
diff --git a/test/compiler/arraycopy/TestEliminatedArrayCopyDeopt.java b/test/compiler/arraycopy/TestEliminatedArrayCopyDeopt.java
index fb98c65..80f81c6 100644
--- a/test/compiler/arraycopy/TestEliminatedArrayCopyDeopt.java
+++ b/test/compiler/arraycopy/TestEliminatedArrayCopyDeopt.java
@@ -25,8 +25,12 @@
  * @test
  * @bug 8130847 8156760
  * @summary Eliminated instance/array written to by an array copy variant must be correctly initialized when reallocated at a deopt
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestEliminatedArrayCopyDeopt
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:-ReduceInitialCardMarks TestEliminatedArrayCopyDeopt
+ * @ignore 8136818
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.arraycopy.TestEliminatedArrayCopyDeopt
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-ReduceInitialCardMarks
+ *                   compiler.arraycopy.TestEliminatedArrayCopyDeopt
  */
 
 // Test that if an ArrayCopy node is eliminated because it doesn't
@@ -34,6 +38,8 @@
 // on a deoptimization, when the object/array is reallocated, it is
 // correctly initialized
 
+package compiler.arraycopy;
+
 public class TestEliminatedArrayCopyDeopt {
 
     static class A implements Cloneable {
diff --git a/test/compiler/arraycopy/TestEliminatedArrayCopyPhi.java b/test/compiler/arraycopy/TestEliminatedArrayCopyPhi.java
index 83edd32..62d55b9 100644
--- a/test/compiler/arraycopy/TestEliminatedArrayCopyPhi.java
+++ b/test/compiler/arraycopy/TestEliminatedArrayCopyPhi.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8134321
  * @summary Code that capture field values of eliminated allocation at a safepoint when there's an arraycopy behind a Phi is broken
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestEliminatedArrayCopyPhi
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.arraycopy.TestEliminatedArrayCopyPhi
  */
 
+package compiler.arraycopy;
+
 public class TestEliminatedArrayCopyPhi {
 
     static int[] escaped;
diff --git a/test/compiler/arraycopy/TestEliminatedArrayLoopPredicateCopyDeopt.java b/test/compiler/arraycopy/TestEliminatedArrayLoopPredicateCopyDeopt.java
index d0ce772..b7e677c 100644
--- a/test/compiler/arraycopy/TestEliminatedArrayLoopPredicateCopyDeopt.java
+++ b/test/compiler/arraycopy/TestEliminatedArrayLoopPredicateCopyDeopt.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8134974
  * @summary Cannot pin eliminated arraycopy loads for deopt state in uncommon trap path if it is a loop predicate unc
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestEliminatedArrayLoopPredicateCopyDeopt
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.arraycopy.TestEliminatedArrayLoopPredicateCopyDeopt
  */
 
+package compiler.arraycopy;
+
 public class TestEliminatedArrayLoopPredicateCopyDeopt {
 
     static boolean test(int[] array_src) {
diff --git a/test/compiler/arraycopy/TestInstanceCloneAsLoadsStores.java b/test/compiler/arraycopy/TestInstanceCloneAsLoadsStores.java
index 640c686..fd3b64d 100644
--- a/test/compiler/arraycopy/TestInstanceCloneAsLoadsStores.java
+++ b/test/compiler/arraycopy/TestInstanceCloneAsLoadsStores.java
@@ -25,12 +25,23 @@
  * @test
  * @bug 6700100 8156760
  * @summary small instance clone as loads/stores
- * @compile TestInstanceCloneAsLoadsStores.java TestInstanceCloneUtils.java
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestInstanceCloneAsLoadsStores::m* TestInstanceCloneAsLoadsStores
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestInstanceCloneAsLoadsStores::m* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode TestInstanceCloneAsLoadsStores
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestInstanceCloneAsLoadsStores::m* -XX:+IgnoreUnrecognizedVMOptions -XX:-ReduceInitialCardMarks TestInstanceCloneAsLoadsStores
+ * @library /
+ *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:CompileCommand=dontinline,compiler.arraycopy.TestInstanceCloneAsLoadsStores::m*
+ *                   compiler.arraycopy.TestInstanceCloneAsLoadsStores
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:CompileCommand=dontinline,compiler.arraycopy.TestInstanceCloneAsLoadsStores::m*
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode
+ *                   compiler.arraycopy.TestInstanceCloneAsLoadsStores
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:CompileCommand=dontinline,compiler.arraycopy.TestInstanceCloneAsLoadsStores::m*
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-ReduceInitialCardMarks
+ *                   compiler.arraycopy.TestInstanceCloneAsLoadsStores
  */
 
+package compiler.arraycopy;
+
 public class TestInstanceCloneAsLoadsStores extends TestInstanceCloneUtils {
 
     // Should be compiled as loads/stores
diff --git a/test/compiler/arraycopy/TestInstanceCloneUtils.java b/test/compiler/arraycopy/TestInstanceCloneUtils.java
index af1e6fc..0e99257 100644
--- a/test/compiler/arraycopy/TestInstanceCloneUtils.java
+++ b/test/compiler/arraycopy/TestInstanceCloneUtils.java
@@ -21,8 +21,12 @@
  * questions.
  */
 
-import java.lang.reflect.*;
-import java.util.*;
+package compiler.arraycopy;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
 
 abstract class TestInstanceCloneUtils {
     static class Base implements Cloneable {
diff --git a/test/compiler/arraycopy/TestLoadBypassArrayCopy.java b/test/compiler/arraycopy/TestLoadBypassArrayCopy.java
index 697b974..d4e4ca1 100644
--- a/test/compiler/arraycopy/TestLoadBypassArrayCopy.java
+++ b/test/compiler/arraycopy/TestLoadBypassArrayCopy.java
@@ -25,10 +25,15 @@
  * @test
  * @bug 8086046
  * @summary load bypasses arraycopy that sets the value after the ArrayCopyNode is expanded
- * @run main/othervm -XX:-BackgroundCompilation  -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestLoadBypassArrayCopy::test_helper -XX:-TieredCompilation TestLoadBypassArrayCopy
  *
+ * @run main/othervm -XX:-BackgroundCompilation  -XX:-UseOnStackReplacement
+ *                   -XX:CompileCommand=dontinline,compiler.arraycopy.TestLoadBypassArrayCopy::test_helper
+ *                   -XX:-TieredCompilation
+ *                   compiler.arraycopy.TestLoadBypassArrayCopy
  */
 
+package compiler.arraycopy;
+
 public class TestLoadBypassArrayCopy {
 
     static long i;
diff --git a/test/compiler/arraycopy/TestMissingControl.java b/test/compiler/arraycopy/TestMissingControl.java
index 503e24b..f362e53 100644
--- a/test/compiler/arraycopy/TestMissingControl.java
+++ b/test/compiler/arraycopy/TestMissingControl.java
@@ -25,9 +25,14 @@
  * @test
  * @bug 8055153
  * @summary missing control on LoadRange and LoadKlass when array copy macro node is expanded
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation TestMissingControl
+ *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation
+ *                   compiler.arraycopy.TestMissingControl
  *
  */
+
+package compiler.arraycopy;
+
 public class TestMissingControl {
 
     static int[] m1(int[] a2) {
diff --git a/test/compiler/arraycopy/TestObjectArrayClone.java b/test/compiler/arraycopy/TestObjectArrayClone.java
index 3cf5c65..9be6fa0 100644
--- a/test/compiler/arraycopy/TestObjectArrayClone.java
+++ b/test/compiler/arraycopy/TestObjectArrayClone.java
@@ -25,8 +25,14 @@
  * @test
  * @bug 8155643
  * @summary Test Object.clone() intrinsic if ReduceInitialCardMarks is disabled.
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:CompileOnly=TestObjectArrayClone.test -XX:-ReduceInitialCardMarks TestObjectArrayClone
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-ReduceInitialCardMarks
+ *                   -XX:CompileCommand=compileonly,compiler.arraycopy.TestObjectArrayClone::test
+ *                   compiler.arraycopy.TestObjectArrayClone
  */
+
+package compiler.arraycopy;
+
 public class TestObjectArrayClone {
 
     public static TestObjectArrayClone[] test(TestObjectArrayClone[] arr) {
diff --git a/test/compiler/arraycopy/TestReduceBulkZeroingDisabled.java b/test/compiler/arraycopy/TestReduceBulkZeroingDisabled.java
index 2c789c0..873eb1b 100644
--- a/test/compiler/arraycopy/TestReduceBulkZeroingDisabled.java
+++ b/test/compiler/arraycopy/TestReduceBulkZeroingDisabled.java
@@ -25,8 +25,13 @@
  * @test
  * @bug 8155241
  * @summary Test arraycopy elimination with ReduceBulkZeroing disabled.
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-ReduceBulkZeroing TestReduceBulkZeroingDisabled
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-ReduceBulkZeroing
+ *                   compiler.arraycopy.TestReduceBulkZeroingDisabled
  */
+
+package compiler.arraycopy;
+
 public class TestReduceBulkZeroingDisabled {
 
     static public void main(String[] args) {
diff --git a/test/compiler/c1/6478991/NullCheckTest.java b/test/compiler/c1/6478991/NullCheckTest.java
deleted file mode 100644
index 760e80c..0000000
--- a/test/compiler/c1/6478991/NullCheckTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2011, 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 6478991
- * @summary C1 NullCheckEliminator yields incorrect exceptions
- *
- * @run main/othervm -XX:CompileOnly=NullCheckTest.test,NullCheckTest.inlined  -Xcomp NullCheckTest
- */
-
-public class NullCheckTest {
-        static class A {
-                int f;
-
-                public final void inlined(A a) {
-                        // This cast is intended to fail.
-                        B b = ((B) a);
-                }
-        }
-
-        static class B extends A {
-        }
-
-
-        private static void test(A a1, A a2) {
-                // Inlined call must do a null check on a1.
-                // However, the exlipcit NullCheck instruction is eliminated and
-                // the null check is folded into the field load below, so the
-                // exception in the inlined method is thrown before the null check
-                // and the NullPointerException is not thrown.
-                a1.inlined(a2);
-
-                int x = a1.f;
-        }
-
-        public static void main(String[] args) {
-                // load classes
-                new B();
-                try {
-                        test(null, new A());
-
-                        throw new InternalError("FAILURE: no exception");
-                } catch (NullPointerException ex) {
-                        System.out.println("CORRECT: NullPointerException");
-                } catch (ClassCastException ex) {
-                        System.out.println("FAILURE: ClassCastException");
-                        throw ex;
-                }
-        }
-}
diff --git a/test/compiler/c1/CanonicalizeArrayLength.java b/test/compiler/c1/CanonicalizeArrayLength.java
index ee2649a..64255c9 100644
--- a/test/compiler/c1/CanonicalizeArrayLength.java
+++ b/test/compiler/c1/CanonicalizeArrayLength.java
@@ -25,11 +25,29 @@
  * @test
  * @bug 8150102 8150514 8150534
  * @summary C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation CanonicalizeArrayLength
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:+PatchALot CanonicalizeArrayLength
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=0 CanonicalizeArrayLength
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=1 CanonicalizeArrayLength
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ *                   -XX:-BackgroundCompilation
+ *                   compiler.c1.CanonicalizeArrayLength
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ *                   -XX:-BackgroundCompilation
+ *                   -XX:+PatchALot
+ *                   compiler.c1.CanonicalizeArrayLength
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ *                   -XX:-BackgroundCompilation
+ *                   -XX:ScavengeRootsInCode=0
+ *                   compiler.c1.CanonicalizeArrayLength
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ *                   -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=1
+ *                   compiler.c1.CanonicalizeArrayLength
  */
+
+package compiler.c1;
+
 public class CanonicalizeArrayLength {
     int[] arr = new int[42];
     int[] arrNull = null;
diff --git a/test/compiler/c1/NullCheckTest.java b/test/compiler/c1/NullCheckTest.java
new file mode 100644
index 0000000..24f72a4
--- /dev/null
+++ b/test/compiler/c1/NullCheckTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011, 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 6478991
+ * @summary C1 NullCheckEliminator yields incorrect exceptions
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c1.NullCheckTest::test
+ *      -XX:CompileCommand=compileonly,compiler.c1.NullCheckTest::inlined
+ *      compiler.c1.NullCheckTest
+ */
+
+package compiler.c1;
+
+public class NullCheckTest {
+    static class A {
+        int f;
+
+        public final void inlined(A a) {
+            // This cast is intended to fail.
+            B b = ((B) a);
+        }
+    }
+
+    static class B extends A {
+    }
+
+
+    private static void test(A a1, A a2) {
+        // Inlined call must do a null check on a1.
+        // However, the exlipcit NullCheck instruction is eliminated and
+        // the null check is folded into the field load below, so the
+        // exception in the inlined method is thrown before the null check
+        // and the NullPointerException is not thrown.
+        a1.inlined(a2);
+
+        int x = a1.f;
+    }
+
+    public static void main(String[] args) {
+        // load classes
+        new B();
+        try {
+                test(null, new A());
+
+                throw new InternalError("FAILURE: no exception");
+        } catch (NullPointerException ex) {
+                System.out.println("CORRECT: NullPointerException");
+        } catch (ClassCastException ex) {
+                System.out.println("FAILURE: ClassCastException");
+                throw ex;
+        }
+    }
+}
diff --git a/test/compiler/c1/6579789/Test6579789.java b/test/compiler/c1/Test6579789.java
similarity index 90%
rename from test/compiler/c1/6579789/Test6579789.java
rename to test/compiler/c1/Test6579789.java
index 344a08f..23603ea 100644
--- a/test/compiler/c1/6579789/Test6579789.java
+++ b/test/compiler/c1/Test6579789.java
@@ -26,9 +26,14 @@
  * @test
  * @bug 6579789
  * @summary Internal error "c1_LinearScan.cpp:1429 Error: assert(false,"")" in debuggee with fastdebug VM
- * @run main/othervm -Xcomp -XX:UseSSE=0 -XX:CompileOnly=Test6579789.bug Test6579789
+ *
+ * @run main/othervm -Xcomp -XX:UseSSE=0
+ *      -XX:CompileCommand=compileonly,compiler.c1.Test6579789::bug
+ *      compiler.c1.Test6579789
  */
 
+package compiler.c1;
+
 public class Test6579789 {
     public static void main(String[] args) {
         bug(4);
diff --git a/test/compiler/c1/6756768/Test6756768.java b/test/compiler/c1/Test6756768.java
similarity index 95%
rename from test/compiler/c1/6756768/Test6756768.java
rename to test/compiler/c1/Test6756768.java
index 42a7474..f1158ef 100644
--- a/test/compiler/c1/6756768/Test6756768.java
+++ b/test/compiler/c1/Test6756768.java
@@ -26,9 +26,11 @@
  * @bug 6756768
  * @summary C1 generates invalid code
  *
- * @run main/othervm -Xcomp Test6756768
+ * @run main/othervm -Xcomp compiler.c1.Test6756768
  */
 
+package compiler.c1;
+
 class Test6756768a
 {
     static boolean var_1 = true;
diff --git a/test/compiler/c1/6756768/Test6756768_2.java b/test/compiler/c1/Test6756768_2.java
similarity index 95%
rename from test/compiler/c1/6756768/Test6756768_2.java
rename to test/compiler/c1/Test6756768_2.java
index b391500..16406cb 100644
--- a/test/compiler/c1/6756768/Test6756768_2.java
+++ b/test/compiler/c1/Test6756768_2.java
@@ -26,9 +26,11 @@
  * @bug 6756768
  * @summary C1 generates invalid code
  *
- * @run main/othervm -Xcomp Test6756768_2
+ * @run main/othervm -Xcomp compiler.c1.Test6756768_2
  */
 
+package compiler.c1;
+
 class Test6756768_2a {
     static int var = ++Test6756768_2.var;
 }
diff --git a/test/compiler/c1/6757316/Test6757316.java b/test/compiler/c1/Test6757316.java
similarity index 94%
rename from test/compiler/c1/6757316/Test6757316.java
rename to test/compiler/c1/Test6757316.java
index 9585caa..9566dfa 100644
--- a/test/compiler/c1/6757316/Test6757316.java
+++ b/test/compiler/c1/Test6757316.java
@@ -25,9 +25,12 @@
  * @test
  * @bug 6757316
  * @summary load_constant() produces a wrong long constant, with high a low words swapped
- * @run main/othervm -Xcomp Test6757316
+ *
+ * @run main/othervm -Xcomp compiler.c1.Test6757316
  */
 
+package compiler.c1;
+
 public class Test6757316 {
     public static void main(String[] args) {
         long[] arr = {
diff --git a/test/compiler/c1/6758234/Test6758234.java b/test/compiler/c1/Test6758234.java
similarity index 89%
rename from test/compiler/c1/6758234/Test6758234.java
rename to test/compiler/c1/Test6758234.java
index 8b880c6..d014354 100644
--- a/test/compiler/c1/6758234/Test6758234.java
+++ b/test/compiler/c1/Test6758234.java
@@ -25,9 +25,14 @@
  * @test
  * @bug 6758234
  * @summary if (k cond (a ? : b: c)) returns reversed answer if k is constant and b and c are longs
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6758234.main Test6758234
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c1.Test6758234::main
+ *      compiler.c1.Test6758234
  */
 
+package compiler.c1;
+
 public class Test6758234 {
     static int x = 0;
     static int y = 1;
diff --git a/test/compiler/c1/6795465/Test6795465.java b/test/compiler/c1/Test6795465.java
similarity index 95%
rename from test/compiler/c1/6795465/Test6795465.java
rename to test/compiler/c1/Test6795465.java
index 2e9db1d..5f3ca9c 100644
--- a/test/compiler/c1/6795465/Test6795465.java
+++ b/test/compiler/c1/Test6795465.java
@@ -27,9 +27,11 @@
  * @bug 6795465
  * @summary Crash in assembler_sparc.cpp with client compiler on solaris-sparc
  *
- * @run main Test6795465
+ * @run main compiler.c1.Test6795465
  */
 
+package compiler.c1;
+
 public class Test6795465 {
     static long var_1 = -1;
 
diff --git a/test/compiler/c1/6849574/Test.java b/test/compiler/c1/Test6849574.java
similarity index 89%
rename from test/compiler/c1/6849574/Test.java
rename to test/compiler/c1/Test6849574.java
index 7639d03..70d1a29 100644
--- a/test/compiler/c1/6849574/Test.java
+++ b/test/compiler/c1/Test6849574.java
@@ -27,12 +27,15 @@
  * @bug 6849574
  * @summary VM crash using NonBlockingHashMap (high_scale_lib)
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC Test
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC
+ *      compiler.c1.Test6849574
  */
 
-import java.util.concurrent.atomic.*;
+package compiler.c1;
 
-public class Test extends Thread {
+import java.util.concurrent.atomic.AtomicReferenceArray;
+
+public class Test6849574 extends Thread {
 
     public static void main(String[] args) {
         AtomicReferenceArray a = new AtomicReferenceArray(10000);
diff --git a/test/compiler/c1/6855215/Test6855215.java b/test/compiler/c1/Test6855215.java
similarity index 95%
rename from test/compiler/c1/6855215/Test6855215.java
rename to test/compiler/c1/Test6855215.java
index 914ec12..3ea0ad5 100644
--- a/test/compiler/c1/6855215/Test6855215.java
+++ b/test/compiler/c1/Test6855215.java
@@ -27,9 +27,11 @@
  * @bug 6855215
  * @summary Calculation error (NaN) after about 1500 calculations
  *
- * @run main/othervm -Xbatch -XX:UseSSE=0 Test6855215
+ * @run main/othervm -Xbatch -XX:UseSSE=0 compiler.c1.Test6855215
  */
 
+package compiler.c1;
+
 public class Test6855215 {
     private double m;
     private double b;
diff --git a/test/compiler/c1/6932496/Test6932496.java b/test/compiler/c1/Test6932496.java
similarity index 97%
rename from test/compiler/c1/6932496/Test6932496.java
rename to test/compiler/c1/Test6932496.java
index 3b75dd7..2679c7e 100644
--- a/test/compiler/c1/6932496/Test6932496.java
+++ b/test/compiler/c1/Test6932496.java
@@ -27,19 +27,25 @@
  * @bug 6932496
  * @summary incorrect deopt of jsr subroutine on 64 bit c1
  * @modules java.base/jdk.internal.org.objectweb.asm
- * @run main/othervm -Xcomp -XX:CompileOnly=Test.test Test6932496
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c1.Test6932496::test
+ *      compiler.c1.Test6932496
  */
+
+package compiler.c1;
+
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+import java.io.IOException;
 import java.lang.reflect.Method;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-import java.io.IOException;
-
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.FieldVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.org.objectweb.asm.Type;
-import jdk.internal.org.objectweb.asm.Label;
 
 public class Test6932496 extends ClassLoader {
     private static final int CLASS_FILE_VERSION = 49;
diff --git a/test/compiler/c1/7042153/Test7042153.java b/test/compiler/c1/Test7042153.java
similarity index 79%
rename from test/compiler/c1/7042153/Test7042153.java
rename to test/compiler/c1/Test7042153.java
index 4319b3b..c743920 100644
--- a/test/compiler/c1/7042153/Test7042153.java
+++ b/test/compiler/c1/Test7042153.java
@@ -27,19 +27,19 @@
  * @bug 7042153
  * @summary Bad folding of IfOps with unloaded constant arguments in C1
  *
- * @run main/othervm -Xcomp Test7042153
+ * @run main/othervm -Xcomp compiler.c1.Test7042153
  */
 
-import java.lang.reflect.*;
+package compiler.c1;
 
 public class Test7042153 {
-  static public class Bar { }
-  static public class Foo { }
+    static public class Bar { }
+    static public class Foo { }
 
-  static volatile boolean z;
-  public static void main(String [] args) {
-    Class cx = Bar.class;
-    Class cy = Foo.class;
-    z = (cx == cy);
-  }
+    static volatile boolean z;
+    public static void main(String [] args) {
+        Class cx = Bar.class;
+        Class cy = Foo.class;
+        z = (cx == cy);
+    }
 }
diff --git a/test/compiler/c1/7090976/Test7090976.java b/test/compiler/c1/Test7090976.java
similarity index 96%
rename from test/compiler/c1/7090976/Test7090976.java
rename to test/compiler/c1/Test7090976.java
index 84ff20a..8f77641 100644
--- a/test/compiler/c1/7090976/Test7090976.java
+++ b/test/compiler/c1/Test7090976.java
@@ -27,9 +27,12 @@
  * @bug 7090976
  * @summary Eclipse/CDT causes a JVM crash while indexing C++ code
  *
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement Test7090976
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *      compiler.c1.Test7090976
  */
 
+package compiler.c1;
+
 public class Test7090976 {
 
     static interface I1 {
diff --git a/test/compiler/c1/7103261/Test7103261.java b/test/compiler/c1/Test7103261.java
similarity index 98%
rename from test/compiler/c1/7103261/Test7103261.java
rename to test/compiler/c1/Test7103261.java
index afb3064..a5d7eca 100644
--- a/test/compiler/c1/7103261/Test7103261.java
+++ b/test/compiler/c1/Test7103261.java
@@ -27,9 +27,11 @@
  * @bug 7103261
  * @summary crash with jittester on sparc
  *
- * @run main Test7103261
+ * @run main compiler.c1.Test7103261
  */
 
+package compiler.c1;
+
 // exercise implicit null checking in the compiler for various field types
 public class Test7103261 {
     static Test7103261 null_value;
diff --git a/test/compiler/c1/7123108/Test7123108.java b/test/compiler/c1/Test7123108.java
similarity index 95%
rename from test/compiler/c1/7123108/Test7123108.java
rename to test/compiler/c1/Test7123108.java
index 66d3a01..908f0ab 100644
--- a/test/compiler/c1/7123108/Test7123108.java
+++ b/test/compiler/c1/Test7123108.java
@@ -27,9 +27,11 @@
  * @bug 7123108
  * @summary C1 crashes with assert(if_state != NULL) failed: states do not match up
  *
- * @run main/othervm -Xcomp Test7123108
+ * @run main/othervm -Xcomp compiler.c1.Test7123108
  */
 
+package compiler.c1;
+
 public class Test7123108 {
 
     static class Test_Class_0 {
diff --git a/test/compiler/c1/8004051/Test8004051.java b/test/compiler/c1/Test8004051.java
similarity index 96%
rename from test/compiler/c1/8004051/Test8004051.java
rename to test/compiler/c1/Test8004051.java
index 981effb..73667f7 100644
--- a/test/compiler/c1/8004051/Test8004051.java
+++ b/test/compiler/c1/Test8004051.java
@@ -28,9 +28,11 @@
  * @bug 8005722
  * @summary assert(_oprs_len[mode] < maxNumberOfOperands) failed: array overflow
  *
- * @run main/othervm -Xcomp Test8004051
+ * @run main/othervm -Xcomp compiler.c1.Test8004051
  */
 
+package compiler.c1;
+
 public class Test8004051 {
     public static void main(String[] argv) {
         Object o = new Object();
diff --git a/test/compiler/c1/8011706/Test8011706.java b/test/compiler/c1/Test8011706.java
similarity index 96%
rename from test/compiler/c1/8011706/Test8011706.java
rename to test/compiler/c1/Test8011706.java
index 4c31737..7703d32 100644
--- a/test/compiler/c1/8011706/Test8011706.java
+++ b/test/compiler/c1/Test8011706.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8011706
  * @summary loop invariant code motion may move load before store to the same field
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8011706
  *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      compiler.c1.Test8011706
  */
 
+package compiler.c1;
+
 public class Test8011706 {
     int[] array;
 
diff --git a/test/compiler/c1/8011771/Test8011771.java b/test/compiler/c1/Test8011771.java
similarity index 96%
rename from test/compiler/c1/8011771/Test8011771.java
rename to test/compiler/c1/Test8011771.java
index 7827150..25e724f 100644
--- a/test/compiler/c1/8011771/Test8011771.java
+++ b/test/compiler/c1/Test8011771.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8011771
  * @summary Array bound check elimination's in block motion doesn't always reset its data structures from one step to the other.
- * @run main/othervm -XX:-BackgroundCompilation Test8011771
  *
+ * @run main/othervm -XX:-BackgroundCompilation compiler.c1.Test8011771
  */
 
+package compiler.c1;
+
 public class Test8011771 {
 
     static void m(int[] a, int[] b, int j) {
diff --git a/test/compiler/c1/6769124/TestArrayCopy6769124.java b/test/compiler/c1/TestArrayCopy.java
similarity index 93%
rename from test/compiler/c1/6769124/TestArrayCopy6769124.java
rename to test/compiler/c1/TestArrayCopy.java
index 61868e7..01ffd0a 100644
--- a/test/compiler/c1/6769124/TestArrayCopy6769124.java
+++ b/test/compiler/c1/TestArrayCopy.java
@@ -26,9 +26,13 @@
  * @test
  * @bug 6769124
  * @summary arraycopy may crash the VM with c1 on 64 bit
+ *
+ * @run main compiler.c1.TestArrayCopy
  */
 
-public class TestArrayCopy6769124 {
+package compiler.c1;
+
+public class TestArrayCopy {
 
     public static void main(String[] args) {
 
diff --git a/test/compiler/c1/6769124/TestDeoptInt6769124.java b/test/compiler/c1/TestDeoptInt.java
similarity index 89%
rename from test/compiler/c1/6769124/TestDeoptInt6769124.java
rename to test/compiler/c1/TestDeoptInt.java
index f6ecdb6..75d0d2b 100644
--- a/test/compiler/c1/6769124/TestDeoptInt6769124.java
+++ b/test/compiler/c1/TestDeoptInt.java
@@ -27,10 +27,14 @@
  * @bug 6769124
  * @summary int value might not be correctly decoded on deopt with c1 on 64 bit
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=TestDeoptInt6769124.m TestDeoptInt6769124
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c1.TestDeoptInt::m
+ *      compiler.c1.TestDeoptInt
  */
 
-public class TestDeoptInt6769124 {
+package compiler.c1;
+
+public class TestDeoptInt {
 
     static class A {
         volatile int vl;
diff --git a/test/compiler/c1/6769124/TestUnalignedLoad6769124.java b/test/compiler/c1/TestUnalignedLoad.java
similarity index 94%
rename from test/compiler/c1/6769124/TestUnalignedLoad6769124.java
rename to test/compiler/c1/TestUnalignedLoad.java
index 11c40cf..1149493 100644
--- a/test/compiler/c1/6769124/TestUnalignedLoad6769124.java
+++ b/test/compiler/c1/TestUnalignedLoad.java
@@ -26,9 +26,13 @@
  * @test
  * @bug 6769124
  * @summary unaligned load may fail with c1 on 64 bit
+ *
+ * @run main compiler.c1.TestUnalignedLoad
  */
 
-public class TestUnalignedLoad6769124 {
+package compiler.c1;
+
+public class TestUnalignedLoad {
 
     static long l1v = 0x200000003L;
     static long l2v = 0x400000005L;
diff --git a/test/compiler/c2/5091921/Test6186134.java b/test/compiler/c2/5091921/Test6186134.java
deleted file mode 100644
index d5f57d1..0000000
--- a/test/compiler/c2/5091921/Test6186134.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2011, 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 6186134
- * @summary Server virtual machine produces/exeutes incorrect code.
- *
- * @run main Test6186134 100000
- */
-import java.util.ArrayList;
-
-public class Test6186134 {
-
-  int num = 0;
-
-  public Test6186134(int n) {
-    num = n;
-  }
-
-  public boolean more() {
-    return num-- > 0;
-  }
-
-  public ArrayList test1() {
-    ArrayList res = new ArrayList();
-    int maxResults = Integer.MAX_VALUE;
-    int n = 0;
-    boolean more = more();
-    while ((n++ < maxResults) && more) {
-      res.add(new Object());
-      more = more();
-    }
-    return res;
-  }
-
-  public static void main(String[] pars) {
-    int n = Integer.parseInt(pars[0]);
-    for (int i=0; i<n; i++) {
-      Test6186134 t = new Test6186134(10);
-      int size = t.test1().size();
-      if (size != 10) {
-        System.out.println("wrong size: " + size +", should be 10");
-        System.exit(97);
-      }
-    }
-    System.out.println("Passed");
-  }
-}
-
diff --git a/test/compiler/c2/5091921/Test6905845.java b/test/compiler/c2/5091921/Test6905845.java
deleted file mode 100644
index 1cb2f74..0000000
--- a/test/compiler/c2/5091921/Test6905845.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, 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 6905845
- * @summary Server VM improperly optimizing away loop.
- *
- * @run main/timeout=480 Test6905845
- */
-
-public class Test6905845 {
-
-   public static void main(String[] args){
-      for (int asdf = 0; asdf < 5; asdf++){
-         //test block
-         {
-            StringBuilder strBuf1 = new StringBuilder(65);
-            long          start   = System.currentTimeMillis();
-            int           count   = 0;
-
-            for (int i = Integer.MIN_VALUE; i < (Integer.MAX_VALUE - 80); i += 79){
-               strBuf1.append(i);
-               count++;
-               strBuf1.delete(0, 65);
-            }
-
-            System.out.println(count);
-            if (count != 54366674) {
-              System.out.println("wrong count: " + count +", should be 54366674");
-              System.exit(97);
-            }
-         }
-         //test block
-         {
-            StringBuilder strBuf1 = new StringBuilder(65);
-            long          start   = System.currentTimeMillis();
-            int           count   = 0;
-
-            for (int i = Integer.MIN_VALUE; i < (Integer.MAX_VALUE - 80); i += 79){
-               strBuf1.append(i);
-               count++;
-               strBuf1.delete(0, 65);
-            }
-
-            System.out.println(count);
-            if (count != 54366674) {
-              System.out.println("wrong count: " + count +", should be 54366674");
-              System.exit(97);
-            }
-         }
-      }
-   }
-}
-
diff --git a/test/compiler/c2/6646019/Test.java b/test/compiler/c2/6646019/Test.java
deleted file mode 100644
index 102280c..0000000
--- a/test/compiler/c2/6646019/Test.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2008, 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 6646019
- * @summary array subscript expressions become top() with -d64
- * @run main/othervm -Xcomp -XX:CompileOnly=Test.test Test
-*/
-
-
-public class Test  {
-  final static int i = 2076285318;
-  long l = 2;
-  short s;
-
-  public static void main(String[] args) {
-    Test t = new Test();
-    try { t.test(); }
-    catch (Throwable e) {
-      if (t.l != 5) {
-        System.out.println("Fails: " + t.l + " != 5");
-      }
-    }
-  }
-
-  private void test() {
-    l = 5;
-    l = (new short[(byte)-2])[(byte)(l = i)];
-  }
-}
diff --git a/test/compiler/c2/6823453/Test.java b/test/compiler/c2/6823453/Test.java
deleted file mode 100644
index 46f3c4c..0000000
--- a/test/compiler/c2/6823453/Test.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2009, 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 6823453
- * @summary DeoptimizeALot causes fastdebug server jvm to fail with assert(false,"unscheduable graph")
- * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:CompileOnly=Test -XX:+DeoptimizeALot Test
- */
-
-public class Test {
-
-   static long vara_1 = 1L;
-
-   static void testa() {
-      short var_2 = (byte) 1.0E10;
-
-      for ( Object temp = new byte[(byte)1.0E10];  true ;
-            var_2 = "1".equals("0") ? ((byte) vara_1) : 1 ) {}
-   }
-
-   static void testb() {
-      long var_1 = -1L;
-
-      short var_2 = (byte) 1.0E10;
-
-      for ( Object temp = new byte[(byte)1.0E10];  true ;
-            var_2 = "1".equals("0") ? ((byte) var_1) : 1 ) {}
-   }
-
-   static void testc() {
-      long var_1 = -1L;
-      if (vara_1 > 0)  var_1 = 1L;
-
-      int var_2 = (byte)var_1 - 128;
-
-      for ( Object temp = new byte[var_2];  true ;
-            var_2 = "1".equals("0") ? 2 : 1 ) {}
-   }
-
-   static void testd() {
-      long var_1 = 0L;
-
-      int var_2 = (byte)var_1 + 1;
-      for (int i=0; i<2 ; i++)  var_2 = var_2 - 1;
-
-      for ( Object temp = new byte[var_2];  true ;
-            var_2 = "1".equals("0") ? 2 : 1 ) {}
-   }
-
-   public static void main(String[] args) throws Exception {
-      int nex = 0;
-
-      try {
-         testa();
-      }
-      catch (java.lang.NegativeArraySizeException ex) { nex++; }
-      try {
-         testb();
-      }
-      catch (java.lang.NegativeArraySizeException ex) { nex++; }
-      try {
-         testc();
-      }
-      catch (java.lang.NegativeArraySizeException ex) { nex++; }
-      try {
-         testd();
-      }
-      catch (java.lang.NegativeArraySizeException ex) { nex++; }
-
-      if (nex != 4)
-        System.exit(97);
-   }
-}
-
diff --git a/test/compiler/c2/6851282/Test.java b/test/compiler/c2/6851282/Test.java
deleted file mode 100644
index b011ac2..0000000
--- a/test/compiler/c2/6851282/Test.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2009, 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 6851282
- * @summary JIT miscompilation results in null entry in array when using CompressedOops
- *
- * @run main/othervm/timeout=600 -Xmx256m -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops Test
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Test {
-  void foo(A a, A[] as) {
-    for (A a1 : as) {
-      B[] filtered = a.c(a1);
-      for (B b : filtered) {
-        if (b == null) {
-          System.out.println("bug: b == null");
-          System.exit(97);
-        }
-      }
-    }
-  }
-
-  public static void main(String[] args) {
-    List<A> as = new ArrayList<A>();
-    for (int i = 0; i < 5000; i++) {
-      List<B> bs = new ArrayList<B>();
-      for (int j = i; j < i + 1000; j++)
-        bs.add(new B(j));
-      as.add(new A(bs.toArray(new B[0])));
-    }
-    new Test().foo(as.get(0), as.subList(1, as.size()).toArray(new A[0]));
-  }
-}
-
-class A {
-  final B[] bs;
-
-  public A(B[] bs) {
-    this.bs = bs;
-  }
-
-  final B[] c(final A a) {
-    return new BoxedArray<B>(bs).filter(new Function<B, Boolean>() {
-      public Boolean apply(B arg) {
-        for (B b : a.bs) {
-          if (b.d == arg.d)
-            return true;
-        }
-        return false;
-      }
-    });
-  }
-}
-
-class BoxedArray<T> {
-
-  private final T[] array;
-
-  BoxedArray(T[] array) {
-    this.array = array;
-  }
-
-  public T[] filter(Function<T, Boolean> function) {
-    boolean[] include = new boolean[array.length];
-    int len = 0;
-    int i = 0;
-    while (i < array.length) {
-      if (function.apply(array[i])) {
-        include[i] = true;
-        len += 1;
-      }
-      i += 1;
-    }
-    T[] result = (T[]) java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), len);
-    len = 0;
-    i = 0;
-    while (len < result.length) {
-      if (include[i]) {
-        result[len] = array[i];
-        len += 1;
-      }
-      i += 1;
-    }
-    return result;
-  }
-}
-
-interface Function<T, R> {
-  R apply(T arg);
-}
-
-class B {
-  final int d;
-  public B(int d) {
-    this.d = d;
-  }
-}
-
diff --git a/test/compiler/c2/6857159/Test6857159.java b/test/compiler/c2/6857159/Test6857159.java
deleted file mode 100644
index f412adf..0000000
--- a/test/compiler/c2/6857159/Test6857159.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2009, 2015, 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 6857159
- * @summary local schedule failed with checkcast of Thread.currentThread()
- * @library /testlibrary
- * @modules java.base/jdk.internal.misc
- *          java.management
- */
-
-import jdk.test.lib.*;
-
-public class Test6857159 {
-    public static void main(String[] args) throws Throwable {
-        OutputAnalyzer analyzer = ProcessTools.executeTestJvm("-Xbatch",
-                "-XX:+PrintCompilation", "-XX:CompileOnly=Test$ct.run", "Test");
-        analyzer.shouldNotContain("COMPILE SKIPPED");
-        analyzer.shouldContain("Test$ct0::run (16 bytes)");
-        analyzer.shouldHaveExitValue(0);
-    }
-}
-
-class Test extends Thread {
-    static class ct0 extends Test {
-        public void message() { }
-
-        public void run() {
-             message();
-             ct0 ct = (ct0) Thread.currentThread();
-             ct.message();
-        }
-    }
-    static class ct1 extends ct0 {
-        public void message() { }
-    }
-    static class ct2 extends ct0 {
-        public void message() { }
-    }
-
-    public static void main(String[] args) throws Exception {
-        for (int i = 0; i < 20000; i++) {
-            Thread t = null;
-            switch (i % 3) {
-              case 0: t = new ct0(); break;
-              case 1: t = new ct1(); break;
-              case 2: t = new ct2(); break;
-            }
-            t.start();
-            t.join();
-        }
-    }
-}
diff --git a/test/compiler/c2/6910618/Test.java b/test/compiler/c2/6910618/Test.java
deleted file mode 100644
index d50edb0..0000000
--- a/test/compiler/c2/6910618/Test.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2010, 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 6910605
- * @summary C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used
- *
- * @run main/othervm -Xmx64m -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -XX:+DoEscapeAnalysis -Xbatch -XX:InlineSmallCode=2000 Test
- *
- */
-
-/*
- * Added InlineSmallCode=2000 to guaranty inlining of StringBuilder::append() to allow scalar replace StringBuilder object.
- *
- * original test: gc/gctests/StringGC
- */
-
-public class Test {
-        private final String toAdd = "0123456789abcdef";
-        private int maxLength;
-        private static final int numberOfThreads = 8;
-
-        private class StringAdder extends Thread {
-                private String s;
-
-                public void test() {
-                        s = s + toAdd;
-                }
-                public void run() {
-                        do {
-                                test();
-                        } while (s.length() < maxLength);
-                 }
-        }
-
-        public void test() throws InterruptedException {
-                maxLength = toAdd.length() * 15000/ numberOfThreads;
-                StringAdder[] sa = new StringAdder[numberOfThreads];
-                for (int i = 0; i < numberOfThreads; i++) {
-                        sa[i] = new StringAdder();
-                        sa[i].start();
-                }
-                for (int i = 0; i < numberOfThreads; i++) {
-                        sa[i].join();
-                }
-        }
-
-        public static void main(String[] args) throws InterruptedException {
-                Test t = new Test();
-                t.test();
-        }
-}
diff --git a/test/compiler/c2/7190310/Test7190310.java b/test/compiler/c2/7190310/Test7190310.java
deleted file mode 100644
index b45c60b..0000000
--- a/test/compiler/c2/7190310/Test7190310.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, 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 7190310
- * @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops
- * @run main/othervm/timeout=600 -Xbatch Test7190310
- */
-
-/*
- * Note bug exhibits as infinite loop, timeout is helpful.
- * It should normally finish pretty quickly, but on some especially slow machines
- * it may not.  The companion _unsafe test lacks a timeout, but that is okay.
- */
-
-import java.lang.ref.*;
-
-public class Test7190310 {
-  private static Object str = new Object() {
-    public String toString() {
-      return "The Object";
-    }
-
-    protected void finalize() throws Throwable {
-      System.out.println("The Object is being finalized");
-      super.finalize();
-    }
-  };
-  private final static ReferenceQueue<Object> rq =
-      new ReferenceQueue<Object>();
-  private final static WeakReference<Object> wr =
-      new WeakReference<Object>(str, rq);
-
-  public static void main(String[] args)
-      throws InterruptedException {
-    Thread reader = new Thread() {
-      public void run() {
-        while (wr.get() != null) {
-        }
-        System.out.println("wr.get() returned null");
-      }
-    };
-
-    Thread queueReader = new Thread() {
-      public void run() {
-        try {
-          Reference<? extends Object> ref = rq.remove();
-          System.out.println(ref);
-          System.out.println("queueReader returned, ref==wr is "
-              + (ref == wr));
-        } catch (InterruptedException e) {
-          System.err.println("Sleep interrupted - exiting");
-        }
-      }
-    };
-
-    reader.start();
-    queueReader.start();
-
-    Thread.sleep(1000);
-    str = null;
-    System.gc();
-  }
-}
-
diff --git a/test/compiler/c2/7190310/Test7190310_unsafe.java b/test/compiler/c2/7190310/Test7190310_unsafe.java
deleted file mode 100644
index de48a6e..0000000
--- a/test/compiler/c2/7190310/Test7190310_unsafe.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2012, 2015, 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 7190310
- * @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops
- * @modules java.base/jdk.internal.misc
- * @run main/othervm -Xbatch Test7190310_unsafe
- */
-
-import java.lang.ref.*;
-import java.lang.reflect.*;
-import jdk.internal.misc.Unsafe;
-
-public class Test7190310_unsafe {
-
-  static class TestObject {
-    public String toString() {
-      return "TestObject";
-    }
-  };
-
-  private static TestObject str = new TestObject();
-  private static final WeakReference ref = new WeakReference(str);
-
-  private TestObject obj;
-
-  public static void main(String[] args) throws Exception {
-    Class c = Test7190310_unsafe.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe");
-    Field f = c.getDeclaredField("theUnsafe");
-    f.setAccessible(true);
-    Unsafe unsafe = (Unsafe)f.get(c);
-
-    f = Reference.class.getDeclaredField("referent");
-    f.setAccessible(true);
-    long referent_offset = unsafe.objectFieldOffset(f);
-
-    Test7190310_unsafe t = new Test7190310_unsafe();
-    TestObject o = new TestObject();
-    t.obj = o;
-
-    // Warmup (compile methods)
-    System.err.println("Warmup");
-    Object obj = null;
-    for (int i = 0; i < 11000; i++) {
-      obj = getRef0(ref);
-    }
-    for (int i = 0; i < 11000; i++) {
-      obj = getRef1(unsafe, ref, referent_offset);
-    }
-    for (int i = 0; i < 11000; i++) {
-      obj = getRef2(unsafe, ref, referent_offset);
-    }
-    for (int i = 0; i < 11000; i++) {
-      obj = getRef3(unsafe, ref, referent_offset);
-    }
-    for (int i = 0; i < 11000; i++) {
-      obj = getRef4(unsafe, t, referent_offset);
-    }
-
-    // Access verification
-    System.err.println("Verification");
-    if (!verifyGet(referent_offset, unsafe)) {
-      System.exit(97);
-    }
-
-    obj = getRef3(unsafe, t, referent_offset);
-    if (obj != o) {
-      System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + o);
-      System.exit(97);
-    }
-    obj = getRef4(unsafe, t, referent_offset);
-    if (obj != o) {
-      System.out.println("FAILED: unsafe.getObject(Test7190310, " + referent_offset + ") " + obj + " != " + o);
-      System.exit(97);
-    }
-  }
-
-  static boolean verifyGet(long referent_offset, Unsafe unsafe) throws Exception {
-    // Access verification
-    System.out.println("referent: " + str);
-    Object obj = getRef0(ref);
-    if (obj != str) {
-      System.out.println("FAILED: weakRef.get() " + obj + " != " + str);
-      return false;
-    }
-    obj = getRef1(unsafe, ref, referent_offset);
-    if (obj != str) {
-      System.out.println("FAILED: unsafe.getObject(weakRef, " + referent_offset + ") " + obj + " != " + str);
-      return false;
-    }
-    obj = getRef2(unsafe, ref, referent_offset);
-    if (obj != str) {
-      System.out.println("FAILED: unsafe.getObject(abstRef, " + referent_offset + ") " + obj + " != " + str);
-      return false;
-    }
-    obj = getRef3(unsafe, ref, referent_offset);
-    if (obj != str) {
-      System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + str);
-      return false;
-    }
-    return true;
-  }
-
-  static Object getRef0(WeakReference ref) throws Exception {
-    return ref.get();
-  }
-  static Object getRef1(Unsafe unsafe, WeakReference ref, long referent_offset) throws Exception {
-    return unsafe.getObject(ref, referent_offset);
-  }
-  static Object getRef2(Unsafe unsafe, Reference ref, long referent_offset) throws Exception {
-    return unsafe.getObject(ref, referent_offset);
-  }
-  static Object getRef3(Unsafe unsafe, Object ref, long referent_offset) throws Exception {
-    return unsafe.getObject(ref, referent_offset);
-  }
-  static Object getRef4(Unsafe unsafe, Test7190310_unsafe ref, long referent_offset) throws Exception {
-    return unsafe.getObject(ref, referent_offset);
-  }
-}
-
diff --git a/test/compiler/c2/8002069/Test8002069.java b/test/compiler/c2/8002069/Test8002069.java
deleted file mode 100644
index 9d11c25..0000000
--- a/test/compiler/c2/8002069/Test8002069.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2012, 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 8002069
- * @summary Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
- *
- * @run main/othervm -Xmx32m -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:CompileCommand=exclude,Test8002069.dummy Test8002069
- */
-
-abstract class O {
-  int f;
-  public O() { f = 5; }
-  abstract void put(int i);
-  public int foo(int i) {
-    put(i);
-    return i;
-  }
-};
-
-class A extends O {
-  int[] a;
-  public A(int s) {
-    a = new int[s];
-  }
-  public void put(int i) {
-    a[i%a.length] = i;
-  }
-}
-
-class B extends O {
-  int sz;
-  int[] a;
-  public B(int s) {
-    sz = s;
-    a = new int[s];
-  }
-  public void put(int i) {
-    a[i%sz] = i;
-  }
-}
-
-public class Test8002069 {
-  public static void main(String args[]) {
-    int sum = 0;
-    for (int i=0; i<8000; i++) {
-      sum += test1(i);
-    }
-    for (int i=0; i<100000; i++) {
-      sum += test2(i);
-    }
-    System.out.println("PASSED. sum = " + sum);
-  }
-
-  private O o;
-
-  private int foo(int i) {
-    return o.foo(i);
-  }
-  static int test1(int i) {
-    Test8002069 t = new Test8002069();
-    t.o = new A(5);
-    return t.foo(i);
-  }
-  static int test2(int i) {
-    Test8002069 t = new Test8002069();
-    t.o = new B(5);
-    dummy(i);
-    return t.foo(i);
-  }
-
-  static int dummy(int i) {
-    return i*2;
-  }
-}
-
diff --git a/test/compiler/c2/FloatingPointFoldingTest.java b/test/compiler/c2/FloatingPointFoldingTest.java
index cb3ce01..78431c2 100644
--- a/test/compiler/c2/FloatingPointFoldingTest.java
+++ b/test/compiler/c2/FloatingPointFoldingTest.java
@@ -26,9 +26,19 @@
  * @test
  * @bug 8073670
  * @summary Test that causes C2 to fold two NaNs with different values into a single NaN.
- * @run main/othervm -XX:-TieredCompilation -Xcomp -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_inf -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_zero -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_nan -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_inf -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_zero -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_nan FloatingPointFoldingTest
+ *
+ * @run main/othervm -XX:-TieredCompilation -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_double_inf
+ *      -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_double_zero
+ *      -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_double_nan
+ *      -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_float_inf
+ *      -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_float_zero
+ *      -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_float_nan
+ *      compiler.c2.FloatingPointFoldingTest
  */
 
+package compiler.c2;
+
 public class FloatingPointFoldingTest {
     // Double values.
     public static final long MINUS_INF_LONGBITS = 0xfff0000000000000L;
diff --git a/test/compiler/c2/6663621/IVTest.java b/test/compiler/c2/IVTest.java
similarity index 98%
rename from test/compiler/c2/6663621/IVTest.java
rename to test/compiler/c2/IVTest.java
index 0ef480b..b6239d0 100644
--- a/test/compiler/c2/6663621/IVTest.java
+++ b/test/compiler/c2/IVTest.java
@@ -26,8 +26,12 @@
  * @test
  * @bug 6663621
  * @summary JVM crashes while trying to execute api/java_security/Signature/SignatureTests.html#initSign tests.
+ *
+ * @run main compiler.c2.IVTest
  */
 
+package compiler.c2;
+
 public class IVTest {
     static int paddedSize;
 
diff --git a/test/compiler/c2/6772683/InterruptedTest.java b/test/compiler/c2/InterruptedTest.java
similarity index 97%
rename from test/compiler/c2/6772683/InterruptedTest.java
rename to test/compiler/c2/InterruptedTest.java
index aa513fa..b4caace 100644
--- a/test/compiler/c2/6772683/InterruptedTest.java
+++ b/test/compiler/c2/InterruptedTest.java
@@ -26,9 +26,12 @@
  * @test
  * @bug 6772683
  * @summary Thread.isInterrupted() fails to return true on multiprocessor PC
- * @run main/othervm InterruptedTest 100
+ *
+ * @run main/othervm compiler.c2.InterruptedTest 100
  */
 
+package compiler.c2;
+
 public class InterruptedTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/c2/6894807/IsInstanceTest.java b/test/compiler/c2/IsInstanceTest.java
similarity index 96%
rename from test/compiler/c2/6894807/IsInstanceTest.java
rename to test/compiler/c2/IsInstanceTest.java
index 6350109..75ee459 100644
--- a/test/compiler/c2/6894807/IsInstanceTest.java
+++ b/test/compiler/c2/IsInstanceTest.java
@@ -25,9 +25,12 @@
  * @test
  * @bug 6894807
  * @summary No ClassCastException for HashAttributeSet constructors if run with -Xcomp
- * @run main IsInstanceTest
+ *
+ * @run main compiler.c2.IsInstanceTest
 */
 
+package compiler.c2;
+
 public class IsInstanceTest {
 
     public static void main(String[] args) {
diff --git a/test/compiler/c2/8005956/PolynomialRoot.java b/test/compiler/c2/PolynomialRoot.java
similarity index 98%
rename from test/compiler/c2/8005956/PolynomialRoot.java
rename to test/compiler/c2/PolynomialRoot.java
index ae59572..86836d0 100644
--- a/test/compiler/c2/8005956/PolynomialRoot.java
+++ b/test/compiler/c2/PolynomialRoot.java
@@ -10,16 +10,20 @@
  */
 
 /**
-* @test
-* @bug 8005956
-* @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
-* @library /testlibrary
-* @modules java.base/jdk.internal.misc
-*          java.management
-* @run main/timeout=300 PolynomialRoot
-*/
+ * @test
+ * @bug 8005956
+ * @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
+ * @library /testlibrary
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @run main/timeout=300 compiler.c2.PolynomialRoot
+ */
+
+package compiler.c2;
 
 import jdk.test.lib.Utils;
+
 import java.util.Arrays;
 import java.util.Random;
 
diff --git a/test/compiler/c2/5057225/Test5057225.java b/test/compiler/c2/Test5057225.java
similarity index 91%
rename from test/compiler/c2/5057225/Test5057225.java
rename to test/compiler/c2/Test5057225.java
index 7cf64f9..632f678 100644
--- a/test/compiler/c2/5057225/Test5057225.java
+++ b/test/compiler/c2/Test5057225.java
@@ -27,9 +27,13 @@
  * @summary Remove useless I2L conversions
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm -Xcomp -XX:CompileOnly=Test5057225.doload Test5057225
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test5057225::doload
+ *      compiler.c2.Test5057225
  */
 
+package compiler.c2;
 import jdk.test.lib.Utils;
 
 public class Test5057225 {
@@ -69,17 +73,17 @@
     public static void main(String[] args) throws Exception {
         for (int i = 0; i < BYTE_MASKS.length; i++) {
             System.setProperty("value", "" + BYTE_MASKS[i]);
-            loadAndRunClass("Test5057225$loadUB2L");
+            loadAndRunClass(Test5057225.class.getName() + "$loadUB2L");
         }
 
         for (int i = 0; i < SHORT_MASKS.length; i++) {
             System.setProperty("value", "" + SHORT_MASKS[i]);
-            loadAndRunClass("Test5057225$loadUS2L");
+            loadAndRunClass(Test5057225.class.getName() + "$loadUS2L");
         }
 
         for (int i = 0; i < INT_MASKS.length; i++) {
             System.setProperty("value", "" + INT_MASKS[i]);
-            loadAndRunClass("Test5057225$loadUI2L");
+            loadAndRunClass(Test5057225.class.getName() + "$loadUI2L");
         }
     }
 
diff --git a/test/compiler/c2/5091921/Test5091921.java b/test/compiler/c2/Test5091921.java
similarity index 97%
rename from test/compiler/c2/5091921/Test5091921.java
rename to test/compiler/c2/Test5091921.java
index dff43e7..07fa59d 100644
--- a/test/compiler/c2/5091921/Test5091921.java
+++ b/test/compiler/c2/Test5091921.java
@@ -27,9 +27,13 @@
  * @bug 5091921
  * @summary Sign flip issues in loop optimizer
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test5091921 -XX:MaxInlineSize=1 Test5091921
+ * @run main/othervm -Xcomp -XX:MaxInlineSize=1
+ *    -XX:CompileCommand=compileonly,compiler.c2.Test5091921::*
+ *    compiler.c2.Test5091921
  */
 
+package compiler.c2;
+
 public class Test5091921 {
   private static int result = 0;
 
diff --git a/test/compiler/c2/Test6186134.java b/test/compiler/c2/Test6186134.java
new file mode 100644
index 0000000..bf00dc8
--- /dev/null
+++ b/test/compiler/c2/Test6186134.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2011, 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 6186134
+ * @summary Server virtual machine produces/exeutes incorrect code.
+ *
+ * @run main compiler.c2.Test6186134 100000
+ */
+
+package compiler.c2;
+
+import java.util.ArrayList;
+
+public class Test6186134 {
+
+    int num = 0;
+
+    public Test6186134(int n) {
+        num = n;
+    }
+
+    public boolean more() {
+        return num-- > 0;
+    }
+
+    public ArrayList test1() {
+        ArrayList res = new ArrayList();
+        int maxResults = Integer.MAX_VALUE;
+        int n = 0;
+        boolean more = more();
+        while ((n++ < maxResults) && more) {
+            res.add(new Object());
+            more = more();
+        }
+        return res;
+    }
+
+    public static void main(String[] pars) {
+        int n = Integer.parseInt(pars[0]);
+        for (int i = 0; i < n; i++) {
+            Test6186134 t = new Test6186134(10);
+            int size = t.test1().size();
+            if (size != 10) {
+                System.out.println("wrong size: " + size + ", should be 10");
+                System.exit(97);
+            }
+        }
+        System.out.println("Passed");
+    }
+}
+
diff --git a/test/compiler/c2/5091921/Test6196102.java b/test/compiler/c2/Test6196102.java
similarity index 95%
rename from test/compiler/c2/5091921/Test6196102.java
rename to test/compiler/c2/Test6196102.java
index 004a68b..aec2616 100644
--- a/test/compiler/c2/5091921/Test6196102.java
+++ b/test/compiler/c2/Test6196102.java
@@ -27,9 +27,11 @@
  * @bug 6196102
  * @summary Integer seems to be greater than Integer.MAX_VALUE
  *
- * @run main Test6196102
+ * @run main compiler.c2.Test6196102
  */
 
+package compiler.c2;
+
 public class Test6196102 {
     static public void main(String[] args) {
         int i1 = 0;
diff --git a/test/compiler/c2/5091921/Test6357214.java b/test/compiler/c2/Test6357214.java
similarity index 85%
rename from test/compiler/c2/5091921/Test6357214.java
rename to test/compiler/c2/Test6357214.java
index 019364d..e9ed37c 100644
--- a/test/compiler/c2/5091921/Test6357214.java
+++ b/test/compiler/c2/Test6357214.java
@@ -27,46 +27,48 @@
  * @bug 6357214
  * @summary Hotspot server compiler gets integer comparison wrong
  *
- * @run main/othervm/timeout=60 -DshowAll=ffo -DeventID=444 Test6357214
+ * @run main/othervm/timeout=60 -DshowAll=ffo -DeventID=444 compiler.c2.Test6357214
  */
 
+package compiler.c2;
+
 // The test hangs after few iterations before the fix. So it fails if timeout.
-class MyResult {
+public class Test6357214 {
+    static class MyResult {
         public boolean next() {
-                return true;
+            return true;
         }
 
         public String getString(String in) {
-                if (in.equals("id"))
-                        return "idFoo";
-                if (in.equals("contentKey"))
-                        return "ckFoo";
-                return "Foo";
+            if (in.equals("id"))
+                return "idFoo";
+            if (in.equals("contentKey"))
+                return "ckFoo";
+            return "Foo";
         }
 
         public int getInt(String in) {
-                if (in.equals("processingComplete"))
-                        return 0;
-                return 1;
+            if (in.equals("processingComplete"))
+                return 0;
+            return 1;
         }
 
         public byte[] getBytes(String in) {
-                byte[] arr = null;
-                if (in.equals("content")) {
-                        arr = new byte[65536];
-                        byte j = 32;
-                        for (int i=0; i<65536; i++) {
-                                arr[i] = j;
-                                if (++j == 127)
-                                        j=32;
-                        }
+            byte[] arr = null;
+            if (in.equals("content")) {
+                arr = new byte[65536];
+                byte j = 32;
+                for (int i=0; i<65536; i++) {
+                    arr[i] = j;
+                    if (++j == 127)
+                        j=32;
                 }
-                return arr;
+            }
+            return arr;
         }
-}
+    }
 
-public class Test6357214 {
-        public static volatile boolean bollocks = true;
+    public static volatile boolean bollocks = true;
     public String create(String context) throws Exception {
 
         //
diff --git a/test/compiler/c2/6443505/Test6443505.java b/test/compiler/c2/Test6443505.java
similarity index 95%
rename from test/compiler/c2/6443505/Test6443505.java
rename to test/compiler/c2/Test6443505.java
index 28461b5..d86cc75 100644
--- a/test/compiler/c2/6443505/Test6443505.java
+++ b/test/compiler/c2/Test6443505.java
@@ -27,9 +27,13 @@
  * @bug 6443505
  * @summary Some cases for CmpLTMask missed; also wrong code.
  *
- * @run main/othervm -Xcomp -XX:CompileOnly="Test6443505.compiled" Test6443505
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6443505::compiled
+ *      compiler.c2.Test6443505
  */
 
+package compiler.c2;
+
 public class Test6443505 {
 
     public static void main(String[] args) throws InterruptedException {
diff --git a/test/compiler/c2/5091921/Test6559156.java b/test/compiler/c2/Test6559156.java
similarity index 97%
rename from test/compiler/c2/5091921/Test6559156.java
rename to test/compiler/c2/Test6559156.java
index 7655323..fafe586 100644
--- a/test/compiler/c2/5091921/Test6559156.java
+++ b/test/compiler/c2/Test6559156.java
@@ -27,9 +27,11 @@
  * @bug 6559156
  * @summary Server compiler generates bad code for "<= Integer.MAX_VALUE" expression
  *
- * @run main Test6559156
+ * @run main compiler.c2.Test6559156
  */
 
+package compiler.c2;
+
 public class Test6559156 {
 
     static final int N_TESTS = 1000000;
diff --git a/test/compiler/c2/6603011/Test.java b/test/compiler/c2/Test6603011.java
similarity index 91%
rename from test/compiler/c2/6603011/Test.java
rename to test/compiler/c2/Test6603011.java
index 39c0419..9495fe3 100644
--- a/test/compiler/c2/6603011/Test.java
+++ b/test/compiler/c2/Test6603011.java
@@ -27,7 +27,8 @@
  * @summary long/int division by constant
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm -Xcomp -Xbatch -XX:-Inline Test
+ *
+ * @run main/othervm -Xcomp -Xbatch -XX:-Inline compiler.c2.Test6603011
  */
 
 //
@@ -37,16 +38,17 @@
 //   dividend and divisor combinations are tested
 //
 
+package compiler.c2;
+
 import jdk.test.lib.Utils;
 
-class s {
-  static int  divi(int  dividend, int  divisor) { return dividend / divisor; }
-  static int  modi(int  dividend, int  divisor) { return dividend % divisor; }
-  static long divl(long dividend, long divisor) { return dividend / divisor; }
-  static long modl(long dividend, long divisor) { return dividend % divisor; }
-}
-
-public class Test implements Runnable {
+public class Test6603011 implements Runnable {
+  static class s {
+    static int  divi(int  dividend, int  divisor) { return dividend / divisor; }
+    static int  modi(int  dividend, int  divisor) { return dividend % divisor; }
+    static long divl(long dividend, long divisor) { return dividend / divisor; }
+    static long modl(long dividend, long divisor) { return dividend % divisor; }
+  }
   // Report verbose messages on failure; turn off to suppress
   // too much output with gross numbers of failures.
   static final boolean VERBOSE = true;
@@ -194,13 +196,13 @@
     System.setProperty("divisor", "" + divisor);
     ClassLoader loader
                 = Utils.getTestClassPathURLClassLoader(apploader.getParent());
-    Class c = loader.loadClass("Test");
+    Class c = loader.loadClass(Test6603011.class.getName());
     Runnable r = (Runnable)c.newInstance();
     r.run();
   }
 
   public static void main(String[] args) throws Exception {
-    Class cl = Class.forName("Test");
+    Class cl = Test6603011.class;
     ClassLoader apploader = cl.getClassLoader();
 
 
diff --git a/test/compiler/c2/6636138/Test1.java b/test/compiler/c2/Test6636138_1.java
similarity index 91%
rename from test/compiler/c2/6636138/Test1.java
rename to test/compiler/c2/Test6636138_1.java
index d57582f..1ae3a45 100644
--- a/test/compiler/c2/6636138/Test1.java
+++ b/test/compiler/c2/Test6636138_1.java
@@ -26,10 +26,14 @@
  * @bug 6636138
  * @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation.
  *
- * @run main/othervm -Xbatch -XX:CompileOnly=Test1.init Test1
+ * @run main/othervm -Xbatch
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6636138_1::init
+ *      compiler.c2.Test6636138_1
  */
 
-public class Test1 {
+package compiler.c2;
+
+public class Test6636138_1 {
 
     public static void init(int src[], int [] dst, int[] ref) {
         // initialize the arrays
diff --git a/test/compiler/c2/6636138/Test2.java b/test/compiler/c2/Test6636138_2.java
similarity index 67%
rename from test/compiler/c2/6636138/Test2.java
rename to test/compiler/c2/Test6636138_2.java
index 29e5546..bb2759a 100644
--- a/test/compiler/c2/6636138/Test2.java
+++ b/test/compiler/c2/Test6636138_2.java
@@ -26,10 +26,14 @@
  * @bug 6636138
  * @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation.
  *
- * @run main/othervm -Xbatch -XX:CompileOnly=Test2.shift Test2
+ * @run main/othervm -Xbatch
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6636138_2::shift
+ *      compiler.c2.Test6636138_2
  */
 
-public class Test2 {
+package compiler.c2;
+
+public class Test6636138_2 {
 
     public static void init(int src[]) {
         // Initialize the array
@@ -37,22 +41,22 @@
             src[i] = i;
     }
 
-   public static void shift(int src[]) {
-       //left-shift the array
-       for (int i = src.length-1; i > 0; i--){
-           int tmp  = src[i];
-           src[i]   = src[i-1];
-           src[i-1] = tmp;
-       }
+    public static void shift(int src[]) {
+        //left-shift the array
+        for (int i = src.length - 1; i > 0; i--) {
+            int tmp = src[i];
+            src[i] = src[i - 1];
+            src[i - 1] = tmp;
+        }
     }
 
     public static void verify(int src[]) {
-        for (int i = 0; i < src.length; i++){
-            int value = (i-1 + src.length)%src.length; // correct value after shifting
-                if (src[i] != value) {
-                    System.out.println("Error: src["+i+"] should be "+ value + " instead of " + src[i]);
-                    System.exit(97);
-                }
+        for (int i = 0; i < src.length; i++) {
+            int value = (i - 1 + src.length) % src.length; // correct value after shifting
+            if (src[i] != value) {
+                System.out.println("Error: src[" + i + "] should be " + value + " instead of " + src[i]);
+                System.exit(97);
+            }
         }
     }
 
@@ -64,7 +68,7 @@
     }
 
     public static void main(String[] args) {
-        for (int i=0; i< 2000; i++)
+        for (int i = 0; i < 2000; i++)
             test();
     }
-}
+}
\ No newline at end of file
diff --git a/test/compiler/c2/6695810/Test.java b/test/compiler/c2/Test6646019.java
similarity index 64%
copy from test/compiler/c2/6695810/Test.java
copy to test/compiler/c2/Test6646019.java
index 7751a5e..2e2060d 100644
--- a/test/compiler/c2/6695810/Test.java
+++ b/test/compiler/c2/Test6646019.java
@@ -23,33 +23,34 @@
 
 /*
  * @test
- * @bug 6695810
- * @summary null oop passed to encode_heap_oop_not_null
- * @run main/othervm -Xbatch Test
- */
+ * @bug 6646019
+ * @summary array subscript expressions become top() with -d64
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6646019::test
+ *      compiler.c2.Test6646019
+*/
 
-public class Test {
-    Test _t;
+package compiler.c2;
 
-    static void test(Test t1, Test t2) {
-        if (t2 != null)
-            t1._t = t2;
-
-        if (t2 != null)
-            t1._t = t2;
-    }
+public class Test6646019 {
+    final static int i = 2076285318;
+    long l = 2;
+    short s;
 
     public static void main(String[] args) {
-        Test t = new Test();
-        for (int i = 0; i < 50; i++) {
-            for (int j = 0; j < 100; j++) {
-                test(t, t);
+        Test6646019 t = new Test6646019();
+        try {
+            t.test();
+        } catch (Throwable e) {
+            if (t.l != 5) {
+                System.out.println("Fails: " + t.l + " != 5");
             }
-            test(t, null);
         }
-        for (int i = 0; i < 10000; i++) {
-            test(t, t);
-        }
-        test(t, null);
+    }
+
+    private void test() {
+        l = 5;
+        l = (new short[(byte) -2])[(byte) (l = i)];
     }
 }
diff --git a/test/compiler/c2/6661247/Test.java b/test/compiler/c2/Test6661247.java
similarity index 97%
rename from test/compiler/c2/6661247/Test.java
rename to test/compiler/c2/Test6661247.java
index 12f1c2c..5175e38 100644
--- a/test/compiler/c2/6661247/Test.java
+++ b/test/compiler/c2/Test6661247.java
@@ -26,16 +26,20 @@
  * @test
  * @bug 6661247
  * @summary Internal bug in 32-bit HotSpot optimizer while bit manipulations
+ *
+ * @run main compiler.c2.Test6661247
  */
 
+package compiler.c2;
+
+import java.nio.LongBuffer;
 import java.util.Random;
-import java.nio.*;
 
 // This isn't a completely reliable test for 6661247 since the results
 // depend on what the local schedule looks like but it does reproduce
 // the issue in current builds.
 
-public class Test {
+public class Test6661247 {
 
     public static void test(boolean[] src, int srcPos, LongBuffer dest, long destPos, int count) {
         int countStart = (destPos & 63) == 0 ? 0 : 64 - (int)(destPos & 63);
diff --git a/test/compiler/c2/6695810/Test.java b/test/compiler/c2/Test6695810.java
similarity index 86%
rename from test/compiler/c2/6695810/Test.java
rename to test/compiler/c2/Test6695810.java
index 7751a5e..a454d6c 100644
--- a/test/compiler/c2/6695810/Test.java
+++ b/test/compiler/c2/Test6695810.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 6695810
  * @summary null oop passed to encode_heap_oop_not_null
- * @run main/othervm -Xbatch Test
+ *
+ * @run main/othervm -Xbatch compiler.c2.Test6695810
  */
 
-public class Test {
-    Test _t;
+package compiler.c2;
 
-    static void test(Test t1, Test t2) {
+public class Test6695810 {
+    Test6695810 _t;
+
+    static void test(Test6695810 t1, Test6695810 t2) {
         if (t2 != null)
             t1._t = t2;
 
@@ -40,7 +43,7 @@
     }
 
     public static void main(String[] args) {
-        Test t = new Test();
+        Test6695810 t = new Test6695810();
         for (int i = 0; i < 50; i++) {
             for (int j = 0; j < 100; j++) {
                 test(t, t);
diff --git a/test/compiler/c2/6700047/Test6700047.java b/test/compiler/c2/Test6700047.java
similarity index 96%
rename from test/compiler/c2/6700047/Test6700047.java
rename to test/compiler/c2/Test6700047.java
index 789f693..120a9c8 100644
--- a/test/compiler/c2/6700047/Test6700047.java
+++ b/test/compiler/c2/Test6700047.java
@@ -25,9 +25,12 @@
  * @test
  * @bug 6700047
  * @summary C2 failed in idom_no_update
- * @run main Test6700047
+ *
+ * @run main compiler.c2.Test6700047
  */
 
+package compiler.c2;
+
 public class Test6700047 {
     static byte[] dummy = new byte[256];
 
diff --git a/test/compiler/c2/6711100/Test.java b/test/compiler/c2/Test6711100.java
similarity index 85%
rename from test/compiler/c2/6711100/Test.java
rename to test/compiler/c2/Test6711100.java
index 090476c..dbdae35 100644
--- a/test/compiler/c2/6711100/Test.java
+++ b/test/compiler/c2/Test6711100.java
@@ -25,16 +25,21 @@
  * @test
  * @bug 6711100
  * @summary 64bit fastdebug server vm crashes with assert(_base == Int,"Not an Int")
- * @run main/othervm -Xcomp -XX:CompileOnly=Test.<init> Test
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6711100::<init>
+ *      compiler.c2.Test6711100
  */
 
-public class Test {
+package compiler.c2;
+
+public class Test6711100 {
 
     static byte b;
 
     // The server compiler chokes on compiling
     // this method when f() is not inlined
-    public Test() {
+    public Test6711100() {
         b = (new byte[1])[(new byte[f()])[-1]];
     }
 
@@ -44,7 +49,7 @@
 
     public static void main(String[] args) {
       try {
-        Test t = new Test();
+        Test6711100 t = new Test6711100();
       } catch (ArrayIndexOutOfBoundsException e) {
       }
     }
diff --git a/test/compiler/c2/6724218/Test.java b/test/compiler/c2/Test6724218.java
similarity index 85%
rename from test/compiler/c2/6724218/Test.java
rename to test/compiler/c2/Test6724218.java
index 5dea55f..0bef15b 100644
--- a/test/compiler/c2/6724218/Test.java
+++ b/test/compiler/c2/Test6724218.java
@@ -25,21 +25,26 @@
  * @test
  * @bug 6724218
  * @summary Fix raise_LCA_above_marks() early termination
- * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.update Test
+ *
+ * @run main/othervm -Xbatch
+ *      -XX:CompileCommand=exclude,compiler.c2.Test6724218::update
+ *      compiler.c2.Test6724218
  */
 
-public class Test {
-    Test   next  = null;
+package compiler.c2;
+
+public class Test6724218 {
+    Test6724218 next  = null;
     Object value = null;
 
     static boolean _closed = false;
     static int size = 0;
-    static Test list  = null;
+    static Test6724218 list  = null;
     static int cache_size = 0;
-    static Test cache = null;
+    static Test6724218 cache = null;
 
     Object get(int i) {
-        Test t = list;
+        Test6724218 t = list;
         list = t.next;
         size -= 1;
         Object o = t.value;
@@ -55,13 +60,13 @@
     void update() {
         // Exclude compilation of this one.
         if (size == 0) {
-            Test t;
+            Test6724218 t;
             if (cache_size > 0) {
                 t = cache;
                 cache = t.next;
                 cache_size = -1;
             } else {
-                t = new Test();
+                t = new Test6724218();
             }
             t.value = new Object();
             t.next = list;
@@ -82,7 +87,7 @@
     }
 
     public static void main(String argv[]) throws Exception {
-        Test t = new Test();
+        Test6724218 t = new Test6724218();
         int lim = 500000;
         Object o;
         for (int j = 0; j < lim; j++) {
diff --git a/test/compiler/c2/6732154/Test6732154.java b/test/compiler/c2/Test6732154.java
similarity index 95%
rename from test/compiler/c2/6732154/Test6732154.java
rename to test/compiler/c2/Test6732154.java
index 3618f67..bc695fe 100644
--- a/test/compiler/c2/6732154/Test6732154.java
+++ b/test/compiler/c2/Test6732154.java
@@ -27,8 +27,13 @@
  * @bug 6732154
  * @summary REG: Printing an Image using image/gif doc flavor crashes the VM, Solsparc
  *
- * @run main/othervm -Xcomp -XX:CompileOnly="Test6732154::ascii85Encode" Test6732154
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6732154::ascii85Encode
+ *      compiler.c2.Test6732154
  */
+
+package compiler.c2;
+
 public class Test6732154 {
 
     // Exact copy of sun.print.PSPrinterJob.ascii85Encode([b)[b
diff --git a/test/compiler/c2/6741738/Tester.java b/test/compiler/c2/Test6741738.java
similarity index 67%
rename from test/compiler/c2/6741738/Tester.java
rename to test/compiler/c2/Test6741738.java
index f9833ae..58f4a6f 100644
--- a/test/compiler/c2/6741738/Tester.java
+++ b/test/compiler/c2/Test6741738.java
@@ -25,26 +25,31 @@
  * @test
  * @bug 6741738
  * @summary TypePtr::add_offset() set incorrect offset when the add overflows
- * @run main/othervm -Xcomp -XX:CompileOnly=Tester.foo Tester
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6741738::foo
+ *      compiler.c2.Test6741738
  */
 
-public class Tester {
-        private String[] values;
-        private int count;
+package compiler.c2;
 
-        String foo() {
-                int i = Integer.MAX_VALUE-1;
-                String s;
-                try {
-                    s = values[i];
-                } catch (Throwable e) {
-                    s = "";
-                }
-                return s;
-        }
+public class Test6741738 {
+    private String[] values;
+    private int count;
 
-        public static void main(String[] args) {
-                Tester t = new Tester();
-                String s = t.foo();
+    String foo() {
+        int i = Integer.MAX_VALUE - 1;
+        String s;
+        try {
+            s = values[i];
+        } catch (Throwable e) {
+            s = "";
         }
+        return s;
+    }
+
+    public static void main(String[] args) {
+        Test6741738 t = new Test6741738();
+        String s = t.foo();
+    }
 }
diff --git a/test/compiler/c2/5091921/Test6753639.java b/test/compiler/c2/Test6753639.java
similarity index 95%
rename from test/compiler/c2/5091921/Test6753639.java
rename to test/compiler/c2/Test6753639.java
index 93466cf..6eba35a 100644
--- a/test/compiler/c2/5091921/Test6753639.java
+++ b/test/compiler/c2/Test6753639.java
@@ -27,9 +27,11 @@
  * @bug 6753639
  * @summary Strange optimisation in for loop with cyclic integer condition
  *
- * @run main/othervm -Xbatch Test6753639
+ * @run main/othervm -Xbatch compiler.c2.Test6753639
  */
 
+package compiler.c2;
+
 public class Test6753639 {
     public static void main(String[] args) throws InterruptedException {
         int END = Integer.MAX_VALUE;
diff --git a/test/compiler/c2/6792161/Test6792161.java b/test/compiler/c2/Test6792161.java
similarity index 89%
rename from test/compiler/c2/6792161/Test6792161.java
rename to test/compiler/c2/Test6792161.java
index 309c5bb..fa4aadd 100644
--- a/test/compiler/c2/6792161/Test6792161.java
+++ b/test/compiler/c2/Test6792161.java
@@ -27,10 +27,13 @@
  * @bug 6792161
  * @summary assert("No dead instructions after post-alloc")
  *
- * @run main/othervm/timeout=600 -Xcomp -XX:MaxInlineSize=120 Test6792161
+ * @run main/othervm/timeout=600 -Xcomp -XX:MaxInlineSize=120 compiler.c2.Test6792161
  */
 
+package compiler.c2;
+
 import java.lang.reflect.Constructor;
+
 public class Test6792161 {
     static Constructor test(Class cls) throws Exception {
         Class[] args= { String.class };
@@ -42,7 +45,7 @@
     public static void main(final String[] args) throws Exception {
         try {
             for (int i = 0; i < 100000; i++) {
-                Constructor ctor = test(Class.forName("Test6792161"));
+                Constructor ctor = test(Class.forName("compiler.c2.Test6792161"));
             }
         } catch (NoSuchMethodException e) {}
     }
diff --git a/test/compiler/c2/6795362/Test6795362.java b/test/compiler/c2/Test6795362.java
similarity index 90%
rename from test/compiler/c2/6795362/Test6795362.java
rename to test/compiler/c2/Test6795362.java
index ac47483..a78510b 100644
--- a/test/compiler/c2/6795362/Test6795362.java
+++ b/test/compiler/c2/Test6795362.java
@@ -26,9 +26,13 @@
  * @bug 6795362
  * @summary 32bit server compiler leads to wrong results on solaris-x86
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6795362.sub Test6795362
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6795362::sub
+ *      compiler.c2.Test6795362
  */
 
+package compiler.c2;
+
 public class Test6795362 {
     public static void main(String[] args)
     {
diff --git a/test/compiler/c2/6796786/Test6796786.java b/test/compiler/c2/Test6796786.java
similarity index 95%
rename from test/compiler/c2/6796786/Test6796786.java
rename to test/compiler/c2/Test6796786.java
index 625b616..285f0d8 100644
--- a/test/compiler/c2/6796786/Test6796786.java
+++ b/test/compiler/c2/Test6796786.java
@@ -27,9 +27,11 @@
  * @bug 6796786
  * @summary invalid FP identity transform - (a - b) -> b - a
  *
- * @run main/othervm -Xbatch Test6796786
+ * @run main/othervm -Xbatch compiler.c2.Test6796786
  */
 
+package compiler.c2;
+
 public class Test6796786 {
     static volatile float d1;
     static volatile float d2;
diff --git a/test/compiler/c2/6799693/Test.java b/test/compiler/c2/Test6799693.java
similarity index 68%
rename from test/compiler/c2/6799693/Test.java
rename to test/compiler/c2/Test6799693.java
index 19a9156..8e3e83a 100644
--- a/test/compiler/c2/6799693/Test.java
+++ b/test/compiler/c2/Test6799693.java
@@ -26,22 +26,27 @@
  * @test
  * @bug 6799693
  * @summary Server compiler leads to data corruption when expression throws an Exception
- * @run main/othervm -Xcomp -XX:CompileOnly=Test Test
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6799693::*
+ *      compiler.c2.Test6799693
  */
 
-public class Test {
-   static int var_bad = 1;
+package compiler.c2;
 
-   public static void main(String[] args)
-   {
-      var_bad++;
+public class Test6799693 {
+    static int var_bad = 1;
 
-      try {
-         for (int i = 0; i < 10; i++) (new byte[((byte)-1 << i)])[0]  = 0;
-      }
-      catch (Exception e) { System.out.println("Got " + e); }
+    public static void main(String[] args) {
+        var_bad++;
 
-      System.out.println("Test.var_bad = " +  var_bad + " (expected 2)\n");
-   }
+        try {
+            for (int i = 0; i < 10; i++) (new byte[((byte) -1 << i)])[0] = 0;
+        } catch (Exception e) {
+            System.out.println("Got " + e);
+        }
+
+        System.out.println("Test.var_bad = " + var_bad + " (expected 2)\n");
+    }
 }
 
diff --git a/test/compiler/c2/6800154/Test6800154.java b/test/compiler/c2/Test6800154.java
similarity index 92%
rename from test/compiler/c2/6800154/Test6800154.java
rename to test/compiler/c2/Test6800154.java
index b43c155..9de9b76 100644
--- a/test/compiler/c2/6800154/Test6800154.java
+++ b/test/compiler/c2/Test6800154.java
@@ -27,9 +27,15 @@
  * @summary Add comments to long_by_long_mulhi() for better understandability
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6800154.divcomp Test6800154
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6800154::divcomp
+ *      compiler.c2.Test6800154
  */
 
+
+package compiler.c2;
+
 import jdk.test.lib.Utils;
 
 public class Test6800154 implements Runnable {
@@ -78,7 +84,7 @@
 
     public static void main(String[] args) throws Exception
     {
-        Class cl = Class.forName("Test6800154");
+        Class cl = Test6800154.class;
         ClassLoader apploader = cl.getClassLoader();
 
         // Iterate over all divisors.
@@ -86,7 +92,7 @@
             System.setProperty("divisor", "" + DIVISORS[i]);
             ClassLoader loader
                     = Utils.getTestClassPathURLClassLoader(apploader.getParent());
-            Class c = loader.loadClass("Test6800154");
+            Class c = loader.loadClass(Test6800154.class.getName());
             Runnable r = (Runnable) c.newInstance();
             r.run();
         }
diff --git a/test/compiler/c2/6805724/Test6805724.java b/test/compiler/c2/Test6805724.java
similarity index 90%
rename from test/compiler/c2/6805724/Test6805724.java
rename to test/compiler/c2/Test6805724.java
index afa20d2..2433fce 100644
--- a/test/compiler/c2/6805724/Test6805724.java
+++ b/test/compiler/c2/Test6805724.java
@@ -28,9 +28,14 @@
  *          when divisor is any (2^k-1) constant.
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6805724.fcomp Test6805724
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6805724::fcomp
+ *      compiler.c2.Test6805724
  */
 
+package compiler.c2;
+
 import jdk.test.lib.Utils;
 
 public class Test6805724 implements Runnable {
@@ -66,7 +71,7 @@
     }
 
     public static void main(String args[]) throws Exception {
-        Class cl = Class.forName("Test6805724");
+        Class cl = Test6805724.class;
         ClassLoader apploader = cl.getClassLoader();
 
         // Iterate over all 2^k-1 divisors.
@@ -75,7 +80,7 @@
             System.setProperty("divisor", "" + divisor);
             ClassLoader loader
                     = Utils.getTestClassPathURLClassLoader(apploader.getParent());
-            Class c = loader.loadClass("Test6805724");
+            Class c = loader.loadClass(Test6805724.class.getName());
             Runnable r = (Runnable) c.newInstance();
             r.run();
         }
diff --git a/test/compiler/c2/Test6823453.java b/test/compiler/c2/Test6823453.java
new file mode 100644
index 0000000..96675ad
--- /dev/null
+++ b/test/compiler/c2/Test6823453.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2009, 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 6823453
+ * @summary DeoptimizeALot causes fastdebug server jvm to fail with assert(false,"unscheduable graph")
+ *
+ * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6823453::*
+ *      compiler.c2.Test6823453
+ */
+
+package compiler.c2;
+
+public class Test6823453 {
+
+    static long vara_1 = 1L;
+
+    static void testa() {
+        short var_2 = (byte) 1.0E10;
+
+        for (Object temp = new byte[(byte) 1.0E10]; true;
+             var_2 = "1".equals("0") ? ((byte) vara_1) : 1) {
+        }
+    }
+
+    static void testb() {
+        long var_1 = -1L;
+
+        short var_2 = (byte) 1.0E10;
+
+        for (Object temp = new byte[(byte) 1.0E10]; true;
+             var_2 = "1".equals("0") ? ((byte) var_1) : 1) {
+        }
+    }
+
+    static void testc() {
+        long var_1 = -1L;
+        if (vara_1 > 0) var_1 = 1L;
+
+        int var_2 = (byte) var_1 - 128;
+
+        for (Object temp = new byte[var_2]; true;
+             var_2 = "1".equals("0") ? 2 : 1) {
+        }
+    }
+
+    static void testd() {
+        long var_1 = 0L;
+
+        int var_2 = (byte) var_1 + 1;
+        for (int i = 0; i < 2; i++) var_2 = var_2 - 1;
+
+        for (Object temp = new byte[var_2]; true;
+             var_2 = "1".equals("0") ? 2 : 1) {
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        int nex = 0;
+
+        try {
+            testa();
+        } catch (java.lang.NegativeArraySizeException ex) {
+            nex++;
+        }
+        try {
+            testb();
+        } catch (java.lang.NegativeArraySizeException ex) {
+            nex++;
+        }
+        try {
+            testc();
+        } catch (java.lang.NegativeArraySizeException ex) {
+            nex++;
+        }
+        try {
+            testd();
+        } catch (java.lang.NegativeArraySizeException ex) {
+            nex++;
+        }
+
+        if (nex != 4)
+            System.exit(97);
+    }
+}
+
diff --git a/test/compiler/c2/6832293/Test.java b/test/compiler/c2/Test6832293.java
similarity index 74%
rename from test/compiler/c2/6832293/Test.java
rename to test/compiler/c2/Test6832293.java
index 302717b..d75c9ab 100644
--- a/test/compiler/c2/6832293/Test.java
+++ b/test/compiler/c2/Test6832293.java
@@ -26,52 +26,57 @@
  * @test
  * @bug 6832293
  * @summary JIT compiler got wrong result in type checking with -server
- * @run main/othervm  -Xcomp -XX:CompileOnly=Test.run Test
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6832293::run
+ *      compiler.c2.Test6832293
  */
 
+package compiler.c2;
+
 import java.io.PrintStream;
 
-interface SomeInterface {
-    int SEVENS = 777;
-}
-
-interface AnotherInterface {
-    int THIRDS = 33;
-}
-
-class SomeClass implements SomeInterface {
-    int i;
-
-    SomeClass(int i) {
-        this.i = i;
+public class Test6832293 {
+    static interface SomeInterface {
+        int SEVENS = 777;
     }
-}
 
-class ImmediateSubclass extends SomeClass implements SomeInterface {
-    float f;
-
-    ImmediateSubclass(int i, float f) {
-        super(i);
-        this.f = f;
+    static interface AnotherInterface {
+        int THIRDS = 33;
     }
-}
 
-final class FinalSubclass extends ImmediateSubclass implements AnotherInterface {
-    double d;
+    static class SomeClass implements SomeInterface {
+        int i;
 
-     FinalSubclass(int i, float f, double d) {
-        super(i, f);
-        this.d = d;
+        SomeClass(int i) {
+            this.i = i;
+        }
     }
-}
 
-public class Test {
+    static class ImmediateSubclass extends SomeClass implements SomeInterface {
+        float f;
+
+        ImmediateSubclass(int i, float f) {
+            super(i);
+            this.f = f;
+        }
+    }
+
+    static final class FinalSubclass extends ImmediateSubclass implements AnotherInterface {
+        double d;
+
+        FinalSubclass(int i, float f, double d) {
+            super(i, f);
+            this.d = d;
+        }
+    }
 
     public static void main(String args[]) throws Exception{
         /* try to pre initialize */
         SomeClass[] a=new SomeClass[10];
-        Class.forName("ImmediateSubclass");
-        Class.forName("FinalSubclass");
+        String className = Test6832293.class.getName();
+        Class.forName(className + "$ImmediateSubclass");
+        Class.forName(className + "$FinalSubclass");
         System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
     }
 
diff --git a/test/compiler/c2/6837011/Test6837011.java b/test/compiler/c2/Test6837011.java
similarity index 90%
rename from test/compiler/c2/6837011/Test6837011.java
rename to test/compiler/c2/Test6837011.java
index be90060..0578f63 100644
--- a/test/compiler/c2/6837011/Test6837011.java
+++ b/test/compiler/c2/Test6837011.java
@@ -26,9 +26,13 @@
  * @bug 6837011
  * @summary SIGSEGV in PhaseIdealLoop in 32bit jvm
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6837011.main Test6837011
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6837011::main
+ *      compiler.c2.Test6837011
  */
 
+package compiler.c2;
+
 public class Test6837011 {
     static boolean var_3 = true;
 
diff --git a/test/compiler/c2/6837094/Test.java b/test/compiler/c2/Test6837094.java
similarity index 76%
rename from test/compiler/c2/6837094/Test.java
rename to test/compiler/c2/Test6837094.java
index 231b476..e1f904b 100644
--- a/test/compiler/c2/6837094/Test.java
+++ b/test/compiler/c2/Test6837094.java
@@ -27,13 +27,19 @@
  * @bug 6837094
  * @summary False positive for "meet not symmetric" failure
  *
- * @run main/othervm -Xbatch -XX:CompileOnly=Test.collectIs,Test$Factory$1.getArray,Test$Factory$2.getArray Test
+ * @run main/othervm -Xbatch
+ *    -XX:CompileCommand=compileonly,compiler.c2.Test6837094::collectIs
+ *    -XX:CompileCommand=compileonly,compiler.c2.Test6837094$Factory$1::getArray
+ *    -XX:CompileCommand=compileonly,compiler.c2.Test6837094$Factory$2::getArray
+ *    compiler.c2.Test6837094
  */
 
-import java.util.Set;
-import java.util.HashSet;
+package compiler.c2;
 
-public class Test {
+import java.util.HashSet;
+import java.util.Set;
+
+public class Test6837094 {
 
   private interface Factory<M extends Interface> {
     Factory<Child0> Zero = new Factory<Child0>() {
@@ -72,23 +78,25 @@
       collectIs(Factory.One, s);
     }
   }
+
+  /**
+   * Establish necessary class hierarchy
+   */
+
+  static interface Interface {
+  }
+
+  static class Parent {
+  }
+
+  static class Child0 extends Parent implements Interface {
+  }
+
+  static class Child1 extends Parent implements Interface {
+  }
+
+  static class Child2 extends Parent implements Interface {
+  }
+
 }
 
-/**
- * Establish necessary class hierarchy
- */
-
-interface Interface {
-}
-
-class Parent {
-}
-
-class Child0 extends Parent implements Interface {
-}
-
-class Child1 extends Parent implements Interface {
-}
-
-class Child2 extends Parent implements Interface {
-}
diff --git a/test/compiler/c2/6843752/Test.java b/test/compiler/c2/Test6843752.java
similarity index 95%
rename from test/compiler/c2/6843752/Test.java
rename to test/compiler/c2/Test6843752.java
index 48afcd2..fbc891c 100644
--- a/test/compiler/c2/6843752/Test.java
+++ b/test/compiler/c2/Test6843752.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 6843752
  * @summary missing code for an anti-dependent Phi in GCM
- * @run main/othervm -Xbatch Test
+ *
+ * @run main/othervm -Xbatch compiler.c2.Test6843752
  */
 
-public class Test {
+package compiler.c2;
+
+public class Test6843752 {
 
     Item list;
 
@@ -97,7 +100,7 @@
 
     static public void main(String[] args) {
         int caseCnt = 0;
-        Test bj = new Test();
+        Test6843752 bj = new Test6843752();
         try {
             for (; caseCnt < 500000;) {
                 int numItems = (++caseCnt % 2);
diff --git a/test/compiler/c2/5091921/Test6850611.java b/test/compiler/c2/Test6850611.java
similarity index 95%
rename from test/compiler/c2/5091921/Test6850611.java
rename to test/compiler/c2/Test6850611.java
index 87b0e6b..bbfa34f 100644
--- a/test/compiler/c2/5091921/Test6850611.java
+++ b/test/compiler/c2/Test6850611.java
@@ -27,9 +27,11 @@
  * @bug 6850611
  * @summary int / long arithmetic seems to be broken in 1.6.0_14 HotSpot Server VM (Win XP)
  *
- * @run main/timeout=480 Test6850611
+ * @run main/timeout=480 compiler.c2.Test6850611
  */
 
+package compiler.c2;
+
 public class Test6850611 {
 
     public static void main(String[] args) {
diff --git a/test/compiler/c2/Test6851282.java b/test/compiler/c2/Test6851282.java
new file mode 100644
index 0000000..8031a05
--- /dev/null
+++ b/test/compiler/c2/Test6851282.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2009, 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 6851282
+ * @summary JIT miscompilation results in null entry in array when using CompressedOops
+ *
+ * @run main/othervm/timeout=600 -Xmx256m -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops
+ *    compiler.c2.Test6851282
+ */
+
+package compiler.c2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Test6851282 {
+  void foo(A a, A[] as) {
+    for (A a1 : as) {
+      B[] filtered = a.c(a1);
+      for (B b : filtered) {
+        if (b == null) {
+          System.out.println("bug: b == null");
+          System.exit(97);
+        }
+      }
+    }
+  }
+
+  public static void main(String[] args) {
+    List<A> as = new ArrayList<A>();
+    for (int i = 0; i < 5000; i++) {
+      List<B> bs = new ArrayList<B>();
+      for (int j = i; j < i + 1000; j++)
+        bs.add(new B(j));
+      as.add(new A(bs.toArray(new B[0])));
+    }
+    new Test6851282().foo(as.get(0), as.subList(1, as.size()).toArray(new A[0]));
+  }
+
+  static class A {
+    final B[] bs;
+
+    public A(B[] bs) {
+      this.bs = bs;
+    }
+
+    final B[] c(final A a) {
+      return new BoxedArray<B>(bs).filter(new Function<B, Boolean>() {
+        public Boolean apply(B arg) {
+          for (B b : a.bs) {
+            if (b.d == arg.d)
+              return true;
+          }
+          return false;
+        }
+      });
+    }
+  }
+
+  static class BoxedArray<T> {
+
+    private final T[] array;
+
+    BoxedArray(T[] array) {
+      this.array = array;
+    }
+
+    public T[] filter(Function<T, Boolean> function) {
+      boolean[] include = new boolean[array.length];
+      int len = 0;
+      int i = 0;
+      while (i < array.length) {
+        if (function.apply(array[i])) {
+          include[i] = true;
+          len += 1;
+        }
+        i += 1;
+      }
+      T[] result = (T[]) java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), len);
+      len = 0;
+      i = 0;
+      while (len < result.length) {
+        if (include[i]) {
+          result[len] = array[i];
+          len += 1;
+        }
+        i += 1;
+      }
+      return result;
+    }
+  }
+
+  static interface Function<T, R> {
+    R apply(T arg);
+  }
+
+  static class B {
+    final int d;
+
+    public B(int d) {
+      this.d = d;
+    }
+  }
+}
+
diff --git a/test/compiler/c2/6852078/Test6852078.java b/test/compiler/c2/Test6852078.java
similarity index 95%
rename from test/compiler/c2/6852078/Test6852078.java
rename to test/compiler/c2/Test6852078.java
index 274c20b..dbf89a0 100644
--- a/test/compiler/c2/6852078/Test6852078.java
+++ b/test/compiler/c2/Test6852078.java
@@ -26,17 +26,20 @@
  * @test
  * @bug 6852078
  * @summary Disable SuperWord optimization for unsafe read/write
- *
  * @modules java.corba/com.sun.corba.se.impl.encoding
  *          java.corba/com.sun.jndi.toolkit.corba
- * @run main Test6852078
+ *
+ * @run main compiler.c2.Test6852078
  */
 
-import java.util.*;
-import java.nio.ByteBuffer;
+package compiler.c2;
+
 import com.sun.corba.se.impl.encoding.ByteBufferWithInfo;
 import com.sun.jndi.toolkit.corba.CorbaUtils;
 
+import java.nio.ByteBuffer;
+import java.util.Hashtable;
+
 public class Test6852078 {
 
     public Test6852078(String [] args) {
diff --git a/test/compiler/c2/Test6857159.java b/test/compiler/c2/Test6857159.java
new file mode 100644
index 0000000..894fc5f
--- /dev/null
+++ b/test/compiler/c2/Test6857159.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2009, 2015, 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 6857159
+ * @summary local schedule failed with checkcast of Thread.currentThread()
+ * @library /testlibrary
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @run driver compiler.c2.Test6857159
+ */
+
+package compiler.c2;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
+public class Test6857159 {
+    public static void main(String[] args) throws Throwable {
+        String className = Test.class.getName();
+        OutputAnalyzer analyzer = ProcessTools.executeTestJvm("-Xbatch",
+                "-XX:+PrintCompilation",
+                "-XX:CompileOnly="+ className + "$ct::run",
+                className);
+        analyzer.shouldNotContain("COMPILE SKIPPED");
+        analyzer.shouldContain(className + "$ct0::run (16 bytes)");
+        analyzer.shouldHaveExitValue(0);
+    }
+
+    static class Test extends Thread {
+        static class ct0 extends Test {
+            public void message() {
+            }
+
+            public void run() {
+                message();
+                ct0 ct = (ct0) Thread.currentThread();
+                ct.message();
+            }
+        }
+
+        static class ct1 extends ct0 {
+            public void message() {
+            }
+        }
+
+        static class ct2 extends ct0 {
+            public void message() {
+            }
+        }
+
+        public static void main(String[] args) throws Exception {
+            for (int i = 0; i < 20000; i++) {
+                Thread t = null;
+                switch (i % 3) {
+                    case 0:
+                        t = new ct0();
+                        break;
+                    case 1:
+                        t = new ct1();
+                        break;
+                    case 2:
+                        t = new ct2();
+                        break;
+                }
+                t.start();
+                t.join();
+            }
+        }
+    }
+}
diff --git a/test/compiler/c2/6863155/Test6863155.java b/test/compiler/c2/Test6863155.java
similarity index 90%
rename from test/compiler/c2/6863155/Test6863155.java
rename to test/compiler/c2/Test6863155.java
index edef9a9..848bfba 100644
--- a/test/compiler/c2/6863155/Test6863155.java
+++ b/test/compiler/c2/Test6863155.java
@@ -26,9 +26,13 @@
  * @bug 6863155
  * @summary Server compiler generates incorrect code (x86, long, bitshift, bitmask)
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6863155.test Test6863155
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6863155::test
+ *      compiler.c2.Test6863155
  */
 
+package compiler.c2;
+
 public class Test6863155 {
     private static long test(byte b) {
         return b << 24 & 0xff000000L;
diff --git a/test/compiler/c2/6866651/Test.java b/test/compiler/c2/Test6866651.java
similarity index 93%
rename from test/compiler/c2/6866651/Test.java
rename to test/compiler/c2/Test6866651.java
index 41b7bd5..88cbf52 100644
--- a/test/compiler/c2/6866651/Test.java
+++ b/test/compiler/c2/Test6866651.java
@@ -26,10 +26,12 @@
  * @bug 6866651
  * @summary delay dead node elimination in set_req_X to prevent killing the current node when it is in use
  *
- * @run main Test
+ * @run main compiler.c2.Test6866651
  */
 
-public class Test {
+package compiler.c2;
+
+public class Test6866651 {
 
     static int sum() {
         int s = 0;
diff --git a/test/compiler/c2/6877254/Test.java b/test/compiler/c2/Test6877254.java
similarity index 93%
rename from test/compiler/c2/6877254/Test.java
rename to test/compiler/c2/Test6877254.java
index d470221..bc092d5 100644
--- a/test/compiler/c2/6877254/Test.java
+++ b/test/compiler/c2/Test6877254.java
@@ -26,10 +26,12 @@
  * @bug 6877254
  * @summary Implement StoreCMNode::Ideal to promote its OopStore above the MergeMem
  *
- * @run main/othervm -Xcomp Test
+ * @run main/othervm -Xcomp compiler.c2.Test6877254
  */
 
-public class Test {
+package compiler.c2;
+
+public class Test6877254 {
     static byte var_1;
     static String var_2 = "";
     static byte var_3;
diff --git a/test/compiler/c2/6880034/Test6880034.java b/test/compiler/c2/Test6880034.java
similarity index 84%
rename from test/compiler/c2/6880034/Test6880034.java
rename to test/compiler/c2/Test6880034.java
index 72af095..628e7b2 100644
--- a/test/compiler/c2/6880034/Test6880034.java
+++ b/test/compiler/c2/Test6880034.java
@@ -26,10 +26,13 @@
  * @bug 6880034
  * @summary SIGBUS during deoptimisation at a safepoint on 64bit-SPARC
  *
- * @run main/othervm -Xcomp -Xbatch -XX:CompileCommand=compileonly,Test6880034,deopt_compiledframe_at_safepoint -XX:+PrintCompilation Test6880034
+ * @run main/othervm -Xcomp -Xbatch
+ *    -XX:+PrintCompilation
+ *    -XX:CompileCommand=compileonly,compiler.c2.Test6880034::deopt_compiledframe_at_safepoint
+ *    compiler.c2.Test6880034
  */
 
-
+package compiler.c2;
 
 // This test provokes a deoptimisation at a safepoint.
 //
@@ -61,39 +64,38 @@
 //
 // Author: Volker H. Simonis
 
-class A {
-  public int doSomething() {
-    return 0;
-  }
-}
-
-class B extends A {
-  public B() {}
-  // override 'A::doSomething()'
-  public int doSomething() {
-    return 1;
-  }
-}
-
-class G {
-  public static volatile A a = new A();
-
-  // Change 'a' to point to a 'B' object
-  public static void setAtoB() {
-    try {
-      a =  (A) ClassLoader.
-        getSystemClassLoader().
-        loadClass("B").
-        getConstructor(new Class[] {}).
-        newInstance(new Object[] {});
-    }
-    catch (Exception e) {
-      System.out.println(e);
-    }
-  }
-}
-
 public class Test6880034 {
+  static class A {
+    public int doSomething() {
+      return 0;
+    }
+  }
+
+  static class B extends A {
+    public B() {}
+    // override 'A::doSomething()'
+    public int doSomething() {
+      return 1;
+    }
+  }
+
+  static class G {
+    public static volatile A a = new A();
+
+    // Change 'a' to point to a 'B' object
+    public static void setAtoB() {
+      try {
+        a =  (A) ClassLoader.
+                getSystemClassLoader().
+                loadClass("B").
+                getConstructor(new Class[] {}).
+                newInstance(new Object[] {});
+      }
+      catch (Exception e) {
+        System.out.println(e);
+      }
+    }
+  }
 
   public static volatile boolean is_in_loop = false;
   public static volatile boolean stop_while_loop = false;
diff --git a/test/compiler/c2/6885584/Test6885584.java b/test/compiler/c2/Test6885584.java
similarity index 95%
rename from test/compiler/c2/6885584/Test6885584.java
rename to test/compiler/c2/Test6885584.java
index 1048bcd..e5ba96f 100644
--- a/test/compiler/c2/6885584/Test6885584.java
+++ b/test/compiler/c2/Test6885584.java
@@ -27,10 +27,10 @@
  * @bug 6885584
  * @summary A particular class structure causes large allocation spike for jit
  *
- * @run main/othervm -Xbatch Test6885584
+ * @run main/othervm -Xbatch compiler.c2.Test6885584
  */
 
-
+package compiler.c2;
 
 public class Test6885584 {
    static private int i1;
diff --git a/test/compiler/c2/5091921/Test6897150.java b/test/compiler/c2/Test6897150.java
similarity index 96%
rename from test/compiler/c2/5091921/Test6897150.java
rename to test/compiler/c2/Test6897150.java
index 58a22ac..9fde86d 100644
--- a/test/compiler/c2/5091921/Test6897150.java
+++ b/test/compiler/c2/Test6897150.java
@@ -27,9 +27,11 @@
  * @bug 6897150
  * @summary Hotspot optimises away a valid loop
  *
- * @run main Test6897150
+ * @run main compiler.c2.Test6897150
  */
 
+package compiler.c2;
+
 // Should be compiled with javac from JDK1.3 to get bytecode which shows the problem.
 public class Test6897150 {
     public static void main(String[] args) {
diff --git a/test/compiler/c2/6901572/Test.java b/test/compiler/c2/Test6901572.java
similarity index 94%
rename from test/compiler/c2/6901572/Test.java
rename to test/compiler/c2/Test6901572.java
index 695373a..583e5e1 100644
--- a/test/compiler/c2/6901572/Test.java
+++ b/test/compiler/c2/Test6901572.java
@@ -26,11 +26,12 @@
  * @bug 6901572
  * @summary JVM 1.6.16 crash on loops: assert(has_node(i),"")
  *
- * @run main/othervm Test
+ * @run main/othervm compiler.c2.Test6901572
  */
 
+package compiler.c2;
 
-public class Test {
+public class Test6901572 {
 
     public static void main(String[] args) {
         for (int i = 0; i < 2; i++)
diff --git a/test/compiler/c2/Test6905845.java b/test/compiler/c2/Test6905845.java
new file mode 100644
index 0000000..18db36b
--- /dev/null
+++ b/test/compiler/c2/Test6905845.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011, 2013, 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 6905845
+ * @summary Server VM improperly optimizing away loop.
+ *
+ * @run main/timeout=480 compiler.c2.Test6905845
+ */
+
+package compiler.c2;
+
+public class Test6905845 {
+
+    public static void main(String[] args) {
+        for (int asdf = 0; asdf < 5; asdf++) {
+            //test block
+            {
+                StringBuilder strBuf1 = new StringBuilder(65);
+                long start = System.currentTimeMillis();
+                int count = 0;
+
+                for (int i = Integer.MIN_VALUE; i < (Integer.MAX_VALUE - 80); i += 79) {
+                    strBuf1.append(i);
+                    count++;
+                    strBuf1.delete(0, 65);
+                }
+
+                System.out.println(count);
+                if (count != 54366674) {
+                    System.out.println("wrong count: " + count + ", should be 54366674");
+                    System.exit(97);
+                }
+            }
+            //test block
+            {
+                StringBuilder strBuf1 = new StringBuilder(65);
+                long start = System.currentTimeMillis();
+                int count = 0;
+
+                for (int i = Integer.MIN_VALUE; i < (Integer.MAX_VALUE - 80); i += 79) {
+                    strBuf1.append(i);
+                    count++;
+                    strBuf1.delete(0, 65);
+                }
+
+                System.out.println(count);
+                if (count != 54366674) {
+                    System.out.println("wrong count: " + count + ", should be 54366674");
+                    System.exit(97);
+                }
+            }
+        }
+    }
+}
+
diff --git a/test/compiler/c2/6910484/Test.java b/test/compiler/c2/Test6910484.java
similarity index 93%
rename from test/compiler/c2/6910484/Test.java
rename to test/compiler/c2/Test6910484.java
index 3907c98..5416523 100644
--- a/test/compiler/c2/6910484/Test.java
+++ b/test/compiler/c2/Test6910484.java
@@ -26,10 +26,12 @@
  * @bug 6910484
  * @summary incorrect integer optimization (loosing and op-r in a given example)
  *
- * @run main/othervm -Xbatch Test
+ * @run main/othervm -Xbatch compiler.c2.Test6910484
  */
 
-public class Test {
+package compiler.c2;
+
+public class Test6910484 {
 
     public static void main(String[] args) {
         long iteration = 0;
diff --git a/test/compiler/c2/6910605/Test.java b/test/compiler/c2/Test6910605_1.java
similarity index 95%
rename from test/compiler/c2/6910605/Test.java
rename to test/compiler/c2/Test6910605_1.java
index ffeb91c..6ab1ff4 100644
--- a/test/compiler/c2/6910605/Test.java
+++ b/test/compiler/c2/Test6910605_1.java
@@ -26,15 +26,16 @@
  * @test
  * @bug 6910605
  * @summary C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used
- *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -Xbatch Test
- *
  * original test: nsk/coverage/runtime/runtime007
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -Xbatch compiler.c2.Test6910605_1
  */
 
-import java.io.*;
+package compiler.c2;
 
-public class Test {
+import java.io.PrintStream;
+
+public class Test6910605_1 {
         public static int buf=0;
 
         public static void main( String argv[] ) {
diff --git a/test/compiler/c2/Test6910605_2.java b/test/compiler/c2/Test6910605_2.java
new file mode 100644
index 0000000..50dbedc
--- /dev/null
+++ b/test/compiler/c2/Test6910605_2.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2010, 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 6910605
+ * @summary C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used
+ *
+ * @run main/othervm -Xmx64m -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot
+ *      -XX:+DoEscapeAnalysis -Xbatch -XX:InlineSmallCode=2000
+ *      compiler.c2.Test6910605_2
+ */
+
+package compiler.c2;
+
+/*
+ * Added InlineSmallCode=2000 to guaranty inlining of StringBuilder::append() to allow scalar replace StringBuilder object.
+ *
+ * original test: gc/gctests/StringGC
+ */
+
+public class Test6910605_2 {
+    private final String toAdd = "0123456789abcdef";
+    private int maxLength;
+    private static final int numberOfThreads = 8;
+
+    private class StringAdder extends Thread {
+        private String s;
+
+        public void test() {
+            s = s + toAdd;
+        }
+
+        public void run() {
+            do {
+                test();
+            } while (s.length() < maxLength);
+        }
+    }
+
+    public void test() throws InterruptedException {
+        maxLength = toAdd.length() * 15000 / numberOfThreads;
+        StringAdder[] sa = new StringAdder[numberOfThreads];
+        for (int i = 0; i < numberOfThreads; i++) {
+            sa[i] = new StringAdder();
+            sa[i].start();
+        }
+        for (int i = 0; i < numberOfThreads; i++) {
+            sa[i].join();
+        }
+    }
+
+    public static void main(String[] args) throws InterruptedException {
+        Test6910605_2 t = new Test6910605_2();
+        t.test();
+    }
+}
diff --git a/test/compiler/c2/6912517/Test.java b/test/compiler/c2/Test6912517.java
similarity index 93%
rename from test/compiler/c2/6912517/Test.java
rename to test/compiler/c2/Test6912517.java
index 0d999fc..f682678 100644
--- a/test/compiler/c2/6912517/Test.java
+++ b/test/compiler/c2/Test6912517.java
@@ -26,14 +26,17 @@
  * @bug 6912517
  * @summary JIT bug compiles out (and stops running) code that needs to be run.  Causes NPE.
  *
- * @run main/othervm -Xbatch -XX:CompileThreshold=100 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops Test
+ * @run main/othervm -Xbatch -XX:CompileThreshold=100 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops
+ *      compiler.c2.Test6912517
  */
 
+package compiler.c2;
+
 /**
  * Highlights a bug with the JIT compiler.
  * @author Matt Bruce m b r u c e __\at/__ g m a i l DOT c o m
  */
-public class Test implements Runnable
+public class Test6912517 implements Runnable
 {
     private final Thread myThread;
     private Thread       myInitialThread;
@@ -42,7 +45,7 @@
     /**
      * Sets up the running thread, and starts it.
      */
-    public Test(int id)
+    public Test6912517(int id)
     {
         myThread = new Thread(this);
         myThread.setName("Runner: " + id);
@@ -69,7 +72,7 @@
         // let this run for a bit, so the "run" below is JITTed.
         for (int id = 0; id < 20; id++) {
             System.out.println("Starting thread: " + id);
-            Test bug = new Test(id);
+            Test6912517 bug = new Test6912517(id);
             bug.setShouldCheckThreads(true);
             Thread.sleep(2500);
         }
diff --git a/test/compiler/c2/6916644/Test6916644.java b/test/compiler/c2/Test6916644.java
similarity index 91%
rename from test/compiler/c2/6916644/Test6916644.java
rename to test/compiler/c2/Test6916644.java
index c64f245..8ad9e7b 100644
--- a/test/compiler/c2/6916644/Test6916644.java
+++ b/test/compiler/c2/Test6916644.java
@@ -27,9 +27,13 @@
  * @bug 6916644
  * @summary C2 compiler crash on x86
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6916644.test Test6916644
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6916644::test
+ *      compiler.c2.Test6916644
  */
 
+package compiler.c2;
+
 public class Test6916644 {
     static int result;
     static int i1;
diff --git a/test/compiler/c2/6930043/Test6930043.java b/test/compiler/c2/Test6930043.java
similarity index 97%
rename from test/compiler/c2/6930043/Test6930043.java
rename to test/compiler/c2/Test6930043.java
index ac30f3a..66cbe10 100644
--- a/test/compiler/c2/6930043/Test6930043.java
+++ b/test/compiler/c2/Test6930043.java
@@ -27,10 +27,10 @@
  * @bug 6930043
  * @summary C2: SIGSEGV in javasoft.sqe.tests.lang.arr017.arr01702.arr01702.loop_forw(II)I
  *
- * @run main Test6930043
+ * @run main compiler.c2.Test6930043
  */
 
-import java.io.PrintStream;
+package compiler.c2;
 
 public class Test6930043 {
     int[] a;
diff --git a/test/compiler/c2/5091921/Test6931567.java b/test/compiler/c2/Test6931567.java
similarity index 96%
rename from test/compiler/c2/5091921/Test6931567.java
rename to test/compiler/c2/Test6931567.java
index 30e8701..7f75390 100644
--- a/test/compiler/c2/5091921/Test6931567.java
+++ b/test/compiler/c2/Test6931567.java
@@ -27,9 +27,11 @@
  * @bug 6931567
  * @summary JIT Error (on class file compiled with eclipse) on JVM x64 (but not on x32!).
  *
- * @run main Test6931567
+ * @run main compiler.c2.Test6931567
  */
 
+package compiler.c2;
+
 // Should be compiled with javac from JDK1.3 to get bytecode which shows the problem.
 public class Test6931567 {
 
diff --git a/test/compiler/c2/5091921/Test6935022.java b/test/compiler/c2/Test6935022.java
similarity index 97%
rename from test/compiler/c2/5091921/Test6935022.java
rename to test/compiler/c2/Test6935022.java
index 0dea6f9..da098a8 100644
--- a/test/compiler/c2/5091921/Test6935022.java
+++ b/test/compiler/c2/Test6935022.java
@@ -27,9 +27,11 @@
  * @bug 6935022
  * @summary Server VM incorrectly breaks out of while loop
  *
- * @run main Test6935022
+ * @run main compiler.c2.Test6935022
  */
 
+package compiler.c2;
+
 public class Test6935022 {
     public static final void main(String[] args) throws Exception {
         Test6935022 test = new Test6935022();
diff --git a/test/compiler/c2/6956668/Test6956668.java b/test/compiler/c2/Test6956668.java
similarity index 96%
rename from test/compiler/c2/6956668/Test6956668.java
rename to test/compiler/c2/Test6956668.java
index 1acf515..54b78d2 100644
--- a/test/compiler/c2/6956668/Test6956668.java
+++ b/test/compiler/c2/Test6956668.java
@@ -27,9 +27,10 @@
  * @bug 6956668
  * @summary misbehavior of XOR operator (^) with int
  *
- * @run main/othervm -Xbatch Test6956668
+ * @run main/othervm -Xbatch compiler.c2.Test6956668
  */
 
+package compiler.c2;
 
 public class Test6956668 {
 
diff --git a/test/compiler/c2/6958485/Test.java b/test/compiler/c2/Test6958485.java
similarity index 89%
rename from test/compiler/c2/6958485/Test.java
rename to test/compiler/c2/Test6958485.java
index 0bbc1ec..b8bc15f 100644
--- a/test/compiler/c2/6958485/Test.java
+++ b/test/compiler/c2/Test6958485.java
@@ -26,10 +26,14 @@
  * @bug 6958485
  * @summary fix for 6879921 was insufficient
  *
- * @run main/othervm -Xbatch -XX:CompileOnly=Test.init Test
+ * @run main/othervm -Xbatch
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test6958485::init
+ *      compiler.c2.Test6958485
  */
 
-public class Test {
+package compiler.c2;
+
+public class Test6958485 {
 
     public static void init(Object src[], boolean[] dst) {
         // initialize the arrays
diff --git a/test/compiler/c2/5091921/Test6959129.java b/test/compiler/c2/Test6959129.java
similarity index 96%
rename from test/compiler/c2/5091921/Test6959129.java
rename to test/compiler/c2/Test6959129.java
index 53fd439..fb58383 100644
--- a/test/compiler/c2/5091921/Test6959129.java
+++ b/test/compiler/c2/Test6959129.java
@@ -27,9 +27,11 @@
  * @bug 6959129
  * @summary COMPARISON WITH INTEGER.MAX_INT DOES NOT WORK CORRECTLY IN THE CLIENT VM.
  *
- * @run main/othervm -ea Test6959129
+ * @run main/othervm -ea compiler.c2.Test6959129
  */
 
+package compiler.c2;
+
 public class Test6959129 {
 
   public static void main(String[] args) {
diff --git a/test/compiler/c2/6968348/Test6968348.java b/test/compiler/c2/Test6968348.java
similarity index 95%
rename from test/compiler/c2/6968348/Test6968348.java
rename to test/compiler/c2/Test6968348.java
index 432f45f..be609bf 100644
--- a/test/compiler/c2/6968348/Test6968348.java
+++ b/test/compiler/c2/Test6968348.java
@@ -26,13 +26,16 @@
  * @test
  * @bug 6968348
  * @summary Byteswapped memory access can point to wrong location after JIT
- *
  * @modules java.base/jdk.internal.misc
- * @run main Test6968348
+ *
+ * @run main compiler.c2.Test6968348
  */
 
+package compiler.c2;
+
 import jdk.internal.misc.Unsafe;
-import java.lang.reflect.*;
+
+import java.lang.reflect.Field;
 
 public class Test6968348 {
     static Unsafe unsafe;
diff --git a/test/compiler/c2/6973329/Test.java b/test/compiler/c2/Test6973329.java
similarity index 60%
rename from test/compiler/c2/6973329/Test.java
rename to test/compiler/c2/Test6973329.java
index caecf8b..9402120 100644
--- a/test/compiler/c2/6973329/Test.java
+++ b/test/compiler/c2/Test6973329.java
@@ -26,38 +26,42 @@
  * @bug 6973329
  * @summary C2 with Zero based COOP produces code with broken anti-dependency on x86
  *
- * @run main/othervm -Xbatch -Xcomp -XX:CompileOnly=Test Test
+ * @run main/othervm -Xbatch -Xcomp
+ *    -XX:CompileCommand=compileonly,compiler.c2.Test6973329::*
+ *    compiler.c2.Test6973329
  */
 
-class A {
-  A next;
-  int n;
+package compiler.c2;
 
-  public int get_n() {
-    return n+1;
-  }
-}
-public class Test {
+public class Test6973329 {
+    static class A {
+        A next;
+        int n;
 
-  A a;
-
-  void test (A new_next) {
-    A prev_next = a.next;
-    a.next = new_next;
-    if (prev_next == null) {
-      a.n = a.get_n();
+        public int get_n() {
+            return n + 1;
+        }
     }
-  }
 
-  public static void main(String args[]) {
-    Test t = new Test();
-    t.a = new A();
-    t.a.n = 1;
-    t.test(new A());
-    if (t.a.n != 2) {
-      System.out.println("Wrong value: " + t.a.n + " expected: 2");
-      System.exit(97);
+    A a;
+
+    void test(A new_next) {
+        A prev_next = a.next;
+        a.next = new_next;
+        if (prev_next == null) {
+            a.n = a.get_n();
+        }
     }
-  }
+
+    public static void main(String args[]) {
+        Test6973329 t = new Test6973329();
+        t.a = new A();
+        t.a.n = 1;
+        t.test(new A());
+        if (t.a.n != 2) {
+            System.out.println("Wrong value: " + t.a.n + " expected: 2");
+            System.exit(97);
+        }
+    }
 }
 
diff --git a/test/compiler/c2/5091921/Test6985295.java b/test/compiler/c2/Test6985295.java
similarity index 95%
rename from test/compiler/c2/5091921/Test6985295.java
rename to test/compiler/c2/Test6985295.java
index 3b3271f..ab18039 100644
--- a/test/compiler/c2/5091921/Test6985295.java
+++ b/test/compiler/c2/Test6985295.java
@@ -27,9 +27,11 @@
  * @bug 6985295
  * @summary JVM fails to evaluate condition randomly
  *
- * @run main/othervm -Xbatch Test6985295
+ * @run main/othervm -Xbatch compiler.c2.Test6985295
  */
 
+package compiler.c2;
+
 public class Test6985295 {
 
     public static void main(String[] args) {
diff --git a/test/compiler/c2/5091921/Test6992759.java b/test/compiler/c2/Test6992759.java
similarity index 96%
rename from test/compiler/c2/5091921/Test6992759.java
rename to test/compiler/c2/Test6992759.java
index 9adece6..8df7b26 100644
--- a/test/compiler/c2/5091921/Test6992759.java
+++ b/test/compiler/c2/Test6992759.java
@@ -27,9 +27,11 @@
  * @bug 6992759
  * @summary Bad code generated for integer <= comparison, fails for Integer.MAX_VALUE
  *
- * @run main/timeout=240 Test6992759
+ * @run main/timeout=240 compiler.c2.Test6992759
  */
 
+package compiler.c2;
+
 public class Test6992759 {
 
     static final int N_TESTS = 1000000000;
diff --git a/test/compiler/c2/7002666/Test7002666.java b/test/compiler/c2/Test7002666.java
similarity index 90%
rename from test/compiler/c2/7002666/Test7002666.java
rename to test/compiler/c2/Test7002666.java
index caca8d8..ebb0d97 100644
--- a/test/compiler/c2/7002666/Test7002666.java
+++ b/test/compiler/c2/Test7002666.java
@@ -27,8 +27,14 @@
  * @bug 7002666
  * @summary eclipse CDT projects crash with compressed oops
  *
- * @run main/othervm -Xbatch -XX:CompileOnly=Test7002666.test,java/lang/reflect/Array Test7002666
- *
+ * @run main/othervm -Xbatch
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test7002666::test
+ *      -XX:CompileCommand=compileonly,java.lang.reflect.Array::*
+ *      compiler.c2.Test7002666
+ */
+
+package compiler.c2;
+/*
  * This will only reliably fail with a fastdebug build since it relies
  * on seeing garbage in the heap to die.  It could be made more
  * reliable in product mode but that would require greatly increasing
diff --git a/test/compiler/c2/7009359/Test7009359.java b/test/compiler/c2/Test7009359.java
similarity index 91%
rename from test/compiler/c2/7009359/Test7009359.java
rename to test/compiler/c2/Test7009359.java
index 8672493..48280c5 100644
--- a/test/compiler/c2/7009359/Test7009359.java
+++ b/test/compiler/c2/Test7009359.java
@@ -27,10 +27,13 @@
  * @bug 7009359
  * @summary HS with -XX:+AggressiveOpts optimize new StringBuffer(null) so it does not throw NPE as expected
  *
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+OptimizeStringConcat -XX:CompileCommand=dontinline,Test7009359,stringmakerBUG Test7009359
- *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+OptimizeStringConcat
+ *      -XX:CompileCommand=dontinline,compiler.c2.Test7009359::stringmakerBUG
+ *      compiler.c2.Test7009359
  */
 
+package compiler.c2;
+
 public class Test7009359 {
     public static void main (String[] args) {
         for(int i = 0; i < 100000; i++) {
diff --git a/test/compiler/c2/7017746/Test.java b/test/compiler/c2/Test7017746.java
similarity index 72%
rename from test/compiler/c2/7017746/Test.java
rename to test/compiler/c2/Test7017746.java
index eab4b7e..893eef3 100644
--- a/test/compiler/c2/7017746/Test.java
+++ b/test/compiler/c2/Test7017746.java
@@ -26,25 +26,27 @@
  * @bug 7017746
  * @summary Regression : C2 compiler crash due to SIGSEGV in PhaseCFG::schedule_early()
  *
- * @run main/othervm -Xbatch Test
+ * @run main/othervm -Xbatch compiler.c2.Test7017746
  */
 
-public class Test {
+package compiler.c2;
 
-  int i;
+public class Test7017746 {
 
-  static int test(Test t, int a, int b) {
-    int j = t.i;
-    int x = a - b;
-    if (a < b) x = x + j;
-    return x - j;
-  }
+    int i;
 
-  public static void main(String args[]) {
-    Test t = new Test();
-    for (int n = 0; n < 1000000; n++) {
-      int i = test(t, 1, 2);
+    static int test(Test7017746 t, int a, int b) {
+        int j = t.i;
+        int x = a - b;
+        if (a < b) x = x + j;
+        return x - j;
     }
-  }
+
+    public static void main(String args[]) {
+        Test7017746 t = new Test7017746();
+        for (int n = 0; n < 1000000; n++) {
+            int i = test(t, 1, 2);
+        }
+    }
 }
 
diff --git a/test/compiler/c2/5091921/Test7020614.java b/test/compiler/c2/Test7020614.java
similarity index 95%
rename from test/compiler/c2/5091921/Test7020614.java
rename to test/compiler/c2/Test7020614.java
index b1d8029..05b2481 100644
--- a/test/compiler/c2/5091921/Test7020614.java
+++ b/test/compiler/c2/Test7020614.java
@@ -27,9 +27,11 @@
  * @bug 7020614
  * @summary "-server" mode optimizer makes code hang
  *
- * @run main/othervm/timeout=30 -Xbatch Test7020614
+ * @run main/othervm/timeout=30 -Xbatch compiler.c2.Test7020614
  */
 
+package compiler.c2;
+
 public class Test7020614 {
 
     private static final int ITERATIONS = 1000;
diff --git a/test/compiler/c2/7024475/Test7024475.java b/test/compiler/c2/Test7024475.java
similarity index 97%
rename from test/compiler/c2/7024475/Test7024475.java
rename to test/compiler/c2/Test7024475.java
index 2f3b2e0..646993f 100644
--- a/test/compiler/c2/7024475/Test7024475.java
+++ b/test/compiler/c2/Test7024475.java
@@ -27,9 +27,11 @@
  * @bug 7024475
  * @summary loop doesn't terminate when compiled
  *
- * @run main Test7024475
+ * @run main compiler.c2.Test7024475
  */
 
+package compiler.c2;
+
 public class Test7024475 {
 
     static int i;
diff --git a/test/compiler/c2/7029152/Test.java b/test/compiler/c2/Test7029152.java
similarity index 70%
rename from test/compiler/c2/7029152/Test.java
rename to test/compiler/c2/Test7029152.java
index edc7fd9..bcd53db 100644
--- a/test/compiler/c2/7029152/Test.java
+++ b/test/compiler/c2/Test7029152.java
@@ -26,24 +26,26 @@
  * @bug 7029152
  * @summary Ideal nodes for String intrinsics miss memory edge optimization
  *
- * @run main/othervm -Xbatch Test
+ * @run main/othervm -Xbatch compiler.c2.Test7029152
  */
 
-public class Test {
+package compiler.c2;
 
-  static final String str = "11111xx11111xx1x";
-  static int idx = 0;
+public class Test7029152 {
 
-  static int IndexOfTest(String str) {
-    return str.indexOf("11111xx1x");
-  }
+    static final String str = "11111xx11111xx1x";
+    static int idx = 0;
 
-  public static void main(String args[]) {
-    final int ITERS=2000000;
-
-    for (int i=0; i<ITERS; i++) {
-      idx = IndexOfTest(str);
+    static int IndexOfTest(String str) {
+        return str.indexOf("11111xx1x");
     }
-    System.out.println("IndexOf = " + idx);
-  }
+
+    public static void main(String args[]) {
+        final int ITERS = 2000000;
+
+        for (int i = 0; i < ITERS; i++) {
+            idx = IndexOfTest(str);
+        }
+        System.out.println("IndexOf = " + idx);
+    }
 }
diff --git a/test/compiler/c2/7041100/Test7041100.java b/test/compiler/c2/Test7041100.java
similarity index 95%
rename from test/compiler/c2/7041100/Test7041100.java
rename to test/compiler/c2/Test7041100.java
index b6c1e8e..937253a 100644
--- a/test/compiler/c2/7041100/Test7041100.java
+++ b/test/compiler/c2/Test7041100.java
@@ -27,9 +27,11 @@
  * @bug 7041100
  * @summary The load in String.equals intrinsic executed before null check
  *
- * @run main/othervm -Xbatch Test7041100 abc def
+ * @run main/othervm -Xbatch compiler.c2.Test7041100 abc def
  */
 
+package compiler.c2;
+
 public class Test7041100 {
 
     static String n = null;
diff --git a/test/compiler/c2/7046096/Test7046096.java b/test/compiler/c2/Test7046096.java
similarity index 62%
rename from test/compiler/c2/7046096/Test7046096.java
rename to test/compiler/c2/Test7046096.java
index 5dff2db..f0937c4 100644
--- a/test/compiler/c2/7046096/Test7046096.java
+++ b/test/compiler/c2/Test7046096.java
@@ -27,39 +27,41 @@
  * @bug 7046096
  * @summary SEGV IN C2 WITH 6U25
  *
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+OptimizeStringConcat Test7046096
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+OptimizeStringConcat
+ *    compiler.c2.Test7046096
  */
 
+package compiler.c2;
 
 public class Test7046096 {
 
-  static int first = 1;
+    static int first = 1;
 
-  String add(String str) {
-    if (first != 0) {
-      return str + "789";
-    } else {
-      return "null";
+    String add(String str) {
+        if (first != 0) {
+            return str + "789";
+        } else {
+            return "null";
+        }
     }
-  }
 
-  String test(String str) {
-    for (int i=0; i < first; i++) {
-      if (i > 1)
-        return "bad";
+    String test(String str) {
+        for (int i = 0; i < first; i++) {
+            if (i > 1)
+                return "bad";
+        }
+        return add(str + "456");
     }
-    return add(str+"456");
-  }
 
-  public static void main(String [] args) {
-    Test7046096 t = new Test7046096();
-    for (int i = 0; i < 11000; i++) {
-      String str = t.test("123");
-      if (!str.equals("123456789")) {
-        System.out.println("FAILED: " + str + " != \"123456789\"");
-        System.exit(97);
-      }
+    public static void main(String[] args) {
+        Test7046096 t = new Test7046096();
+        for (int i = 0; i < 11000; i++) {
+            String str = t.test("123");
+            if (!str.equals("123456789")) {
+                System.out.println("FAILED: " + str + " != \"123456789\"");
+                System.exit(97);
+            }
+        }
     }
-  }
 }
 
diff --git a/test/compiler/c2/7047069/Test7047069.java b/test/compiler/c2/Test7047069.java
similarity index 98%
rename from test/compiler/c2/7047069/Test7047069.java
rename to test/compiler/c2/Test7047069.java
index fcfee8c..812a5ac 100644
--- a/test/compiler/c2/7047069/Test7047069.java
+++ b/test/compiler/c2/Test7047069.java
@@ -26,13 +26,14 @@
  * @test
  * @bug 7047069
  * @summary Array can dynamically change size when assigned to an object field
- *
  * @modules java.desktop
- * @run main/othervm -Xbatch Test7047069
+ *
+ * @run main/othervm -Xbatch compiler.c2.Test7047069
  */
 
-import java.util.*;
-import java.awt.geom.*;
+package compiler.c2;
+
+import java.awt.geom.Line2D;
 
 public class Test7047069 {
     static boolean verbose;
diff --git a/test/compiler/c2/7048332/Test7048332.java b/test/compiler/c2/Test7048332.java
similarity index 62%
rename from test/compiler/c2/7048332/Test7048332.java
rename to test/compiler/c2/Test7048332.java
index fc6794e..2c850a4 100644
--- a/test/compiler/c2/7048332/Test7048332.java
+++ b/test/compiler/c2/Test7048332.java
@@ -27,34 +27,35 @@
  * @bug 7048332
  * @summary Cadd_cmpLTMask doesn't handle 64-bit tmp register properly
  *
- * @run main/othervm -Xbatch Test7048332
+ * @run main/othervm -Xbatch compiler.c2.Test7048332
  */
 
+package compiler.c2;
 
 public class Test7048332 {
 
-  static int capacity = 2;
-  static int first = 1;
-  static int last = 2;
+    static int capacity = 2;
+    static int first = 1;
+    static int last = 2;
 
-  static int test(int i1, int i2, int i3, int i4, int i5, int i6) {
-    final int result;
-    if (last >= first) {
-      result = last - first;
-    } else {
-      result = last - first + capacity;
+    static int test(int i1, int i2, int i3, int i4, int i5, int i6) {
+        final int result;
+        if (last >= first) {
+            result = last - first;
+        } else {
+            result = last - first + capacity;
+        }
+        return result;
     }
-    return result;
-  }
 
-  public static void main(String [] args) {
-    for (int i = 0; i < 11000; i++) {
-      last = (i & 1) << 1; // 0 or 2
-      int k = test(1, 2, 3, 4, 5, 6);
-      if (k != 1) {
-        System.out.println("FAILED: " + k + " != 1");
-        System.exit(97);
-      }
+    public static void main(String[] args) {
+        for (int i = 0; i < 11000; i++) {
+            last = (i & 1) << 1; // 0 or 2
+            int k = test(1, 2, 3, 4, 5, 6);
+            if (k != 1) {
+                System.out.println("FAILED: " + k + " != 1");
+                System.exit(97);
+            }
+        }
     }
-  }
 }
diff --git a/test/compiler/c2/7068051/Test7068051.java b/test/compiler/c2/Test7068051.java
similarity index 98%
rename from test/compiler/c2/7068051/Test7068051.java
rename to test/compiler/c2/Test7068051.java
index 7f75fe6..408fd6f 100644
--- a/test/compiler/c2/7068051/Test7068051.java
+++ b/test/compiler/c2/Test7068051.java
@@ -27,12 +27,14 @@
  * @bug 7068051
  * @summary SIGSEGV in PhaseIdealLoop::build_loop_late_post on T5440
  * @library /testlibrary
- *
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main/othervm -showversion -Xbatch Test7068051
+ *
+ * @run main/othervm -showversion -Xbatch compiler.c2.Test7068051
  */
 
+package compiler.c2;
+
 import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.OutputAnalyzer;
 
diff --git a/test/compiler/c2/7110586/Test7110586.java b/test/compiler/c2/Test7110586.java
similarity index 97%
rename from test/compiler/c2/7110586/Test7110586.java
rename to test/compiler/c2/Test7110586.java
index e40c903..62d2f5d 100644
--- a/test/compiler/c2/7110586/Test7110586.java
+++ b/test/compiler/c2/Test7110586.java
@@ -27,9 +27,11 @@
  * @bug 7110586
  * @summary C2 generates icorrect results
  *
- * @run main/othervm -Xbatch Test7110586
+ * @run main/othervm -Xbatch compiler.c2.Test7110586
  */
 
+package compiler.c2;
+
 public class Test7110586 {
   static int test1() {
     int i = 0;
diff --git a/test/compiler/c2/7125879/Test7125879.java b/test/compiler/c2/Test7125879.java
similarity index 95%
rename from test/compiler/c2/7125879/Test7125879.java
rename to test/compiler/c2/Test7125879.java
index 729aac6..a751c5a 100644
--- a/test/compiler/c2/7125879/Test7125879.java
+++ b/test/compiler/c2/Test7125879.java
@@ -27,9 +27,11 @@
  * @bug 7125879
  * @summary assert(proj != NULL) failed: must be found
  *
- * @run main/othervm -Xcomp Test7125879
+ * @run main/othervm -Xcomp compiler.c2.Test7125879
  */
 
+package compiler.c2;
+
 public class Test7125879 {
     String var_1 = "abc";
 
diff --git a/test/compiler/c2/7160610/Test7160610.java b/test/compiler/c2/Test7160610.java
similarity index 97%
rename from test/compiler/c2/7160610/Test7160610.java
rename to test/compiler/c2/Test7160610.java
index 62b2e6e..31d7134 100644
--- a/test/compiler/c2/7160610/Test7160610.java
+++ b/test/compiler/c2/Test7160610.java
@@ -27,9 +27,11 @@
  * @bug 7160610
  * @summary Unknown Native Code compilation issue.
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-OptimizeFill Test7160610
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-OptimizeFill compiler.c2.Test7160610
  */
 
+package compiler.c2;
+
 public class Test7160610 {
   private static final byte[] BYTE_ARRAY = new byte[7];
   private static int[] anIntArray1190 = new int[32768];
diff --git a/test/compiler/c2/7169782/Test7169782.java b/test/compiler/c2/Test7169782.java
similarity index 89%
rename from test/compiler/c2/7169782/Test7169782.java
rename to test/compiler/c2/Test7169782.java
index 381c4c9..8fbb9c1 100644
--- a/test/compiler/c2/7169782/Test7169782.java
+++ b/test/compiler/c2/Test7169782.java
@@ -27,9 +27,13 @@
  * @bug 7169782
  * @summary C2: SIGSEGV in LShiftLNode::Ideal(PhaseGVN*, bool)
  *
- * @run main/othervm -Xcomp -XX:CompileOnly="Test7169782::<clinit>" Test7169782
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test7169782::<clinit>
+ *      compiler.c2.Test7169782
  */
 
+package compiler.c2;
+
 public class Test7169782 {
     static long var_8;
 
diff --git a/test/compiler/c2/7174363/Test7174363.java b/test/compiler/c2/Test7174363.java
similarity index 89%
rename from test/compiler/c2/7174363/Test7174363.java
rename to test/compiler/c2/Test7174363.java
index 50f784d..77f2ff0 100644
--- a/test/compiler/c2/7174363/Test7174363.java
+++ b/test/compiler/c2/Test7174363.java
@@ -27,10 +27,12 @@
  * @bug 7174363
  * @summary crash with Arrays.copyOfRange(original, from, to) when from > original.length
  *
- * @run main/othervm -XX:-BackgroundCompilation Test7174363
+ * @run main/othervm -XX:-BackgroundCompilation compiler.c2.Test7174363
  */
 
-import java.util.*;
+package compiler.c2;
+
+import java.util.Arrays;
 
 public class Test7174363 {
 
@@ -43,7 +45,8 @@
     for (int i = 0; i < 20000; i++) {
       try {
         m(orig, 15, 20);
-      } catch(ArrayIndexOutOfBoundsException excp) {}
+      } catch (ArrayIndexOutOfBoundsException excp) {
+      }
     }
   }
 }
diff --git a/test/compiler/c2/7177917/Test7177917.java b/test/compiler/c2/Test7177917.java
similarity index 94%
rename from test/compiler/c2/7177917/Test7177917.java
rename to test/compiler/c2/Test7177917.java
index 0713b27..6fe88a3 100644
--- a/test/compiler/c2/7177917/Test7177917.java
+++ b/test/compiler/c2/Test7177917.java
@@ -22,11 +22,20 @@
  *
  */
 
-/*
- * Micro-benchmark for Math.pow() and Math.exp()
+/**
+ * @test
+ * @bug 7177917
+ * @summary Micro-benchmark for Math.pow() and Math.exp()
+ * @modules java.base/jdk.internal.misc
+ * @library /testlibrary
+ *
+ * @run main compiler.c2.Test7177917
  */
 
+package compiler.c2;
+
 import jdk.test.lib.Utils;
+
 import java.util.Random;
 
 public class Test7177917 {
diff --git a/test/compiler/c2/7179138/Test7179138_1.java b/test/compiler/c2/Test7179138_1.java
similarity index 96%
rename from test/compiler/c2/7179138/Test7179138_1.java
rename to test/compiler/c2/Test7179138_1.java
index afa8307..6cdbed4 100644
--- a/test/compiler/c2/7179138/Test7179138_1.java
+++ b/test/compiler/c2/Test7179138_1.java
@@ -25,11 +25,15 @@
  * @test
  * @bug 7179138
  * @summary Incorrect result with String concatenation optimization
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation Test7179138_1
+ *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *      compiler.c2.Test7179138_1
  *
  * @author Skip Balk
  */
 
+package compiler.c2;
+
 public class Test7179138_1 {
     public static void main(String[] args) throws Exception {
         System.out.println("Java Version: " + System.getProperty("java.vm.version"));
diff --git a/test/compiler/c2/7179138/Test7179138_2.java b/test/compiler/c2/Test7179138_2.java
similarity index 96%
rename from test/compiler/c2/7179138/Test7179138_2.java
rename to test/compiler/c2/Test7179138_2.java
index 615c614..4e89f6a 100644
--- a/test/compiler/c2/7179138/Test7179138_2.java
+++ b/test/compiler/c2/Test7179138_2.java
@@ -25,11 +25,15 @@
  * @test
  * @bug 7179138
  * @summary Incorrect result with String concatenation optimization
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation Test7179138_2
+ *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *      compiler.c2.Test7179138_2
  *
  * @author Skip Balk
  */
 
+package compiler.c2;
+
 public class Test7179138_2 {
     public static void main(String[] args) throws Exception {
         System.out.println("Java Version: " + System.getProperty("java.vm.version"));
diff --git a/test/compiler/c2/Test7190310.java b/test/compiler/c2/Test7190310.java
new file mode 100644
index 0000000..3e388e8
--- /dev/null
+++ b/test/compiler/c2/Test7190310.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2012, 2013, 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 7190310
+ * @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops
+ *
+ * @run main/othervm/timeout=600 -Xbatch compiler.c2.Test7190310
+ */
+
+/*
+ * Note bug exhibits as infinite loop, timeout is helpful.
+ * It should normally finish pretty quickly, but on some especially slow machines
+ * it may not.  The companion _unsafe test lacks a timeout, but that is okay.
+ */
+package compiler.c2;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+
+public class Test7190310 {
+    private static Object str = new Object() {
+        public String toString() {
+            return "The Object";
+        }
+
+        protected void finalize() throws Throwable {
+            System.out.println("The Object is being finalized");
+            super.finalize();
+        }
+    };
+    private final static ReferenceQueue<Object> rq =
+            new ReferenceQueue<Object>();
+    private final static WeakReference<Object> wr =
+            new WeakReference<Object>(str, rq);
+
+    public static void main(String[] args)
+            throws InterruptedException {
+        Thread reader = new Thread() {
+            public void run() {
+                while (wr.get() != null) {
+                }
+                System.out.println("wr.get() returned null");
+            }
+        };
+
+        Thread queueReader = new Thread() {
+            public void run() {
+                try {
+                    Reference<? extends Object> ref = rq.remove();
+                    System.out.println(ref);
+                    System.out.println("queueReader returned, ref==wr is "
+                            + (ref == wr));
+                } catch (InterruptedException e) {
+                    System.err.println("Sleep interrupted - exiting");
+                }
+            }
+        };
+
+        reader.start();
+        queueReader.start();
+
+        Thread.sleep(1000);
+        str = null;
+        System.gc();
+    }
+}
+
diff --git a/test/compiler/c2/Test7190310_unsafe.java b/test/compiler/c2/Test7190310_unsafe.java
new file mode 100644
index 0000000..deaefb7
--- /dev/null
+++ b/test/compiler/c2/Test7190310_unsafe.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2012, 2015, 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 7190310
+ * @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops
+ * @modules java.base/jdk.internal.misc
+ *
+ * @run main/othervm -Xbatch compiler.c2.Test7190310_unsafe
+ */
+
+package compiler.c2;
+
+import jdk.internal.misc.Unsafe;
+
+import java.lang.ref.Reference;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
+
+public class Test7190310_unsafe {
+
+    static class TestObject {
+        public String toString() {
+            return "TestObject";
+        }
+    }
+
+    ;
+
+    private static TestObject str = new TestObject();
+    private static final WeakReference ref = new WeakReference(str);
+
+    private TestObject obj;
+
+    public static void main(String[] args) throws Exception {
+        Class c = Test7190310_unsafe.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe");
+        Field f = c.getDeclaredField("theUnsafe");
+        f.setAccessible(true);
+        Unsafe unsafe = (Unsafe) f.get(c);
+
+        f = Reference.class.getDeclaredField("referent");
+        f.setAccessible(true);
+        long referent_offset = unsafe.objectFieldOffset(f);
+
+        Test7190310_unsafe t = new Test7190310_unsafe();
+        TestObject o = new TestObject();
+        t.obj = o;
+
+        // Warmup (compile methods)
+        System.err.println("Warmup");
+        Object obj = null;
+        for (int i = 0; i < 11000; i++) {
+            obj = getRef0(ref);
+        }
+        for (int i = 0; i < 11000; i++) {
+            obj = getRef1(unsafe, ref, referent_offset);
+        }
+        for (int i = 0; i < 11000; i++) {
+            obj = getRef2(unsafe, ref, referent_offset);
+        }
+        for (int i = 0; i < 11000; i++) {
+            obj = getRef3(unsafe, ref, referent_offset);
+        }
+        for (int i = 0; i < 11000; i++) {
+            obj = getRef4(unsafe, t, referent_offset);
+        }
+
+        // Access verification
+        System.err.println("Verification");
+        if (!verifyGet(referent_offset, unsafe)) {
+            System.exit(97);
+        }
+
+        obj = getRef3(unsafe, t, referent_offset);
+        if (obj != o) {
+            System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + o);
+            System.exit(97);
+        }
+        obj = getRef4(unsafe, t, referent_offset);
+        if (obj != o) {
+            System.out.println("FAILED: unsafe.getObject(Test7190310, " + referent_offset + ") " + obj + " != " + o);
+            System.exit(97);
+        }
+    }
+
+    static boolean verifyGet(long referent_offset, Unsafe unsafe) throws Exception {
+        // Access verification
+        System.out.println("referent: " + str);
+        Object obj = getRef0(ref);
+        if (obj != str) {
+            System.out.println("FAILED: weakRef.get() " + obj + " != " + str);
+            return false;
+        }
+        obj = getRef1(unsafe, ref, referent_offset);
+        if (obj != str) {
+            System.out.println("FAILED: unsafe.getObject(weakRef, " + referent_offset + ") " + obj + " != " + str);
+            return false;
+        }
+        obj = getRef2(unsafe, ref, referent_offset);
+        if (obj != str) {
+            System.out.println("FAILED: unsafe.getObject(abstRef, " + referent_offset + ") " + obj + " != " + str);
+            return false;
+        }
+        obj = getRef3(unsafe, ref, referent_offset);
+        if (obj != str) {
+            System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + str);
+            return false;
+        }
+        return true;
+    }
+
+    static Object getRef0(WeakReference ref) throws Exception {
+        return ref.get();
+    }
+
+    static Object getRef1(Unsafe unsafe, WeakReference ref, long referent_offset) throws Exception {
+        return unsafe.getObject(ref, referent_offset);
+    }
+
+    static Object getRef2(Unsafe unsafe, Reference ref, long referent_offset) throws Exception {
+        return unsafe.getObject(ref, referent_offset);
+    }
+
+    static Object getRef3(Unsafe unsafe, Object ref, long referent_offset) throws Exception {
+        return unsafe.getObject(ref, referent_offset);
+    }
+
+    static Object getRef4(Unsafe unsafe, Test7190310_unsafe ref, long referent_offset) throws Exception {
+        return unsafe.getObject(ref, referent_offset);
+    }
+}
+
diff --git a/test/compiler/c2/7199742/Test7199742.java b/test/compiler/c2/Test7199742.java
similarity index 67%
rename from test/compiler/c2/7199742/Test7199742.java
rename to test/compiler/c2/Test7199742.java
index 7f29e96..a0ce4b0 100644
--- a/test/compiler/c2/7199742/Test7199742.java
+++ b/test/compiler/c2/Test7199742.java
@@ -27,28 +27,32 @@
  * @bug 7199742
  * @summary A lot of C2 OSR compilations of the same method's bci
  *
- * @run main/othervm -Xmx32m -Xbatch Test7199742
+ * @run main/othervm -Xmx32m -Xbatch compiler.c2.Test7199742
  */
 
+package compiler.c2;
+
 public class Test7199742 {
-  private static final int ITERS  = 10000000;
-  public static void main(String args[]) {
-    Test7199742 t = new Test7199742();
-    for (int i=0; i<10; i++) {
-      test(t, 7);
+    private static final int ITERS = 10000000;
+
+    public static void main(String args[]) {
+        Test7199742 t = new Test7199742();
+        for (int i = 0; i < 10; i++) {
+            test(t, 7);
+        }
     }
-  }
-  static Test7199742 test(Test7199742 t, int m) {
-    int i = -(ITERS/2);
-    if (i == 0) return null;
-    Test7199742 v = null;
-    while(i < ITERS) {
-      if ((i&m) == 0) {
-        v = t;
-      }
-      i++;
+
+    static Test7199742 test(Test7199742 t, int m) {
+        int i = -(ITERS / 2);
+        if (i == 0) return null;
+        Test7199742 v = null;
+        while (i < ITERS) {
+            if ((i & m) == 0) {
+                v = t;
+            }
+            i++;
+        }
+        return v;
     }
-    return v;
-  }
 }
 
diff --git a/test/compiler/c2/8000805/Test8000805.java b/test/compiler/c2/Test8000805.java
similarity index 62%
rename from test/compiler/c2/8000805/Test8000805.java
rename to test/compiler/c2/Test8000805.java
index 0776f92..8fee089 100644
--- a/test/compiler/c2/8000805/Test8000805.java
+++ b/test/compiler/c2/Test8000805.java
@@ -26,31 +26,35 @@
  * @bug 8000805
  * @summary JMM issue: short loads are non-atomic
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Xcomp -XX:+PrintCompilation -XX:CompileOnly=Test8000805.loadS2LmaskFF,Test8000805.loadS2Lmask16,Test8000805.loadS2Lmask13,Test8000805.loadUS_signExt,Test8000805.loadB2L_mask8 Test8000805
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Xcomp
+ *      -XX:+PrintCompilation
+ *      -XX:CompileCommand=compileonly,compiler.c2.Test8000805::load*
+ *      compiler.c2.Test8000805
  */
 
+package compiler.c2;
 public class Test8000805 {
-    static long loadS2LmaskFF   (short[] sa) { return sa[0] & 0xFF; }
-    static long loadS2LmaskFF_1 (short[] sa) { return sa[0] & 0xFF; }
+    static long  loadS2LmaskFF (short[] sa) { return sa[0] & 0xFF; }
+    static long _loadS2LmaskFF (short[] sa) { return sa[0] & 0xFF; }
 
-    static long loadS2Lmask16   (short[] sa) { return sa[0] & 0xFFFE; }
-    static long loadS2Lmask16_1 (short[] sa) { return sa[0] & 0xFFFE; }
+    static long  loadS2Lmask16 (short[] sa) { return sa[0] & 0xFFFE; }
+    static long _loadS2Lmask16 (short[] sa) { return sa[0] & 0xFFFE; }
 
-    static long loadS2Lmask13   (short[] sa) { return sa[0] & 0x0FFF; }
-    static long loadS2Lmask13_1 (short[] sa) { return sa[0] & 0x0FFF; }
+    static long  loadS2Lmask13 (short[] sa) { return sa[0] & 0x0FFF; }
+    static long _loadS2Lmask13 (short[] sa) { return sa[0] & 0x0FFF; }
 
-    static int loadUS_signExt   (char[] ca) { return (ca[0] << 16) >> 16; }
-    static int loadUS_signExt_1 (char[] ca) { return (ca[0] << 16) >> 16; }
+    static int  loadUS_signExt (char[] ca) { return (ca[0] << 16) >> 16; }
+    static int _loadUS_signExt (char[] ca) { return (ca[0] << 16) >> 16; }
 
-    static long loadB2L_mask8   (byte[] ba) { return ba[0] & 0x55; }
-    static long loadB2L_mask8_1 (byte[] ba) { return ba[0] & 0x55; }
+    static long  loadB2L_mask8 (byte[] ba) { return ba[0] & 0x55; }
+    static long _loadB2L_mask8 (byte[] ba) { return ba[0] & 0x55; }
 
     public static void main(String[] args) {
         for (int i = Byte.MIN_VALUE; i < Byte.MAX_VALUE; i++) {
             byte[] ba = new byte[]  { (byte) i};
 
-            { long v1 = loadB2L_mask8(ba);
-              long v2 = loadB2L_mask8_1(ba);
+            { long v1 =  loadB2L_mask8(ba);
+              long v2 = _loadB2L_mask8(ba);
               if (v1 != v2)
               throw new InternalError(String.format("loadB2L_mask8 failed: %x != %x", v1, v2)); }
         }
@@ -59,23 +63,23 @@
             short[] sa = new short[] { (short)i };
             char[] ca = new char[] { (char)i };
 
-            { long v1 = loadS2LmaskFF(sa);
-              long v2 = loadS2LmaskFF_1(sa);
+            { long v1 =  loadS2LmaskFF(sa);
+              long v2 = _loadS2LmaskFF(sa);
               if (v1 != v2)
               throw new InternalError(String.format("loadS2LmaskFF failed: %x != %x", v1, v2)); }
 
-            { long v1 = loadS2Lmask16(sa);
-              long v2 = loadS2Lmask16_1(sa);
+            { long v1 =  loadS2Lmask16(sa);
+              long v2 = _loadS2Lmask16(sa);
               if (v1 != v2)
               throw new InternalError(String.format("loadS2Lmask16 failed: %x != %x", v1, v2)); }
 
-            { long v1 = loadS2Lmask13(sa);
-              long v2 = loadS2Lmask13_1(sa);
+            { long v1 =  loadS2Lmask13(sa);
+              long v2 = _loadS2Lmask13(sa);
               if (v1 != v2)
               throw new InternalError(String.format("loadS2Lmask13 failed: %x != %x", v1, v2)); }
 
-            { int v1 = loadUS_signExt(ca);
-              int v2 = loadUS_signExt_1(ca);
+            { int v1 =  loadUS_signExt(ca);
+              int v2 = _loadUS_signExt(ca);
               if (v1 != v2)
                 throw new InternalError(String.format("loadUS_signExt failed: %x != %x", v1, v2)); }
         }
diff --git a/test/compiler/c2/Test8002069.java b/test/compiler/c2/Test8002069.java
new file mode 100644
index 0000000..5f19f56
--- /dev/null
+++ b/test/compiler/c2/Test8002069.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2012, 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 8002069
+ * @summary Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
+ *
+ * @run main/othervm -Xmx32m -XX:+IgnoreUnrecognizedVMOptions -Xbatch
+ *      -XX:CompileCommand=exclude,compiler.c2.Test8002069::dummy
+ *      compiler.c2.Test8002069
+ */
+
+package compiler.c2;
+
+public class Test8002069 {
+    static abstract class O {
+        int f;
+
+        public O() {
+            f = 5;
+        }
+
+        abstract void put(int i);
+
+        public int foo(int i) {
+            put(i);
+            return i;
+        }
+    }
+
+    static class A extends O {
+        int[] a;
+
+        public A(int s) {
+            a = new int[s];
+        }
+
+        public void put(int i) {
+            a[i % a.length] = i;
+        }
+    }
+
+    static class B extends O {
+        int sz;
+        int[] a;
+
+        public B(int s) {
+            sz = s;
+            a = new int[s];
+        }
+
+        public void put(int i) {
+            a[i % sz] = i;
+        }
+    }
+
+    public static void main(String args[]) {
+        int sum = 0;
+        for (int i = 0; i < 8000; i++) {
+            sum += test1(i);
+        }
+        for (int i = 0; i < 100000; i++) {
+            sum += test2(i);
+        }
+        System.out.println("PASSED. sum = " + sum);
+    }
+
+    private O o;
+
+    private int foo(int i) {
+        return o.foo(i);
+    }
+
+    static int test1(int i) {
+        Test8002069 t = new Test8002069();
+        t.o = new A(5);
+        return t.foo(i);
+    }
+
+    static int test2(int i) {
+        Test8002069 t = new Test8002069();
+        t.o = new B(5);
+        dummy(i);
+        return t.foo(i);
+    }
+
+    static int dummy(int i) {
+        return i * 2;
+    }
+}
+
diff --git a/test/compiler/c2/8004741/Test8004741.java b/test/compiler/c2/Test8004741.java
similarity index 93%
rename from test/compiler/c2/8004741/Test8004741.java
rename to test/compiler/c2/Test8004741.java
index 7e64ff1..f52a68e 100644
--- a/test/compiler/c2/8004741/Test8004741.java
+++ b/test/compiler/c2/Test8004741.java
@@ -25,11 +25,17 @@
  * @test Test8004741.java
  * @bug 8004741
  * @summary Missing compiled exception handle table entry for multidimensional array allocation
- * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 Test8004741
- * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers Test8004741
+ *
+ * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *    -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers
+ *    -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100
+ *    compiler.c2.Test8004741
+ * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *    -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers
+ *    compiler.c2.Test8004741
  */
 
-import java.util.*;
+package compiler.c2;
 
 public class Test8004741 extends Thread {
 
diff --git a/test/compiler/c2/8007294/Test8007294.java b/test/compiler/c2/Test8007294.java
similarity index 95%
rename from test/compiler/c2/8007294/Test8007294.java
rename to test/compiler/c2/Test8007294.java
index a335ba7..4f5295c 100644
--- a/test/compiler/c2/8007294/Test8007294.java
+++ b/test/compiler/c2/Test8007294.java
@@ -26,10 +26,14 @@
  * @bug 8007294
  * @bug 8146999
  * @summary ReduceFieldZeroing doesn't check for dependent load and can lead to incorrect execution
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8007294
  *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
+ *      -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      compiler.c2.Test8007294
  */
 
+package compiler.c2;
+
 public class Test8007294 {
 
     int i1;
diff --git a/test/compiler/c2/8007722/Test8007722.java b/test/compiler/c2/Test8007722.java
similarity index 93%
rename from test/compiler/c2/8007722/Test8007722.java
rename to test/compiler/c2/Test8007722.java
index 2e197a4..d01b91b 100644
--- a/test/compiler/c2/8007722/Test8007722.java
+++ b/test/compiler/c2/Test8007722.java
@@ -25,11 +25,14 @@
  * @test
  * @bug 8007722
  * @summary GetAndSetP's MachNode should capture bottom type
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8007722
  *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      compiler.c2.Test8007722
  */
 
-import java.util.concurrent.atomic.*;
+package compiler.c2;
+
+import java.util.concurrent.atomic.AtomicReference;
 
 public class Test8007722 {
 
diff --git a/test/compiler/c2/6946040/TestCharShortByteSwap.java b/test/compiler/c2/TestCharShortByteSwap.java
similarity index 91%
rename from test/compiler/c2/6946040/TestCharShortByteSwap.java
rename to test/compiler/c2/TestCharShortByteSwap.java
index cddbbd3..280bbf5 100644
--- a/test/compiler/c2/6946040/TestCharShortByteSwap.java
+++ b/test/compiler/c2/TestCharShortByteSwap.java
@@ -26,9 +26,15 @@
  * @test
  * @bug 6946040
  * @summary Tests Character/Short.reverseBytes and their intrinsics implementation in the server compiler
- * @run main/othervm -Xbatch -XX:CompileOnly=.testChar,.testShort TestCharShortByteSwap
+ *
+ * @run main/othervm -Xbatch
+ *      -XX:CompileCommand=compileonly,compiler.c2.TestCharShortByteSwap::testChar
+ *      -XX:CompileCommand=compileonly,compiler.c2.TestCharShortByteSwap::testShort
+ *      compiler.c2.TestCharShortByteSwap
  */
 
+package compiler.c2;
+
 // This test must run without any command line arguments.
 
 public class TestCharShortByteSwap {
diff --git a/test/compiler/c2/TestDominatingDeadCheckCast.java b/test/compiler/c2/TestDominatingDeadCheckCast.java
index 3c8f153..9b2e724 100644
--- a/test/compiler/c2/TestDominatingDeadCheckCast.java
+++ b/test/compiler/c2/TestDominatingDeadCheckCast.java
@@ -26,10 +26,15 @@
  * @test
  * @bug 8149797
  * @summary node replaced by dominating dead cast during parsing
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:TypeProfileLevel=200 -XX:CompileCommand=dontinline,TestDominatingDeadCheckCast::not_inlined TestDominatingDeadCheckCast
  *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      -XX:TypeProfileLevel=200
+ *      -XX:CompileCommand=dontinline,compiler.c2.TestDominatingDeadCheckCast::not_inlined
+ *      compiler.c2.TestDominatingDeadCheckCast
  */
 
+package compiler.c2;
+
 public class TestDominatingDeadCheckCast {
 
     static class A {
diff --git a/test/compiler/c2/6921969/TestMultiplyLongHiZero.java b/test/compiler/c2/TestMultiplyLongHiZero.java
similarity index 88%
rename from test/compiler/c2/6921969/TestMultiplyLongHiZero.java
rename to test/compiler/c2/TestMultiplyLongHiZero.java
index 3c295e0..0725889 100644
--- a/test/compiler/c2/6921969/TestMultiplyLongHiZero.java
+++ b/test/compiler/c2/TestMultiplyLongHiZero.java
@@ -26,11 +26,20 @@
  * @test
  * @bug 6921969
  * @summary Tests shorter long multiply sequences when the high 32 bits of long operands are known to be zero on x86_32
- * @run main/othervm -Xbatch -XX:-Inline -XX:CompileOnly=.testNormal,.testLeftOptimized,.testRightOptimized,.testOptimized,.testLeftOptimized_LoadUI2L,.testRightOptimized_LoadUI2L,.testOptimized_LoadUI2L TestMultiplyLongHiZero
+ * @run main/othervm -Xbatch -XX:-Inline
+ *    -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testNormal
+ *    -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testLeftOptimized
+ *    -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testRightOptimized
+ *    -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testOptimized
+ *    -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testLeftOptimized_LoadUI2L
+ *    -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testRightOptimized_LoadUI2L
+ *    -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testOptimized_LoadUI2L
+ *    compiler.c2.TestMultiplyLongHiZero
  */
 
-// This test must run without any command line arguments.
+package compiler.c2;
 
+// This test must run without any command line arguments.
 public class TestMultiplyLongHiZero {
 
   private static void check(long leftFactor, long rightFactor, long optimizedProduct, long constantProduct) {
diff --git a/test/compiler/c2/6340864/TestByteVect.java b/test/compiler/c2/cr6340864/TestByteVect.java
similarity index 99%
rename from test/compiler/c2/6340864/TestByteVect.java
rename to test/compiler/c2/cr6340864/TestByteVect.java
index 5db3687..b104530 100644
--- a/test/compiler/c2/6340864/TestByteVect.java
+++ b/test/compiler/c2/cr6340864/TestByteVect.java
@@ -27,9 +27,11 @@
  * @bug 6340864
  * @summary Implement vectorization optimizations in hotspot-server
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestByteVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestByteVect
  */
 
+package compiler.c2.cr6340864;
+
 public class TestByteVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/6340864/TestDoubleVect.java b/test/compiler/c2/cr6340864/TestDoubleVect.java
similarity index 99%
rename from test/compiler/c2/6340864/TestDoubleVect.java
rename to test/compiler/c2/cr6340864/TestDoubleVect.java
index db0f460..adf1439 100644
--- a/test/compiler/c2/6340864/TestDoubleVect.java
+++ b/test/compiler/c2/cr6340864/TestDoubleVect.java
@@ -27,9 +27,11 @@
  * @bug 6340864
  * @summary Implement vectorization optimizations in hotspot-server
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestDoubleVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestDoubleVect
  */
 
+package compiler.c2.cr6340864;
+
 public class TestDoubleVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/6340864/TestFloatVect.java b/test/compiler/c2/cr6340864/TestFloatVect.java
similarity index 99%
rename from test/compiler/c2/6340864/TestFloatVect.java
rename to test/compiler/c2/cr6340864/TestFloatVect.java
index 63f517c..9940a32 100644
--- a/test/compiler/c2/6340864/TestFloatVect.java
+++ b/test/compiler/c2/cr6340864/TestFloatVect.java
@@ -27,9 +27,11 @@
  * @bug 6340864
  * @summary Implement vectorization optimizations in hotspot-server
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestFloatVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestFloatVect
  */
 
+package compiler.c2.cr6340864;
+
 public class TestFloatVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/6340864/TestIntVect.java b/test/compiler/c2/cr6340864/TestIntVect.java
similarity index 99%
rename from test/compiler/c2/6340864/TestIntVect.java
rename to test/compiler/c2/cr6340864/TestIntVect.java
index 5866b34..9f05bca 100644
--- a/test/compiler/c2/6340864/TestIntVect.java
+++ b/test/compiler/c2/cr6340864/TestIntVect.java
@@ -27,9 +27,11 @@
  * @bug 6340864
  * @summary Implement vectorization optimizations in hotspot-server
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestIntVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestIntVect
  */
 
+package compiler.c2.cr6340864;
+
 public class TestIntVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/6340864/TestLongVect.java b/test/compiler/c2/cr6340864/TestLongVect.java
similarity index 99%
rename from test/compiler/c2/6340864/TestLongVect.java
rename to test/compiler/c2/cr6340864/TestLongVect.java
index 436a847..670576e 100644
--- a/test/compiler/c2/6340864/TestLongVect.java
+++ b/test/compiler/c2/cr6340864/TestLongVect.java
@@ -27,9 +27,11 @@
  * @bug 6340864
  * @summary Implement vectorization optimizations in hotspot-server
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestLongVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestLongVect
  */
 
+package compiler.c2.cr6340864;
+
 public class TestLongVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/6340864/TestShortVect.java b/test/compiler/c2/cr6340864/TestShortVect.java
similarity index 99%
rename from test/compiler/c2/6340864/TestShortVect.java
rename to test/compiler/c2/cr6340864/TestShortVect.java
index 9f59c8f..a5c0d4b 100644
--- a/test/compiler/c2/6340864/TestShortVect.java
+++ b/test/compiler/c2/cr6340864/TestShortVect.java
@@ -27,9 +27,11 @@
  * @bug 6340864
  * @summary Implement vectorization optimizations in hotspot-server
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestShortVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestShortVect
  */
 
+package compiler.c2.cr6340864;
+
 public class TestShortVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/6589834/InlinedArrayCloneTestCase.java b/test/compiler/c2/cr6589834/InlinedArrayCloneTestCase.java
similarity index 98%
rename from test/compiler/c2/6589834/InlinedArrayCloneTestCase.java
rename to test/compiler/c2/cr6589834/InlinedArrayCloneTestCase.java
index aadc105..9f23bdd 100644
--- a/test/compiler/c2/6589834/InlinedArrayCloneTestCase.java
+++ b/test/compiler/c2/cr6589834/InlinedArrayCloneTestCase.java
@@ -21,6 +21,8 @@
  * questions.
  */
 
+package compiler.c2.cr6589834;
+
 public class InlinedArrayCloneTestCase implements Runnable {
     private Test_ia32 executionController;
 
diff --git a/test/compiler/c2/6589834/Test_ia32.java b/test/compiler/c2/cr6589834/Test_ia32.java
similarity index 83%
rename from test/compiler/c2/6589834/Test_ia32.java
rename to test/compiler/c2/cr6589834/Test_ia32.java
index a9d11c6..c6cf651 100644
--- a/test/compiler/c2/6589834/Test_ia32.java
+++ b/test/compiler/c2/cr6589834/Test_ia32.java
@@ -26,27 +26,32 @@
  * @bug 6589834
  * @summary Safepoint placed between stack pointer increment and decrement leads
  *          to interpreter's stack corruption after deoptimization.
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
  *          jdk.jvmstat/sun.jvmstat.monitor
+ *
  * @build ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.*
- *        Test_ia32 InlinedArrayCloneTestCase
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *        compiler.c2.cr6589834.Test_ia32
+ *        compiler.c2.cr6589834.InlinedArrayCloneTestCase
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *      -XX:+WhiteBoxAPI -XX:CompileOnly=InlinedArrayCloneTestCase
- *      -XX:CompileCommand=dontinline,InlinedArrayCloneTestCase.invokeArrayClone
- *      -XX:CompileCommand=inline,InlinedArrayCloneTestCase.verifyArguments
- *      -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack Test_ia32
+ *      -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack
+ *      -XX:CompileCommand=compileonly,compiler.c2.cr6589834.InlinedArrayCloneTestCase::*
+ *      -XX:CompileCommand=dontinline,compiler.c2.cr6589834.InlinedArrayCloneTestCase::invokeArrayClone
+ *      -XX:CompileCommand=inline,compiler.c2.cr6589834.InlinedArrayCloneTestCase::verifyArguments
+ *      compiler.c2.cr6589834.Test_ia32
  */
 
-import java.lang.reflect.Method;
+package compiler.c2.cr6589834;
 
 import jdk.test.lib.Asserts;
 import sun.hotspot.WhiteBox;
 
+import java.lang.reflect.Method;
+
 public class Test_ia32 {
     private static final int NUM_THREADS
             = Math.min(100, 2 * Runtime.getRuntime().availableProcessors());
@@ -111,7 +116,7 @@
          * dependency.
          */
         try {
-            Class.forName("NotLoadedClass");
+            Class.forName(Test_ia32.class.getPackage().getName() + ".NotLoadedClass");
         } catch (ClassNotFoundException e) {
             throw new Error("Unable to load class that invalidates "
                     + "CHA-dependency for method " + method.getName(), e);
diff --git a/test/compiler/c2/6646020/Tester.java b/test/compiler/c2/cr6646020/Tester.java
similarity index 99%
rename from test/compiler/c2/6646020/Tester.java
rename to test/compiler/c2/cr6646020/Tester.java
index b9d5769..76c6f28 100644
--- a/test/compiler/c2/6646020/Tester.java
+++ b/test/compiler/c2/cr6646020/Tester.java
@@ -25,8 +25,12 @@
  * @test
  * @bug 6646020
  * @summary assert(in_bb(n),"must be in block") in -Xcomp mode
+ *
+ * @run main compiler.c2.cr6646020.Tester
  */
 
+package compiler.c2.cr6646020;
+
 /* Complexity upper bound: 3361 ops */
 
 class Tester_Class_0 {
diff --git a/test/compiler/c2/6663848/Tester.java b/test/compiler/c2/cr6663848/Tester.java
similarity index 99%
rename from test/compiler/c2/6663848/Tester.java
rename to test/compiler/c2/cr6663848/Tester.java
index 972e6c6..5d1a9e1 100644
--- a/test/compiler/c2/6663848/Tester.java
+++ b/test/compiler/c2/cr6663848/Tester.java
@@ -25,8 +25,11 @@
  * @test
  * @bug 6663848
  * @summary assert(i < Max(),"oob")
+ *
+ * @run main compiler.c2.cr6663848.Tester
  */
 
+package compiler.c2.cr6663848;
 /* Complexity upper bound: 296055 ops */
 
 final class Tester_Class_0 {
diff --git a/test/compiler/c2/6663854/Test6663854.java b/test/compiler/c2/cr6663854/Test6663854.java
similarity index 99%
rename from test/compiler/c2/6663854/Test6663854.java
rename to test/compiler/c2/cr6663854/Test6663854.java
index 9cbdbed..26aad09 100644
--- a/test/compiler/c2/6663854/Test6663854.java
+++ b/test/compiler/c2/cr6663854/Test6663854.java
@@ -27,9 +27,10 @@
  * @bug 6663854
  * @summary assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp
  *
- * @run main/othervm -Xcomp Test6663854
+ * @run main/othervm -Xcomp compiler.c2.cr6663854.Test6663854
  */
 
+package compiler.c2.cr6663854;
 // This is a randomly generated test that exposed a crash so don't try
 // to make sense of what's it's doing.  The output produced is likely
 // to be stable but it is not being checked as part of this test.
diff --git a/test/compiler/c2/6711117/Test.java b/test/compiler/c2/cr6711117/Test.java
similarity index 99%
rename from test/compiler/c2/6711117/Test.java
rename to test/compiler/c2/cr6711117/Test.java
index 0b67f05..b5a2f6d 100644
--- a/test/compiler/c2/6711117/Test.java
+++ b/test/compiler/c2/cr6711117/Test.java
@@ -26,9 +26,14 @@
  * @test
  * @bug 6711117
  * @summary Assertion in 64bit server vm (flat != TypePtr::BOTTOM,"cannot alias-analyze an untyped ptr")
- * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+AggressiveOpts -XX:+UseCompressedOops Test
+ *
+ * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+AggressiveOpts
+ *      -XX:+UseCompressedOops
+ *       compiler.c2.cr6711117.Test
  */
 
+package compiler.c2.cr6711117;
+
 final class Test_Class_0 {
     final static char var_1 = 'E';
     short var_2 = 16213;
diff --git a/test/compiler/c2/6712835/Test6712835.java b/test/compiler/c2/cr6712835/Test6712835.java
similarity index 99%
rename from test/compiler/c2/6712835/Test6712835.java
rename to test/compiler/c2/cr6712835/Test6712835.java
index eee860a..efaeeb7 100644
--- a/test/compiler/c2/6712835/Test6712835.java
+++ b/test/compiler/c2/cr6712835/Test6712835.java
@@ -25,9 +25,12 @@
  * @test
  * @bug 6712835
  * @summary Server compiler fails with assertion (loop_count < K,"infinite loop in PhaseIterGVN::transform")
- * @run main/othervm -Xcomp Test6712835
+ *
+ * @run main/othervm -Xcomp compiler.c2.cr6712835.Test6712835
  */
 
+package compiler.c2.cr6712835;
+
 /* Complexity upper bound: 349851 ops */
 
 abstract class Tester_Class_0 {
diff --git a/test/compiler/c2/6714694/Tester.java b/test/compiler/c2/cr6714694/Tester.java
similarity index 99%
rename from test/compiler/c2/6714694/Tester.java
rename to test/compiler/c2/cr6714694/Tester.java
index 65f2ed2..dd7690f 100644
--- a/test/compiler/c2/6714694/Tester.java
+++ b/test/compiler/c2/cr6714694/Tester.java
@@ -25,9 +25,11 @@
  * @test
  * @bug 6714694
  * @summary assertion in 64bit server vm (store->find_edge(load) != -1,"missing precedence edge") with COOPs
- * @run main/othervm -Xcomp Tester
+ *
+ * @run main/othervm -Xcomp compiler.c2.cr6714694.Tester
  */
 
+package compiler.c2.cr6714694;
 /* Complexity upper bound: 38602 ops */
 
 interface Tester_Interface_0 {
diff --git a/test/compiler/c2/6865031/Test.java b/test/compiler/c2/cr6865031/Test.java
similarity index 98%
rename from test/compiler/c2/6865031/Test.java
rename to test/compiler/c2/cr6865031/Test.java
index 4f9db19..71689ea 100644
--- a/test/compiler/c2/6865031/Test.java
+++ b/test/compiler/c2/cr6865031/Test.java
@@ -26,9 +26,15 @@
  * @test
  * @bug 6865031
  * @summary Application gives bad result (throws bad exception) with compressed oops
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g -XX:-LoopUnswitching -XX:CompileCommand=inline,AbstractMemoryEfficientList.equals Test hello goodbye
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops
+ *      -XX:HeapBaseMinAddress=32g -XX:-LoopUnswitching
+ *      -XX:CompileCommand=inline,compiler.c2.cr6865031.AbstractMemoryEfficientList::equals
+ *      compiler.c2.cr6865031.Test hello goodbye
  */
 
+package compiler.c2.cr6865031;
+
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
diff --git a/test/compiler/c2/5091921/Test6890943.java b/test/compiler/c2/cr6890943/Test6890943.java
similarity index 97%
rename from test/compiler/c2/5091921/Test6890943.java
rename to test/compiler/c2/cr6890943/Test6890943.java
index 9752b1d..605e9ff 100644
--- a/test/compiler/c2/5091921/Test6890943.java
+++ b/test/compiler/c2/cr6890943/Test6890943.java
@@ -27,10 +27,13 @@
  * @bug 6890943
  * @summary JVM mysteriously gives wrong result on 64-bit 1.6 VMs in hotspot mode.
  *
- * @run main/othervm/timeout=240 Test6890943
+ * @run main/othervm/timeout=240 compiler.c2.cr6890943.Test6890943
  */
 
-import java.io.*;
+package compiler.c2.cr6890943;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.HashMap;
diff --git a/test/compiler/c2/5091921/input6890943.txt b/test/compiler/c2/cr6890943/input6890943.txt
similarity index 100%
rename from test/compiler/c2/5091921/input6890943.txt
rename to test/compiler/c2/cr6890943/input6890943.txt
diff --git a/test/compiler/c2/5091921/output6890943.txt b/test/compiler/c2/cr6890943/output6890943.txt
similarity index 100%
rename from test/compiler/c2/5091921/output6890943.txt
rename to test/compiler/c2/cr6890943/output6890943.txt
diff --git a/test/compiler/c2/5091921/Test7005594.java b/test/compiler/c2/cr7005594/Test7005594.java
similarity index 98%
rename from test/compiler/c2/5091921/Test7005594.java
rename to test/compiler/c2/cr7005594/Test7005594.java
index 32e8bae..0dbe827 100644
--- a/test/compiler/c2/5091921/Test7005594.java
+++ b/test/compiler/c2/cr7005594/Test7005594.java
@@ -30,6 +30,8 @@
  * @run shell Test7005594.sh
  */
 
+package compiler.c2.cr7005594;
+
 public class Test7005594 {
 
       static int test(byte a[]){
diff --git a/test/compiler/c2/5091921/Test7005594.sh b/test/compiler/c2/cr7005594/Test7005594.sh
similarity index 93%
rename from test/compiler/c2/5091921/Test7005594.sh
rename to test/compiler/c2/cr7005594/Test7005594.sh
index 6350a08..503d0aa 100644
--- a/test/compiler/c2/5091921/Test7005594.sh
+++ b/test/compiler/c2/cr7005594/Test7005594.sh
@@ -78,7 +78,10 @@
 
 ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7005594.java
 
-${TESTJAVA}/bin/java ${TESTOPTS} -Xmx1600m -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test -XX:CompileCommand=quiet Test7005594 > test.out 2>&1
+${TESTJAVA}/bin/java ${TESTOPTS} -Xmx1600m -Xms1600m -XX:+IgnoreUnrecognizedVMOptions \
+        -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileCommand=quiet \
+        -XX:CompileOnly=compiler.c2.cr7005594.Test7005594::test \
+        compiler.c2.cr7005594.Test7005594 > test.out 2>&1
 
 result=$?
 
diff --git a/test/compiler/c2/7192963/TestByteVect.java b/test/compiler/c2/cr7192963/TestByteVect.java
similarity index 97%
rename from test/compiler/c2/7192963/TestByteVect.java
rename to test/compiler/c2/cr7192963/TestByteVect.java
index fd466ff..208a9aa 100644
--- a/test/compiler/c2/7192963/TestByteVect.java
+++ b/test/compiler/c2/cr7192963/TestByteVect.java
@@ -27,9 +27,11 @@
  * @bug 7192963
  * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new'
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestByteVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestByteVect
  */
 
+package compiler.c2.cr7192963;
+
 public class TestByteVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/7192963/TestDoubleVect.java b/test/compiler/c2/cr7192963/TestDoubleVect.java
similarity index 97%
rename from test/compiler/c2/7192963/TestDoubleVect.java
rename to test/compiler/c2/cr7192963/TestDoubleVect.java
index 872eb42..f969cf7 100644
--- a/test/compiler/c2/7192963/TestDoubleVect.java
+++ b/test/compiler/c2/cr7192963/TestDoubleVect.java
@@ -27,9 +27,11 @@
  * @bug 7192963
  * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new'
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestDoubleVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestDoubleVect
  */
 
+package compiler.c2.cr7192963;
+
 public class TestDoubleVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/7192963/TestFloatVect.java b/test/compiler/c2/cr7192963/TestFloatVect.java
similarity index 97%
rename from test/compiler/c2/7192963/TestFloatVect.java
rename to test/compiler/c2/cr7192963/TestFloatVect.java
index 399e68e..d608def 100644
--- a/test/compiler/c2/7192963/TestFloatVect.java
+++ b/test/compiler/c2/cr7192963/TestFloatVect.java
@@ -27,9 +27,11 @@
  * @bug 7192963
  * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new'
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestFloatVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestFloatVect
  */
 
+package compiler.c2.cr7192963;
+
 public class TestFloatVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/7192963/TestIntVect.java b/test/compiler/c2/cr7192963/TestIntVect.java
similarity index 97%
rename from test/compiler/c2/7192963/TestIntVect.java
rename to test/compiler/c2/cr7192963/TestIntVect.java
index b1bb147..d9f25ab 100644
--- a/test/compiler/c2/7192963/TestIntVect.java
+++ b/test/compiler/c2/cr7192963/TestIntVect.java
@@ -27,9 +27,11 @@
  * @bug 7192963
  * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new'
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestIntVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestIntVect
  */
 
+package compiler.c2.cr7192963;
+
 public class TestIntVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/7192963/TestLongVect.java b/test/compiler/c2/cr7192963/TestLongVect.java
similarity index 97%
rename from test/compiler/c2/7192963/TestLongVect.java
rename to test/compiler/c2/cr7192963/TestLongVect.java
index 7266352..d0f2eba 100644
--- a/test/compiler/c2/7192963/TestLongVect.java
+++ b/test/compiler/c2/cr7192963/TestLongVect.java
@@ -27,9 +27,11 @@
  * @bug 7192963
  * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new'
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestLongVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestLongVect
  */
 
+package compiler.c2.cr7192963;
+
 public class TestLongVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/7192963/TestShortVect.java b/test/compiler/c2/cr7192963/TestShortVect.java
similarity index 97%
rename from test/compiler/c2/7192963/TestShortVect.java
rename to test/compiler/c2/cr7192963/TestShortVect.java
index f83e5ff..ae0dcf3 100644
--- a/test/compiler/c2/7192963/TestShortVect.java
+++ b/test/compiler/c2/cr7192963/TestShortVect.java
@@ -27,9 +27,11 @@
  * @bug 7192963
  * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new'
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestShortVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestShortVect
  */
 
+package compiler.c2.cr7192963;
+
 public class TestShortVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/c2/7200264/Test7200264.sh b/test/compiler/c2/cr7200264/Test7200264.sh
similarity index 95%
rename from test/compiler/c2/7200264/Test7200264.sh
rename to test/compiler/c2/cr7200264/Test7200264.sh
index df2d1ba..7848bff 100644
--- a/test/compiler/c2/7200264/Test7200264.sh
+++ b/test/compiler/c2/cr7200264/Test7200264.sh
@@ -56,7 +56,9 @@
 ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} -d . TestIntVect.java
 
 # CICompilerCount must be at least 2 with -TieredCompilation
-${TESTJAVA}${FS}bin${FS}java ${TESTOPTS} -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=2 -XX:+PrintCompilation -XX:+TraceNewVectors TestIntVect > test.out 2>&1
+${TESTJAVA}${FS}bin${FS}java ${TESTOPTS} -Xbatch -XX:-TieredCompilation  \
+        -XX:CICompilerCount=2 -XX:+PrintCompilation -XX:+TraceNewVectors \
+        compiler.c2.cr7200264.TestIntVect > test.out 2>&1
 
 COUNT=`grep AddVI test.out | wc -l | awk '{print $1}'`
 if [ $COUNT -lt 4 ]
diff --git a/test/compiler/c2/7200264/TestIntVect.java b/test/compiler/c2/cr7200264/TestIntVect.java
similarity index 99%
rename from test/compiler/c2/7200264/TestIntVect.java
rename to test/compiler/c2/cr7200264/TestIntVect.java
index f85d4ff..1a24815 100644
--- a/test/compiler/c2/7200264/TestIntVect.java
+++ b/test/compiler/c2/cr7200264/TestIntVect.java
@@ -30,6 +30,7 @@
  * @run shell Test7200264.sh
  */
 
+package compiler.c2.cr7200264;
 /*
  * Copy of test/compiler/6340864/TestIntVect.java without performance tests.
  */
diff --git a/test/compiler/c2/8004867/TestIntAtomicCAS.java b/test/compiler/c2/cr8004867/TestIntAtomicCAS.java
similarity index 99%
rename from test/compiler/c2/8004867/TestIntAtomicCAS.java
rename to test/compiler/c2/cr8004867/TestIntAtomicCAS.java
index 16d7d97..fa2fafb 100644
--- a/test/compiler/c2/8004867/TestIntAtomicCAS.java
+++ b/test/compiler/c2/cr8004867/TestIntAtomicCAS.java
@@ -27,10 +27,16 @@
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntAtomicCAS
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntAtomicCAS
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:-OptimizeFill
+ *    compiler.c2.cr8004867.TestIntAtomicCAS
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:+OptimizeFill
+ *    compiler.c2.cr8004867.TestIntAtomicCAS
  */
 
+package compiler.c2.cr8004867;
+
 import java.util.concurrent.atomic.AtomicIntegerArray;
 
 public class TestIntAtomicCAS {
diff --git a/test/compiler/c2/8004867/TestIntAtomicOrdered.java b/test/compiler/c2/cr8004867/TestIntAtomicOrdered.java
similarity index 98%
rename from test/compiler/c2/8004867/TestIntAtomicOrdered.java
rename to test/compiler/c2/cr8004867/TestIntAtomicOrdered.java
index 8e81f6c..d7f1151 100644
--- a/test/compiler/c2/8004867/TestIntAtomicOrdered.java
+++ b/test/compiler/c2/cr8004867/TestIntAtomicOrdered.java
@@ -27,10 +27,16 @@
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntAtomicOrdered
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntAtomicOrdered
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:-OptimizeFill
+ *    compiler.c2.cr8004867.TestIntAtomicOrdered
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:+OptimizeFill
+ *    compiler.c2.cr8004867.TestIntAtomicOrdered
  */
 
+package compiler.c2.cr8004867;
+
 import java.util.concurrent.atomic.AtomicIntegerArray;
 
 public class TestIntAtomicOrdered {
diff --git a/test/compiler/c2/8004867/TestIntAtomicVolatile.java b/test/compiler/c2/cr8004867/TestIntAtomicVolatile.java
similarity index 98%
rename from test/compiler/c2/8004867/TestIntAtomicVolatile.java
rename to test/compiler/c2/cr8004867/TestIntAtomicVolatile.java
index ed0563d..6b1a067 100644
--- a/test/compiler/c2/8004867/TestIntAtomicVolatile.java
+++ b/test/compiler/c2/cr8004867/TestIntAtomicVolatile.java
@@ -27,10 +27,16 @@
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntAtomicVolatile
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntAtomicVolatile
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:-OptimizeFill
+ *    compiler.c2.cr8004867.TestIntAtomicVolatile
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:+OptimizeFill
+ *    compiler.c2.cr8004867.TestIntAtomicVolatile
  */
 
+package compiler.c2.cr8004867;
+
 import java.util.concurrent.atomic.AtomicIntegerArray;
 
 public class TestIntAtomicVolatile {
diff --git a/test/compiler/c2/8004867/TestIntUnsafeCAS.java b/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java
similarity index 98%
rename from test/compiler/c2/8004867/TestIntUnsafeCAS.java
rename to test/compiler/c2/cr8004867/TestIntUnsafeCAS.java
index a405f56..4499ed5 100644
--- a/test/compiler/c2/8004867/TestIntUnsafeCAS.java
+++ b/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java
@@ -26,14 +26,21 @@
  * @test
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
- *
  * @modules java.base/jdk.internal.misc
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeCAS
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeCAS
+ *
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:-OptimizeFill
+ *    compiler.c2.cr8004867.TestIntUnsafeCAS
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:+OptimizeFill
+ *    compiler.c2.cr8004867.TestIntUnsafeCAS
  */
 
+package compiler.c2.cr8004867;
+
 import jdk.internal.misc.Unsafe;
-import java.lang.reflect.*;
+
+import java.lang.reflect.Field;
 
 public class TestIntUnsafeCAS {
   private static final int ARRLEN = 97;
diff --git a/test/compiler/c2/8004867/TestIntUnsafeOrdered.java b/test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java
similarity index 98%
rename from test/compiler/c2/8004867/TestIntUnsafeOrdered.java
rename to test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java
index 3fec4bd..3298e1b 100644
--- a/test/compiler/c2/8004867/TestIntUnsafeOrdered.java
+++ b/test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java
@@ -26,13 +26,20 @@
  * @test
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
- *
  * @modules java.base/jdk.internal.misc
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeOrdered
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeOrdered
+ *
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:-OptimizeFill
+ *    compiler.c2.cr8004867.TestIntUnsafeOrdered
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:+OptimizeFill
+ *    compiler.c2.cr8004867.TestIntUnsafeOrdered
  */
 
+package compiler.c2.cr8004867;
+
 import jdk.internal.misc.Unsafe;
+
 import java.lang.reflect.Field;
 
 public class TestIntUnsafeOrdered {
diff --git a/test/compiler/c2/8004867/TestIntUnsafeVolatile.java b/test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java
similarity index 98%
rename from test/compiler/c2/8004867/TestIntUnsafeVolatile.java
rename to test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java
index 6cbab7a..6bcd398 100644
--- a/test/compiler/c2/8004867/TestIntUnsafeVolatile.java
+++ b/test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java
@@ -26,14 +26,21 @@
  * @test
  * @bug 8004867
  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
- *
  * @modules java.base/jdk.internal.misc
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeVolatile
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeVolatile
+ *
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:-OptimizeFill
+ *    compiler.c2.cr8004867.TestIntUnsafeVolatile
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *    -XX:+OptimizeFill
+ *    compiler.c2.cr8004867.TestIntUnsafeVolatile
  */
 
+package compiler.c2.cr8004867;
+
 import jdk.internal.misc.Unsafe;
-import java.lang.reflect.*;
+
+import java.lang.reflect.Field;
 
 public class TestIntUnsafeVolatile {
   private static final int ARRLEN = 97;
diff --git a/test/compiler/c2/7070134/Stemmer.java b/test/compiler/c2/stemmer/Stemmer.java
similarity index 98%
rename from test/compiler/c2/7070134/Stemmer.java
rename to test/compiler/c2/stemmer/Stemmer.java
index b8dbc05..0f8cb29 100644
--- a/test/compiler/c2/7070134/Stemmer.java
+++ b/test/compiler/c2/stemmer/Stemmer.java
@@ -4,8 +4,9 @@
  * @summary Hotspot crashes with sigsegv from PorterStemmer
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
+ *
  * @run driver jdk.test.lib.FileInstaller words words
- * @run main/othervm -Xbatch Stemmer words
+ * @run main/othervm -Xbatch compiler.c2.stemmer.Stemmer words
  */
 
 /*
@@ -53,7 +54,11 @@
 
 */
 
-import java.io.*;
+package compiler.c2.stemmer;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
 
 /**
   * Stemmer, implementing the Porter Stemming Algorithm
diff --git a/test/compiler/c2/7070134/words b/test/compiler/c2/stemmer/words
similarity index 100%
rename from test/compiler/c2/7070134/words
rename to test/compiler/c2/stemmer/words
diff --git a/test/compiler/native/TestDirtyInt.java b/test/compiler/calls/TestDirtyInt.java
similarity index 95%
rename from test/compiler/native/TestDirtyInt.java
rename to test/compiler/calls/TestDirtyInt.java
index 607fd2d..ee89177 100644
--- a/test/compiler/native/TestDirtyInt.java
+++ b/test/compiler/calls/TestDirtyInt.java
@@ -22,8 +22,12 @@
  */
 
 /* @test
- * @run main/native TestDirtyInt
+
+ * @run main/native compiler.calls.TestDirtyInt
  */
+
+package compiler.calls;
+
 public class TestDirtyInt {
     static {
         System.loadLibrary("TestDirtyInt");
diff --git a/test/compiler/calls/common/CallsBase.java b/test/compiler/calls/common/CallsBase.java
index f6a9ad9..44549a3 100644
--- a/test/compiler/calls/common/CallsBase.java
+++ b/test/compiler/calls/common/CallsBase.java
@@ -24,11 +24,12 @@
 package compiler.calls.common;
 
 import compiler.testlibrary.CompilerUtils;
-import java.lang.reflect.Method;
-import java.util.Arrays;
 import jdk.test.lib.Asserts;
 import sun.hotspot.WhiteBox;
 
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
 /**
  * A common class for Invoke* classes
  */
diff --git a/test/compiler/calls/common/InvokeDynamicPatcher.java b/test/compiler/calls/common/InvokeDynamicPatcher.java
index 644f0a2..f38c949 100644
--- a/test/compiler/calls/common/InvokeDynamicPatcher.java
+++ b/test/compiler/calls/common/InvokeDynamicPatcher.java
@@ -23,6 +23,14 @@
 
 package compiler.calls.common;
 
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.lang.invoke.CallSite;
@@ -33,13 +41,6 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.StandardOpenOption;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Handle;
-import jdk.internal.org.objectweb.asm.Label;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
 
 /**
  * A class which patch InvokeDynamic class bytecode with invokydynamic
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java
index 3124d3d..0ba2498 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java
@@ -23,11 +23,13 @@
 
 /*
  * @test
+ * @summary check calls from compiled to compiled using InvokeDynamic
  * @library /test/lib /testlibrary /
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm
+ *
  * @build compiler.calls.common.InvokeDynamic
- * @build compiler.calls.common.InvokeDynamicPatcher
+ *        compiler.calls.common.InvokeDynamicPatcher
  * @run main compiler.calls.common.InvokeDynamicPatcher
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -43,5 +45,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeDynamic
  *    -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from compiled to compiled using InvokeDynamic
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java
index 4916220..98a86b1 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java
@@ -23,9 +23,11 @@
 
 /*
  * @test
+ * @summary check calls from compiled to interpreted using InvokeDynamic
  * @library /test/lib /testlibrary /
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm
+ *
  * @build compiler.calls.common.InvokeDynamic
  * @build compiler.calls.common.InvokeDynamicPatcher
  * @run main compiler.calls.common.InvokeDynamicPatcher
@@ -37,5 +39,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic
  *    -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
- * @summary check calls from compiled to interpreted using InvokeDynamic
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java
index 3721632..397faf2 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java
@@ -23,11 +23,13 @@
 
 /*
  * @test
+ * @summary check calls from compiled to native using InvokeDynamic
  * @library /test/lib /testlibrary /
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm
+ *
  * @build compiler.calls.common.InvokeDynamic
- * @build compiler.calls.common.InvokeDynamicPatcher
+ *        compiler.calls.common.InvokeDynamicPatcher
  * @run main compiler.calls.common.InvokeDynamicPatcher
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -37,5 +39,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeDynamic
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
- * @summary check calls from compiled to native using InvokeDynamic
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java
index 34f86cd..46667c9 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java
@@ -24,7 +24,9 @@
 /*
  * @test
  * @modules java.base/jdk.internal.misc
+ * @summary check calls from compiled to compiled using InvokeInterface
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeInterface
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -40,5 +42,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeInterface
  *    -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from compiled to compiled using InvokeInterface
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java
index fb30210..07fcff1 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to interpreted using InvokeInterface
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeInterface
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface
  *    -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
- * @summary check calls from compiled to interpreted using InvokeInterface
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java
index a930528..e3a6895 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to native using InvokeInterface
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeInterface
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeInterface
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
- * @summary check calls from compiled to native using InvokeInterface
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java
index 39648e7..07e6fc9 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to compiled using InvokeSpecial
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -40,5 +42,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeSpecial
  *    -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from compiled to compiled using InvokeSpecial
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java
index 25cac6b..e08784d 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to interpreted using InvokeSpecial
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial
  *    -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
- * @summary check calls from compiled to interpreted using InvokeSpecial
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java
index e30115a..600301b 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to native using InvokeSpecial
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeSpecial
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
- * @summary check calls from compiled to native using InvokeSpecial
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java
index 8cda5e0..ddd88ab 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to compiled using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -40,5 +42,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeStatic
  *    -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from compiled to compiled using InvokeStatic
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java
index 1d998e0..7ca6263 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to interpreted using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic
  *    -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
- * @summary check calls from compiled to interpreted using InvokeStatic
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java
index a0c8009..560c807 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to native using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeStatic
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
- * @summary check calls from compiled to native using InvokeStatic
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java
index 6ac0e2b..ef408fd 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to compiled using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeVirtual
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -40,5 +42,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeVirtual
  *    -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from compiled to compiled using InvokeVirtual
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java
index 9f03a2c..718aef2 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to interpreted using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeVirtual
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual
  *    -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
- * @summary check calls from compiled to interpreted using InvokeVirtual
  */
diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java
index 93643d6..e161834 100644
--- a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java
+++ b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from compiled to native using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeVirtual
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeVirtual
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
- * @summary check calls from compiled to native using InvokeVirtual
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java
index 17d1512..f83beb4 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java
@@ -23,11 +23,13 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to compiled using InvokeDynamic
  * @library /test/lib /testlibrary /
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm
+ *
  * @build compiler.calls.common.InvokeDynamic
- * @build compiler.calls.common.InvokeDynamicPatcher
+ *        compiler.calls.common.InvokeDynamicPatcher
  * @run main compiler.calls.common.InvokeDynamicPatcher
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -37,5 +39,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -Xbatch compiler.calls.common.InvokeDynamic
  *    -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from interpreted to compiled using InvokeDynamic
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java
index 5988ac6..e4ff099 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java
@@ -23,16 +23,17 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to interpreted using InvokeDynamic
  * @library /test/lib /testlibrary /
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm
+ *
  * @build compiler.calls.common.InvokeDynamic
- * @build compiler.calls.common.InvokeDynamicPatcher
+ *        compiler.calls.common.InvokeDynamicPatcher
  * @run main compiler.calls.common.InvokeDynamicPatcher
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic
  *    -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
- * @summary check calls from interpreted to interpreted using InvokeDynamic
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java
index 7f0015a..3785058 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java
@@ -23,16 +23,17 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to native using InvokeDynamic
  * @library /test/lib /testlibrary /
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm
+ *
  * @build compiler.calls.common.InvokeDynamic
- * @build compiler.calls.common.InvokeDynamicPatcher
+ *        compiler.calls.common.InvokeDynamicPatcher
  * @run main compiler.calls.common.InvokeDynamicPatcher
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller  compiler.calls.common.InvokeDynamic
  *    -checkCallerCompileLevel 0 -nativeCallee
- * @summary check calls from interpreted to native using InvokeDynamic
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java
index ea458db..83024bb 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to compiled using InvokeInterface
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeInterface
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -Xbatch compiler.calls.common.InvokeInterface
  *    -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from interpreted to compiled using InvokeInterface
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java
index ed150e4..2a81110 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to interpreted using InvokeInterface
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeInterface
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface
  *    -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
- * @summary check calls from interpreted to interpreted using InvokeInterface
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java
index 8adc7a6..72c9275 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to native using InvokeInterface
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeInterface
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller  compiler.calls.common.InvokeInterface
  *    -checkCallerCompileLevel 0 -nativeCallee
- * @summary check calls from interpreted to native using InvokeInterface
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java
index 324ad86..a6a3ae4 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to interpreted using InvokeSpecial
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial
  *    -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
- * @summary check calls from interpreted to interpreted using InvokeSpecial
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java
index e34cca0..f52dd62 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to native using InvokeSpecial
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller  compiler.calls.common.InvokeSpecial
  *    -checkCallerCompileLevel 0 -nativeCallee
- * @summary check calls from interpreted to native using InvokeSpecial
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java
index 96501a1..1db1014 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to compiled using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -Xbatch compiler.calls.common.InvokeStatic
  *    -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from interpreted to compiled using InvokeStatic
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java
index 8efd93d..7e39254 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to interpreted using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic
  *    -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
- * @summary check calls from interpreted to interpreted using InvokeStatic
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java
index 0bcbb37..789fe9c 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to native using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller  compiler.calls.common.InvokeStatic
  *    -checkCallerCompileLevel 0 -nativeCallee
- * @summary check calls from interpreted to native using InvokeStatic
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java
index eefe4e6..41e89d3 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to compiled using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeVirtual
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -Xbatch compiler.calls.common.InvokeVirtual
  *    -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from interpreted to compiled using InvokeVirtual
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java
index d44e140..f299f4a 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to interpreted using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeVirtual
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual
  *    -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
- * @summary check calls from interpreted to interpreted using InvokeVirtual
  */
diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java
index 2011993..5a99727 100644
--- a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java
+++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from interpreted to native using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeVirtual
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller  compiler.calls.common.InvokeVirtual
  *    -checkCallerCompileLevel 0 -nativeCallee
- * @summary check calls from interpreted to native using InvokeVirtual
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java b/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java
index 86a0784..b25f7a1 100644
--- a/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from native to compiled using InvokeSpecial
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeSpecial
  *    -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from native to compiled using InvokeSpecial
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java b/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java
index 83520ce..f7c66cf 100644
--- a/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from native to interpreted using InvokeSpecial
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial
  *    -nativeCaller -checkCalleeCompileLevel 0
- * @summary check calls from native to interpreted using InvokeSpecial
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java b/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java
index f9b3ce5..041af4f 100644
--- a/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from native to native using InvokeSpecial
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    compiler.calls.common.InvokeSpecial
  *    -nativeCaller -nativeCallee
- * @summary check calls from native to native using InvokeSpecial
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java b/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java
index 7133571..f7e8f52 100644
--- a/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from native to compiled using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeStatic
  *    -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from native to compiled using InvokeStatic
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java b/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java
index 541b364..ab0e447 100644
--- a/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from native to interpreted using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic
  *    -nativeCaller -checkCalleeCompileLevel 0
- * @summary check calls from native to interpreted using InvokeStatic
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java b/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java
index 34ad481..de0b8c1 100644
--- a/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from native to native using InvokeStatic
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeStatic
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    compiler.calls.common.InvokeStatic
  *    -nativeCaller -nativeCallee
- * @summary check calls from native to native using InvokeStatic
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java b/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java
index 4f86421..4361a8d 100644
--- a/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java
@@ -23,8 +23,10 @@
 
 /*
  * @test
+ * @summary check calls from native to compiled using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeVirtual
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -34,5 +36,4 @@
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeVirtual
  *    -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
- * @summary check calls from native to compiled using InvokeVirtual
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java b/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java
index c0d3b77..fde2465 100644
--- a/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from native to interpreted using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
  * @build compiler.calls.common.InvokeVirtual
+ *
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual
  *    -nativeCaller -checkCalleeCompileLevel 0
- * @summary check calls from native to interpreted using InvokeVirtual
  */
diff --git a/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java b/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java
index b83b933..a075107 100644
--- a/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java
+++ b/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java
@@ -23,13 +23,14 @@
 
 /*
  * @test
+ * @summary check calls from native to native using InvokeVirtual
  * @modules java.base/jdk.internal.misc
  * @library /test/lib /testlibrary /
+ *
  * @build compiler.calls.common.InvokeVirtual
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    compiler.calls.common.InvokeVirtual
  *    -nativeCaller -nativeCallee
- * @summary check calls from native to native using InvokeVirtual
  */
diff --git a/test/compiler/native/libTestDirtyInt.c b/test/compiler/calls/libTestDirtyInt.c
similarity index 92%
rename from test/compiler/native/libTestDirtyInt.c
rename to test/compiler/calls/libTestDirtyInt.c
index b688a36..229df0f 100644
--- a/test/compiler/native/libTestDirtyInt.c
+++ b/test/compiler/calls/libTestDirtyInt.c
@@ -26,7 +26,7 @@
 
 static int array = 0x42;
 
-JNIEXPORT jint JNICALL Java_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v)
+JNIEXPORT jint JNICALL Java_compiler_calls_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v)
 {
   int* ptr = &array + v + 4;
   return *ptr;
diff --git a/test/compiler/ciReplay/TestVM_no_comp_level.sh b/test/compiler/ciReplay/TestVM_no_comp_level.sh
index fd0bd00..85ce38b 100644
--- a/test/compiler/ciReplay/TestVM_no_comp_level.sh
+++ b/test/compiler/ciReplay/TestVM_no_comp_level.sh
@@ -29,7 +29,6 @@
 ## @summary testing of ciReplay with using generated by VM replay.txt w/o comp_level
 ## @author igor.ignatyev@oracle.com
 ## @requires vm.flightRecorder != true
-## @ignore 8157984
 ## @run shell TestVM_no_comp_level.sh
 ##
 
diff --git a/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java b/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java
index 65b3d58..694b6e7 100644
--- a/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java
+++ b/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java
@@ -21,26 +21,28 @@
  * questions.
  */
 
-import sun.hotspot.WhiteBox;
+/*
+ * @test TestAnonymousClassUnloading
+ * @bug 8054402
+ * @summary "Tests unloading of anonymous classes."
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *
+ * @run main/othervm/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *      -XX:-BackgroundCompilation
+ *      compiler.classUnloading.anonymousClass.TestAnonymousClassUnloading
+ */
+
+package compiler.classUnloading.anonymousClass;
+
 import jdk.internal.misc.Unsafe;
+import sun.hotspot.WhiteBox;
 
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.net.URLConnection;
 
-/*
- * @test TestAnonymousClassUnloading
- * @bug 8054402
- * @summary "Tests unloading of anonymous classes."
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- * @compile TestAnonymousClassUnloading.java
- * @run main ClassFileInstaller TestAnonymousClassUnloading
- *                              sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation TestAnonymousClassUnloading
- */
 public class TestAnonymousClassUnloading {
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
     private static final Unsafe UNSAFE = Unsafe.getUnsafe();
@@ -107,7 +109,8 @@
      */
     static public void main(String[] args) throws Exception {
         // (1) Load an anonymous version of this class using the corresponding Unsafe method
-        URL classUrl = TestAnonymousClassUnloading.class.getResource("TestAnonymousClassUnloading.class");
+        URL classUrl = TestAnonymousClassUnloading.class.getResource(
+                TestAnonymousClassUnloading.class.getName().replace('.', '/') + ".class");
         URLConnection connection = classUrl.openConnection();
 
         int length = connection.getContentLength();
diff --git a/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java b/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java
index d141546..d0f022d 100644
--- a/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java
+++ b/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java
@@ -21,26 +21,34 @@
  * questions.
  */
 
+/*
+ * @test MethodUnloadingTest
+ * @bug 8029443
+ * @summary Tests the unloading of methods to to class unloading
+ * @modules java.base/jdk.internal.misc
+ * @library /testlibrary /test/lib /
+ *
+ * @build compiler.classUnloading.methodUnloading.TestMethodUnloading
+ *        compiler.classUnloading.methodUnloading.WorkerClass
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+ *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:-BackgroundCompilation -XX:-UseCompressedOops
+ *                   -XX:CompileCommand=compileonly,compiler.classUnloading.methodUnloading.TestMethodUnloading::doWork
+ *                   compiler.classUnloading.methodUnloading.TestMethodUnloading
+ */
+
+package compiler.classUnloading.methodUnloading;
+
 import sun.hotspot.WhiteBox;
 
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.net.URLClassLoader;
 
-/*
- * @test MethodUnloadingTest
- * @bug 8029443
- * @summary "Tests the unloading of methods to to class unloading"
- * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib
- * @build TestMethodUnloading
- * @build WorkerClass
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation -XX:-UseCompressedOops -XX:CompileOnly=TestMethodUnloading::doWork TestMethodUnloading
- */
 public class TestMethodUnloading {
-    private static final String workerClassName = "WorkerClass";
+    private static final String workerClassName = "compiler.classUnloading.methodUnloading.WorkerClass";
     private static int work = -1;
 
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
diff --git a/test/compiler/classUnloading/methodUnloading/WorkerClass.java b/test/compiler/classUnloading/methodUnloading/WorkerClass.java
index c67154f..4d7c7ac 100644
--- a/test/compiler/classUnloading/methodUnloading/WorkerClass.java
+++ b/test/compiler/classUnloading/methodUnloading/WorkerClass.java
@@ -24,6 +24,9 @@
 /**
  * Worker class that is dynamically loaded/unloaded by TestMethodUnloading.
  */
+
+package compiler.classUnloading.methodUnloading;
+
 public class WorkerClass {
     /**
      * We override hashCode here to be able to access this implementation
diff --git a/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java b/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java
index 0fee258..1c8d70f 100644
--- a/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java
+++ b/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java
@@ -27,29 +27,34 @@
  * @summary Test checks that the order in which ReversedCodeCacheSize and
  *          InitialCodeCacheSize are passed to the VM is irrelevant.
  * @library /testlibrary
- *
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
+ * @run driver compiler.codecache.CheckReservedInitialCodeCacheSizeArgOrder
  */
-import jdk.test.lib.*;
+
+package compiler.codecache;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
 
 public class CheckReservedInitialCodeCacheSizeArgOrder {
-  public static void main(String[] args) throws Exception {
-    ProcessBuilder pb1,  pb2;
-    OutputAnalyzer out1, out2;
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb1,  pb2;
+        OutputAnalyzer out1, out2;
 
-    pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version");
-    pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version");
+        pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version");
+        pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version");
 
-    out1 = new OutputAnalyzer(pb1.start());
-    out2 = new OutputAnalyzer(pb2.start());
+        out1 = new OutputAnalyzer(pb1.start());
+        out2 = new OutputAnalyzer(pb2.start());
 
-    // Check that the outputs are equal
-    if (out1.getStdout().compareTo(out2.getStdout()) != 0) {
-      throw new RuntimeException("Test failed");
+        // Check that the outputs are equal
+        if (out1.getStdout().compareTo(out2.getStdout()) != 0) {
+            throw new RuntimeException("Test failed");
+        }
+
+        out1.shouldHaveExitValue(0);
+        out2.shouldHaveExitValue(0);
     }
-
-    out1.shouldHaveExitValue(0);
-    out2.shouldHaveExitValue(0);
-  }
 }
diff --git a/test/compiler/codecache/CheckSegmentedCodeCache.java b/test/compiler/codecache/CheckSegmentedCodeCache.java
index 45ae4b8..2e09a4a 100644
--- a/test/compiler/codecache/CheckSegmentedCodeCache.java
+++ b/test/compiler/codecache/CheckSegmentedCodeCache.java
@@ -21,131 +21,139 @@
  * questions.
  */
 
-import jdk.test.lib.*;
-import sun.hotspot.WhiteBox;
-
 /*
  * @test CheckSegmentedCodeCache
  * @bug 8015774
+ * @summary Checks VM options related to the segmented code cache
  * @library /testlibrary /test/lib
- * @summary "Checks VM options related to the segmented code cache"
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build CheckSegmentedCodeCache
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI CheckSegmentedCodeCache
+ *
+ * @build compiler.codecache.CheckSegmentedCodeCache
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.codecache.CheckSegmentedCodeCache
  */
+
+package compiler.codecache;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
+import sun.hotspot.WhiteBox;
+
 public class CheckSegmentedCodeCache {
-  private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
-  // Code heap names
-  private static final String NON_METHOD = "CodeHeap 'non-nmethods'";
-  private static final String PROFILED = "CodeHeap 'profiled nmethods'";
-  private static final String NON_PROFILED = "CodeHeap 'non-profiled nmethods'";
+    private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+    // Code heap names
+    private static final String NON_METHOD = "CodeHeap 'non-nmethods'";
+    private static final String PROFILED = "CodeHeap 'profiled nmethods'";
+    private static final String NON_PROFILED = "CodeHeap 'non-profiled nmethods'";
 
-  private static void verifySegmentedCodeCache(ProcessBuilder pb, boolean enabled) throws Exception {
-    OutputAnalyzer out = new OutputAnalyzer(pb.start());
-    out.shouldHaveExitValue(0);
-    if (enabled) {
-      try {
-        // Non-nmethod code heap should be always available with the segmented code cache
-        out.shouldContain(NON_METHOD);
-      } catch (RuntimeException e) {
-        // Check if TieredCompilation is disabled (in a client VM)
-        if(!out.getOutput().contains("-XX:+TieredCompilation not supported in this VM")) {
-          // Code cache is not segmented
-          throw new RuntimeException("No code cache segmentation.");
+    private static void verifySegmentedCodeCache(ProcessBuilder pb, boolean enabled) throws Exception {
+        OutputAnalyzer out = new OutputAnalyzer(pb.start());
+        out.shouldHaveExitValue(0);
+        if (enabled) {
+            try {
+                // Non-nmethod code heap should be always available with the segmented code cache
+                out.shouldContain(NON_METHOD);
+            } catch (RuntimeException e) {
+                // Check if TieredCompilation is disabled (in a client VM)
+                if(!out.getOutput().contains("-XX:+TieredCompilation not supported in this VM")) {
+                    // Code cache is not segmented
+                    throw new RuntimeException("No code cache segmentation.");
+                    }
+            }
+        } else {
+            out.shouldNotContain(NON_METHOD);
         }
-      }
-    } else {
-      out.shouldNotContain(NON_METHOD);
     }
-  }
 
-  private static void verifyCodeHeapNotExists(ProcessBuilder pb, String... heapNames) throws Exception {
-    OutputAnalyzer out = new OutputAnalyzer(pb.start());
-    out.shouldHaveExitValue(0);
-    for (String name : heapNames) {
-      out.shouldNotContain(name);
+    private static void verifyCodeHeapNotExists(ProcessBuilder pb, String... heapNames) throws Exception {
+        OutputAnalyzer out = new OutputAnalyzer(pb.start());
+        out.shouldHaveExitValue(0);
+        for (String name : heapNames) {
+            out.shouldNotContain(name);
+        }
     }
-  }
 
-  private static void failsWith(ProcessBuilder pb, String message) throws Exception {
-    OutputAnalyzer out = new OutputAnalyzer(pb.start());
-    out.shouldContain(message);
-    out.shouldHaveExitValue(1);
-  }
+    private static void failsWith(ProcessBuilder pb, String message) throws Exception {
+        OutputAnalyzer out = new OutputAnalyzer(pb.start());
+        out.shouldContain(message);
+        out.shouldHaveExitValue(1);
+    }
 
-  /**
-   * Check the result of segmented code cache related VM options.
-   */
-  public static void main(String[] args) throws Exception {
-    ProcessBuilder pb;
+    /**
+    * Check the result of segmented code cache related VM options.
+    */
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb;
 
-    // Disabled with ReservedCodeCacheSize < 240MB
-    pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m",
-                                               "-XX:+PrintCodeCache", "-version");
-    verifySegmentedCodeCache(pb, false);
+        // Disabled with ReservedCodeCacheSize < 240MB
+        pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m",
+                                                   "-XX:+PrintCodeCache", "-version");
+        verifySegmentedCodeCache(pb, false);
 
-    // Disabled without TieredCompilation
-    pb = ProcessTools.createJavaProcessBuilder("-XX:-TieredCompilation",
-                                               "-XX:+PrintCodeCache", "-version");
-    verifySegmentedCodeCache(pb, false);
+        // Disabled without TieredCompilation
+        pb = ProcessTools.createJavaProcessBuilder("-XX:-TieredCompilation",
+                                                   "-XX:+PrintCodeCache", "-version");
+        verifySegmentedCodeCache(pb, false);
 
-    // Enabled with TieredCompilation and ReservedCodeCacheSize >= 240MB
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
-                                               "-XX:ReservedCodeCacheSize=240m",
-                                               "-XX:+PrintCodeCache", "-version");
-    verifySegmentedCodeCache(pb, true);
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
-                                               "-XX:ReservedCodeCacheSize=400m",
-                                               "-XX:+PrintCodeCache", "-version");
-    verifySegmentedCodeCache(pb, true);
+        // Enabled with TieredCompilation and ReservedCodeCacheSize >= 240MB
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
+                                                   "-XX:ReservedCodeCacheSize=240m",
+                                                   "-XX:+PrintCodeCache", "-version");
+        verifySegmentedCodeCache(pb, true);
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
+                                                   "-XX:ReservedCodeCacheSize=400m",
+                                                   "-XX:+PrintCodeCache", "-version");
+        verifySegmentedCodeCache(pb, true);
 
-    // Always enabled if SegmentedCodeCache is set
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
-                                               "-XX:-TieredCompilation",
-                                               "-XX:ReservedCodeCacheSize=239m",
-                                               "-XX:+PrintCodeCache", "-version");
-    verifySegmentedCodeCache(pb, true);
+        // Always enabled if SegmentedCodeCache is set
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
+                                                   "-XX:-TieredCompilation",
+                                                   "-XX:ReservedCodeCacheSize=239m",
+                                                   "-XX:+PrintCodeCache", "-version");
+        verifySegmentedCodeCache(pb, true);
 
-    // The profiled and non-profiled code heaps should not be available in
-    // interpreter-only mode
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
-                                               "-Xint",
-                                               "-XX:+PrintCodeCache", "-version");
-    verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED);
+        // The profiled and non-profiled code heaps should not be available in
+        // interpreter-only mode
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
+                                                   "-Xint",
+                                                   "-XX:+PrintCodeCache", "-version");
+        verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED);
 
-    // If we stop compilation at CompLevel_none or CompLevel_simple we
-    // don't need a profiled code heap.
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
-                                               "-XX:TieredStopAtLevel=0",
-                                               "-XX:+PrintCodeCache", "-version");
-    verifyCodeHeapNotExists(pb, PROFILED);
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
-                                               "-XX:TieredStopAtLevel=1",
-                                               "-XX:+PrintCodeCache", "-version");
-    verifyCodeHeapNotExists(pb, PROFILED);
+        // If we stop compilation at CompLevel_none or CompLevel_simple we
+        // don't need a profiled code heap.
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
+                                                   "-XX:TieredStopAtLevel=0",
+                                                   "-XX:+PrintCodeCache", "-version");
+        verifyCodeHeapNotExists(pb, PROFILED);
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
+                                                   "-XX:TieredStopAtLevel=1",
+                                                   "-XX:+PrintCodeCache", "-version");
+        verifyCodeHeapNotExists(pb, PROFILED);
 
-    // Fails with too small non-nmethod code heap size
-    pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K");
-    failsWith(pb, "Invalid NonNMethodCodeHeapSize");
+        // Fails with too small non-nmethod code heap size
+        pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K");
+        failsWith(pb, "Invalid NonNMethodCodeHeapSize");
 
-    // Fails if code heap sizes do not add up
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
-                                               "-XX:ReservedCodeCacheSize=10M",
-                                               "-XX:NonNMethodCodeHeapSize=5M",
-                                               "-XX:ProfiledCodeHeapSize=5M",
-                                               "-XX:NonProfiledCodeHeapSize=5M");
-    failsWith(pb, "Invalid code heap sizes");
+        // Fails if code heap sizes do not add up
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
+                                                   "-XX:ReservedCodeCacheSize=10M",
+                                                   "-XX:NonNMethodCodeHeapSize=5M",
+                                                   "-XX:ProfiledCodeHeapSize=5M",
+                                                   "-XX:NonProfiledCodeHeapSize=5M");
+        failsWith(pb, "Invalid code heap sizes");
 
-    // Fails if not enough space for VM internal code
-    long minUseSpace = WHITE_BOX.getUintxVMFlag("CodeCacheMinimumUseSpace");
-    // minimum size: CodeCacheMinimumUseSpace DEBUG_ONLY(* 3)
-    long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace;
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
-                                               "-XX:ReservedCodeCacheSize=" + minSize,
-                                               "-XX:InitialCodeCacheSize=100K");
-    failsWith(pb, "Not enough space in non-nmethod code heap to run VM");
-  }
+        // Fails if not enough space for VM internal code
+        long minUseSpace = WHITE_BOX.getUintxVMFlag("CodeCacheMinimumUseSpace");
+        // minimum size: CodeCacheMinimumUseSpace DEBUG_ONLY(* 3)
+        long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace;
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
+                                                   "-XX:ReservedCodeCacheSize=" + minSize,
+                                                   "-XX:InitialCodeCacheSize=100K");
+        failsWith(pb, "Not enough space in non-nmethod code heap to run VM");
+    }
 }
diff --git a/test/compiler/codecache/CheckUpperLimit.java b/test/compiler/codecache/CheckUpperLimit.java
index 086532f..d4c34ca 100644
--- a/test/compiler/codecache/CheckUpperLimit.java
+++ b/test/compiler/codecache/CheckUpperLimit.java
@@ -26,20 +26,25 @@
  * @bug 8015635
  * @summary Test ensures that the ReservedCodeCacheSize is at most MAXINT
  * @library /testlibrary
- *
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
+ * @run driver compiler.codecache.CheckUpperLimit
  */
-import jdk.test.lib.*;
+
+package compiler.codecache;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
 
 public class CheckUpperLimit {
-  public static void main(String[] args) throws Exception {
-    ProcessBuilder pb;
-    OutputAnalyzer out;
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer out;
 
-    pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
-    out = new OutputAnalyzer(pb.start());
-    out.shouldContain("Invalid ReservedCodeCacheSize=");
-    out.shouldHaveExitValue(1);
-  }
+        pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
+        out = new OutputAnalyzer(pb.start());
+        out.shouldContain("Invalid ReservedCodeCacheSize=");
+        out.shouldHaveExitValue(1);
+    }
 }
diff --git a/test/compiler/codecache/OverflowCodeCacheTest.java b/test/compiler/codecache/OverflowCodeCacheTest.java
index 31e8d2b..6b45694 100644
--- a/test/compiler/codecache/OverflowCodeCacheTest.java
+++ b/test/compiler/codecache/OverflowCodeCacheTest.java
@@ -22,32 +22,38 @@
  *
  */
 
-import java.lang.management.MemoryPoolMXBean;
-import java.util.EnumSet;
-import java.util.ArrayList;
-
-import sun.hotspot.WhiteBox;
-import sun.hotspot.code.BlobType;
-import sun.hotspot.code.CodeBlob;
-import jdk.test.lib.Asserts;
-
 /*
  * @test OverflowCodeCacheTest
  * @bug 8059550
+ * @summary testing of code cache segments overflow
  * @library /testlibrary /test/lib
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build OverflowCodeCacheTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *          java.management
+ *
+ * @build compiler.codecache.OverflowCodeCacheTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
- *                   -XX:-SegmentedCodeCache OverflowCodeCacheTest
+ *                   -XX:-SegmentedCodeCache
+ *                   compiler.codecache.OverflowCodeCacheTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
- *                   -XX:+SegmentedCodeCache OverflowCodeCacheTest
- * @summary testing of code cache segments overflow
+ *                   -XX:+SegmentedCodeCache
+ *                   compiler.codecache.OverflowCodeCacheTest
  */
+
+package compiler.codecache;
+
+import jdk.test.lib.Asserts;
+import sun.hotspot.WhiteBox;
+import sun.hotspot.code.BlobType;
+import sun.hotspot.code.CodeBlob;
+
+import java.lang.management.MemoryPoolMXBean;
+import java.util.ArrayList;
+import java.util.EnumSet;
+
 public class OverflowCodeCacheTest {
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
 
diff --git a/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java b/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java
index 5bb55b3..c5db695 100644
--- a/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java
+++ b/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java
@@ -20,24 +20,29 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-import jdk.test.lib.ExitCode;
-import jdk.test.lib.Platform;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import common.CodeCacheOptions;
-import sun.hotspot.code.BlobType;
 
 /**
  * @test
  * @bug 8015774
  * @summary Verify SegmentedCodeCache option's processing
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
  *          jdk.jvmstat/sun.jvmstat.monitor
- * @build TestSegmentedCodeCacheOption jdk.test.lib.*
- * @run main TestSegmentedCodeCacheOption
+ *
+ * @build jdk.test.lib.*
+ * @run driver compiler.codecache.cli.TestSegmentedCodeCacheOption
  */
+
+package compiler.codecache.cli;
+
+import compiler.codecache.cli.common.CodeCacheOptions;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import sun.hotspot.code.BlobType;
+
 public class TestSegmentedCodeCacheOption {
     private static final String INT_MODE = "-Xint";
     private static final String TIERED_COMPILATION = "TieredCompilation";
diff --git a/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java b/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java
index c8588eb..ffc333c 100644
--- a/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java
+++ b/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java
@@ -20,13 +20,14 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package codeheapsize;
 
+package compiler.codecache.cli.codeheapsize;
+
+import compiler.codecache.cli.common.CodeCacheCLITestCase;
+import compiler.codecache.cli.common.CodeCacheOptions;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
-import common.CodeCacheCLITestCase;
-import common.CodeCacheOptions;
 import sun.hotspot.code.BlobType;
 
 /**
diff --git a/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java b/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java
index 5d26ea9..a8186fc 100644
--- a/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java
+++ b/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java
@@ -20,11 +20,12 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package codeheapsize;
 
+package compiler.codecache.cli.codeheapsize;
+
+import compiler.codecache.cli.common.CodeCacheCLITestCase;
+import compiler.codecache.cli.common.CodeCacheOptions;
 import jdk.test.lib.cli.CommandLineOptionTest;
-import common.CodeCacheCLITestCase;
-import common.CodeCacheOptions;
 import sun.hotspot.code.BlobType;
 
 /**
diff --git a/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java b/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java
index 4f15fa6..8eb8d15 100644
--- a/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java
+++ b/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java
@@ -20,14 +20,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package codeheapsize;
 
-import common.CodeCacheCLITestCase;
-import common.CodeCacheOptions;
+package compiler.codecache.cli.codeheapsize;
+
+import compiler.codecache.cli.common.CodeCacheCLITestCase;
+import compiler.codecache.cli.common.CodeCacheOptions;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Utils;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import sun.hotspot.code.BlobType;
+
 import java.util.Random;
 
 /**
diff --git a/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java b/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java
index f664e1b..ce57610 100644
--- a/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java
+++ b/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java
@@ -20,26 +20,30 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package codeheapsize;
 
-import jdk.test.lib.Platform;
-import common.CodeCacheCLITestBase;
-import common.CodeCacheCLITestCase;
-import sun.hotspot.code.BlobType;
-import java.util.EnumSet;
 /**
  * @test
  * @bug 8015774
  * @summary Verify processing of options related to code heaps sizing.
- * @library /testlibrary .. /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
  *          jdk.jvmstat/sun.jvmstat.monitor
- * @build TestCodeHeapSizeOptions jdk.test.lib.* codeheapsize.*
- *        common.*
- * @run main/timeout=240 codeheapsize.TestCodeHeapSizeOptions
+ *
+ * @build compiler.codecache.cli.codeheapsize.TestCodeHeapSizeOptions jdk.test.lib.*
+ * @run driver/timeout=240 compiler.codecache.cli.codeheapsize.TestCodeHeapSizeOptions
  */
+
+package compiler.codecache.cli.codeheapsize;
+
+import compiler.codecache.cli.common.CodeCacheCLITestBase;
+import compiler.codecache.cli.common.CodeCacheCLITestCase;
+import jdk.test.lib.Platform;
+import sun.hotspot.code.BlobType;
+
+import java.util.EnumSet;
+
 public class TestCodeHeapSizeOptions extends CodeCacheCLITestBase {
     private static final CodeCacheCLITestCase JVM_STARTUP
             = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description(
diff --git a/test/compiler/codecache/cli/common/CodeCacheCLITestBase.java b/test/compiler/codecache/cli/common/CodeCacheCLITestBase.java
index d57e0f7..f1f1895 100644
--- a/test/compiler/codecache/cli/common/CodeCacheCLITestBase.java
+++ b/test/compiler/codecache/cli/common/CodeCacheCLITestBase.java
@@ -20,7 +20,8 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package common;
+
+package compiler.codecache.cli.common;
 
 /**
  * Base for code cache related command line options tests.
diff --git a/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java b/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java
index 003fdba..1c28a1f 100644
--- a/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java
+++ b/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java
@@ -20,7 +20,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package common;
+package compiler.codecache.cli.common;
 
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
diff --git a/test/compiler/codecache/cli/common/CodeCacheInfoFormatter.java b/test/compiler/codecache/cli/common/CodeCacheInfoFormatter.java
index 3ad16a6..9349272 100644
--- a/test/compiler/codecache/cli/common/CodeCacheInfoFormatter.java
+++ b/test/compiler/codecache/cli/common/CodeCacheInfoFormatter.java
@@ -20,9 +20,10 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package common;
+package compiler.codecache.cli.common;
 
 import sun.hotspot.code.BlobType;
+
 import java.util.Arrays;
 
 public class CodeCacheInfoFormatter {
diff --git a/test/compiler/codecache/cli/common/CodeCacheOptions.java b/test/compiler/codecache/cli/common/CodeCacheOptions.java
index 41025d7..d5e2f16 100644
--- a/test/compiler/codecache/cli/common/CodeCacheOptions.java
+++ b/test/compiler/codecache/cli/common/CodeCacheOptions.java
@@ -20,7 +20,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package common;
+package compiler.codecache.cli.common;
 
 import jdk.test.lib.cli.CommandLineOptionTest;
 import sun.hotspot.code.BlobType;
diff --git a/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java b/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java
index 5fb3ca4..4bd269a 100644
--- a/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java
+++ b/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java
@@ -20,13 +20,14 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package printcodecache;
 
+package compiler.codecache.cli.printcodecache;
+
+import compiler.codecache.cli.common.CodeCacheCLITestCase;
+import compiler.codecache.cli.common.CodeCacheInfoFormatter;
+import compiler.codecache.cli.common.CodeCacheOptions;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.cli.CommandLineOptionTest;
-import common.CodeCacheCLITestCase;
-import common.CodeCacheInfoFormatter;
-import common.CodeCacheOptions;
 import sun.hotspot.code.BlobType;
 
 import java.util.EnumSet;
diff --git a/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java b/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java
index efbf2fe..eb50d4a 100644
--- a/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java
+++ b/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java
@@ -20,25 +20,29 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package printcodecache;
 
-import common.CodeCacheCLITestBase;
-import common.CodeCacheCLITestCase;
-import sun.hotspot.code.BlobType;
-import java.util.EnumSet;
 /**
  * @test
  * @bug 8015774
  * @summary Verify that PrintCodeCache option print correct information.
- * @library /testlibrary .. /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
  *          jdk.jvmstat/sun.jvmstat.monitor
- * @build TestPrintCodeCacheOption jdk.test.lib.*
- *        printcodecache.* common.*
- * @run main/timeout=240 printcodecache.TestPrintCodeCacheOption
+ *
+ * @build jdk.test.lib.* compiler.codecache.cli.common.*
+ * @run main/timeout=240 compiler.codecache.cli.printcodecache.TestPrintCodeCacheOption
  */
+
+package compiler.codecache.cli.printcodecache;
+
+import compiler.codecache.cli.common.CodeCacheCLITestBase;
+import compiler.codecache.cli.common.CodeCacheCLITestCase;
+import sun.hotspot.code.BlobType;
+
+import java.util.EnumSet;
+
 public class TestPrintCodeCacheOption extends CodeCacheCLITestBase {
     private static final CodeCacheCLITestCase DISABLED_PRINT_CODE_CACHE
             = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description(
diff --git a/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java b/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java
index 57fc8e0..535adc0 100644
--- a/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java
+++ b/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java
@@ -21,6 +21,24 @@
  * questions.
  */
 
+/*
+ * @test SegmentedCodeCacheDtraceTest
+ * @bug 8015774
+ * @summary testing of dtrace for segmented code cache
+ * @requires os.family=="solaris"
+ * @modules java.base/jdk.internal.misc
+ * @library /testlibrary /test/lib /
+ *
+ * @build compiler.codecache.dtrace.SegmentedCodeCacheDtraceTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=600 -Xbootclasspath/a:.
+ *     -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *     compiler.codecache.dtrace.SegmentedCodeCacheDtraceTest
+ */
+
+package compiler.codecache.dtrace;
+
 import compiler.testlibrary.CompilerUtils;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.JDKToolFinder;
@@ -28,6 +46,7 @@
 import jdk.test.lib.Utils;
 import jdk.test.lib.dtrace.DtraceResultsAnalyzer;
 import jdk.test.lib.dtrace.DtraceRunner;
+
 import java.io.IOException;
 import java.lang.reflect.Executable;
 import java.nio.file.Files;
@@ -44,20 +63,6 @@
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
-/*
- * @test SegmentedCodeCacheDtraceTest
- * @bug 8015774
- * @requires os.family=="solaris"
- * @modules java.base/jdk.internal.misc
- * @library /testlibrary / /test/lib
- * @build SegmentedCodeCacheDtraceTestWorker
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+TieredCompilation
- *     -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *     SegmentedCodeCacheDtraceTest
- * @summary testing of dtrace for segmented code cache
- */
 public class SegmentedCodeCacheDtraceTest {
 
     private static final String WORKER_CLASS_NAME
diff --git a/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java b/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java
index 53422df..058c6ea 100644
--- a/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java
+++ b/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java
@@ -21,13 +21,16 @@
  * questions.
  */
 
+package compiler.codecache.dtrace;
+
 import jdk.test.lib.Utils;
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import sun.hotspot.WhiteBox;
 
 public class SegmentedCodeCacheDtraceTestWorker {
 
diff --git a/test/compiler/codecache/jmx/BeanTypeTest.java b/test/compiler/codecache/jmx/BeanTypeTest.java
index f7838e5..d620e9e 100644
--- a/test/compiler/codecache/jmx/BeanTypeTest.java
+++ b/test/compiler/codecache/jmx/BeanTypeTest.java
@@ -21,24 +21,33 @@
  * questions.
  */
 
-import jdk.test.lib.Asserts;
-import java.lang.management.MemoryType;
-import sun.hotspot.code.BlobType;
-
 /**
  * @test BeanTypeTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build BeanTypeTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache BeanTypeTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache BeanTypeTest
  * @summary verify types of code cache memory pool bean
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @library /testlibrary /test/lib
+ *
+ * @build compiler.codecache.jmx.BeanTypeTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.BeanTypeTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.BeanTypeTest
  */
+
+package compiler.codecache.jmx;
+
+import jdk.test.lib.Asserts;
+import sun.hotspot.code.BlobType;
+
+import java.lang.management.MemoryType;
+
 public class BeanTypeTest {
 
     public static void main(String args[]) {
diff --git a/test/compiler/codecache/jmx/CodeCacheUtils.java b/test/compiler/codecache/jmx/CodeCacheUtils.java
index 0adab36..31646f9 100644
--- a/test/compiler/codecache/jmx/CodeCacheUtils.java
+++ b/test/compiler/codecache/jmx/CodeCacheUtils.java
@@ -21,14 +21,17 @@
  * questions.
  */
 
+package compiler.codecache.jmx;
+
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Utils;
-import java.lang.management.MemoryPoolMXBean;
-import javax.management.Notification;
 import sun.hotspot.WhiteBox;
 import sun.hotspot.code.BlobType;
 import sun.hotspot.code.CodeBlob;
 
+import javax.management.Notification;
+import java.lang.management.MemoryPoolMXBean;
+
 public final class CodeCacheUtils {
 
     /**
diff --git a/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java b/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java
index 6f99c25..ccf6927 100644
--- a/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java
+++ b/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java
@@ -21,24 +21,33 @@
  * questions.
  */
 
-import jdk.test.lib.Asserts;
-import java.util.EnumSet;
-import sun.hotspot.code.BlobType;
-
 /**
  * @test CodeHeapBeanPresenceTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build CodeHeapBeanPresenceTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache CodeHeapBeanPresenceTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache CodeHeapBeanPresenceTest
  * @summary verify CodeHeap bean presence
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @library /testlibrary /test/lib
+ *
+ * @build compiler.codecache.jmx.CodeHeapBeanPresenceTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.CodeHeapBeanPresenceTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.CodeHeapBeanPresenceTest
  */
+
+package compiler.codecache.jmx;
+
+import jdk.test.lib.Asserts;
+import sun.hotspot.code.BlobType;
+
+import java.util.EnumSet;
+
 public class CodeHeapBeanPresenceTest {
 
     public static void main(String args[]) {
diff --git a/test/compiler/codecache/jmx/GetUsageTest.java b/test/compiler/codecache/jmx/GetUsageTest.java
index c4fdc5b..01f247c 100644
--- a/test/compiler/codecache/jmx/GetUsageTest.java
+++ b/test/compiler/codecache/jmx/GetUsageTest.java
@@ -21,25 +21,37 @@
  * questions.
  */
 
+/*
+ * @test GetUsageTest
+ * @summary testing of getUsage() for segmented code cache
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @library /testlibrary /test/lib /
+ *
+ * @build compiler.codecache.jmx.GetUsageTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
+ *     -XX:-UseCodeCacheFlushing -XX:-MethodFlushing
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.GetUsageTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
+ *     -XX:-UseCodeCacheFlushing -XX:-MethodFlushing
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.GetUsageTest
+ */
+
+package compiler.codecache.jmx;
+
 import jdk.test.lib.Asserts;
+import sun.hotspot.code.BlobType;
+
 import java.lang.management.MemoryPoolMXBean;
 import java.util.HashMap;
 import java.util.Map;
-import sun.hotspot.code.BlobType;
 
-/*
- * @test GetUsageTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @build GetUsageTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:CompileCommand=compileonly,null::*
- *     -XX:-UseCodeCacheFlushing -XX:-MethodFlushing -XX:+SegmentedCodeCache
- *     -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI GetUsageTest
- * @summary testing of getUsage() for segmented code cache
- */
 public class GetUsageTest {
 
     private final BlobType btype;
diff --git a/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java b/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java
index f695234..ea17ba2 100644
--- a/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java
+++ b/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java
@@ -21,26 +21,32 @@
  * questions.
  */
 
+/*
+ * @test InitialAndMaxUsageTest
+ * @summary testing of initial and max usage
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @library /testlibrary /test/lib /
+ *
+ * @build compiler.codecache.jmx.InitialAndMaxUsageTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
+ *     -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *     -XX:CompileCommand=compileonly,null::* -XX:-UseLargePages
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.InitialAndMaxUsageTest
+ */
+
+package compiler.codecache.jmx;
+
 import jdk.test.lib.Asserts;
+import sun.hotspot.code.BlobType;
+
 import java.lang.management.MemoryPoolMXBean;
 import java.util.ArrayList;
 import java.util.List;
-import sun.hotspot.code.BlobType;
 
-/*
- * @test InitialAndMaxUsageTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @build InitialAndMaxUsageTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
- *     -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *     -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::*
- *     -XX:-UseLargePages InitialAndMaxUsageTest
- * @summary testing of initial and max usage
- */
 public class InitialAndMaxUsageTest {
 
     private static final double CACHE_USAGE_COEF = 0.95d;
diff --git a/test/compiler/codecache/jmx/ManagerNamesTest.java b/test/compiler/codecache/jmx/ManagerNamesTest.java
index 45107f0..f8e6787 100644
--- a/test/compiler/codecache/jmx/ManagerNamesTest.java
+++ b/test/compiler/codecache/jmx/ManagerNamesTest.java
@@ -21,24 +21,33 @@
  * questions.
  */
 
-import jdk.test.lib.Asserts;
-import java.lang.management.MemoryPoolMXBean;
-import sun.hotspot.code.BlobType;
-
 /**
  * @test ManagerNamesTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build ManagerNamesTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache ManagerNamesTest
- * * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache ManagerNamesTest
  * @summary verify getMemoryManageNames calls in case of segmented code cache
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @library /testlibrary /test/lib
+ *
+ * @build compiler.codecache.jmx.ManagerNamesTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.ManagerNamesTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.ManagerNamesTest
  */
+
+package compiler.codecache.jmx;
+
+import jdk.test.lib.Asserts;
+import sun.hotspot.code.BlobType;
+
+import java.lang.management.MemoryPoolMXBean;
+
 public class ManagerNamesTest {
 
     private final MemoryPoolMXBean bean;
diff --git a/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java b/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java
index a3a0308..b0796cd 100644
--- a/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java
+++ b/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java
@@ -21,29 +21,38 @@
  * questions.
  */
 
+/**
+ * @test MemoryPoolsPresenceTest
+ * @summary verify that MemoryManagerMXBean exists for every code cache segment
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @library /testlibrary /test/lib
+ *
+ * @build compiler.codecache.jmx.MemoryPoolsPresenceTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.MemoryPoolsPresenceTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.MemoryPoolsPresenceTest
+ */
+
+package compiler.codecache.jmx;
+
 import jdk.test.lib.Asserts;
+import sun.hotspot.code.BlobType;
+
 import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryManagerMXBean;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import sun.hotspot.code.BlobType;
 
-/**
- * @test MemoryPoolsPresenceTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build MemoryPoolsPresenceTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache MemoryPoolsPresenceTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache MemoryPoolsPresenceTest
- * @summary verify that MemoryManagerMXBean exists for every code cache segment
- */
 public class MemoryPoolsPresenceTest {
 
     private static final String CC_MANAGER = "CodeCacheManager";
diff --git a/test/compiler/codecache/jmx/PeakUsageTest.java b/test/compiler/codecache/jmx/PeakUsageTest.java
index d00aabb..e75a362 100644
--- a/test/compiler/codecache/jmx/PeakUsageTest.java
+++ b/test/compiler/codecache/jmx/PeakUsageTest.java
@@ -21,28 +21,35 @@
  * questions.
  */
 
-import jdk.test.lib.Asserts;
-import java.lang.management.MemoryPoolMXBean;
-import sun.hotspot.code.BlobType;
-
 /*
  * @test PeakUsageTest
- * @ignore 8151345
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build PeakUsageTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *
+ * @ignore 8151345
+ * @build ompiler.codecache.jmx.PeakUsageTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *     sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache
- *     -XX:CompileCommand=compileonly,null::* PeakUsageTest
+ *     -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.PeakUsageTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache
- *     -XX:CompileCommand=compileonly,null::* PeakUsageTest
+ *     -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.PeakUsageTest
  * @summary testing of getPeakUsage() and resetPeakUsage for
  *     segmented code cache
  */
+
+package compiler.codecache.jmx;
+
+import sun.hotspot.code.BlobType;
+
+import java.lang.management.MemoryPoolMXBean;
+
+
 public class PeakUsageTest {
 
     private final BlobType btype;
diff --git a/test/compiler/codecache/jmx/PoolsIndependenceTest.java b/test/compiler/codecache/jmx/PoolsIndependenceTest.java
index 5b5ee81..cd61fea 100644
--- a/test/compiler/codecache/jmx/PoolsIndependenceTest.java
+++ b/test/compiler/codecache/jmx/PoolsIndependenceTest.java
@@ -21,33 +21,43 @@
  * questions.
  */
 
+/*
+ * @test PoolsIndependenceTest
+ * @summary testing of getUsageThreshold()
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @library /testlibrary /test/lib /
+ *
+ * @build compiler.codecache.jmx.PoolsIndependenceTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.PoolsIndependenceTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.PoolsIndependenceTest
+ */
+
+package compiler.codecache.jmx;
+
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Utils;
+import sun.hotspot.code.BlobType;
+
+import javax.management.ListenerNotFoundException;
+import javax.management.Notification;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationListener;
 import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryNotificationInfo;
 import java.lang.management.MemoryPoolMXBean;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
-import javax.management.ListenerNotFoundException;
-import javax.management.Notification;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationListener;
-import sun.hotspot.code.BlobType;
 
-/*
- * @test PoolsIndependenceTest
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @library /testlibrary /test/lib
- * @build PoolsIndependenceTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
- *     -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *     -XX:+SegmentedCodeCache PoolsIndependenceTest
- * @summary testing of getUsageThreshold()
- */
 public class PoolsIndependenceTest implements NotificationListener {
 
     private final Map<String, AtomicInteger> counters;
diff --git a/test/compiler/codecache/jmx/ThresholdNotificationsTest.java b/test/compiler/codecache/jmx/ThresholdNotificationsTest.java
index 7fde959..86b22cd 100644
--- a/test/compiler/codecache/jmx/ThresholdNotificationsTest.java
+++ b/test/compiler/codecache/jmx/ThresholdNotificationsTest.java
@@ -21,31 +21,40 @@
  * questions.
  */
 
+/*
+ * @test ThresholdNotificationsTest
+ * @summary testing of getUsageThreshold()
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @build compiler.codecache.jmx.ThresholdNotificationsTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
+ *     -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::*
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.ThresholdNotificationsTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
+ *     -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::*
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.ThresholdNotificationsTest
+ */
+
+package compiler.codecache.jmx;
+
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Utils;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryNotificationInfo;
-import java.lang.management.MemoryPoolMXBean;
+import sun.hotspot.code.BlobType;
+
 import javax.management.ListenerNotFoundException;
 import javax.management.Notification;
 import javax.management.NotificationEmitter;
 import javax.management.NotificationListener;
-import sun.hotspot.code.BlobType;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryNotificationInfo;
+import java.lang.management.MemoryPoolMXBean;
 
-/*
- * @test ThresholdNotificationsTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @build ThresholdNotificationsTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
- *     -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *     -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::*
- *     ThresholdNotificationsTest
- * @summary testing of getUsageThreshold()
- */
 public class ThresholdNotificationsTest implements NotificationListener {
 
     private final static long WAIT_TIME = 10000L;
@@ -80,8 +89,8 @@
     }
 
     protected void runTest() {
-        int iterationsCount =
-            Integer.getInteger("jdk.test.lib.iterations", 1);
+        int iterationsCount
+                = Integer.getInteger("jdk.test.lib.iterations", 1);
         MemoryPoolMXBean bean = btype.getMemoryPool();
         ((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
                 addNotificationListener(this, null, null);
diff --git a/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java b/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java
index aa60507..e90222d 100644
--- a/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java
+++ b/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java
@@ -23,16 +23,23 @@
 
 /*
  * @test UsageThresholdExceededSeveralTimesTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @build UsageThresholdExceededTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
- *     -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *     -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::*
- *     -Djdk.test.lib.iterations=10 UsageThresholdExceededTest
  * @summary verifying that getUsageThresholdCount() returns correct value
  *     after threshold has been hit several times
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @build compiler.codecache.jmx.UsageThresholdExceededTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *      -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing
+ *      -XX:CompileCommand=compileonly,null::* -Djdk.test.lib.iterations=10
+ *      -XX:+SegmentedCodeCache
+ *      compiler.codecache.jmx.UsageThresholdExceededTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *      -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing
+ *      -XX:CompileCommand=compileonly,null::* -Djdk.test.lib.iterations=10
+ *      -XX:-SegmentedCodeCache
+ *      compiler.codecache.jmx.UsageThresholdExceededTest
  */
diff --git a/test/compiler/codecache/jmx/UsageThresholdExceededTest.java b/test/compiler/codecache/jmx/UsageThresholdExceededTest.java
index 0700875..baa2ebe 100644
--- a/test/compiler/codecache/jmx/UsageThresholdExceededTest.java
+++ b/test/compiler/codecache/jmx/UsageThresholdExceededTest.java
@@ -21,25 +21,35 @@
  * questions.
  */
 
-import jdk.test.lib.Asserts;
-import java.lang.management.MemoryPoolMXBean;
-import sun.hotspot.code.BlobType;
-
 /*
  * @test UsageThresholdExceededTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @build UsageThresholdExceededTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache -XX:-UseCodeCacheFlushing
- *     -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::*
- *     UsageThresholdExceededTest
  * @summary verifying that getUsageThresholdCount() returns correct value
  *     after threshold has been hit
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @build compiler.codecache.jmx.UsageThresholdExceededTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing  -XX:-MethodFlushing
+ *     -XX:CompileCommand=compileonly,null::*
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.UsageThresholdExceededTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing  -XX:-MethodFlushing
+ *     -XX:CompileCommand=compileonly,null::*
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.UsageThresholdExceededTest
  */
+
+package compiler.codecache.jmx;
+
+import sun.hotspot.code.BlobType;
+
+import java.lang.management.MemoryPoolMXBean;
+
 public class UsageThresholdExceededTest {
 
     protected final int iterations;
diff --git a/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java b/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java
index 8f2e6f1..2f62822 100644
--- a/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java
+++ b/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java
@@ -21,25 +21,35 @@
  * questions.
  */
 
-import jdk.test.lib.Asserts;
-import java.lang.management.MemoryPoolMXBean;
-import sun.hotspot.code.BlobType;
-
 /*
  * @test UsageThresholdIncreasedTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @build UsageThresholdIncreasedTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *     -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache -XX:-UseCodeCacheFlushing
- *     -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::*
- *     UsageThresholdIncreasedTest
  * @summary verifying that threshold hasn't been hit after allocation smaller
  *     than threshold value and that threshold value can be changed
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build compiler.codecache.jmx.UsageThresholdIncreasedTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing  -XX:-MethodFlushing
+ *     -XX:CompileCommand=compileonly,null::*
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.UsageThresholdIncreasedTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing  -XX:-MethodFlushing
+ *     -XX:CompileCommand=compileonly,null::*
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.UsageThresholdIncreasedTest
  */
+
+package compiler.codecache.jmx;
+
+import sun.hotspot.code.BlobType;
+
+import java.lang.management.MemoryPoolMXBean;
+
 public class UsageThresholdIncreasedTest {
 
     private static final int ALLOCATION_STEP = 5;
diff --git a/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java b/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java
index 1838226..46bd21b 100644
--- a/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java
+++ b/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java
@@ -21,25 +21,35 @@
  * questions.
  */
 
-import jdk.test.lib.Asserts;
-import java.lang.management.MemoryPoolMXBean;
-import sun.hotspot.code.BlobType;
-
 /*
  * @test UsageThresholdNotExceededTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @build UsageThresholdNotExceededTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *     sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
- *     -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *     -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::*
- *     UsageThresholdNotExceededTest
  * @summary verifying that usage threshold not exceeded while allocating less
  *     than usage threshold
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build compiler.codecache.jmx.UsageThresholdNotExceededTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing
+ *     -XX:CompileCommand=compileonly,null::*
+ *     -XX:+SegmentedCodeCache
+ *     compiler.codecache.jmx.UsageThresholdNotExceededTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing
+ *     -XX:CompileCommand=compileonly,null::*
+ *     -XX:-SegmentedCodeCache
+ *     compiler.codecache.jmx.UsageThresholdNotExceededTest
  */
+
+package compiler.codecache.jmx;
+
+import sun.hotspot.code.BlobType;
+
+import java.lang.management.MemoryPoolMXBean;
+
 public class UsageThresholdNotExceededTest {
 
     private final BlobType btype;
diff --git a/test/compiler/codecache/stress/CodeCacheStressRunner.java b/test/compiler/codecache/stress/CodeCacheStressRunner.java
index 7daa0a1..e3d4a9a 100644
--- a/test/compiler/codecache/stress/CodeCacheStressRunner.java
+++ b/test/compiler/codecache/stress/CodeCacheStressRunner.java
@@ -22,6 +22,8 @@
  *
  */
 
+package compiler.codecache.stress;
+
 import jdk.test.lib.TimeLimitedRunner;
 import jdk.test.lib.Utils;
 
diff --git a/test/compiler/codecache/stress/Helper.java b/test/compiler/codecache/stress/Helper.java
index 2ac95f6..6399d30 100644
--- a/test/compiler/codecache/stress/Helper.java
+++ b/test/compiler/codecache/stress/Helper.java
@@ -22,11 +22,7 @@
  *
  */
 
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.concurrent.Callable;
-import java.util.Random;
+package compiler.codecache.stress;
 
 import jdk.test.lib.Asserts;
 import jdk.test.lib.ByteCodeLoader;
@@ -34,18 +30,24 @@
 import jdk.test.lib.Utils;
 import sun.hotspot.WhiteBox;
 
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Random;
+import java.util.concurrent.Callable;
+
 public final class Helper {
     public static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
     public static final Random RNG = Utils.getRandomInstance();
 
     private static final long THRESHOLD = WHITE_BOX.getIntxVMFlag("CompileThreshold");
-    private static final String TEST_CASE_IMPL_CLASS_NAME = "Helper$TestCaseImpl";
+    private static final String TEST_CASE_IMPL_CLASS_NAME = "compiler.codecache.stress.Helper$TestCaseImpl";
     private static byte[] CLASS_DATA;
     static {
         try {
             CLASS_DATA = loadClassData(TEST_CASE_IMPL_CLASS_NAME);
         } catch (IOException e) {
-            throw new Error("TESTBUG: cannot load class byte code", e);
+            throw new Error("TESTBUG: cannot load class byte code " + TEST_CASE_IMPL_CLASS_NAME, e);
         }
     }
 
diff --git a/test/compiler/codecache/stress/OverloadCompileQueueTest.java b/test/compiler/codecache/stress/OverloadCompileQueueTest.java
index e4b6018..4a93f2e 100644
--- a/test/compiler/codecache/stress/OverloadCompileQueueTest.java
+++ b/test/compiler/codecache/stress/OverloadCompileQueueTest.java
@@ -22,35 +22,41 @@
  *
  */
 
-import java.lang.reflect.Method;
-import java.util.stream.IntStream;
+/*
+ * @test OverloadCompileQueueTest
+ * @summary stressing code cache by overloading compile queues
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @ignore 8071905
+ * @build compiler.codecache.stress.OverloadCompileQueueTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method
+ *                   -XX:-SegmentedCodeCache
+ *                   compiler.codecache.stress.OverloadCompileQueueTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method
+ *                   -XX:+SegmentedCodeCache
+ *                   compiler.codecache.stress.OverloadCompileQueueTest
+ */
+
+package compiler.codecache.stress;
 
 import jdk.test.lib.Platform;
 
-/*
- * @test OverloadCompileQueueTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @ignore 8071905
- * @build OverloadCompileQueueTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:CompileCommand=dontinline,Helper$TestCase::method
- *                   -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache OverloadCompileQueueTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:CompileCommand=dontinline,Helper$TestCase::method
- *                   -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache OverloadCompileQueueTest
- * @summary stressing code cache by overloading compile queues
- */
+import java.lang.reflect.Method;
+import java.util.stream.IntStream;
+
 public class OverloadCompileQueueTest implements Runnable {
     private static final int MAX_SLEEP = 10000;
     private static final String METHOD_TO_ENQUEUE = "method";
     private static final int LEVEL_SIMPLE = 1;
     private static final int LEVEL_FULL_OPTIMIZATION = 4;
-    private static final boolean INTERPRETED
-            = System.getProperty("java.vm.info").startsWith("interpreted ");
     private static final boolean TIERED_COMPILATION
             = Helper.WHITE_BOX.getBooleanVMFlag("TieredCompilation");
     private static final int TIERED_STOP_AT_LEVEL
@@ -66,15 +72,13 @@
         } else if (Platform.isClient() || Platform.isMinimal()) {
             AVAILABLE_LEVELS = new int[] { LEVEL_SIMPLE };
         } else {
-            throw new Error(String.format(
-                    "TESTBUG: unknown VM: %s", System.getProperty("java.vm.name")));
+            throw new Error("TESTBUG: unknown VM: " + Platform.vmName);
         }
     }
 
     public static void main(String[] args) {
-        if (INTERPRETED) {
-            System.err.println("Test isn't applicable for interpreter. Skip test.");
-            return;
+        if (Platform.isInt()) {
+            throw new Error("TESTBUG: test can not be run in interpreter");
         }
         new CodeCacheStressRunner(new OverloadCompileQueueTest()).runTest();
     }
diff --git a/test/compiler/codecache/stress/RandomAllocationTest.java b/test/compiler/codecache/stress/RandomAllocationTest.java
index 3000cae..f1b8fd2 100644
--- a/test/compiler/codecache/stress/RandomAllocationTest.java
+++ b/test/compiler/codecache/stress/RandomAllocationTest.java
@@ -22,26 +22,34 @@
  *
  */
 
-import java.util.ArrayList;
+/*
+ * @test RandomAllocationTest
+ * @summary stressing code cache by allocating randomly sized "dummy" code blobs
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @build compiler.codecache.stress.RandomAllocationTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method
+ *                   -XX:-SegmentedCodeCache
+ *                   compiler.codecache.stress.RandomAllocationTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method
+ *                   -XX:+SegmentedCodeCache
+ *                   compiler.codecache.stress.RandomAllocationTest
+ */
+
+package compiler.codecache.stress;
 
 import sun.hotspot.code.BlobType;
 
-/*
- * @test RandomAllocationTest
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @build RandomAllocationTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:CompileCommand=dontinline,Helper$TestCase::method
- *                   -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache RandomAllocationTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:CompileCommand=dontinline,Helper$TestCase::method
- *                   -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache RandomAllocationTest
- * @summary stressing code cache by allocating randomly sized "dummy" code blobs
- */
+import java.util.ArrayList;
+
 public class RandomAllocationTest implements Runnable {
     private static final long CODE_CACHE_SIZE
             = Helper.WHITE_BOX.getUintxVMFlag("ReservedCodeCacheSize");
diff --git a/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java b/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java
index 0eb051e..c6e455d 100644
--- a/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java
+++ b/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java
@@ -24,22 +24,28 @@
 
 /*
  * @test UnexpectedDeoptimizationTest
- * @library /testlibrary /test/lib
+ * @summary stressing code cache by forcing unexpected deoptimizations
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build UnexpectedDeoptimizationTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.codecache.stress.UnexpectedDeoptimizationTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:CompileCommand=dontinline,Helper$TestCase::method
- *                   -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache -XX:-DeoptimizeRandom
- *                   UnexpectedDeoptimizationTest
+ *                   -XX:+WhiteBoxAPI -XX:-DeoptimizeRandom
+ *                   -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method
+ *                   -XX:-SegmentedCodeCache
+ *                   compiler.codecache.stress.UnexpectedDeoptimizationTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:CompileCommand=dontinline,Helper$TestCase::method
- *                   -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache -XX:-DeoptimizeRandom
- *                   UnexpectedDeoptimizationTest
- * @summary stressing code cache by forcing unexpected deoptimizations
+ *                   -XX:+WhiteBoxAPI -XX:-DeoptimizeRandom
+ *                   -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method
+ *                   -XX:+SegmentedCodeCache
+ *                   compiler.codecache.stress.UnexpectedDeoptimizationTest
  */
+
+package compiler.codecache.stress;
+
 public class UnexpectedDeoptimizationTest implements Runnable {
 
     public static void main(String[] args) {
diff --git a/test/compiler/codegen/6431242/Test.java b/test/compiler/codegen/6431242/Test.java
deleted file mode 100644
index 603a1e5..0000000
--- a/test/compiler/codegen/6431242/Test.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2006, 2013, 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 6431242
- * @run main Test
- */
-
-public class Test{
-
-  int    _len      = 8;
-  int[]  _arr_i    = new int[_len];
-  long[] _arr_l    = new long[_len];
-
-  int[]  _arr_i_cp = new int [_len];
-  long[] _arr_l_cp = new long [_len];
-
-  int _k     = 0x12345678;
-  int _j     = 0;
-  int _ir    = 0x78563412;
-  int _ir1   = 0x78563413;
-  int _ir2   = 0x79563412;
-
-  long _m    = 0x123456789abcdef0L;
-  long _l    = 0L;
-  long _lr   = 0xf0debc9a78563412L;
-  long _lr1  = 0xf0debc9a78563413L;
-  long _lr2  = 0xf1debc9a78563412L;
-
-  void init() {
-    for (int i=0; i<_arr_i.length; i++) {
-      _arr_i[i] = _k;
-      _arr_l[i] = _m;
-    }
-  }
-
-  public int test_int_reversed(int i) {
-    return Integer.reverseBytes(i);
-  }
-
-  public long test_long_reversed(long i) {
-    return Long.reverseBytes(i);
-  }
-
-  public void test_copy_ints(int[] dst, int[] src) {
-    for(int i=0; i<src.length; i++) {
-      dst[i] = Integer.reverseBytes(src[i]);
-    }
-  }
-
-  public void test_copy_ints_reversed(int[] dst, int[] src) {
-    for (int i=0; i<src.length; i++) {
-      dst[i] = 1 + Integer.reverseBytes(src[i]);
-    }
-  }
-
-  public void test_copy_ints_store_reversed(int[] dst, int[] src) {
-    for(int i=0; i<src.length; i++) {
-      dst[i] = Integer.reverseBytes(1 + src[i]);
-    }
-  }
-
-  public void test_copy_longs(long[] dst, long[] src) {
-    for(int i=0; i<src.length; i++) {
-      dst[i] = Long.reverseBytes(src[i]);
-    }
-  }
-
-  public void test_copy_longs_reversed(long[] dst, long[] src) {
-    for (int i=0; i<src.length; i++) {
-      dst[i] = 1 + Long.reverseBytes(src[i]);
-    }
-  }
-
-  public void test_copy_longs_store_reversed(long[] dst, long[] src) {
-    for(int i=0; i<src.length; i++) {
-      dst[i] = Long.reverseBytes(1 + src[i]);
-    }
-  }
-
-  public void test() throws Exception {
-    int up_limit=90000;
-
-
-    //test single
-
-    for (int loop=0; loop<up_limit; loop++) {
-      _j = test_int_reversed(_k);
-      if (_j != _ir ) {
-        throw new Exception("Interger.reverseBytes failed " + _j + " iter " + loop);
-      }
-      _l = test_long_reversed(_m);
-      if (_l != _lr ) {
-        throw new Exception("Long.reverseBytes failed " + _l + " iter " + loop);
-      }
-    }
-
-    // test scalar load/store
-    for (int loop=0; loop<up_limit; loop++) {
-
-      test_copy_ints(_arr_i_cp, _arr_i);
-      for (int j=0; j< _arr_i.length; j++) {
-        if (_arr_i_cp[j] != _ir) {
-          throw new Exception("Interger.reverseBytes failed test_copy_ints iter " + loop);
-        }
-      }
-
-      test_copy_ints_reversed(_arr_i_cp, _arr_i);
-      for (int j=0; j< _arr_i.length; j++) {
-        if (_arr_i_cp[j] != _ir1) {
-          throw new Exception("Interger.reverseBytes failed test_copy_ints_reversed iter " + loop);
-        }
-      }
-      test_copy_ints_store_reversed(_arr_i_cp, _arr_i);
-      for (int j=0; j< _arr_i.length; j++) {
-        if (_arr_i_cp[j] != _ir2) {
-          throw new Exception("Interger.reverseBytes failed test_copy_ints_store_reversed iter " + loop);
-        }
-      }
-
-      test_copy_longs(_arr_l_cp, _arr_l);
-      for (int j=0; j< _arr_i.length; j++) {
-        if (_arr_l_cp[j] != _lr) {
-          throw new Exception("Long.reverseBytes failed test_copy_longs iter " + loop);
-        }
-      }
-      test_copy_longs_reversed(_arr_l_cp, _arr_l);
-      for (int j=0; j< _arr_i.length; j++) {
-        if (_arr_l_cp[j] != _lr1) {
-          throw new Exception("Long.reverseBytes failed test_copy_longs_reversed iter " + loop);
-        }
-      }
-      test_copy_longs_store_reversed(_arr_l_cp, _arr_l);
-      for (int j=0; j< _arr_i.length; j++) {
-        if (_arr_l_cp[j] != _lr2) {
-          throw new Exception("Long.reverseBytes failed test_copy_longs_store_reversed iter " + loop);
-        }
-      }
-
-    }
-  }
-
-  public static void main(String args[]) {
-    try {
-      Test t = new Test();
-      t.init();
-      t.test();
-      System.out.println("Passed");
-    }catch (Exception e) {
-      e.printStackTrace();
-      System.out.println("Failed");
-    }
-  }
-}
diff --git a/test/compiler/codegen/7184394/TestAESBase.java b/test/compiler/codegen/7184394/TestAESBase.java
deleted file mode 100644
index 6fa53c0..0000000
--- a/test/compiler/codegen/7184394/TestAESBase.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2012, 2015, 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.
- *
- */
-
-/**
- * @author Tom Deneau
- */
-
-import jdk.test.lib.Utils;
-import java.security.AlgorithmParameters;
-import java.util.Random;
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.GCMParameterSpec;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-
-abstract public class TestAESBase {
-  int msgSize = Integer.getInteger("msgSize", 646);
-  boolean checkOutput = Boolean.getBoolean("checkOutput");
-  boolean noReinit = Boolean.getBoolean("noReinit");
-  boolean testingMisalignment;
-  private static final int ALIGN = 8;
-  int encInputOffset = Integer.getInteger("encInputOffset", 0) % ALIGN;
-  int encOutputOffset = Integer.getInteger("encOutputOffset", 0) % ALIGN;
-  int decOutputOffset = Integer.getInteger("decOutputOffset", 0) % ALIGN;
-  int lastChunkSize = Integer.getInteger("lastChunkSize", 32);
-  int keySize = Integer.getInteger("keySize", 128);
-  int inputLength;
-  int encodeLength;
-  int decodeLength;
-  int decodeMsgSize;
-  String algorithm = System.getProperty("algorithm", "AES");
-  String mode = System.getProperty("mode", "CBC");
-  String paddingStr = System.getProperty("paddingStr", "PKCS5Padding");
-  byte[] input;
-  byte[] encode;
-  byte[] expectedEncode;
-  byte[] decode;
-  byte[] expectedDecode;
-  final Random random = Utils.getRandomInstance();
-  Cipher cipher;
-  Cipher dCipher;
-  AlgorithmParameters algParams = null;
-  SecretKey key;
-  GCMParameterSpec gcm_spec;
-  byte[] aad = { 0x11, 0x22, 0x33, 0x44, 0x55 };
-  int tlen = 12;
-  byte[] iv = new byte[16];
-
-  static int numThreads = 0;
-  int  threadId;
-  static synchronized int getThreadId() {
-    int id = numThreads;
-    numThreads++;
-    return id;
-  }
-
-  abstract public void run();
-
-  public void prepare() {
-    try {
-      System.out.println("\nalgorithm=" + algorithm + ", mode=" + mode + ", paddingStr=" + paddingStr +
-              ", msgSize=" + msgSize + ", keySize=" + keySize + ", noReinit=" + noReinit +
-              ", checkOutput=" + checkOutput + ", encInputOffset=" + encInputOffset + ", encOutputOffset=" +
-              encOutputOffset + ", decOutputOffset=" + decOutputOffset + ", lastChunkSize=" +lastChunkSize );
-
-      if (encInputOffset % ALIGN != 0 || encOutputOffset % ALIGN != 0 || decOutputOffset % ALIGN !=0 )
-        testingMisalignment = true;
-
-      int keyLenBytes = (keySize == 0 ? 16 : keySize/8);
-      byte keyBytes[] = new byte[keyLenBytes];
-      if (keySize == 128)
-        keyBytes = new byte[] {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
-      else
-        random.nextBytes(keyBytes);
-
-      key = new SecretKeySpec(keyBytes, algorithm);
-      if (threadId == 0) {
-        System.out.println("Algorithm: " + key.getAlgorithm() + "("
-                           + key.getEncoded().length * 8 + "bit)");
-      }
-
-      cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
-      dCipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
-
-      // CBC or CTR init
-      if (mode.equals("CBC") || mode.equals("CTR")) {
-        IvParameterSpec initVector = new IvParameterSpec(iv);
-        cipher.init(Cipher.ENCRYPT_MODE, key, initVector);
-        algParams = cipher.getParameters();
-        dCipher.init(Cipher.DECRYPT_MODE, key, initVector);
-
-      // GCM init
-      } else if (mode.equals("GCM")) {
-        gcm_init(true);
-        gcm_init(false);
-
-      // ECB init
-      } else {
-        cipher.init(Cipher.ENCRYPT_MODE, key, algParams);
-        dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
-      }
-
-      if (threadId == 0) {
-        childShowCipher();
-      }
-
-      inputLength = msgSize + encInputOffset;
-      if (testingMisalignment) {
-        encodeLength = cipher.getOutputSize(msgSize - lastChunkSize) + encOutputOffset;
-        encodeLength += cipher.getOutputSize(lastChunkSize);
-        decodeLength = dCipher.getOutputSize(encodeLength - lastChunkSize) + decOutputOffset;
-        decodeLength += dCipher.getOutputSize(lastChunkSize);
-      } else {
-        encodeLength = cipher.getOutputSize(msgSize) + encOutputOffset;
-        decodeLength = dCipher.getOutputSize(encodeLength) + decOutputOffset;
-      }
-
-      input = new byte[inputLength];
-      for (int i=encInputOffset, j=0; i<inputLength; i++, j++) {
-        input[i] = (byte) (j & 0xff);
-      }
-
-      // do one encode and decode in preparation
-      encode = new byte[encodeLength];
-      decode = new byte[decodeLength];
-      if (testingMisalignment) {
-        decodeMsgSize = cipher.update(input, encInputOffset, (msgSize - lastChunkSize), encode, encOutputOffset);
-        decodeMsgSize += cipher.doFinal(input, (encInputOffset + msgSize - lastChunkSize), lastChunkSize, encode, (encOutputOffset + decodeMsgSize));
-
-        int tempSize = dCipher.update(encode, encOutputOffset, (decodeMsgSize - lastChunkSize), decode, decOutputOffset);
-        dCipher.doFinal(encode, (encOutputOffset + decodeMsgSize - lastChunkSize), lastChunkSize, decode, (decOutputOffset + tempSize));
-      } else {
-        decodeMsgSize = cipher.doFinal(input, encInputOffset, msgSize, encode, encOutputOffset);
-        dCipher.doFinal(encode, encOutputOffset, decodeMsgSize, decode, decOutputOffset);
-      }
-      if (checkOutput) {
-        expectedEncode = (byte[]) encode.clone();
-        expectedDecode = (byte[]) decode.clone();
-        showArray(key.getEncoded()  ,  "key:    ");
-        showArray(input,  "input:  ");
-        showArray(encode, "encode: ");
-        showArray(decode, "decode: ");
-      }
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-      System.exit(1);
-    }
-  }
-
-  void showArray(byte b[], String name) {
-    System.out.format("%s [%d]: ", name, b.length);
-    for (int i=0; i<Math.min(b.length, 32); i++) {
-      System.out.format("%02x ", b[i] & 0xff);
-    }
-    System.out.println();
-  }
-
-  void compareArrays(byte b[], byte exp[]) {
-    if (b.length != exp.length) {
-      System.out.format("different lengths for actual and expected output arrays\n");
-      showArray(b, "test: ");
-      showArray(exp, "exp : ");
-      System.exit(1);
-    }
-    for (int i=0; i< exp.length; i++) {
-      if (b[i] != exp[i]) {
-        System.out.format("output error at index %d: got %02x, expected %02x\n", i, b[i] & 0xff, exp[i] & 0xff);
-        showArray(b, "test: ");
-        showArray(exp, "exp : ");
-        System.exit(1);
-      }
-    }
-  }
-
-
-  void showCipher(Cipher c, String kind) {
-    System.out.println(kind + " cipher provider: " + cipher.getProvider());
-    System.out.println(kind + " cipher algorithm: " + cipher.getAlgorithm());
-  }
-
-  abstract void childShowCipher();
-
-  void gcm_init(boolean encrypt) throws Exception {
-    gcm_spec = new GCMParameterSpec(tlen * 8, iv);
-    if (encrypt) {
-      // Get a new instance everytime because of reuse IV restrictions
-      cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
-      cipher.init(Cipher.ENCRYPT_MODE, key, gcm_spec);
-      cipher.updateAAD(aad);
-    } else {
-      dCipher.init(Cipher.DECRYPT_MODE, key, gcm_spec);
-      dCipher.updateAAD(aad);
-
-
-    }
-  }
-}
diff --git a/test/compiler/codegen/7184394/TestAESDecode.java b/test/compiler/codegen/7184394/TestAESDecode.java
deleted file mode 100644
index e90ef76..0000000
--- a/test/compiler/codegen/7184394/TestAESDecode.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, 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.
- *
- */
-
-/**
- * @author Tom Deneau
- */
-
-import javax.crypto.Cipher;
-
-public class TestAESDecode extends TestAESBase {
-  @Override
-  public void run() {
-    try {
-      if (mode.equals("GCM")) {
-        gcm_init(false);
-      } else if (!noReinit) {
-        dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
-      }
-      decode = new byte[decodeLength];
-      if (testingMisalignment) {
-        int tempSize = dCipher.update(encode, encOutputOffset, (decodeMsgSize - lastChunkSize), decode, decOutputOffset);
-        dCipher.doFinal(encode, (encOutputOffset + decodeMsgSize - lastChunkSize), lastChunkSize, decode, (decOutputOffset + tempSize));
-      } else {
-        dCipher.doFinal(encode, encOutputOffset, decodeMsgSize, decode, decOutputOffset);
-      }
-      if (checkOutput) {
-        compareArrays(decode, expectedDecode);
-      }
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-      System.exit(1);
-    }
-  }
-
-  @Override
-  void childShowCipher() {
-    showCipher(dCipher, "Decryption");
-  }
-
-}
diff --git a/test/compiler/codegen/7184394/TestAESEncode.java b/test/compiler/codegen/7184394/TestAESEncode.java
deleted file mode 100644
index cbfb817..0000000
--- a/test/compiler/codegen/7184394/TestAESEncode.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2012, 2015, 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.
- *
- */
-
-/**
- * @author Tom Deneau
- */
-
-import javax.crypto.Cipher;
-
-public class TestAESEncode extends TestAESBase {
-  @Override
-  public void run() {
-    try {
-      if (mode.equals("GCM")) {
-        gcm_init(true);
-      } else if (!noReinit) {
-        cipher.init(Cipher.ENCRYPT_MODE, key, algParams);
-      }
-      encode = new byte[encodeLength];
-      if (testingMisalignment) {
-        int tempSize = cipher.update(input, encInputOffset, (msgSize - lastChunkSize), encode, encOutputOffset);
-        cipher.doFinal(input, (encInputOffset + msgSize - lastChunkSize), lastChunkSize, encode, (encOutputOffset + tempSize));
-      } else {
-        cipher.doFinal(input, encInputOffset, msgSize, encode, encOutputOffset);
-      }
-      if (checkOutput) {
-        compareArrays(encode, expectedEncode);
-      }
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-      System.exit(1);
-    }
-  }
-
-  @Override
-  void childShowCipher() {
-    showCipher(cipher, "Encryption");
-  }
-
-}
diff --git a/test/compiler/codegen/7184394/TestAESMain.java b/test/compiler/codegen/7184394/TestAESMain.java
deleted file mode 100644
index 23a04c2..0000000
--- a/test/compiler/codegen/7184394/TestAESMain.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2012, 2015, 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 7184394
- * @summary add intrinsics to use AES instructions
- * @library /testlibrary
- *
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DdecOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DdecOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DdecOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DdecOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain
- *
- * @author Tom Deneau
- */
-
-public class TestAESMain {
-  public static void main(String[] args) {
-    int iters = (args.length > 0 ? Integer.valueOf(args[0]) : 1000000);
-    int warmupIters = (args.length > 1 ? Integer.valueOf(args[1]) : 20000);
-    System.out.println(iters + " iterations");
-    TestAESEncode etest = new TestAESEncode();
-    etest.prepare();
-    // warm-up
-    System.out.println("Starting encryption warm-up");
-    for (int i=0; i<warmupIters; i++) {
-      etest.run();
-    }
-    System.out.println("Finished encryption warm-up");
-    long start = System.nanoTime();
-    for (int i=0; i<iters; i++) {
-      etest.run();
-    }
-    long end = System.nanoTime();
-    System.out.println("TestAESEncode runtime was " + (double)((end - start)/1000000.0) + " ms");
-
-    TestAESDecode dtest = new TestAESDecode();
-    dtest.prepare();
-    // warm-up
-    System.out.println("Starting decryption warm-up");
-    for (int i=0; i<warmupIters; i++) {
-      dtest.run();
-    }
-    System.out.println("Finished decryption warm-up");
-    start = System.nanoTime();
-    for (int i=0; i<iters; i++) {
-      dtest.run();
-    }
-    end = System.nanoTime();
-    System.out.println("TestAESDecode runtime was " + (double)((end - start)/1000000.0) + " ms");
-  }
-}
diff --git a/test/compiler/codegen/BMI1.java b/test/compiler/codegen/BMI1.java
index ada9cf0..dd1a844 100644
--- a/test/compiler/codegen/BMI1.java
+++ b/test/compiler/codegen/BMI1.java
@@ -25,277 +25,306 @@
  * @test
  * @bug 8031321
  * @summary Support BMI1 instructions on x86/x64
- * @run main/othervm -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,BMITests.* BMI1
  *
+ * @run main/othervm -Xbatch -XX:-TieredCompilation
+ *      -XX:CompileCommand=compileonly,compiler.codegen.BMI1$BMITests::*
+ *      compiler.codegen.BMI1
  */
 
-class MemI {
-  public int x;
-  public MemI(int x) { this.x = x; }
-}
-
-class MemL {
-  public long x;
-  public MemL(long x) { this.x = x; }
-}
-
-class BMITests {
-  static int andnl(int src1, int src2) {
-    return ~src1 & src2;
-  }
-  static long andnq(long src1, long src2) {
-    return ~src1 & src2;
-  }
-  static int andnl(int src1, MemI src2) {
-    return ~src1 & src2.x;
-  }
-  static long andnq(long src1, MemL src2) {
-    return ~src1 & src2.x;
-  }
-  static int blsil(int src1) {
-    return src1 & -src1;
-  }
-  static long blsiq(long src1) {
-    return src1 & -src1;
-  }
-  static int blsil(MemI src1) {
-    return src1.x & -src1.x;
-  }
-  static long blsiq(MemL src1) {
-    return src1.x & -src1.x;
-  }
-  static int blsmskl(int src1) {
-    return (src1 - 1) ^ src1;
-  }
-  static long blsmskq(long src1) {
-    return (src1 - 1) ^ src1;
-  }
-  static int blsmskl(MemI src1) {
-    return (src1.x - 1) ^ src1.x;
-  }
-  static long blsmskq(MemL src1) {
-    return (src1.x - 1) ^ src1.x;
-  }
-  static int blsrl(int src1) {
-    return (src1 - 1) & src1;
-  }
-  static long blsrq(long src1) {
-    return (src1 - 1) & src1;
-  }
-  static int blsrl(MemI src1) {
-    return (src1.x - 1) & src1.x;
-  }
-  static long blsrq(MemL src1) {
-    return (src1.x - 1) & src1.x;
-  }
-  static int lzcntl(int src1) {
-    return Integer.numberOfLeadingZeros(src1);
-  }
-  static int lzcntq(long src1) {
-    return Long.numberOfLeadingZeros(src1);
-  }
-  static int tzcntl(int src1) {
-    return Integer.numberOfTrailingZeros(src1);
-  }
-  static int tzcntq(long src1) {
-    return Long.numberOfTrailingZeros(src1);
-  }
-}
+package compiler.codegen;
 
 public class BMI1 {
-  private final static int ITERATIONS = 1000000;
+    private final static int ITERATIONS = 1000000;
 
-  public static void main(String[] args) {
-    int ix = 0x01234567;
-    int iy = 0x89abcdef;
-    MemI imy = new MemI(iy);
-    long lx = 0x0123456701234567L;
-    long ly = 0x89abcdef89abcdefL;
-    MemL lmy = new MemL(ly);
+    public static void main(String[] args) {
+        int ix = 0x01234567;
+        int iy = 0x89abcdef;
+        MemI imy = new MemI(iy);
+        long lx = 0x0123456701234567L;
+        long ly = 0x89abcdef89abcdefL;
+        MemL lmy = new MemL(ly);
 
-    { // match(Set dst (AndI (XorI src1 minus_1) src2))
-      int z = BMITests.andnl(ix, iy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.andnl(ix, iy);
-        if (ii != z) {
-          throw new Error("andnl with register failed");
+        { // match(Set dst (AndI (XorI src1 minus_1) src2))
+            int z = BMITests.andnl(ix, iy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.andnl(ix, iy);
+                if (ii != z) {
+                    throw new Error("andnl with register failed");
+                }
+            }
         }
-      }
-    }
-    { // match(Set dst (AndL (XorL src1 minus_1) src2))
-      long z = BMITests.andnq(lx, ly);
-      for (int i = 0; i < ITERATIONS; i++) {
-        long ll = BMITests.andnq(lx, ly);
-        if (ll != z) {
-          throw new Error("andnq with register failed");
+        { // match(Set dst (AndL (XorL src1 minus_1) src2))
+            long z = BMITests.andnq(lx, ly);
+            for (int i = 0; i < ITERATIONS; i++) {
+                long ll = BMITests.andnq(lx, ly);
+                if (ll != z) {
+                    throw new Error("andnq with register failed");
+                }
+            }
         }
-      }
-    }
-    { // match(Set dst (AndI (XorI src1 minus_1) (LoadI src2)))
-      int z = BMITests.andnl(ix, imy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.andnl(ix, imy);
-        if (ii != z) {
-          throw new Error("andnl with memory failed");
+        { // match(Set dst (AndI (XorI src1 minus_1) (LoadI src2)))
+            int z = BMITests.andnl(ix, imy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.andnl(ix, imy);
+                if (ii != z) {
+                    throw new Error("andnl with memory failed");
+                }
+            }
         }
-      }
-    }
-    { // match(Set dst (AndL (XorL src1 minus_1) (LoadL src2)))
-      long z = BMITests.andnq(lx, lmy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        long ll = BMITests.andnq(lx, lmy);
-        if (ll != z) {
-          throw new Error("andnq with memory failed");
+        { // match(Set dst (AndL (XorL src1 minus_1) (LoadL src2)))
+            long z = BMITests.andnq(lx, lmy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                long ll = BMITests.andnq(lx, lmy);
+                if (ll != z) {
+                    throw new Error("andnq with memory failed");
+                }
+            }
         }
-      }
-    }
-    { // match(Set dst (AndI (SubI imm_zero src) src))
-      int z = BMITests.blsil(ix);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.blsil(ix);
-        if (ii != z) {
-          throw new Error("blsil with register failed");
+        { // match(Set dst (AndI (SubI imm_zero src) src))
+            int z = BMITests.blsil(ix);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.blsil(ix);
+                if (ii != z) {
+                    throw new Error("blsil with register failed");
+                }
+            }
         }
-      }
-    }
-    { // match(Set dst (AndL (SubL imm_zero src) src))
-      long z = BMITests.blsiq(lx);
-      for (int i = 0; i < ITERATIONS; i++) {
-        long ll = BMITests.blsiq(lx);
-        if (ll != z) {
-          throw new Error("blsiq with register failed");
+        { // match(Set dst (AndL (SubL imm_zero src) src))
+            long z = BMITests.blsiq(lx);
+            for (int i = 0; i < ITERATIONS; i++) {
+                long ll = BMITests.blsiq(lx);
+                if (ll != z) {
+                    throw new Error("blsiq with register failed");
+                }
+            }
         }
-      }
-    }
-    { // match(Set dst (AndI (SubI imm_zero (LoadI src) ) (LoadI src) ))
-      int z = BMITests.blsil(imy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.blsil(imy);
-        if (ii != z) {
-          throw new Error("blsil with memory failed");
+        { // match(Set dst (AndI (SubI imm_zero (LoadI src) ) (LoadI src) ))
+            int z = BMITests.blsil(imy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.blsil(imy);
+                if (ii != z) {
+                    throw new Error("blsil with memory failed");
+                }
+            }
         }
-      }
-    }
-    { // match(Set dst (AndL (SubL imm_zero (LoadL src) ) (LoadL src) ))
-      long z = BMITests.blsiq(lmy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        long ll = BMITests.blsiq(lmy);
-        if (ll != z) {
-          throw new Error("blsiq with memory failed");
+        { // match(Set dst (AndL (SubL imm_zero (LoadL src) ) (LoadL src) ))
+            long z = BMITests.blsiq(lmy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                long ll = BMITests.blsiq(lmy);
+                if (ll != z) {
+                    throw new Error("blsiq with memory failed");
+                }
+            }
         }
-      }
+
+        { // match(Set dst (XorI (AddI src minus_1) src))
+            int z = BMITests.blsmskl(ix);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.blsmskl(ix);
+                if (ii != z) {
+                    throw new Error("blsmskl with register failed");
+                }
+            }
+        }
+        { // match(Set dst (XorL (AddL src minus_1) src))
+            long z = BMITests.blsmskq(lx);
+            for (int i = 0; i < ITERATIONS; i++) {
+                long ll = BMITests.blsmskq(lx);
+                if (ll != z) {
+                    throw new Error("blsmskq with register failed");
+                }
+            }
+        }
+        { // match(Set dst (XorI (AddI (LoadI src) minus_1) (LoadI src) ) )
+            int z = BMITests.blsmskl(imy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.blsmskl(imy);
+                if (ii != z) {
+                    throw new Error("blsmskl with memory failed");
+                }
+            }
+        }
+        {  // match(Set dst (XorL (AddL (LoadL src) minus_1) (LoadL src) ) )
+            long z = BMITests.blsmskq(lmy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                long ll = BMITests.blsmskq(lmy);
+                if (ll != z) {
+                    throw new Error("blsmskq with memory failed");
+                }
+            }
+        }
+
+        { //  match(Set dst (AndI (AddI src minus_1) src) )
+            int z = BMITests.blsrl(ix);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.blsrl(ix);
+                if (ii != z) {
+                    throw new Error("blsrl with register failed");
+                }
+            }
+        }
+        { // match(Set dst (AndL (AddL src minus_1) src) )
+            long z = BMITests.blsrq(lx);
+            for (int i = 0; i < ITERATIONS; i++) {
+                long ll = BMITests.blsrq(lx);
+                if (ll != z) {
+                    throw new Error("blsrq with register failed");
+                }
+            }
+        }
+        { // match(Set dst (AndI (AddI (LoadI src) minus_1) (LoadI src) ) )
+            int z = BMITests.blsrl(imy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.blsrl(imy);
+                if (ii != z) {
+                    throw new Error("blsrl with memory failed");
+                }
+            }
+        }
+        { // match(Set dst (AndL (AddL (LoadL src) minus_1) (LoadL src)) )
+            long z = BMITests.blsrq(lmy);
+            for (int i = 0; i < ITERATIONS; i++) {
+                long ll = BMITests.blsrq(lmy);
+                if (ll != z) {
+                    throw new Error("blsrq with memory failed");
+                }
+            }
+        }
+
+        {
+            int z = BMITests.lzcntl(ix);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.lzcntl(ix);
+                if (ii != z) {
+                    throw new Error("lzcntl failed");
+                }
+            }
+        }
+        {
+            int z = BMITests.lzcntq(lx);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.lzcntq(lx);
+                if (ii != z) {
+                    throw new Error("lzcntq failed");
+                }
+            }
+        }
+
+        {
+            int z = BMITests.tzcntl(ix);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.tzcntl(ix);
+                if (ii != z) {
+                    throw new Error("tzcntl failed");
+                }
+            }
+        }
+        {
+            int z = BMITests.tzcntq(lx);
+            for (int i = 0; i < ITERATIONS; i++) {
+                int ii = BMITests.tzcntq(lx);
+                if (ii != z) {
+                    throw new Error("tzcntq failed");
+                }
+            }
+        }
     }
 
-    { // match(Set dst (XorI (AddI src minus_1) src))
-      int z = BMITests.blsmskl(ix);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.blsmskl(ix);
-        if (ii != z) {
-          throw new Error("blsmskl with register failed");
+    static class MemI {
+        public int x;
+
+        public MemI(int x) {
+            this.x = x;
         }
-      }
-    }
-    { // match(Set dst (XorL (AddL src minus_1) src))
-      long z = BMITests.blsmskq(lx);
-      for (int i = 0; i < ITERATIONS; i++) {
-        long ll = BMITests.blsmskq(lx);
-        if (ll != z) {
-          throw new Error("blsmskq with register failed");
-        }
-      }
-    }
-    { // match(Set dst (XorI (AddI (LoadI src) minus_1) (LoadI src) ) )
-      int z = BMITests.blsmskl(imy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.blsmskl(imy);
-        if (ii != z) {
-          throw new Error("blsmskl with memory failed");
-        }
-      }
-    }
-    {  // match(Set dst (XorL (AddL (LoadL src) minus_1) (LoadL src) ) )
-      long z = BMITests.blsmskq(lmy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        long ll = BMITests.blsmskq(lmy);
-        if (ll != z) {
-          throw new Error("blsmskq with memory failed");
-        }
-      }
     }
 
-    { //  match(Set dst (AndI (AddI src minus_1) src) )
-      int z = BMITests.blsrl(ix);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.blsrl(ix);
-        if (ii != z) {
-          throw new Error("blsrl with register failed");
+    static class MemL {
+        public long x;
+
+        public MemL(long x) {
+            this.x = x;
         }
-      }
-    }
-    { // match(Set dst (AndL (AddL src minus_1) src) )
-      long z = BMITests.blsrq(lx);
-      for (int i = 0; i < ITERATIONS; i++) {
-        long ll = BMITests.blsrq(lx);
-        if (ll != z) {
-          throw new Error("blsrq with register failed");
-        }
-      }
-    }
-    { // match(Set dst (AndI (AddI (LoadI src) minus_1) (LoadI src) ) )
-      int z = BMITests.blsrl(imy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.blsrl(imy);
-        if (ii != z) {
-          throw new Error("blsrl with memory failed");
-        }
-      }
-    }
-    { // match(Set dst (AndL (AddL (LoadL src) minus_1) (LoadL src)) )
-      long z = BMITests.blsrq(lmy);
-      for (int i = 0; i < ITERATIONS; i++) {
-        long ll = BMITests.blsrq(lmy);
-        if (ll != z) {
-          throw new Error("blsrq with memory failed");
-        }
-      }
     }
 
-    {
-      int z = BMITests.lzcntl(ix);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.lzcntl(ix);
-        if (ii != z) {
-          throw new Error("lzcntl failed");
+    static class BMITests {
+        static int andnl(int src1, int src2) {
+            return ~src1 & src2;
         }
-      }
-    }
-    {
-      int z = BMITests.lzcntq(lx);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.lzcntq(lx);
-        if (ii != z) {
-          throw new Error("lzcntq failed");
-        }
-      }
-    }
 
-    {
-      int z = BMITests.tzcntl(ix);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.tzcntl(ix);
-        if (ii != z) {
-          throw new Error("tzcntl failed");
+        static long andnq(long src1, long src2) {
+            return ~src1 & src2;
         }
-      }
-    }
-    {
-      int z = BMITests.tzcntq(lx);
-      for (int i = 0; i < ITERATIONS; i++) {
-        int ii = BMITests.tzcntq(lx);
-        if (ii != z) {
-          throw new Error("tzcntq failed");
+
+        static int andnl(int src1, MemI src2) {
+            return ~src1 & src2.x;
         }
-      }
+
+        static long andnq(long src1, MemL src2) {
+            return ~src1 & src2.x;
+        }
+
+        static int blsil(int src1) {
+            return src1 & -src1;
+        }
+
+        static long blsiq(long src1) {
+            return src1 & -src1;
+        }
+
+        static int blsil(MemI src1) {
+            return src1.x & -src1.x;
+        }
+
+        static long blsiq(MemL src1) {
+            return src1.x & -src1.x;
+        }
+
+        static int blsmskl(int src1) {
+            return (src1 - 1) ^ src1;
+        }
+
+        static long blsmskq(long src1) {
+            return (src1 - 1) ^ src1;
+        }
+
+        static int blsmskl(MemI src1) {
+            return (src1.x - 1) ^ src1.x;
+        }
+
+        static long blsmskq(MemL src1) {
+            return (src1.x - 1) ^ src1.x;
+        }
+
+        static int blsrl(int src1) {
+            return (src1 - 1) & src1;
+        }
+
+        static long blsrq(long src1) {
+            return (src1 - 1) & src1;
+        }
+
+        static int blsrl(MemI src1) {
+            return (src1.x - 1) & src1.x;
+        }
+
+        static long blsrq(MemL src1) {
+            return (src1.x - 1) & src1.x;
+        }
+
+        static int lzcntl(int src1) {
+            return Integer.numberOfLeadingZeros(src1);
+        }
+
+        static int lzcntq(long src1) {
+            return Long.numberOfLeadingZeros(src1);
+        }
+
+        static int tzcntl(int src1) {
+            return Integer.numberOfTrailingZeros(src1);
+        }
+
+        static int tzcntq(long src1) {
+            return Long.numberOfTrailingZeros(src1);
+        }
     }
-  }
 }
diff --git a/test/compiler/codegen/8144028/BitTests.java b/test/compiler/codegen/BitTests.java
similarity index 80%
rename from test/compiler/codegen/8144028/BitTests.java
rename to test/compiler/codegen/BitTests.java
index d00b048..89397c1 100644
--- a/test/compiler/codegen/8144028/BitTests.java
+++ b/test/compiler/codegen/BitTests.java
@@ -25,13 +25,18 @@
  * @test
  * @bug 8144028
  * @summary Use AArch64 bit-test instructions in C2
- * @modules java.base
- * @run main/othervm -Xbatch -XX:CompileCommand=dontinline,BitTests::* -XX:-TieredCompilation BitTests
- * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1 BitTests
- * @run main/othervm -Xbatch -XX:+TieredCompilation BitTests
  *
+ * @run main/othervm -Xbatch -XX:-TieredCompilation
+ *      -XX:CompileCommand=dontinline,compiler.codegen.BitTests::*
+ *      compiler.codegen.BitTests
+ * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ *      compiler.codegen.BitTests
+ * @run main/othervm -Xbatch -XX:+TieredCompilation
+ *      compiler.codegen.BitTests
  */
 
+package compiler.codegen;
+
 // Try to ensure that the bit test instructions TBZ/TBNZ, TST/TSTW
 // don't generate incorrect code.  We can't guarantee that C2 will use
 // bit test instructions for this test and it's not a bug if it
@@ -50,7 +55,7 @@
     }
 
     private final long testIntSignedBranch(long counter) {
-        if ((int)r.nextLong() < 0) {
+        if ((int) r.nextLong() < 0) {
             counter = increment(counter);
         }
         return counter;
@@ -64,10 +69,10 @@
     }
 
     private final long testIntBitBranch(long counter) {
-        if (((int)r.nextLong() & (1 << 27)) != 0) {
+        if (((int) r.nextLong() & (1 << 27)) != 0) {
             counter = increment(counter);
         }
-        if (((int)r.nextLong() & (1 << 27)) != 0) {
+        if (((int) r.nextLong() & (1 << 27)) != 0) {
             counter = increment(counter);
         }
         return counter;
@@ -87,11 +92,11 @@
         if (((r.nextLong() & 0x0800000000l) != 0)) {
             counter++;
         }
-       return counter;
+        return counter;
     }
 
     private final long testIntMaskBranch(long counter) {
-        if ((((int)r.nextLong() & 0x08) != 0)) {
+        if ((((int) r.nextLong() & 0x08) != 0)) {
             counter++;
         }
         return counter;
@@ -101,11 +106,11 @@
         if (((r.nextLong() & mask) != 0)) {
             counter++;
         }
-       return counter;
+        return counter;
     }
 
     private final long testIntMaskBranch(long counter, int mask) {
-        if ((((int)r.nextLong() & mask) != 0)) {
+        if ((((int) r.nextLong() & mask) != 0)) {
             counter++;
         }
         return counter;
@@ -142,23 +147,22 @@
         System.out.println("PASSED");
     }
 
-}
+    // Marsaglia's xor-shift generator, used here because it is
+    // reproducible across all Java implementations.  It is also very
+    // fast.
+    static class XorShift {
 
-// Marsaglia's xor-shift generator, used here because it is
-// reproducible across all Java implementations.  It is also very
-// fast.
-class XorShift {
+        private long y;
 
-    private long y;
+        XorShift() {
+            y = 2463534242l;
+        }
 
-    XorShift() {
-        y = 2463534242l;
-    }
+        public long nextLong() {
+            y ^= (y << 13);
+            y ^= (y >>> 17);
+            return (y ^= (y << 5));
 
-    public long nextLong() {
-        y ^= (y << 13);
-        y ^= (y >>> 17);
-        return (y ^= (y << 5));
-
+        }
     }
 }
diff --git a/test/compiler/codegen/C1NullCheckOfNullStore.java b/test/compiler/codegen/C1NullCheckOfNullStore.java
index 0bec2c1..67ddccc 100644
--- a/test/compiler/codegen/C1NullCheckOfNullStore.java
+++ b/test/compiler/codegen/C1NullCheckOfNullStore.java
@@ -25,33 +25,39 @@
  * @test
  * @bug 8039043
  * @summary Null check is placed in a wrong place when storing a null to an object field on x64 with compressed oops off
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=compileonly,C1NullCheckOfNullStore::test -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-UseCompressedOops C1NullCheckOfNullStore
  *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-UseCompressedOops
+ *    -XX:CompileCommand=compileonly,compiler.codegen.C1NullCheckOfNullStore::test
+ *    compiler.codegen.C1NullCheckOfNullStore
  */
 
+package compiler.codegen;
+
 public class C1NullCheckOfNullStore {
-  private static class Foo {
-    Object bar;
-  }
-  static private void test(Foo x) {
-    x.bar = null;
-  }
-  static public void main(String args[]) {
-    Foo x = new Foo();
-    for (int i = 0; i < 10000; i++) {
-      test(x);
+    private static class Foo {
+        Object bar;
     }
-    boolean gotNPE = false;
-    try {
-      for (int i = 0; i < 10000; i++) {
-        test(null);
-      }
+
+    static private void test(Foo x) {
+        x.bar = null;
     }
-    catch(NullPointerException e) {
-      gotNPE = true;
+
+    static public void main(String args[]) {
+        Foo x = new Foo();
+        for (int i = 0; i < 10000; i++) {
+            test(x);
+        }
+        boolean gotNPE = false;
+        try {
+            for (int i = 0; i < 10000; i++) {
+                test(null);
+            }
+        } catch (NullPointerException e) {
+            gotNPE = true;
+        }
+        if (!gotNPE) {
+            throw new Error("Expecting a NullPointerException");
+        }
     }
-    if (!gotNPE) {
-      throw new Error("Expecting a NullPointerException");
-    }
-  }
 }
diff --git a/test/compiler/codegen/7088419/CRCTest.java b/test/compiler/codegen/CRCTest.java
similarity index 96%
rename from test/compiler/codegen/7088419/CRCTest.java
rename to test/compiler/codegen/CRCTest.java
index fa1f520..950e9ad 100644
--- a/test/compiler/codegen/7088419/CRCTest.java
+++ b/test/compiler/codegen/CRCTest.java
@@ -22,12 +22,15 @@
  */
 
 /*
-   @test
-   @bug 7088419
-   @run main CRCTest
-   @summary Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 and java.util.zip.Adler32
+ * @test
+ * @bug 7088419
+ * @summary Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 and java.util.zip.Adler32
+ *
+ * @run main compiler.codegen.CRCTest
  */
 
+package compiler.codegen;
+
 import java.nio.ByteBuffer;
 import java.util.zip.CRC32;
 import java.util.zip.Checksum;
diff --git a/test/compiler/codegen/IntRotateWithImmediate.java b/test/compiler/codegen/IntRotateWithImmediate.java
index 3da2aec..ae8ef23 100644
--- a/test/compiler/codegen/IntRotateWithImmediate.java
+++ b/test/compiler/codegen/IntRotateWithImmediate.java
@@ -28,51 +28,54 @@
  * @bug 8154537
  * @key regression
  * @summary Test that the rotate distance used in the rotate instruction is properly masked with 0x1f
- * @run main/othervm -Xbatch -XX:-UseOnStackReplacement IntRotateWithImmediate
+ *
+ * @run main/othervm -Xbatch -XX:-UseOnStackReplacement compiler.codegen.IntRotateWithImmediate
  * @author volker.simonis@gmail.com
  */
 
+package compiler.codegen;
+
 public class IntRotateWithImmediate {
 
-  // This is currently the same as Integer.rotateRight()
-  static int rotateRight1(int i, int distance) {
-    // On some architectures (i.e. x86_64 and ppc64) the following computation is
-    // matched in the .ad file into a single MachNode which emmits a single rotate
-    // machine instruction. It is important that the shift amount is masked to match
-    // corresponding immediate width in the native instruction. On x86_64 the rotate
-    // left instruction ('rol') encodes an 8-bit immediate while the corresponding
-    // 'rotlwi' instruction on Power only encodes a 5-bit immediate.
-    return ((i >>> distance) | (i << -distance));
-  }
-
-  static int rotateRight2(int i, int distance) {
-      return ((i >>> distance) | (i << (32-distance)));
-  }
-
-  static int compute1(int x) {
-    return rotateRight1(x, 3);
-  }
-
-  static int compute2(int x) {
-    return rotateRight2(x, 3);
-  }
-
-  public static void main(String args[]) {
-    int val = 4096;
-
-    int firstResult = compute1(val);
-
-    for (int i = 0; i < 100000; i++) {
-      int newResult = compute1(val);
-      if (firstResult != newResult) {
-        throw new InternalError(firstResult + " != " + newResult);
-      }
-      newResult = compute2(val);
-      if (firstResult != newResult) {
-        throw new InternalError(firstResult + " != " + newResult);
-      }
+    // This is currently the same as Integer.rotateRight()
+    static int rotateRight1(int i, int distance) {
+        // On some architectures (i.e. x86_64 and ppc64) the following computation is
+        // matched in the .ad file into a single MachNode which emmits a single rotate
+        // machine instruction. It is important that the shift amount is masked to match
+        // corresponding immediate width in the native instruction. On x86_64 the rotate
+        // left instruction ('rol') encodes an 8-bit immediate while the corresponding
+        // 'rotlwi' instruction on Power only encodes a 5-bit immediate.
+        return ((i >>> distance) | (i << -distance));
     }
-    System.out.println("OK");
-  }
+
+    static int rotateRight2(int i, int distance) {
+        return ((i >>> distance) | (i << (32 - distance)));
+    }
+
+    static int compute1(int x) {
+        return rotateRight1(x, 3);
+    }
+
+    static int compute2(int x) {
+        return rotateRight2(x, 3);
+    }
+
+    public static void main(String args[]) {
+        int val = 4096;
+
+        int firstResult = compute1(val);
+
+        for (int i = 0; i < 100000; i++) {
+            int newResult = compute1(val);
+            if (firstResult != newResult) {
+                throw new InternalError(firstResult + " != " + newResult);
+            }
+            newResult = compute2(val);
+            if (firstResult != newResult) {
+                throw new InternalError(firstResult + " != " + newResult);
+            }
+        }
+        System.out.println("OK");
+    }
 
 }
diff --git a/test/compiler/codegen/LoadWithMask.java b/test/compiler/codegen/LoadWithMask.java
index 06c4c14..bea0df8 100644
--- a/test/compiler/codegen/LoadWithMask.java
+++ b/test/compiler/codegen/LoadWithMask.java
@@ -25,20 +25,26 @@
  * @test
  * @bug 8032207
  * @summary Invalid node sizing for loadUS2L_immI16 and loadI2L_immI
- * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,LoadWithMask.foo LoadWithMask
  *
+ * @run main/othervm -Xbatch
+ *      -XX:CompileCommand=compileonly,compiler.codegen.LoadWithMask::foo
+ *      compiler.codegen.LoadWithMask
  */
-public class LoadWithMask {
-  static int x[] = new int[1];
-  static long foo() {
-    return x[0] & 0xfff0ffff;
-  }
 
-  public static void main(String[] args) {
-    x[0] = -1;
-    long l = 0;
-    for (int i = 0; i < 100000; ++i) {
-      l = foo();
+package compiler.codegen;
+
+public class LoadWithMask {
+    static int x[] = new int[1];
+
+    static long foo() {
+        return x[0] & 0xfff0ffff;
     }
-  }
+
+    public static void main(String[] args) {
+        x[0] = -1;
+        long l = 0;
+        for (int i = 0; i < 100000; ++i) {
+            l = foo();
+        }
+    }
 }
diff --git a/test/compiler/codegen/LoadWithMask2.java b/test/compiler/codegen/LoadWithMask2.java
index 82c942d..840e321 100644
--- a/test/compiler/codegen/LoadWithMask2.java
+++ b/test/compiler/codegen/LoadWithMask2.java
@@ -25,31 +25,39 @@
  * @test
  * @bug 8031743
  * @summary loadI2L_immI broken for negative memory values
- * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,*.foo* LoadWithMask2
  *
+ * @run main/othervm -Xbatch
+ *      -XX:CompileCommand=compileonly,compiler.codegen.LoadWithMask2::foo*
+ *      compiler.codegen.LoadWithMask2
  */
-public class LoadWithMask2 {
-  static int x;
-  static long foo1() {
-    return x & 0xfffffffe;
-  }
-  static long foo2() {
-    return x & 0xff000000;
-  }
-  static long foo3() {
-    return x & 0x8abcdef1;
-  }
 
-  public static void main(String[] args) {
-    x = -1;
-    long l = 0;
-    for (int i = 0; i < 100000; ++i) {
-      l = foo1() & foo2() & foo3();
+package compiler.codegen;
+
+public class LoadWithMask2 {
+    static int x;
+
+    static long foo1() {
+        return x & 0xfffffffe;
     }
-    if (l > 0) {
-      System.out.println("FAILED");
-      System.exit(97);
+
+    static long foo2() {
+        return x & 0xff000000;
     }
-    System.out.println("PASSED");
-  }
+
+    static long foo3() {
+        return x & 0x8abcdef1;
+    }
+
+    public static void main(String[] args) {
+        x = -1;
+        long l = 0;
+        for (int i = 0; i < 100000; ++i) {
+            l = foo1() & foo2() & foo3();
+        }
+        if (l > 0) {
+            System.out.println("FAILED");
+            System.exit(97);
+        }
+        System.out.println("PASSED");
+    }
 }
diff --git a/test/compiler/codegen/6378821/Test6378821.java b/test/compiler/codegen/Test6378821.java
similarity index 94%
rename from test/compiler/codegen/6378821/Test6378821.java
rename to test/compiler/codegen/Test6378821.java
index 2010d72..e8ebe5f 100644
--- a/test/compiler/codegen/6378821/Test6378821.java
+++ b/test/compiler/codegen/Test6378821.java
@@ -26,9 +26,13 @@
  * @bug 6378821
  * @summary where available, bitCount() should use POPC on SPARC processors and AMD+10h
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6378821.fcomp Test6378821
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.codegen.Test6378821::fcomp
+ *      compiler.codegen.Test6378821
  */
 
+package compiler.codegen;
+
 public class Test6378821 {
     static final int[]  ia = new int[]  { 0x12345678 };
     static final long[] la = new long[] { 0x12345678abcdefL };
diff --git a/test/compiler/codegen/Test6431242.java b/test/compiler/codegen/Test6431242.java
new file mode 100644
index 0000000..68b92a9
--- /dev/null
+++ b/test/compiler/codegen/Test6431242.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2006, 2013, 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 6431242
+ *
+ * @run main compiler.codegen.Test6431242
+ */
+
+package compiler.codegen;
+
+public class Test6431242 {
+
+    int _len = 8;
+    int[] _arr_i = new int[_len];
+    long[] _arr_l = new long[_len];
+
+    int[] _arr_i_cp = new int[_len];
+    long[] _arr_l_cp = new long[_len];
+
+    int _k = 0x12345678;
+    int _j = 0;
+    int _ir = 0x78563412;
+    int _ir1 = 0x78563413;
+    int _ir2 = 0x79563412;
+
+    long _m = 0x123456789abcdef0L;
+    long _l = 0L;
+    long _lr = 0xf0debc9a78563412L;
+    long _lr1 = 0xf0debc9a78563413L;
+    long _lr2 = 0xf1debc9a78563412L;
+
+    void init() {
+        for (int i = 0; i < _arr_i.length; i++) {
+            _arr_i[i] = _k;
+            _arr_l[i] = _m;
+        }
+    }
+
+    public int test_int_reversed(int i) {
+        return Integer.reverseBytes(i);
+    }
+
+    public long test_long_reversed(long i) {
+        return Long.reverseBytes(i);
+    }
+
+    public void test_copy_ints(int[] dst, int[] src) {
+        for (int i = 0; i < src.length; i++) {
+            dst[i] = Integer.reverseBytes(src[i]);
+        }
+    }
+
+    public void test_copy_ints_reversed(int[] dst, int[] src) {
+        for (int i = 0; i < src.length; i++) {
+            dst[i] = 1 + Integer.reverseBytes(src[i]);
+        }
+    }
+
+    public void test_copy_ints_store_reversed(int[] dst, int[] src) {
+        for (int i = 0; i < src.length; i++) {
+            dst[i] = Integer.reverseBytes(1 + src[i]);
+        }
+    }
+
+    public void test_copy_longs(long[] dst, long[] src) {
+        for (int i = 0; i < src.length; i++) {
+            dst[i] = Long.reverseBytes(src[i]);
+        }
+    }
+
+    public void test_copy_longs_reversed(long[] dst, long[] src) {
+        for (int i = 0; i < src.length; i++) {
+            dst[i] = 1 + Long.reverseBytes(src[i]);
+        }
+    }
+
+    public void test_copy_longs_store_reversed(long[] dst, long[] src) {
+        for (int i = 0; i < src.length; i++) {
+            dst[i] = Long.reverseBytes(1 + src[i]);
+        }
+    }
+
+    public void test() throws Exception {
+        int up_limit = 90000;
+
+
+        //test single
+
+        for (int loop = 0; loop < up_limit; loop++) {
+            _j = test_int_reversed(_k);
+            if (_j != _ir) {
+                throw new Exception("Interger.reverseBytes failed " + _j + " iter " + loop);
+            }
+            _l = test_long_reversed(_m);
+            if (_l != _lr) {
+                throw new Exception("Long.reverseBytes failed " + _l + " iter " + loop);
+            }
+        }
+
+        // test scalar load/store
+        for (int loop = 0; loop < up_limit; loop++) {
+
+            test_copy_ints(_arr_i_cp, _arr_i);
+            for (int j = 0; j < _arr_i.length; j++) {
+                if (_arr_i_cp[j] != _ir) {
+                    throw new Exception("Interger.reverseBytes failed test_copy_ints iter " + loop);
+                }
+            }
+
+            test_copy_ints_reversed(_arr_i_cp, _arr_i);
+            for (int j = 0; j < _arr_i.length; j++) {
+                if (_arr_i_cp[j] != _ir1) {
+                    throw new Exception("Interger.reverseBytes failed test_copy_ints_reversed iter " + loop);
+                }
+            }
+            test_copy_ints_store_reversed(_arr_i_cp, _arr_i);
+            for (int j = 0; j < _arr_i.length; j++) {
+                if (_arr_i_cp[j] != _ir2) {
+                    throw new Exception("Interger.reverseBytes failed test_copy_ints_store_reversed iter " + loop);
+                }
+            }
+
+            test_copy_longs(_arr_l_cp, _arr_l);
+            for (int j = 0; j < _arr_i.length; j++) {
+                if (_arr_l_cp[j] != _lr) {
+                    throw new Exception("Long.reverseBytes failed test_copy_longs iter " + loop);
+                }
+            }
+            test_copy_longs_reversed(_arr_l_cp, _arr_l);
+            for (int j = 0; j < _arr_i.length; j++) {
+                if (_arr_l_cp[j] != _lr1) {
+                    throw new Exception("Long.reverseBytes failed test_copy_longs_reversed iter " + loop);
+                }
+            }
+            test_copy_longs_store_reversed(_arr_l_cp, _arr_l);
+            for (int j = 0; j < _arr_i.length; j++) {
+                if (_arr_l_cp[j] != _lr2) {
+                    throw new Exception("Long.reverseBytes failed test_copy_longs_store_reversed iter " + loop);
+                }
+            }
+
+        }
+    }
+
+    public static void main(String args[]) {
+        try {
+            Test6431242 t = new Test6431242();
+            t.init();
+            t.test();
+            System.out.println("Passed");
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("Failed");
+        }
+    }
+}
diff --git a/test/compiler/codegen/6797305/Test6797305.java b/test/compiler/codegen/Test6797305.java
similarity index 92%
rename from test/compiler/codegen/6797305/Test6797305.java
rename to test/compiler/codegen/Test6797305.java
index 139c165..7c51e03 100644
--- a/test/compiler/codegen/6797305/Test6797305.java
+++ b/test/compiler/codegen/Test6797305.java
@@ -26,9 +26,13 @@
  * @bug 6797305
  * @summary Add LoadUB and LoadUI opcode class
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6797305.loadB,Test6797305.loadB2L,Test6797305.loadUB,Test6797305.loadUBmask,Test6797305.loadUB2L,Test6797305.loadS,Test6797305.loadS2L,Test6797305.loadUS,Test6797305.loadUSmask,Test6797305.loadUS2L,Test6797305.loadI,Test6797305.loadI2L,Test6797305.loadUI2L,Test6797305.loadL Test6797305
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.codegen.Test6797305::load*
+ *      compiler.codegen.Test6797305
  */
 
+package compiler.codegen;
+
 public class Test6797305 {
     static final byte[]  ba = new byte[]  { -1 };
     static final short[] sa = new short[] { -1 };
diff --git a/test/compiler/codegen/6814842/Test6814842.java b/test/compiler/codegen/Test6814842.java
similarity index 92%
rename from test/compiler/codegen/6814842/Test6814842.java
rename to test/compiler/codegen/Test6814842.java
index a7c8b44..9f35df6 100644
--- a/test/compiler/codegen/6814842/Test6814842.java
+++ b/test/compiler/codegen/Test6814842.java
@@ -26,9 +26,13 @@
  * @bug 6814842
  * @summary Load shortening optimizations
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6814842.loadS2B,Test6814842.loadS2Bmask255,Test6814842.loadUS2B,Test6814842.loadUS2Bmask255,Test6814842.loadI2B,Test6814842.loadI2Bmask255,Test6814842.loadI2S,Test6814842.loadI2Smask255,Test6814842.loadI2Smask65535,Test6814842.loadI2US,Test6814842.loadI2USmask255,Test6814842.loadI2USmask65535 Test6814842
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.codegen.Test6814842::load*
+ *      compiler.codegen.Test6814842
  */
 
+package compiler.codegen;
+
 public class Test6814842 {
     static final short[] sa = new short[] { (short) 0xF1F2 };
     static final char[]  ca = new char[]  { (char) 0xF3F4  };
diff --git a/test/compiler/codegen/6823354/Test6823354.java b/test/compiler/codegen/Test6823354.java
similarity index 92%
rename from test/compiler/codegen/6823354/Test6823354.java
rename to test/compiler/codegen/Test6823354.java
index 1ba60e1..7ff6f2c 100644
--- a/test/compiler/codegen/6823354/Test6823354.java
+++ b/test/compiler/codegen/Test6823354.java
@@ -27,9 +27,17 @@
  * @summary These methods can be instrinsified by using bit scan, bit test, and population count instructions.
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm -Xcomp -XX:CompileOnly=Test6823354.lzcomp,Test6823354.tzcomp,.dolzcomp,.dotzcomp Test6823354
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.codegen.Test6823354::lzcomp
+ *      -XX:CompileCommand=compileonly,compiler.codegen.Test6823354::tzcomp
+ *      -XX:CompileCommand=compileonly,compiler.codegen.*::dolzcomp
+ *      -XX:CompileCommand=compileonly,compiler.codegen.*::dotzcomp
+ *      compiler.codegen.Test6823354
  */
 
+package compiler.codegen;
+
 import jdk.test.lib.Utils;
 
 public class Test6823354 {
@@ -63,7 +71,7 @@
             check(x, lzcomp(x), lzint(x));
         }
 
-        String classname = "Test6823354$lzconI";
+        String classname = Test6823354.class.getName() + "$lzconI";
 
         // Test Ideal optimizations (constant values).
         for (int i = 0; i < ia.length; i++) {
@@ -91,7 +99,7 @@
             check(x, lzcomp(x), lzint(x));
         }
 
-        classname = "Test6823354$lzconL";
+        classname = Test6823354.class.getName() + "$lzconL";
 
         // Test Ideal optimizations (constant values).
         for (int i = 0; i < la.length; i++) {
@@ -120,7 +128,7 @@
             check(x, tzcomp(x), tzint(x));
         }
 
-        String classname = "Test6823354$tzconI";
+        String classname = Test6823354.class.getName() + "$tzconI";
 
         // Test Ideal optimizations (constant values).
         for (int i = 0; i < ia.length; i++) {
@@ -148,7 +156,7 @@
             check(x, tzcomp(x), tzint(x));
         }
 
-        classname = "Test6823354$tzconL";
+        classname = Test6823354.class.getName() + "$tzconL";
 
         // Test Ideal optimizations (constant values).
         for (int i = 0; i < la.length; i++) {
diff --git a/test/compiler/codegen/6875866/Test.java b/test/compiler/codegen/Test6875866.java
similarity index 72%
rename from test/compiler/codegen/6875866/Test.java
rename to test/compiler/codegen/Test6875866.java
index 8b9da1a..9c10fb2 100644
--- a/test/compiler/codegen/6875866/Test.java
+++ b/test/compiler/codegen/Test6875866.java
@@ -26,21 +26,24 @@
  * @bug 6875866
  * @summary Intrinsic for String.indexOf() is broken on x86 with SSE4.2
  *
- * @run main/othervm -Xcomp Test
+ * @run main/othervm -Xcomp compiler.codegen.Test6875866
  */
 
-public class Test {
 
-  static int IndexOfTest(String str) {
-    return str.indexOf("11111xx1x");
-  }
+package compiler.codegen;
 
-  public static void main(String args[]) {
-    String str = "11111xx11111xx1x";
-    int idx = IndexOfTest(str);
-    System.out.println("IndexOf = " + idx);
-    if (idx != 7) {
-      System.exit(97);
+public class Test6875866 {
+
+    static int IndexOfTest(String str) {
+        return str.indexOf("11111xx1x");
     }
-  }
+
+    public static void main(String args[]) {
+        String str = "11111xx11111xx1x";
+        int idx = IndexOfTest(str);
+        System.out.println("IndexOf = " + idx);
+        if (idx != 7) {
+            System.exit(97);
+        }
+    }
 }
diff --git a/test/compiler/codegen/6879902/Test6879902.java b/test/compiler/codegen/Test6879902.java
similarity index 98%
rename from test/compiler/codegen/6879902/Test6879902.java
rename to test/compiler/codegen/Test6879902.java
index 5e39119..4156d74 100644
--- a/test/compiler/codegen/6879902/Test6879902.java
+++ b/test/compiler/codegen/Test6879902.java
@@ -26,9 +26,11 @@
  * @bug 6879902
  * @summary CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
  *
- * @run main Test6879902
+ * @run main compiler.codegen.Test6879902
  */
 
+package compiler.codegen;
+
 import java.util.Arrays;
 
 public class Test6879902 {
diff --git a/test/compiler/codegen/6896617/Test6896617.java b/test/compiler/codegen/Test6896617.java
similarity index 98%
rename from test/compiler/codegen/6896617/Test6896617.java
rename to test/compiler/codegen/Test6896617.java
index c83a22a..90e4854 100644
--- a/test/compiler/codegen/6896617/Test6896617.java
+++ b/test/compiler/codegen/Test6896617.java
@@ -29,11 +29,14 @@
  * @modules java.base/jdk.internal.misc
  *          java.base/sun.nio.cs
  *          java.management
- * @run main/othervm/timeout=1200 -Xbatch -Xmx256m Test6896617
  *
+ * @run main/othervm/timeout=1200 -Xbatch -Xmx256m compiler.codegen.Test6896617
  */
 
+package compiler.codegen;
+
 import jdk.test.lib.Utils;
+
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.nio.charset.Charset;
diff --git a/test/compiler/codegen/6909839/Test6909839.java b/test/compiler/codegen/Test6909839.java
similarity index 98%
rename from test/compiler/codegen/6909839/Test6909839.java
rename to test/compiler/codegen/Test6909839.java
index 78b5ce5..daea8b7 100644
--- a/test/compiler/codegen/6909839/Test6909839.java
+++ b/test/compiler/codegen/Test6909839.java
@@ -27,9 +27,11 @@
  * @bug 6909839
  * @summary missing unsigned compare cases for some cmoves in sparc.ad
  *
- * @run main/othervm -XX:+AggressiveOpts -Xbatch Test6909839
+ * @run main/othervm -XX:+AggressiveOpts -Xbatch compiler.codegen.Test6909839
  */
 
+package compiler.codegen;
+
 public class Test6909839 {
     public static void main(String[] args) {
         testi();
diff --git a/test/compiler/codegen/6935535/Test.java b/test/compiler/codegen/Test6935535.java
similarity index 68%
rename from test/compiler/codegen/6935535/Test.java
rename to test/compiler/codegen/Test6935535.java
index a2576c2..815e972 100644
--- a/test/compiler/codegen/6935535/Test.java
+++ b/test/compiler/codegen/Test6935535.java
@@ -26,23 +26,25 @@
  * @bug 6935535
  * @summary String.indexOf() returns incorrect result on x86 with SSE4.2
  *
- * @run main/othervm -Xcomp Test
+ * @run main/othervm -Xcomp compiler.codegen.Test6935535
  */
 
-public class Test {
+package compiler.codegen;
 
-  static int IndexOfTest(String str) {
-    return str.indexOf("1111111111111xx1x");
-  }
+public class Test6935535 {
 
-  public static void main(String args[]) {
-    String str = "1111111111111xx1111111111111xx1x";
-    str = str.substring(0, 31);
-    int idx = IndexOfTest(str);
-    System.out.println("IndexOf(" + "1111111111111xx1x" + ") = " + idx + " in " + str);
-    if (idx != -1) {
-      System.exit(97);
+    static int IndexOfTest(String str) {
+        return str.indexOf("1111111111111xx1x");
     }
-  }
+
+    public static void main(String args[]) {
+        String str = "1111111111111xx1111111111111xx1x";
+        str = str.substring(0, 31);
+        int idx = IndexOfTest(str);
+        System.out.println("IndexOf(" + "1111111111111xx1x" + ") = " + idx + " in " + str);
+        if (idx != -1) {
+            System.exit(97);
+        }
+    }
 }
 
diff --git a/test/compiler/codegen/6942326/Test.java b/test/compiler/codegen/Test6942326.java
similarity index 95%
rename from test/compiler/codegen/6942326/Test.java
rename to test/compiler/codegen/Test6942326.java
index cd3d97e..08e754d 100644
--- a/test/compiler/codegen/6942326/Test.java
+++ b/test/compiler/codegen/Test6942326.java
@@ -27,11 +27,20 @@
  * @bug 6942326
  * @summary x86 code in string_indexof() could read beyond reserved heap space
  *
- * @run main/othervm/timeout=300 -Xmx32m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=exclude,Test,main -XX:CompileCommand=exclude,Test,test_varsub_indexof -XX:CompileCommand=exclude,Test,test_varstr_indexof -XX:CompileCommand=exclude,Test,test_missub_indexof -XX:CompileCommand=exclude,Test,test_consub_indexof -XX:CompileCommand=exclude,Test,test_conmis_indexof -XX:CompileCommand=exclude,Test,test_subcon Test
- *
+ * @run main/othervm/timeout=300 -Xmx32m -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *      -XX:CompileCommand=exclude,compiler.codegen.Test6942326::main
+ *      -XX:CompileCommand=exclude,compiler.codegen.Test6942326::test_varsub_indexof
+ *      -XX:CompileCommand=exclude,compiler.codegen.Test6942326::test_varstr_indexof
+ *      -XX:CompileCommand=exclude,compiler.codegen.Test6942326::test_missub_indexof
+ *      -XX:CompileCommand=exclude,compiler.codegen.Test6942326::test_consub_indexof
+ *      -XX:CompileCommand=exclude,compiler.codegen.Test6942326::test_conmis_indexof
+ *      -XX:CompileCommand=exclude,compiler.codegen.Test6942326::test_subcon
+ *      compiler.codegen.Test6942326
  */
 
-public class Test {
+package compiler.codegen;
+
+public class Test6942326 {
 
     static String[] strings = new String[1024];
     private static final int ITERATIONS = 100000;
diff --git a/test/compiler/codegen/7009231/Test7009231.java b/test/compiler/codegen/Test7009231.java
similarity index 96%
rename from test/compiler/codegen/7009231/Test7009231.java
rename to test/compiler/codegen/Test7009231.java
index 64afc66..a384d0f 100644
--- a/test/compiler/codegen/7009231/Test7009231.java
+++ b/test/compiler/codegen/Test7009231.java
@@ -27,13 +27,12 @@
  * @bug 7009231
  * @summary C1: Incorrect CAS code for longs on SPARC 32bit
  *
- * @run main/othervm -Xbatch Test7009231
- *
+ * @run main/othervm -Xbatch compiler.codegen.Test7009231
  */
 
-import java.util.Random;
-import java.util.concurrent.atomic.AtomicLong;
+package compiler.codegen;
 
+import java.util.concurrent.atomic.AtomicLong;
 
 public class Test7009231 {
     public static void main(String[] args) throws InterruptedException {
diff --git a/test/compiler/codegen/7100757/Test7100757.java b/test/compiler/codegen/Test7100757.java
similarity index 97%
rename from test/compiler/codegen/7100757/Test7100757.java
rename to test/compiler/codegen/Test7100757.java
index d400616..3736d85 100644
--- a/test/compiler/codegen/7100757/Test7100757.java
+++ b/test/compiler/codegen/Test7100757.java
@@ -29,10 +29,14 @@
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main/timeout=300 Test7100757
+ *
+ * @run main/timeout=300 compiler.codegen.Test7100757
  */
 
+package compiler.codegen;
+
 import jdk.test.lib.Utils;
+
 import java.util.BitSet;
 import java.util.Random;
 
diff --git a/test/compiler/codegen/8005033/Test8005033.java b/test/compiler/codegen/Test8005033.java
similarity index 91%
rename from test/compiler/codegen/8005033/Test8005033.java
rename to test/compiler/codegen/Test8005033.java
index 1918136..84630ad 100644
--- a/test/compiler/codegen/8005033/Test8005033.java
+++ b/test/compiler/codegen/Test8005033.java
@@ -25,10 +25,15 @@
  * @test
  * @bug 8005033
  * @summary On sparcv9, C2's intrinsic for Integer.bitCount(OV) returns wrong result if OV is the result of an operation with int overflow.
- * @run main/othervm -Xcomp -XX:CompileOnly=Test8005033::testBitCount Test8005033
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileony,compiler.codegen.Test8005033::testBitCount
+ *      compiler.codegen.Test8005033
  * @author Richard Reingruber richard DOT reingruber AT sap DOT com
  */
 
+package compiler.codegen;
+
 public class Test8005033 {
     public static int MINUS_ONE = -1;
 
diff --git a/test/compiler/codegen/8011901/Test8011901.java b/test/compiler/codegen/Test8011901.java
similarity index 95%
rename from test/compiler/codegen/8011901/Test8011901.java
rename to test/compiler/codegen/Test8011901.java
index 837a92c..6a865c1 100644
--- a/test/compiler/codegen/8011901/Test8011901.java
+++ b/test/compiler/codegen/Test8011901.java
@@ -26,13 +26,16 @@
  * @bug 8011901
  * @summary instruct xaddL_no_res shouldn't allow 64 bit constants.
  * @modules java.base/jdk.internal.misc
- * @run main/othervm -XX:-BackgroundCompilation Test8011901
  *
+ * @run main/othervm -XX:-BackgroundCompilation compiler.codegen.Test8011901
  */
 
-import java.lang.reflect.Field;
+package compiler.codegen;
+
 import jdk.internal.misc.Unsafe;
 
+import java.lang.reflect.Field;
+
 public class Test8011901 {
 
     private long ctl;
diff --git a/test/compiler/codegen/7119644/TestBooleanVect.java b/test/compiler/codegen/TestBooleanVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestBooleanVect.java
rename to test/compiler/codegen/TestBooleanVect.java
index d4e3ad6..2b6363e 100644
--- a/test/compiler/codegen/7119644/TestBooleanVect.java
+++ b/test/compiler/codegen/TestBooleanVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestBooleanVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestBooleanVect
  */
 
+package compiler.codegen;
+
 public class TestBooleanVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestByteDoubleVect.java b/test/compiler/codegen/TestByteDoubleVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestByteDoubleVect.java
rename to test/compiler/codegen/TestByteDoubleVect.java
index acf71bf..e9376c1 100644
--- a/test/compiler/codegen/7119644/TestByteDoubleVect.java
+++ b/test/compiler/codegen/TestByteDoubleVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteDoubleVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestByteDoubleVect
  */
 
+package compiler.codegen;
+
 public class TestByteDoubleVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestByteFloatVect.java b/test/compiler/codegen/TestByteFloatVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestByteFloatVect.java
rename to test/compiler/codegen/TestByteFloatVect.java
index 45fe34e..d718f48 100644
--- a/test/compiler/codegen/7119644/TestByteFloatVect.java
+++ b/test/compiler/codegen/TestByteFloatVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteFloatVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestByteFloatVect
  */
 
+package compiler.codegen;
+
 public class TestByteFloatVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestByteIntVect.java b/test/compiler/codegen/TestByteIntVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestByteIntVect.java
rename to test/compiler/codegen/TestByteIntVect.java
index 8d9aa6a..2e2b8b4 100644
--- a/test/compiler/codegen/7119644/TestByteIntVect.java
+++ b/test/compiler/codegen/TestByteIntVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteIntVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestByteIntVect
  */
 
+package compiler.codegen;
+
 public class TestByteIntVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestByteLongVect.java b/test/compiler/codegen/TestByteLongVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestByteLongVect.java
rename to test/compiler/codegen/TestByteLongVect.java
index c2d4390..23a57e2 100644
--- a/test/compiler/codegen/7119644/TestByteLongVect.java
+++ b/test/compiler/codegen/TestByteLongVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteLongVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestByteLongVect
  */
 
+package compiler.codegen;
+
 public class TestByteLongVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestByteShortVect.java b/test/compiler/codegen/TestByteShortVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestByteShortVect.java
rename to test/compiler/codegen/TestByteShortVect.java
index ee1a206..0b4b4d7 100644
--- a/test/compiler/codegen/7119644/TestByteShortVect.java
+++ b/test/compiler/codegen/TestByteShortVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteShortVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestByteShortVect
  */
 
+package compiler.codegen;
+
 public class TestByteShortVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestByteVect.java b/test/compiler/codegen/TestByteVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestByteVect.java
rename to test/compiler/codegen/TestByteVect.java
index 6167678..06bc2bb 100644
--- a/test/compiler/codegen/7119644/TestByteVect.java
+++ b/test/compiler/codegen/TestByteVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestByteVect
  */
 
+package compiler.codegen;
+
 public class TestByteVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestCharShortVect.java b/test/compiler/codegen/TestCharShortVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestCharShortVect.java
rename to test/compiler/codegen/TestCharShortVect.java
index 55f8e03..5ae572e 100644
--- a/test/compiler/codegen/7119644/TestCharShortVect.java
+++ b/test/compiler/codegen/TestCharShortVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestCharShortVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestCharShortVect
  */
 
+package compiler.codegen;
+
 public class TestCharShortVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestCharVect.java b/test/compiler/codegen/TestCharVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestCharVect.java
rename to test/compiler/codegen/TestCharVect.java
index d05ed4d..ef21a88 100644
--- a/test/compiler/codegen/7119644/TestCharVect.java
+++ b/test/compiler/codegen/TestCharVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestCharVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestCharVect
  */
 
+package compiler.codegen;
+
 public class TestCharVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/8001183/TestCharVect.java b/test/compiler/codegen/TestCharVect2.java
similarity index 99%
rename from test/compiler/codegen/8001183/TestCharVect.java
rename to test/compiler/codegen/TestCharVect2.java
index a6ff1e2..748d3be 100644
--- a/test/compiler/codegen/8001183/TestCharVect.java
+++ b/test/compiler/codegen/TestCharVect2.java
@@ -27,10 +27,12 @@
  * @bug 8001183
  * @summary incorrect results of char vectors right shift operaiton
  *
- * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestCharVect
+ * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.codegen.TestCharVect2
  */
 
-public class TestCharVect {
+package compiler.codegen;
+
+public class TestCharVect2 {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
   private static final int ADD_INIT = Character.MAX_VALUE-500;
diff --git a/test/compiler/codegen/7119644/TestDoubleVect.java b/test/compiler/codegen/TestDoubleVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestDoubleVect.java
rename to test/compiler/codegen/TestDoubleVect.java
index 385a64d..b8772d9 100644
--- a/test/compiler/codegen/7119644/TestDoubleVect.java
+++ b/test/compiler/codegen/TestDoubleVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestDoubleVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestDoubleVect
  */
 
+package compiler.codegen;
+
 public class TestDoubleVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestFloatDoubleVect.java b/test/compiler/codegen/TestFloatDoubleVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestFloatDoubleVect.java
rename to test/compiler/codegen/TestFloatDoubleVect.java
index 827ecdb..d90d295 100644
--- a/test/compiler/codegen/7119644/TestFloatDoubleVect.java
+++ b/test/compiler/codegen/TestFloatDoubleVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestFloatDoubleVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestFloatDoubleVect
  */
 
+package compiler.codegen;
+
 public class TestFloatDoubleVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestFloatVect.java b/test/compiler/codegen/TestFloatVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestFloatVect.java
rename to test/compiler/codegen/TestFloatVect.java
index 825fffe..523761a 100644
--- a/test/compiler/codegen/7119644/TestFloatVect.java
+++ b/test/compiler/codegen/TestFloatVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestFloatVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestFloatVect
  */
 
+package compiler.codegen;
+
 public class TestFloatVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestIntDoubleVect.java b/test/compiler/codegen/TestIntDoubleVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestIntDoubleVect.java
rename to test/compiler/codegen/TestIntDoubleVect.java
index fc6e32d..739353d 100644
--- a/test/compiler/codegen/7119644/TestIntDoubleVect.java
+++ b/test/compiler/codegen/TestIntDoubleVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntDoubleVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestIntDoubleVect
  */
 
+package compiler.codegen;
+
 public class TestIntDoubleVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestIntFloatVect.java b/test/compiler/codegen/TestIntFloatVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestIntFloatVect.java
rename to test/compiler/codegen/TestIntFloatVect.java
index e698c89..c41d824 100644
--- a/test/compiler/codegen/7119644/TestIntFloatVect.java
+++ b/test/compiler/codegen/TestIntFloatVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntFloatVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestIntFloatVect
  */
 
+package compiler.codegen;
+
 public class TestIntFloatVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestIntLongVect.java b/test/compiler/codegen/TestIntLongVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestIntLongVect.java
rename to test/compiler/codegen/TestIntLongVect.java
index def0d9b..02c4b62 100644
--- a/test/compiler/codegen/7119644/TestIntLongVect.java
+++ b/test/compiler/codegen/TestIntLongVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntLongVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestIntLongVect
  */
 
+package compiler.codegen;
+
 public class TestIntLongVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestIntVect.java b/test/compiler/codegen/TestIntVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestIntVect.java
rename to test/compiler/codegen/TestIntVect.java
index 9d3f4e5..cb2b31b 100644
--- a/test/compiler/codegen/7119644/TestIntVect.java
+++ b/test/compiler/codegen/TestIntVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestIntVect
  */
 
+package compiler.codegen;
+
 public class TestIntVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestLongDoubleVect.java b/test/compiler/codegen/TestLongDoubleVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestLongDoubleVect.java
rename to test/compiler/codegen/TestLongDoubleVect.java
index 344e3a9..c73cc98 100644
--- a/test/compiler/codegen/7119644/TestLongDoubleVect.java
+++ b/test/compiler/codegen/TestLongDoubleVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestLongDoubleVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestLongDoubleVect
  */
 
+package compiler.codegen;
+
 public class TestLongDoubleVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestLongFloatVect.java b/test/compiler/codegen/TestLongFloatVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestLongFloatVect.java
rename to test/compiler/codegen/TestLongFloatVect.java
index 714f6c8..ef00e6f 100644
--- a/test/compiler/codegen/7119644/TestLongFloatVect.java
+++ b/test/compiler/codegen/TestLongFloatVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestLongFloatVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestLongFloatVect
  */
 
+package compiler.codegen;
+
 public class TestLongFloatVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestLongVect.java b/test/compiler/codegen/TestLongVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestLongVect.java
rename to test/compiler/codegen/TestLongVect.java
index 6f0365b..d76025a 100644
--- a/test/compiler/codegen/7119644/TestLongVect.java
+++ b/test/compiler/codegen/TestLongVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestLongVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestLongVect
  */
 
+package compiler.codegen;
+
 public class TestLongVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestShortDoubleVect.java b/test/compiler/codegen/TestShortDoubleVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestShortDoubleVect.java
rename to test/compiler/codegen/TestShortDoubleVect.java
index c21037e..f36baa3 100644
--- a/test/compiler/codegen/7119644/TestShortDoubleVect.java
+++ b/test/compiler/codegen/TestShortDoubleVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestShortDoubleVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestShortDoubleVect
  */
 
+package compiler.codegen;
+
 public class TestShortDoubleVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestShortFloatVect.java b/test/compiler/codegen/TestShortFloatVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestShortFloatVect.java
rename to test/compiler/codegen/TestShortFloatVect.java
index 05b4ddd..7704a1b 100644
--- a/test/compiler/codegen/7119644/TestShortFloatVect.java
+++ b/test/compiler/codegen/TestShortFloatVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestShortFloatVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestShortFloatVect
  */
 
+package compiler.codegen;
+
 public class TestShortFloatVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestShortIntVect.java b/test/compiler/codegen/TestShortIntVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestShortIntVect.java
rename to test/compiler/codegen/TestShortIntVect.java
index bf18094..d979fad 100644
--- a/test/compiler/codegen/7119644/TestShortIntVect.java
+++ b/test/compiler/codegen/TestShortIntVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestShortIntVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestShortIntVect
  */
 
+package compiler.codegen;
+
 public class TestShortIntVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestShortLongVect.java b/test/compiler/codegen/TestShortLongVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestShortLongVect.java
rename to test/compiler/codegen/TestShortLongVect.java
index d4c121f..b6c0c79 100644
--- a/test/compiler/codegen/7119644/TestShortLongVect.java
+++ b/test/compiler/codegen/TestShortLongVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestShortLongVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestShortLongVect
  */
 
+package compiler.codegen;
+
 public class TestShortLongVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/7119644/TestShortVect.java b/test/compiler/codegen/TestShortVect.java
similarity index 99%
rename from test/compiler/codegen/7119644/TestShortVect.java
rename to test/compiler/codegen/TestShortVect.java
index d458383..04b4ecb 100644
--- a/test/compiler/codegen/7119644/TestShortVect.java
+++ b/test/compiler/codegen/TestShortVect.java
@@ -27,9 +27,13 @@
  * @bug 7119644
  * @summary Increase superword's vector size up to 256 bits
  *
- * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestShortVect
+ * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *    -XX:-TieredCompilation -XX:-OptimizeFill
+ *    compiler.codegen.TestShortVect
  */
 
+package compiler.codegen;
+
 public class TestShortVect {
   private static final int ARRLEN = 997;
   private static final int ITERS  = 11000;
diff --git a/test/compiler/codegen/aes/TestAESBase.java b/test/compiler/codegen/aes/TestAESBase.java
new file mode 100644
index 0000000..ca2d5c9
--- /dev/null
+++ b/test/compiler/codegen/aes/TestAESBase.java
@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) 2012, 2015, 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.
+ *
+ */
+
+
+package compiler.codegen.aes;
+
+import jdk.test.lib.Utils;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.GCMParameterSpec;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.AlgorithmParameters;
+import java.util.Random;
+
+/**
+ * @author Tom Deneau
+ */
+public abstract class TestAESBase {
+    int msgSize = Integer.getInteger("msgSize", 646);
+    boolean checkOutput = Boolean.getBoolean("checkOutput");
+    boolean noReinit = Boolean.getBoolean("noReinit");
+    boolean testingMisalignment;
+    private static final int ALIGN = 8;
+    int encInputOffset = Integer.getInteger("encInputOffset", 0) % ALIGN;
+    int encOutputOffset = Integer.getInteger("encOutputOffset", 0) % ALIGN;
+    int decOutputOffset = Integer.getInteger("decOutputOffset", 0) % ALIGN;
+    int lastChunkSize = Integer.getInteger("lastChunkSize", 32);
+    int keySize = Integer.getInteger("keySize", 128);
+    int inputLength;
+    int encodeLength;
+    int decodeLength;
+    int decodeMsgSize;
+    String algorithm = System.getProperty("algorithm", "AES");
+    String mode = System.getProperty("mode", "CBC");
+    String paddingStr = System.getProperty("paddingStr", "PKCS5Padding");
+    byte[] input;
+    byte[] encode;
+    byte[] expectedEncode;
+    byte[] decode;
+    byte[] expectedDecode;
+    final Random random = Utils.getRandomInstance();
+    Cipher cipher;
+    Cipher dCipher;
+    AlgorithmParameters algParams = null;
+    SecretKey key;
+    GCMParameterSpec gcm_spec;
+    byte[] aad = {0x11, 0x22, 0x33, 0x44, 0x55};
+    int tlen = 12;
+    byte[] iv = new byte[16];
+
+    static int numThreads = 0;
+    int threadId;
+
+    static synchronized int getThreadId() {
+        int id = numThreads;
+        numThreads++;
+        return id;
+    }
+
+    abstract public void run();
+
+    public void prepare() {
+        try {
+            System.out.println("\nalgorithm=" + algorithm + ", mode=" + mode + ", paddingStr=" + paddingStr +
+                    ", msgSize=" + msgSize + ", keySize=" + keySize + ", noReinit=" + noReinit +
+                    ", checkOutput=" + checkOutput + ", encInputOffset=" + encInputOffset + ", encOutputOffset=" +
+                    encOutputOffset + ", decOutputOffset=" + decOutputOffset + ", lastChunkSize=" + lastChunkSize);
+
+            if (encInputOffset % ALIGN != 0 || encOutputOffset % ALIGN != 0 || decOutputOffset % ALIGN != 0)
+                testingMisalignment = true;
+
+            int keyLenBytes = (keySize == 0 ? 16 : keySize / 8);
+            byte keyBytes[] = new byte[keyLenBytes];
+            if (keySize == 128)
+                keyBytes = new byte[]{-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
+            else
+                random.nextBytes(keyBytes);
+
+            key = new SecretKeySpec(keyBytes, algorithm);
+            if (threadId == 0) {
+                System.out.println("Algorithm: " + key.getAlgorithm() + "("
+                        + key.getEncoded().length * 8 + "bit)");
+            }
+
+            cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
+            dCipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
+
+            // CBC or CTR init
+            if (mode.equals("CBC") || mode.equals("CTR")) {
+                IvParameterSpec initVector = new IvParameterSpec(iv);
+                cipher.init(Cipher.ENCRYPT_MODE, key, initVector);
+                algParams = cipher.getParameters();
+                dCipher.init(Cipher.DECRYPT_MODE, key, initVector);
+
+                // GCM init
+            } else if (mode.equals("GCM")) {
+                gcm_init(true);
+                gcm_init(false);
+
+                // ECB init
+            } else {
+                cipher.init(Cipher.ENCRYPT_MODE, key, algParams);
+                dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
+            }
+
+            if (threadId == 0) {
+                childShowCipher();
+            }
+
+            inputLength = msgSize + encInputOffset;
+            if (testingMisalignment) {
+                encodeLength = cipher.getOutputSize(msgSize - lastChunkSize) + encOutputOffset;
+                encodeLength += cipher.getOutputSize(lastChunkSize);
+                decodeLength = dCipher.getOutputSize(encodeLength - lastChunkSize) + decOutputOffset;
+                decodeLength += dCipher.getOutputSize(lastChunkSize);
+            } else {
+                encodeLength = cipher.getOutputSize(msgSize) + encOutputOffset;
+                decodeLength = dCipher.getOutputSize(encodeLength) + decOutputOffset;
+            }
+
+            input = new byte[inputLength];
+            for (int i = encInputOffset, j = 0; i < inputLength; i++, j++) {
+                input[i] = (byte) (j & 0xff);
+            }
+
+            // do one encode and decode in preparation
+            encode = new byte[encodeLength];
+            decode = new byte[decodeLength];
+            if (testingMisalignment) {
+                decodeMsgSize = cipher.update(input, encInputOffset, (msgSize - lastChunkSize), encode, encOutputOffset);
+                decodeMsgSize += cipher.doFinal(input, (encInputOffset + msgSize - lastChunkSize), lastChunkSize, encode, (encOutputOffset + decodeMsgSize));
+
+                int tempSize = dCipher.update(encode, encOutputOffset, (decodeMsgSize - lastChunkSize), decode, decOutputOffset);
+                dCipher.doFinal(encode, (encOutputOffset + decodeMsgSize - lastChunkSize), lastChunkSize, decode, (decOutputOffset + tempSize));
+            } else {
+                decodeMsgSize = cipher.doFinal(input, encInputOffset, msgSize, encode, encOutputOffset);
+                dCipher.doFinal(encode, encOutputOffset, decodeMsgSize, decode, decOutputOffset);
+            }
+            if (checkOutput) {
+                expectedEncode = (byte[]) encode.clone();
+                expectedDecode = (byte[]) decode.clone();
+                showArray(key.getEncoded(), "key:    ");
+                showArray(input, "input:  ");
+                showArray(encode, "encode: ");
+                showArray(decode, "decode: ");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    void showArray(byte b[], String name) {
+        System.out.format("%s [%d]: ", name, b.length);
+        for (int i = 0; i < Math.min(b.length, 32); i++) {
+            System.out.format("%02x ", b[i] & 0xff);
+        }
+        System.out.println();
+    }
+
+    void compareArrays(byte b[], byte exp[]) {
+        if (b.length != exp.length) {
+            System.out.format("different lengths for actual and expected output arrays\n");
+            showArray(b, "test: ");
+            showArray(exp, "exp : ");
+            System.exit(1);
+        }
+        for (int i = 0; i < exp.length; i++) {
+            if (b[i] != exp[i]) {
+                System.out.format("output error at index %d: got %02x, expected %02x\n", i, b[i] & 0xff, exp[i] & 0xff);
+                showArray(b, "test: ");
+                showArray(exp, "exp : ");
+                System.exit(1);
+            }
+        }
+    }
+
+    void showCipher(Cipher c, String kind) {
+        System.out.println(kind + " cipher provider: " + cipher.getProvider());
+        System.out.println(kind + " cipher algorithm: " + cipher.getAlgorithm());
+    }
+
+    abstract void childShowCipher();
+
+    void gcm_init(boolean encrypt) throws Exception {
+        gcm_spec = new GCMParameterSpec(tlen * 8, iv);
+        if (encrypt) {
+            // Get a new instance everytime because of reuse IV restrictions
+            cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
+            cipher.init(Cipher.ENCRYPT_MODE, key, gcm_spec);
+            cipher.updateAAD(aad);
+        } else {
+            dCipher.init(Cipher.DECRYPT_MODE, key, gcm_spec);
+            dCipher.updateAAD(aad);
+
+
+        }
+    }
+}
diff --git a/test/compiler/codegen/aes/TestAESDecode.java b/test/compiler/codegen/aes/TestAESDecode.java
new file mode 100644
index 0000000..b485520
--- /dev/null
+++ b/test/compiler/codegen/aes/TestAESDecode.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2012, 2014, 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.
+ *
+ */
+
+package compiler.codegen.aes;
+
+import javax.crypto.Cipher;
+
+/**
+ * @author Tom Deneau
+ */
+public class TestAESDecode extends TestAESBase {
+    @Override
+    public void run() {
+        try {
+            if (mode.equals("GCM")) {
+                gcm_init(false);
+            } else if (!noReinit) {
+                dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
+            }
+            decode = new byte[decodeLength];
+            if (testingMisalignment) {
+                int tempSize = dCipher.update(encode, encOutputOffset, (decodeMsgSize - lastChunkSize), decode, decOutputOffset);
+                dCipher.doFinal(encode, (encOutputOffset + decodeMsgSize - lastChunkSize), lastChunkSize, decode, (decOutputOffset + tempSize));
+            } else {
+                dCipher.doFinal(encode, encOutputOffset, decodeMsgSize, decode, decOutputOffset);
+            }
+            if (checkOutput) {
+                compareArrays(decode, expectedDecode);
+            }
+        } catch (Exception e) {
+            throw new Error(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    void childShowCipher() {
+        showCipher(dCipher, "Decryption");
+    }
+}
diff --git a/test/compiler/codegen/aes/TestAESEncode.java b/test/compiler/codegen/aes/TestAESEncode.java
new file mode 100644
index 0000000..c31da69
--- /dev/null
+++ b/test/compiler/codegen/aes/TestAESEncode.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2012, 2015, 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.
+ *
+ */
+
+package compiler.codegen.aes;
+
+import javax.crypto.Cipher;
+
+/**
+ * @author Tom Deneau
+ */
+public class TestAESEncode extends TestAESBase {
+    @Override
+    public void run() {
+        try {
+            if (mode.equals("GCM")) {
+                gcm_init(true);
+            } else if (!noReinit) {
+                cipher.init(Cipher.ENCRYPT_MODE, key, algParams);
+            }
+            encode = new byte[encodeLength];
+            if (testingMisalignment) {
+                int tempSize = cipher.update(input, encInputOffset, (msgSize - lastChunkSize), encode, encOutputOffset);
+                cipher.doFinal(input, (encInputOffset + msgSize - lastChunkSize), lastChunkSize, encode, (encOutputOffset + tempSize));
+            } else {
+                cipher.doFinal(input, encInputOffset, msgSize, encode, encOutputOffset);
+            }
+            if (checkOutput) {
+                compareArrays(encode, expectedEncode);
+            }
+        } catch (Exception e) {
+            throw new Error(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    void childShowCipher() {
+        showCipher(cipher, "Encryption");
+    }
+
+}
diff --git a/test/compiler/codegen/aes/TestAESMain.java b/test/compiler/codegen/aes/TestAESMain.java
new file mode 100644
index 0000000..679cd88
--- /dev/null
+++ b/test/compiler/codegen/aes/TestAESMain.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2012, 2015, 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 7184394
+ * @summary add intrinsics to use AES instructions
+ * @library /testlibrary /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DdecOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640
+ *      compiler.codegen.aes.TestAESMain
+ *
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencOutputOffset=
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DdecOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640
+ *      compiler.codegen.aes.TestAESMain
+ *
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DdecOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640
+ *      compiler.codegen.aes.TestAESMain
+ *
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DdecOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1
+ *      compiler.codegen.aes.TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640
+ *      compiler.codegen.aes.TestAESMain
+ *
+ * @author Tom Deneau
+ */
+
+package compiler.codegen.aes;
+
+public class TestAESMain {
+    public static void main(String[] args) {
+        int iters = (args.length > 0 ? Integer.valueOf(args[0]) : 1000000);
+        int warmupIters = (args.length > 1 ? Integer.valueOf(args[1]) : 20000);
+        System.out.println(iters + " iterations");
+        TestAESEncode etest = new TestAESEncode();
+        etest.prepare();
+        // warm-up
+        System.out.println("Starting encryption warm-up");
+        for (int i = 0; i < warmupIters; i++) {
+            etest.run();
+        }
+        System.out.println("Finished encryption warm-up");
+        long start = System.nanoTime();
+        for (int i = 0; i < iters; i++) {
+            etest.run();
+        }
+        long end = System.nanoTime();
+        System.out.println("TestAESEncode runtime was " + (double) ((end - start) / 1000000.0) + " ms");
+
+        TestAESDecode dtest = new TestAESDecode();
+        dtest.prepare();
+        // warm-up
+        System.out.println("Starting decryption warm-up");
+        for (int i = 0; i < warmupIters; i++) {
+            dtest.run();
+        }
+        System.out.println("Finished decryption warm-up");
+        start = System.nanoTime();
+        for (int i = 0; i < iters; i++) {
+            dtest.run();
+        }
+        end = System.nanoTime();
+        System.out.println("TestAESDecode runtime was " + (double) ((end - start) / 1000000.0) + " ms");
+    }
+}
diff --git a/test/compiler/compilercontrol/InlineMatcherTest.java b/test/compiler/compilercontrol/InlineMatcherTest.java
index afba82b..a406e2e 100644
--- a/test/compiler/compilercontrol/InlineMatcherTest.java
+++ b/test/compiler/compilercontrol/InlineMatcherTest.java
@@ -24,18 +24,23 @@
 /*
  * @test InlineMatcherTest
  * @bug 8074095
+ * @summary Testing of compiler/InlineMatcher
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary /test/lib
- * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI InlineMatcherTest
- * @summary Testing of compiler/InlineMatcher
+ *
+ * @build compiler.compilercontrol.InlineMatcherTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *      compiler.compilercontrol.InlineMatcherTest
  */
 
+package compiler.compilercontrol;
+
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Method;
 import java.util.ArrayList;
-import sun.hotspot.WhiteBox;
 
 public class InlineMatcherTest {
 
@@ -70,17 +75,18 @@
         testCases.add(helper, "--*.*", NO_MATCH); // - is a valid part of the
                                                   // class name
 
-        testCases.add(helper, "+InlineMatcherTest.*", FORCE_INLINE);
-        testCases.add(helper, "+InlineMatcherTest.helper", FORCE_INLINE);
-        testCases.add(helper, "+InlineMatcherTest.helper()", FORCE_INLINE);
-        testCases.add(helper, "+InlineMatcherTest.helper()V", FORCE_INLINE);
-        testCases.add(helper, "+InlineMatcherTest.helper(", FORCE_INLINE);
+        String className = this.getClass().getName().replace('.', '/');
+        testCases.add(helper, "+" + className + ".*", FORCE_INLINE);
+        testCases.add(helper, "+" + className + ".helper", FORCE_INLINE);
+        testCases.add(helper, "+" + className + ".helper()", FORCE_INLINE);
+        testCases.add(helper, "+" + className + ".helper()V", FORCE_INLINE);
+        testCases.add(helper, "+" + className + ".helper(", FORCE_INLINE);
 
-        testCases.add(helper, "-InlineMatcherTest.*", DONT_INLINE);
-        testCases.add(helper, "-InlineMatcherTest.helper", DONT_INLINE);
-        testCases.add(helper, "-InlineMatcherTest.helper()", DONT_INLINE);
-        testCases.add(helper, "-InlineMatcherTest.helper()V", DONT_INLINE);
-        testCases.add(helper, "-InlineMatcherTest.helper(", DONT_INLINE);
+        testCases.add(helper, "-" + className + ".*", DONT_INLINE);
+        testCases.add(helper, "-" + className + ".helper", DONT_INLINE);
+        testCases.add(helper, "-" + className + ".helper()", DONT_INLINE);
+        testCases.add(helper, "-" + className + ".helper()V", DONT_INLINE);
+        testCases.add(helper, "-" + className + ".helper(", DONT_INLINE);
 
         testCases.add(helper, "+abc.*", NO_MATCH);
         testCases.add(helper, "+*.abc", NO_MATCH);
diff --git a/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java b/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java
index bd776c1..882e783 100644
--- a/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java
+++ b/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java
@@ -24,33 +24,35 @@
 /*
  * @test TestCompilerDirectivesCompatibilityBase
  * @bug 8137167
+ * @summary Test compiler control compatibility with compile command
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
+ *
  * @build jdk.test.lib.*
  *        jdk.test.lib.dcmd.*
  *        sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.TestCompilerDirectivesCompatibilityBase
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestCompilerDirectivesCompatibilityBase
- * @summary Test compiler control compatibility with compile command
+ * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
+ *      -XX:+WhiteBoxAPI
+ *      compiler.compilercontrol.TestCompilerDirectivesCompatibilityBase
  */
 
+package compiler.compilercontrol;
+
 import compiler.testlibrary.CompilerUtils;
 import compiler.whitebox.CompilerWhiteBoxTest;
 import jdk.test.lib.dcmd.CommandExecutor;
 import jdk.test.lib.dcmd.JMXExecutor;
 import org.testng.annotations.Test;
-import org.testng.Assert;
 import sun.hotspot.WhiteBox;
 
-import java.io.BufferedReader;
 import java.io.File;
-import java.io.StringReader;
 import java.lang.reflect.Method;
-import java.util.Objects;
 
 public class TestCompilerDirectivesCompatibilityBase {
 
diff --git a/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java b/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java
index 4b06129..9036919 100644
--- a/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java
+++ b/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java
@@ -24,35 +24,28 @@
 /*
  * @test TestCompilerDirectivesCompatibilityCommandOff
  * @bug 8137167
+ * @summary Test compiler control compatibility with compile command
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
+ *
  * @build jdk.test.lib.*
  *        jdk.test.lib.dcmd.*
  *        sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.TestCompilerDirectivesCompatibilityCommandOff
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
  *      -XX:-PrintAssembly -XX:CompileCommand=option,*.helper,bool,PrintAssembly,false
- *      -XX:+WhiteBoxAPI TestCompilerDirectivesCompatibilityCommandOff
- * @summary Test compiler control compatibility with compile command
+ *      -XX:+WhiteBoxAPI
+ *      compiler.compilercontrol.TestCompilerDirectivesCompatibilityCommandOff
  */
 
+package compiler.compilercontrol;
+
 import jdk.test.lib.dcmd.CommandExecutor;
-import jdk.test.lib.dcmd.JMXExecutor;
-
-import org.testng.annotations.Test;
-import org.testng.Assert;
-
-import sun.hotspot.WhiteBox;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.StringReader;
-import java.lang.reflect.Method;
-import java.util.Objects;
 
 public class TestCompilerDirectivesCompatibilityCommandOff extends TestCompilerDirectivesCompatibilityBase {
 
diff --git a/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java b/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java
index e9f2bf1..7336b0e 100644
--- a/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java
+++ b/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java
@@ -24,37 +24,29 @@
 /*
  * @test TestCompilerDirectivesCompatibilityCommandOn
  * @bug 8137167
+ * @summary Test compiler control compatibility with compile command
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
+ *
  * @build jdk.test.lib.*
  *        jdk.test.lib.dcmd.*
  *        sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.TestCompilerDirectivesCompatibilityCommandOn
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
  *      -XX:-PrintAssembly -XX:CompileCommand=print,*.* -XX:+WhiteBoxAPI
- *      TestCompilerDirectivesCompatibilityCommandOn
- * @summary Test compiler control compatibility with compile command
+ *      compiler.compilercontrol.TestCompilerDirectivesCompatibilityCommandOn
  */
 
+package compiler.compilercontrol;
+
 import jdk.test.lib.dcmd.CommandExecutor;
-import jdk.test.lib.dcmd.JMXExecutor;
 
-import org.testng.annotations.Test;
-import org.testng.Assert;
-
-import sun.hotspot.WhiteBox;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.StringReader;
-import java.lang.reflect.Method;
-import java.util.Objects;
-
-public class TestCompilerDirectivesCompatibilityCommandOn extends TestCompilerDirectivesCompatibilityBase{
+public class TestCompilerDirectivesCompatibilityCommandOn extends TestCompilerDirectivesCompatibilityBase {
 
     public void testCompatibility(CommandExecutor executor, int comp_level) throws Exception {
 
diff --git a/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java b/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java
index d4d3718..a827656 100644
--- a/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java
+++ b/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java
@@ -28,30 +28,23 @@
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
+ *
  * @build jdk.test.lib.*
  *        jdk.test.lib.dcmd.*
  *        sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.TestCompilerDirectivesCompatibilityFlag
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
- *      -XX:+PrintAssembly -XX:+WhiteBoxAPI TestCompilerDirectivesCompatibilityFlag
+ *      -XX:+PrintAssembly -XX:+WhiteBoxAPI
+ *      compiler.compilercontrol.TestCompilerDirectivesCompatibilityFlag
  * @summary Test compiler control compatibility with compile command
  */
 
+package compiler.compilercontrol;
+
 import jdk.test.lib.dcmd.CommandExecutor;
-import jdk.test.lib.dcmd.JMXExecutor;
-
-import org.testng.annotations.Test;
-import org.testng.Assert;
-
-import sun.hotspot.WhiteBox;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.StringReader;
-import java.lang.reflect.Method;
-import java.util.Objects;
 
 public class TestCompilerDirectivesCompatibilityFlag extends TestCompilerDirectivesCompatibilityBase {
 
diff --git a/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java b/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java
index 8acac55..ae03d3f 100644
--- a/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java
+++ b/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests CompileCommand=compileonly
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.commandfile.CompileOnlyTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.commandfile.CompileOnlyTest
diff --git a/test/compiler/compilercontrol/commandfile/ExcludeTest.java b/test/compiler/compilercontrol/commandfile/ExcludeTest.java
index 4a4bde5..0caa287 100644
--- a/test/compiler/compilercontrol/commandfile/ExcludeTest.java
+++ b/test/compiler/compilercontrol/commandfile/ExcludeTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests CompileCommand=exclude
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.commandfile.ExcludeTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.commandfile.ExcludeTest
diff --git a/test/compiler/compilercontrol/commandfile/LogTest.java b/test/compiler/compilercontrol/commandfile/LogTest.java
index 75b9e79..1d5768b 100644
--- a/test/compiler/compilercontrol/commandfile/LogTest.java
+++ b/test/compiler/compilercontrol/commandfile/LogTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests CompileCommand=log
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.commandfile.LogTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.commandfile.LogTest
diff --git a/test/compiler/compilercontrol/commandfile/PrintTest.java b/test/compiler/compilercontrol/commandfile/PrintTest.java
index ed45af6..30127ce 100644
--- a/test/compiler/compilercontrol/commandfile/PrintTest.java
+++ b/test/compiler/compilercontrol/commandfile/PrintTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests CompileCommand=print
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.commandfile.PrintTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.commandfile.PrintTest
diff --git a/test/compiler/compilercontrol/commands/CompileOnlyTest.java b/test/compiler/compilercontrol/commands/CompileOnlyTest.java
index db98ab9..49b6c48 100644
--- a/test/compiler/compilercontrol/commands/CompileOnlyTest.java
+++ b/test/compiler/compilercontrol/commands/CompileOnlyTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests CompileCommand=compileonly
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.commands.CompileOnlyTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.commands.CompileOnlyTest
diff --git a/test/compiler/compilercontrol/commands/ExcludeTest.java b/test/compiler/compilercontrol/commands/ExcludeTest.java
index 272d465..d6b931e 100644
--- a/test/compiler/compilercontrol/commands/ExcludeTest.java
+++ b/test/compiler/compilercontrol/commands/ExcludeTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests CompileCommand=exclude
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.commands.ExcludeTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.commands.ExcludeTest
diff --git a/test/compiler/compilercontrol/commands/LogTest.java b/test/compiler/compilercontrol/commands/LogTest.java
index 01189e3..b079475 100644
--- a/test/compiler/compilercontrol/commands/LogTest.java
+++ b/test/compiler/compilercontrol/commands/LogTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests CompileCommand=log
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.commands.LogTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.commands.LogTest
diff --git a/test/compiler/compilercontrol/commands/PrintTest.java b/test/compiler/compilercontrol/commands/PrintTest.java
index f1bbe20..ca5eaa0 100644
--- a/test/compiler/compilercontrol/commands/PrintTest.java
+++ b/test/compiler/compilercontrol/commands/PrintTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests CompileCommand=print
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.commands.PrintTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.commands.PrintTest
diff --git a/test/compiler/compilercontrol/directives/CompileOnlyTest.java b/test/compiler/compilercontrol/directives/CompileOnlyTest.java
index d9e8bd8..fce5841 100644
--- a/test/compiler/compilercontrol/directives/CompileOnlyTest.java
+++ b/test/compiler/compilercontrol/directives/CompileOnlyTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests directives to be able to compile only specified  methods
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.directives.CompileOnlyTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.directives.CompileOnlyTest
diff --git a/test/compiler/compilercontrol/directives/ExcludeTest.java b/test/compiler/compilercontrol/directives/ExcludeTest.java
index 54614ab..fda9b26 100644
--- a/test/compiler/compilercontrol/directives/ExcludeTest.java
+++ b/test/compiler/compilercontrol/directives/ExcludeTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests directives to be able to exclude methods from compilation
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.directives.ExcludeTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.directives.ExcludeTest
diff --git a/test/compiler/compilercontrol/directives/LogTest.java b/test/compiler/compilercontrol/directives/LogTest.java
index 1832323..d5cef20 100644
--- a/test/compiler/compilercontrol/directives/LogTest.java
+++ b/test/compiler/compilercontrol/directives/LogTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests directives to be able to turn on LogCompilation
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.directives.LogTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.directives.LogTest
diff --git a/test/compiler/compilercontrol/directives/PrintTest.java b/test/compiler/compilercontrol/directives/PrintTest.java
index d551865..4132654 100644
--- a/test/compiler/compilercontrol/directives/PrintTest.java
+++ b/test/compiler/compilercontrol/directives/PrintTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests directives to be able to turn on print_assembly
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.directives.PrintTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.directives.PrintTest
diff --git a/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java b/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java
index 01de110..55674eb 100644
--- a/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java
+++ b/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests directives to be able to add and remove directives
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.jcmd.AddAndRemoveTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.jcmd.AddAndRemoveTest
diff --git a/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java b/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java
index e3783b4..598a2ea 100644
--- a/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java
+++ b/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests jcmd to be able to add a directive to compile only specified methods
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.jcmd.AddCompileOnlyTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.jcmd.AddCompileOnlyTest
diff --git a/test/compiler/compilercontrol/jcmd/AddExcludeTest.java b/test/compiler/compilercontrol/jcmd/AddExcludeTest.java
index a4d552f..c8be85d 100644
--- a/test/compiler/compilercontrol/jcmd/AddExcludeTest.java
+++ b/test/compiler/compilercontrol/jcmd/AddExcludeTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests jcmd to be able to add a directive to exclude only specified methods
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.jcmd.AddExcludeTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.jcmd.AddExcludeTest
diff --git a/test/compiler/compilercontrol/jcmd/AddLogTest.java b/test/compiler/compilercontrol/jcmd/AddLogTest.java
index acf98fa..c4ffd00 100644
--- a/test/compiler/compilercontrol/jcmd/AddLogTest.java
+++ b/test/compiler/compilercontrol/jcmd/AddLogTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests jcmd to be able to add a directive to log only specified methods
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.jcmd.AddLogTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.jcmd.AddLogTest
diff --git a/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java b/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java
index aff3938..5d81789 100644
--- a/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java
+++ b/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java
@@ -27,10 +27,14 @@
  * @summary Tests jcmd to be able to add a directive to print assembly
  *          only for specified methods
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.jcmd.AddPrintAssemblyTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.jcmd.AddPrintAssemblyTest
diff --git a/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java b/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java
index 75c2e8a..bd01ba1 100644
--- a/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java
+++ b/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java
@@ -24,13 +24,17 @@
 /*
  * @test
  * @bug 8137167
- * @ignore 8140405
  * @summary Tests jcmd to be able to clear directives added via options
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
+ * @ignore 8140405
  * @build compiler.compilercontrol.jcmd.ClearDirectivesFileStackTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.jcmd.ClearDirectivesFileStackTest
diff --git a/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java b/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java
index 63b467a..d8c8c81 100644
--- a/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java
+++ b/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests clear JCMD command
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.jcmd.ClearDirectivesStackTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.jcmd.ClearDirectivesStackTest
diff --git a/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java b/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java
index 44c1d47..297ad1a 100644
--- a/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java
+++ b/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java
@@ -26,11 +26,15 @@
  * @bug 8137167
  * @summary Tests jcmd to be able to add a directive to compile only specified methods
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
  * @requires vm.flavor != "minimal"
+ *
  * @build compiler.compilercontrol.jcmd.PrintDirectivesTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.jcmd.PrintDirectivesTest
diff --git a/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java b/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java
index 580d9b6..4f8dd0f 100644
--- a/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java
+++ b/test/compiler/compilercontrol/jcmd/StressAddJcmdBase.java
@@ -26,11 +26,11 @@
 import compiler.compilercontrol.parser.HugeDirectiveUtil;
 import compiler.compilercontrol.share.AbstractTestBase;
 import compiler.compilercontrol.share.method.MethodDescriptor;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import compiler.compilercontrol.share.scenario.Executor;
 import jdk.test.lib.OutputAnalyzer;
 import jdk.test.lib.TimeLimitedRunner;
 import jdk.test.lib.Utils;
-import pool.PoolHelper;
 
 import java.util.ArrayList;
 import java.util.List;
diff --git a/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java b/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java
index 83f05f8..2fbe536 100644
--- a/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java
+++ b/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java
@@ -27,9 +27,12 @@
  * @summary Tests jcmd to be able to add a lot of huge directive files with
  *          parallel executed jcmds until timeout has reached
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.jcmd.StressAddMultiThreadedTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
  *        compiler.testlibrary.CompilerUtils
  *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/test/compiler/compilercontrol/logcompilation/LogTest.java b/test/compiler/compilercontrol/logcompilation/LogTest.java
index 68b5981..1535d3e 100644
--- a/test/compiler/compilercontrol/logcompilation/LogTest.java
+++ b/test/compiler/compilercontrol/logcompilation/LogTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Tests LogCompilation executed standalone without log commands or directives
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.logcompilation.LogTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver compiler.compilercontrol.logcompilation.LogTest
diff --git a/test/compiler/compilercontrol/matcher/MethodMatcherTest.java b/test/compiler/compilercontrol/matcher/MethodMatcherTest.java
index 2c8bcb5..91c7fa7 100644
--- a/test/compiler/compilercontrol/matcher/MethodMatcherTest.java
+++ b/test/compiler/compilercontrol/matcher/MethodMatcherTest.java
@@ -26,7 +26,8 @@
  * @bug 8135068
  * @summary Tests CompilerCommand's method matcher
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.matcher.MethodMatcherTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -36,10 +37,10 @@
 
 package compiler.compilercontrol.matcher;
 
-import jdk.test.lib.Pair;
 import compiler.compilercontrol.share.method.MethodDescriptor;
 import compiler.compilercontrol.share.method.MethodGenerator;
-import pool.PoolHelper;
+import compiler.compilercontrol.share.pool.PoolHelper;
+import jdk.test.lib.Pair;
 import sun.hotspot.WhiteBox;
 
 import java.lang.reflect.Executable;
diff --git a/test/compiler/compilercontrol/mixed/RandomCommandsTest.java b/test/compiler/compilercontrol/mixed/RandomCommandsTest.java
index 2455766..85cb8c6 100644
--- a/test/compiler/compilercontrol/mixed/RandomCommandsTest.java
+++ b/test/compiler/compilercontrol/mixed/RandomCommandsTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Randomly generates commands with random types
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.mixed.RandomCommandsTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=600 compiler.compilercontrol.mixed.RandomCommandsTest
diff --git a/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java b/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java
index d573ed0..4b1b6f6 100644
--- a/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java
+++ b/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java
@@ -26,10 +26,14 @@
  * @bug 8137167
  * @summary Randomly generates valid commands with random types
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @build compiler.compilercontrol.mixed.RandomValidCommandsTest
- *        pool.sub.* pool.subpack.* sun.hotspot.WhiteBox
- *        compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.*
+ *        compiler.compilercontrol.share.pool.sub.*
+ *        compiler.compilercontrol.share.pool.subpack.*
+ *        sun.hotspot.WhiteBox
+ *        compiler.testlibrary.CompilerUtils
+ *        compiler.compilercontrol.share.actions.*
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run driver/timeout=600 compiler.compilercontrol.mixed.RandomValidCommandsTest
diff --git a/test/compiler/compilercontrol/parser/DirectiveParserTest.java b/test/compiler/compilercontrol/parser/DirectiveParserTest.java
index e4fda4a..a362e02 100644
--- a/test/compiler/compilercontrol/parser/DirectiveParserTest.java
+++ b/test/compiler/compilercontrol/parser/DirectiveParserTest.java
@@ -26,7 +26,8 @@
  * @bug 8137167
  * @summary Tests directive json parser
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @run driver compiler.compilercontrol.parser.DirectiveParserTest
  */
 
@@ -35,7 +36,6 @@
 import compiler.compilercontrol.share.JSONFile;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.ProcessTools;
 import jdk.test.lib.Utils;
 
 public class DirectiveParserTest {
diff --git a/test/compiler/compilercontrol/parser/DirectiveStressTest.java b/test/compiler/compilercontrol/parser/DirectiveStressTest.java
index c99b531..fa95072 100644
--- a/test/compiler/compilercontrol/parser/DirectiveStressTest.java
+++ b/test/compiler/compilercontrol/parser/DirectiveStressTest.java
@@ -26,7 +26,8 @@
  * @bug 8137167
  * @summary Stress directive json parser
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib ../share /
+ * @library /testlibrary /test/lib /
+ *
  * @run driver compiler.compilercontrol.parser.DirectiveStressTest
  */
 
@@ -35,9 +36,9 @@
 import compiler.compilercontrol.share.AbstractTestBase;
 import compiler.compilercontrol.share.JSONFile;
 import compiler.compilercontrol.share.method.MethodDescriptor;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import compiler.compilercontrol.share.scenario.DirectiveWriter;
 import jdk.test.lib.OutputAnalyzer;
-import pool.PoolHelper;
 
 import java.util.List;
 import java.util.stream.Collectors;
diff --git a/test/compiler/compilercontrol/share/AbstractTestBase.java b/test/compiler/compilercontrol/share/AbstractTestBase.java
index 04d8ada..0baf937 100644
--- a/test/compiler/compilercontrol/share/AbstractTestBase.java
+++ b/test/compiler/compilercontrol/share/AbstractTestBase.java
@@ -25,8 +25,8 @@
 
 import compiler.compilercontrol.share.method.MethodDescriptor;
 import compiler.compilercontrol.share.method.MethodGenerator;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import jdk.test.lib.Pair;
-import pool.PoolHelper;
 
 import java.lang.reflect.Executable;
 import java.util.List;
diff --git a/test/compiler/compilercontrol/share/actions/BaseAction.java b/test/compiler/compilercontrol/share/actions/BaseAction.java
index 3a88286..d8a5bd1 100644
--- a/test/compiler/compilercontrol/share/actions/BaseAction.java
+++ b/test/compiler/compilercontrol/share/actions/BaseAction.java
@@ -23,16 +23,16 @@
 
 package compiler.compilercontrol.share.actions;
 
+import compiler.compilercontrol.share.pool.PoolHelper;
 import compiler.compilercontrol.share.scenario.State;
 import jdk.test.lib.Pair;
 import jdk.test.lib.ProcessTools;
-import pool.PoolHelper;
 
 import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.OutputStreamWriter;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
 import java.lang.reflect.Executable;
 import java.net.InetAddress;
 import java.net.Socket;
diff --git a/test/compiler/compilercontrol/share/actions/CompileAction.java b/test/compiler/compilercontrol/share/actions/CompileAction.java
index 6813736..e01c533 100644
--- a/test/compiler/compilercontrol/share/actions/CompileAction.java
+++ b/test/compiler/compilercontrol/share/actions/CompileAction.java
@@ -23,12 +23,12 @@
 
 package compiler.compilercontrol.share.actions;
 
+import compiler.compilercontrol.share.pool.PoolHelper;
 import compiler.compilercontrol.share.scenario.State;
 import compiler.testlibrary.CompilerUtils;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Pair;
 import jdk.test.lib.Utils;
-import pool.PoolHelper;
 import sun.hotspot.WhiteBox;
 
 import java.lang.reflect.Executable;
diff --git a/test/compiler/compilercontrol/share/method/MethodGenerator.java b/test/compiler/compilercontrol/share/method/MethodGenerator.java
index e14d890..50f5136 100644
--- a/test/compiler/compilercontrol/share/method/MethodGenerator.java
+++ b/test/compiler/compilercontrol/share/method/MethodGenerator.java
@@ -25,10 +25,10 @@
 
 import compiler.compilercontrol.share.method.MethodDescriptor.PatternType;
 import compiler.compilercontrol.share.method.MethodDescriptor.Separator;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import jdk.test.lib.Pair;
 import jdk.test.lib.Triple;
 import jdk.test.lib.Utils;
-import pool.PoolHelper;
 
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
diff --git a/test/compiler/compilercontrol/share/pool/MethodHolder.java b/test/compiler/compilercontrol/share/pool/MethodHolder.java
index 26002b0..a7b367a 100644
--- a/test/compiler/compilercontrol/share/pool/MethodHolder.java
+++ b/test/compiler/compilercontrol/share/pool/MethodHolder.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package pool;
+package compiler.compilercontrol.share.pool;
 
 import jdk.test.lib.Pair;
 
diff --git a/test/compiler/compilercontrol/share/pool/PoolHelper.java b/test/compiler/compilercontrol/share/pool/PoolHelper.java
index 10918ed..ed06e1b 100644
--- a/test/compiler/compilercontrol/share/pool/PoolHelper.java
+++ b/test/compiler/compilercontrol/share/pool/PoolHelper.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package pool;
+package compiler.compilercontrol.share.pool;
 
 import jdk.test.lib.Pair;
-import pool.MethodHolder;
+
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
 import java.util.List;
@@ -53,12 +53,12 @@
     static {
         METHODS = new ArrayList<>();
         List<MethodHolder> holders = new ArrayList<>();
-        holders.add(new pool.sub.Klass());
-        holders.add(new pool.sub.KlassDup());
-        holders.add(new pool.subpack.Klass());
-        holders.add(new pool.subpack.KlassDup());
-        holders.add(new pool.sub.Klass.Internal());
-        holders.add(new pool.subpack.KlassDup.Internal());
+        holders.add(new compiler.compilercontrol.share.pool.sub.Klass());
+        holders.add(new compiler.compilercontrol.share.pool.sub.KlassDup());
+        holders.add(new compiler.compilercontrol.share.pool.subpack.Klass());
+        holders.add(new compiler.compilercontrol.share.pool.subpack.KlassDup());
+        holders.add(new compiler.compilercontrol.share.pool.sub.Klass.Internal());
+        holders.add(new compiler.compilercontrol.share.pool.subpack.KlassDup.Internal());
         for (MethodHolder holder : holders) {
             METHODS.addAll(holder.getAllMethods());
         }
diff --git a/test/compiler/compilercontrol/share/pool/SubMethodHolder.java b/test/compiler/compilercontrol/share/pool/SubMethodHolder.java
index 7ccc739..e9f23fc 100644
--- a/test/compiler/compilercontrol/share/pool/SubMethodHolder.java
+++ b/test/compiler/compilercontrol/share/pool/SubMethodHolder.java
@@ -1,4 +1,4 @@
-package pool;
+package compiler.compilercontrol.share.pool;
 
 import jdk.test.lib.Pair;
 
diff --git a/test/compiler/compilercontrol/share/pool/sub/Klass.java b/test/compiler/compilercontrol/share/pool/sub/Klass.java
index f1a3b3e..3f39c47 100644
--- a/test/compiler/compilercontrol/share/pool/sub/Klass.java
+++ b/test/compiler/compilercontrol/share/pool/sub/Klass.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package pool.sub;
+package compiler.compilercontrol.share.pool.sub;
 
-import pool.MethodHolder;
-import pool.SubMethodHolder;
+import compiler.compilercontrol.share.pool.MethodHolder;
+import compiler.compilercontrol.share.pool.SubMethodHolder;
 
 /**
  * Simple class with methods to test signatures
diff --git a/test/compiler/compilercontrol/share/pool/sub/KlassDup.java b/test/compiler/compilercontrol/share/pool/sub/KlassDup.java
index 6ddcdba..942c79b 100644
--- a/test/compiler/compilercontrol/share/pool/sub/KlassDup.java
+++ b/test/compiler/compilercontrol/share/pool/sub/KlassDup.java
@@ -21,9 +21,9 @@
  * questions.
  */
 
-package pool.sub;
+package compiler.compilercontrol.share.pool.sub;
 
-import pool.MethodHolder;
+import compiler.compilercontrol.share.pool.MethodHolder;
 
 /**
  * Simple class with methods to test signatures
diff --git a/test/compiler/compilercontrol/share/pool/subpack/Klass.java b/test/compiler/compilercontrol/share/pool/subpack/Klass.java
index 59506e9..48220a5 100644
--- a/test/compiler/compilercontrol/share/pool/subpack/Klass.java
+++ b/test/compiler/compilercontrol/share/pool/subpack/Klass.java
@@ -21,15 +21,15 @@
  * questions.
  */
 
-package pool.subpack;
+package compiler.compilercontrol.share.pool.subpack;
 
-import pool.MethodHolder;
+import compiler.compilercontrol.share.pool.MethodHolder;
 
 /**
  * Simple class with methods to test signatures
- * This is a clone of the pool.sub.Klass, but without inner class
+ * This is a clone of the c.c.s.pool.sub.Klass, but without inner class
  * This class has different package name to test prefix patterns like *Klass.
- * *Klass patern should match both pool.sub.Klass and pool.subpack.Klass
+ * *Klass patern should match both c.c.s.pool.sub.Klass and c.c.s.pool.subpack.Klass
  */
 public class Klass extends MethodHolder {
     public void method(int a, String[] ss, Integer i, byte[] bb, double[][] dd) { }
diff --git a/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java b/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java
index f5e930b..a90273a 100644
--- a/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java
+++ b/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java
@@ -21,14 +21,14 @@
  * questions.
  */
 
-package pool.subpack;
+package compiler.compilercontrol.share.pool.subpack;
 
-import pool.MethodHolder;
-import pool.SubMethodHolder;
+import compiler.compilercontrol.share.pool.MethodHolder;
+import compiler.compilercontrol.share.pool.SubMethodHolder;
 
 /**
- * This is a clone of the pool.sub.Klass used to test pattern matching
- * Full class name contains both suffix (Dup) and prefix (pool.subpack)
+ * This is a clone of the c.c.s.pool.sub.Klass used to test pattern matching
+ * Full class name contains both suffix (Dup) and prefix (c.c.s.pool.subpack)
  */
 public class KlassDup extends MethodHolder {
     public void method(int a, String[] ss, Integer i, byte[] bb, double[][] dd) { }
diff --git a/test/compiler/compilercontrol/share/processors/LogProcessor.java b/test/compiler/compilercontrol/share/processors/LogProcessor.java
index d921d1d..0cfc7d6 100644
--- a/test/compiler/compilercontrol/share/processors/LogProcessor.java
+++ b/test/compiler/compilercontrol/share/processors/LogProcessor.java
@@ -25,10 +25,10 @@
 
 import compiler.compilercontrol.share.method.MethodDescriptor;
 import compiler.compilercontrol.share.method.MethodGenerator;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import compiler.compilercontrol.share.scenario.State;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.OutputAnalyzer;
-import pool.PoolHelper;
 
 import java.io.File;
 import java.io.FileNotFoundException;
diff --git a/test/compiler/compilercontrol/share/processors/PrintProcessor.java b/test/compiler/compilercontrol/share/processors/PrintProcessor.java
index dab4349..9fa00c1 100644
--- a/test/compiler/compilercontrol/share/processors/PrintProcessor.java
+++ b/test/compiler/compilercontrol/share/processors/PrintProcessor.java
@@ -26,10 +26,9 @@
 import com.sun.management.HotSpotDiagnosticMXBean;
 import compiler.compilercontrol.share.method.MethodDescriptor;
 import compiler.compilercontrol.share.method.MethodGenerator;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import compiler.compilercontrol.share.scenario.State;
 import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.Pair;
-import pool.PoolHelper;
 
 import java.lang.management.ManagementFactory;
 import java.lang.reflect.Executable;
diff --git a/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java b/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java
index eafbefb..2173128 100644
--- a/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java
+++ b/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java
@@ -24,8 +24,8 @@
 package compiler.compilercontrol.share.scenario;
 
 import compiler.compilercontrol.share.method.MethodDescriptor;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import jdk.test.lib.Pair;
-import pool.PoolHelper;
 
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
@@ -33,7 +33,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Optional;
 import java.util.concurrent.Callable;
 
 /**
diff --git a/test/compiler/compilercontrol/share/scenario/Command.java b/test/compiler/compilercontrol/share/scenario/Command.java
index c4b2193..49fdf74 100644
--- a/test/compiler/compilercontrol/share/scenario/Command.java
+++ b/test/compiler/compilercontrol/share/scenario/Command.java
@@ -24,6 +24,7 @@
 package compiler.compilercontrol.share.scenario;
 
 import compiler.compilercontrol.share.processors.LogProcessor;
+
 import java.util.Arrays;
 
 /**
diff --git a/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java b/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java
index af6c86d..124c265 100644
--- a/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java
+++ b/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java
@@ -26,15 +26,15 @@
 import compiler.compilercontrol.share.JSONFile;
 import compiler.compilercontrol.share.method.MethodDescriptor;
 import compiler.compilercontrol.share.method.MethodGenerator;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import jdk.test.lib.Pair;
-import pool.PoolHelper;
 
 import java.lang.reflect.Executable;
-import java.util.List;
-import java.util.Map;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.concurrent.Callable;
 import java.util.stream.Collectors;
 
diff --git a/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java b/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java
index b799174..bf12f99 100644
--- a/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java
+++ b/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java
@@ -25,7 +25,7 @@
 
 import compiler.compilercontrol.share.method.MethodDescriptor;
 import compiler.compilercontrol.share.method.MethodGenerator;
-import pool.PoolHelper;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import jdk.test.lib.Pair;
 
 import java.lang.reflect.Executable;
diff --git a/test/compiler/compilercontrol/share/scenario/Scenario.java b/test/compiler/compilercontrol/share/scenario/Scenario.java
index a0fefab..8a1723f 100644
--- a/test/compiler/compilercontrol/share/scenario/Scenario.java
+++ b/test/compiler/compilercontrol/share/scenario/Scenario.java
@@ -24,6 +24,7 @@
 package compiler.compilercontrol.share.scenario;
 
 import compiler.compilercontrol.share.method.MethodDescriptor;
+import compiler.compilercontrol.share.pool.PoolHelper;
 import compiler.compilercontrol.share.processors.CommandProcessor;
 import compiler.compilercontrol.share.processors.LogProcessor;
 import compiler.compilercontrol.share.processors.PrintDirectivesProcessor;
@@ -31,7 +32,6 @@
 import jdk.test.lib.Asserts;
 import jdk.test.lib.OutputAnalyzer;
 import jdk.test.lib.Pair;
-import pool.PoolHelper;
 
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
diff --git a/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java b/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java
index 9c3daaf..b3c3d03 100644
--- a/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java
+++ b/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java
@@ -27,10 +27,15 @@
  * @bug 8139771
  * @summary Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
  * @requires vm.gc=="Serial" | vm.gc=="Parallel"
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM TestEliminatedCastPPAtPhi
+ *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *      -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM
+ *      compiler.controldependency.TestEliminatedCastPPAtPhi
  *
  */
 
+package compiler.controldependency;
+
 public class TestEliminatedCastPPAtPhi {
 
     static TestEliminatedCastPPAtPhi saved;
diff --git a/test/compiler/cpuflags/AESIntrinsicsBase.java b/test/compiler/cpuflags/AESIntrinsicsBase.java
index 7be9e43..0aa9dc3 100644
--- a/test/compiler/cpuflags/AESIntrinsicsBase.java
+++ b/test/compiler/cpuflags/AESIntrinsicsBase.java
@@ -21,8 +21,12 @@
  * questions.
  *
  */
+
+package compiler.cpuflags;
+
+import compiler.codegen.aes.TestAESMain;
+import compiler.cpuflags.predicate.AESSupportPredicate;
 import jdk.test.lib.cli.CommandLineOptionTest;
-import predicate.AESSupportPredicate;
 
 import java.util.Arrays;
 import java.util.function.BooleanSupplier;
@@ -45,7 +49,7 @@
     public static final String[] TEST_AES_CMD
             = {"-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsFinal",
             "-Xbatch", "-DcheckOutput=true", "-Dmode=CBC",
-            "TestAESMain"};
+            TestAESMain.class.getName()};
 
     protected AESIntrinsicsBase(BooleanSupplier predicate) {
         super(predicate);
diff --git a/test/compiler/cpuflags/RestoreMXCSR.java b/test/compiler/cpuflags/RestoreMXCSR.java
index 9b75374..b0df389 100644
--- a/test/compiler/cpuflags/RestoreMXCSR.java
+++ b/test/compiler/cpuflags/RestoreMXCSR.java
@@ -28,16 +28,22 @@
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
+ * @run driver compiler.cpuflags.RestoreMXCSR
  */
-import jdk.test.lib.*;
+
+package compiler.cpuflags;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
 
 public class RestoreMXCSR {
-  public static void main(String[] args) throws Exception {
-    ProcessBuilder pb;
-    OutputAnalyzer out;
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer out;
 
-    pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version");
-    out = new OutputAnalyzer(pb.start());
-    out.shouldHaveExitValue(0);
-  }
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version");
+        out = new OutputAnalyzer(pb.start());
+        out.shouldHaveExitValue(0);
+    }
 }
diff --git a/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java
index 75c411d..c5c4db0 100644
--- a/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java
+++ b/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java
@@ -24,18 +24,21 @@
 
 /*
  * @test
- * @library /testlibrary /test/lib /compiler/codegen/7184394 /
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
  * @ignore 8146128
- * @build TestAESIntrinsicsOnSupportedConfig TestAESMain
+ * @build compiler.cpuflags.TestAESIntrinsicsOnSupportedConfig
+ *        compiler.codegen.aes.TestAESMain
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch
- *                   TestAESIntrinsicsOnSupportedConfig
+ *                   compiler.cpuflags.TestAESIntrinsicsOnSupportedConfig
  */
 
+package compiler.cpuflags;
+
 import jdk.test.lib.OutputAnalyzer;
 import jdk.test.lib.Platform;
 import jdk.test.lib.ProcessTools;
diff --git a/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java
index 9bc4662..caef413 100644
--- a/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java
+++ b/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java
@@ -24,19 +24,24 @@
 
 /*
  * @test
- * @library /testlibrary /test/lib /compiler/codegen/7184394 /
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestAESIntrinsicsOnUnsupportedConfig TestAESMain
+ *
+ * @build compiler.cpuflags.TestAESIntrinsicsOnUnsupportedConfig
+ *        compiler.codegen.aes.TestAESMain
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *       -XX:+WhiteBoxAPI -Xbatch  TestAESIntrinsicsOnUnsupportedConfig
+ *       -XX:+WhiteBoxAPI -Xbatch
+ *       compiler.cpuflags.TestAESIntrinsicsOnUnsupportedConfig
  */
 
-import jdk.test.lib.cli.predicate.NotPredicate;
+package compiler.cpuflags;
+
 import jdk.test.lib.OutputAnalyzer;
 import jdk.test.lib.ProcessTools;
+import jdk.test.lib.cli.predicate.NotPredicate;
 
 public class TestAESIntrinsicsOnUnsupportedConfig extends AESIntrinsicsBase {
 
diff --git a/test/compiler/cpuflags/TestSSE4Disabled.java b/test/compiler/cpuflags/TestSSE4Disabled.java
index 2700b91..b1af812 100644
--- a/test/compiler/cpuflags/TestSSE4Disabled.java
+++ b/test/compiler/cpuflags/TestSSE4Disabled.java
@@ -27,8 +27,12 @@
  * @bug 8158214
  * @requires (vm.simpleArch == "x64")
  * @summary Test correct execution without SSE 4.
- * @run main/othervm -Xcomp -XX:UseSSE=3 TestSSE4Disabled
+ *
+ * @run main/othervm -Xcomp -XX:UseSSE=3 compiler.cpuflags.TestSSE4Disabled
  */
+
+package compiler.cpuflags;
+
 public class TestSSE4Disabled {
     public static void main(String args[]) {
         System.out.println("Passed");
diff --git a/test/compiler/cpuflags/predicate/AESSupportPredicate.java b/test/compiler/cpuflags/predicate/AESSupportPredicate.java
index 7b4f78b..3ec85e6 100644
--- a/test/compiler/cpuflags/predicate/AESSupportPredicate.java
+++ b/test/compiler/cpuflags/predicate/AESSupportPredicate.java
@@ -21,9 +21,10 @@
  * questions.
  *
  */
-package predicate;
+package compiler.cpuflags.predicate;
 
 import sun.hotspot.cpuinfo.CPUInfo;
+
 import java.util.function.BooleanSupplier;
 
 public class AESSupportPredicate implements BooleanSupplier {
diff --git a/test/compiler/debug/TraceIterativeGVN.java b/test/compiler/debug/TraceIterativeGVN.java
index 7d98dd6..1656b1b 100644
--- a/test/compiler/debug/TraceIterativeGVN.java
+++ b/test/compiler/debug/TraceIterativeGVN.java
@@ -25,10 +25,14 @@
 
 /*
  * @test
+ *
  * @run main/othervm -Xbatch -XX:-TieredCompilation
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceIterativeGVN
- *                   TraceIterativeGVN
+ *                   compiler.debug.TraceIterativeGVN
  */
+
+package compiler.debug;
+
 public class TraceIterativeGVN {
     public static void main(String[] args) {
         for (int i = 0; i < 100_000; i++) {
diff --git a/test/compiler/debug/VerifyAdapterSharing.java b/test/compiler/debug/VerifyAdapterSharing.java
index 418eed7..263f263 100644
--- a/test/compiler/debug/VerifyAdapterSharing.java
+++ b/test/compiler/debug/VerifyAdapterSharing.java
@@ -28,17 +28,23 @@
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
+ * @run driver compiler.debug.VerifyAdapterSharing
  */
-import jdk.test.lib.*;
+
+package compiler.debug;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
 
 public class VerifyAdapterSharing {
-  public static void main(String[] args) throws Exception {
-    ProcessBuilder pb;
-    OutputAnalyzer out;
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer out;
 
-    pb = ProcessTools.createJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions",
-                                               "-XX:+VerifyAdapterSharing", "-version");
-    out = new OutputAnalyzer(pb.start());
-    out.shouldHaveExitValue(0);
-  }
+        pb = ProcessTools.createJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions",
+                "-XX:+VerifyAdapterSharing", "-version");
+        out = new OutputAnalyzer(pb.start());
+        out.shouldHaveExitValue(0);
+    }
 }
diff --git a/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java b/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java
index 365ca7b..0016c92 100644
--- a/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java
+++ b/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java
@@ -25,11 +25,17 @@
  * @test
  * @bug 8050079
  * @summary Compiles a monomorphic call to finalizeObject() on a modified java.lang.Object to test C1 CHA.
+ *
  * @build java.base/java.lang.Object
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-VerifyDependencies
- *                   -XX:TieredStopAtLevel=1 -XX:CompileOnly=TestMonomorphicObjectCall::callFinalize
- *                   -XX:CompileOnly=java.lang.Object::finalizeObject TestMonomorphicObjectCall
+ *                   -XX:TieredStopAtLevel=1
+ *                   -XX:CompileCommand=compileonly,compiler.dependencies.MonomorphicObjectCall.TestMonomorphicObjectCall::callFinalize
+ *                   -XX:CompileCommand=compileonly,java.lang.Object::finalizeObject
+ *                   compiler.dependencies.MonomorphicObjectCall.TestMonomorphicObjectCall
  */
+
+package compiler.dependencies.MonomorphicObjectCall;
+
 public class TestMonomorphicObjectCall {
 
     private static void callFinalize(Object object) throws Throwable {
diff --git a/test/compiler/eliminateAutobox/6934604/TestByteBoxing.java b/test/compiler/eliminateAutobox/TestByteBoxing.java
similarity index 95%
rename from test/compiler/eliminateAutobox/6934604/TestByteBoxing.java
rename to test/compiler/eliminateAutobox/TestByteBoxing.java
index ee5511a..1b96d7f 100644
--- a/test/compiler/eliminateAutobox/6934604/TestByteBoxing.java
+++ b/test/compiler/eliminateAutobox/TestByteBoxing.java
@@ -24,15 +24,23 @@
 /*
  * @test
  * @bug 6934604
- * @summary enable parts of EliminateAutoBox by default
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestByteBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
- * -XX:CompileCommand=exclude,TestByteBoxing.dummy -XX:CompileCommand=exclude,TestByteBoxing.foo -XX:CompileCommand=exclude,TestByteBoxing.foob TestByteBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
- * -XX:CompileCommand=exclude,TestByteBoxing.dummy -XX:CompileCommand=exclude,TestByteBoxing.foo -XX:CompileCommand=exclude,TestByteBoxing.foob TestByteBoxing
  *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   compiler.eliminateAutobox.TestByteBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foob
+ *                   compiler.eliminateAutobox.TestByteBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foob
+ *                   compiler.eliminateAutobox.TestByteBoxing
  */
 
+package compiler.eliminateAutobox;
+
 public class TestByteBoxing {
 
   static final Byte ibc = new Byte((byte)1);
diff --git a/test/compiler/eliminateAutobox/6934604/TestDoubleBoxing.java b/test/compiler/eliminateAutobox/TestDoubleBoxing.java
similarity index 95%
rename from test/compiler/eliminateAutobox/6934604/TestDoubleBoxing.java
rename to test/compiler/eliminateAutobox/TestDoubleBoxing.java
index 7b76ac9..63e027a 100644
--- a/test/compiler/eliminateAutobox/6934604/TestDoubleBoxing.java
+++ b/test/compiler/eliminateAutobox/TestDoubleBoxing.java
@@ -25,14 +25,23 @@
  * @test
  * @bug 6934604
  * @summary enable parts of EliminateAutoBox by default
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestDoubleBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
- * -XX:CompileCommand=exclude,TestDoubleBoxing.dummy -XX:CompileCommand=exclude,TestDoubleBoxing.foo -XX:CompileCommand=exclude,TestDoubleBoxing.foob TestDoubleBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
- * -XX:CompileCommand=exclude,TestDoubleBoxing.dummy -XX:CompileCommand=exclude,TestDoubleBoxing.foo -XX:CompileCommand=exclude,TestDoubleBoxing.foob TestDoubleBoxing
  *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   compiler.eliminateAutobox.TestDoubleBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foob
+ *                   compiler.eliminateAutobox.TestDoubleBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foob
+ *                   compiler.eliminateAutobox.TestDoubleBoxing
  */
 
+package compiler.eliminateAutobox;
+
 public class TestDoubleBoxing {
 
   static final Double ibc = new Double(1.);
diff --git a/test/compiler/eliminateAutobox/6934604/TestFloatBoxing.java b/test/compiler/eliminateAutobox/TestFloatBoxing.java
similarity index 95%
rename from test/compiler/eliminateAutobox/6934604/TestFloatBoxing.java
rename to test/compiler/eliminateAutobox/TestFloatBoxing.java
index 4571673..756e990 100644
--- a/test/compiler/eliminateAutobox/6934604/TestFloatBoxing.java
+++ b/test/compiler/eliminateAutobox/TestFloatBoxing.java
@@ -25,14 +25,23 @@
  * @test
  * @bug 6934604
  * @summary enable parts of EliminateAutoBox by default
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestFloatBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
- * -XX:CompileCommand=exclude,TestFloatBoxing.dummy -XX:CompileCommand=exclude,TestFloatBoxing.foo -XX:CompileCommand=exclude,TestFloatBoxing.foob TestFloatBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
- * -XX:CompileCommand=exclude,TestFloatBoxing.dummy -XX:CompileCommand=exclude,TestFloatBoxing.foo -XX:CompileCommand=exclude,TestFloatBoxing.foob TestFloatBoxing
  *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   compiler.eliminateAutobox.TestFloatBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::foob
+ *                   compiler.eliminateAutobox.TestFloatBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::foob
+ *                   compiler.eliminateAutobox.TestFloatBoxing
  */
 
+package compiler.eliminateAutobox;
+
 public class TestFloatBoxing {
 
   static final Float ibc = new Float(1.f);
diff --git a/test/compiler/eliminateAutobox/6934604/TestIntBoxing.java b/test/compiler/eliminateAutobox/TestIntBoxing.java
similarity index 95%
rename from test/compiler/eliminateAutobox/6934604/TestIntBoxing.java
rename to test/compiler/eliminateAutobox/TestIntBoxing.java
index d1ad10b..8c2eec1 100644
--- a/test/compiler/eliminateAutobox/6934604/TestIntBoxing.java
+++ b/test/compiler/eliminateAutobox/TestIntBoxing.java
@@ -25,14 +25,23 @@
  * @test
  * @bug 6934604
  * @summary enable parts of EliminateAutoBox by default
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestIntBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
- * -XX:CompileCommand=exclude,TestIntBoxing.dummy -XX:CompileCommand=exclude,TestIntBoxing.foo -XX:CompileCommand=exclude,TestIntBoxing.foob TestIntBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
- * -XX:CompileCommand=exclude,TestIntBoxing.dummy -XX:CompileCommand=exclude,TestIntBoxing.foo -XX:CompileCommand=exclude,TestIntBoxing.foob TestIntBoxing
  *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   compiler.eliminateAutobox.TestIntBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::foob
+ *                   compiler.eliminateAutobox.TestIntBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::foob
+ *                   compiler.eliminateAutobox.TestIntBoxing
  */
 
+package compiler.eliminateAutobox;
+
 public class TestIntBoxing {
 
   static final Integer ibc = new Integer(1);
diff --git a/test/compiler/eliminateAutobox/6934604/TestLongBoxing.java b/test/compiler/eliminateAutobox/TestLongBoxing.java
similarity index 95%
rename from test/compiler/eliminateAutobox/6934604/TestLongBoxing.java
rename to test/compiler/eliminateAutobox/TestLongBoxing.java
index b92a01c..a354831 100644
--- a/test/compiler/eliminateAutobox/6934604/TestLongBoxing.java
+++ b/test/compiler/eliminateAutobox/TestLongBoxing.java
@@ -25,14 +25,23 @@
  * @test
  * @bug 6934604
  * @summary enable parts of EliminateAutoBox by default
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestLongBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
- * -XX:CompileCommand=exclude,TestLongBoxing.dummy -XX:CompileCommand=exclude,TestLongBoxing.foo -XX:CompileCommand=exclude,TestLongBoxing.foob TestLongBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
- * -XX:CompileCommand=exclude,TestLongBoxing.dummy -XX:CompileCommand=exclude,TestLongBoxing.foo -XX:CompileCommand=exclude,TestLongBoxing.foob TestLongBoxing
  *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   compiler.eliminateAutobox.TestLongBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::foob
+ *                   compiler.eliminateAutobox.TestLongBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::foob
+ *                   compiler.eliminateAutobox.TestLongBoxing
  */
 
+package compiler.eliminateAutobox;
+
 public class TestLongBoxing {
 
   static final Long ibc = new Long(1);
diff --git a/test/compiler/eliminateAutobox/6934604/TestShortBoxing.java b/test/compiler/eliminateAutobox/TestShortBoxing.java
similarity index 95%
rename from test/compiler/eliminateAutobox/6934604/TestShortBoxing.java
rename to test/compiler/eliminateAutobox/TestShortBoxing.java
index 0f065af..3db1846 100644
--- a/test/compiler/eliminateAutobox/6934604/TestShortBoxing.java
+++ b/test/compiler/eliminateAutobox/TestShortBoxing.java
@@ -25,14 +25,23 @@
  * @test
  * @bug 6934604
  * @summary enable parts of EliminateAutoBox by default
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestShortBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
- * -XX:CompileCommand=exclude,TestShortBoxing.dummy -XX:CompileCommand=exclude,TestShortBoxing.foo -XX:CompileCommand=exclude,TestShortBoxing.foob TestShortBoxing
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
- * -XX:CompileCommand=exclude,TestShortBoxing.dummy -XX:CompileCommand=exclude,TestShortBoxing.foo -XX:CompileCommand=exclude,TestShortBoxing.foob TestShortBoxing
  *
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   compiler.eliminateAutobox.TestShortBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::foob
+ *                   compiler.eliminateAutobox.TestShortBoxing
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::dummy
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::foo
+ *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::foob
+ *                   compiler.eliminateAutobox.TestShortBoxing
  */
 
+package compiler.eliminateAutobox;
+
 public class TestShortBoxing {
 
   static final Short ibc = new Short((short)1);
diff --git a/test/compiler/eliminateAutobox/UnsignedLoads.java b/test/compiler/eliminateAutobox/UnsignedLoads.java
index 440a4b6..e5dbe6a 100644
--- a/test/compiler/eliminateAutobox/UnsignedLoads.java
+++ b/test/compiler/eliminateAutobox/UnsignedLoads.java
@@ -27,10 +27,14 @@
  * @test
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
+ *
  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
  *                   -XX:CompileOnly=::valueOf,::byteValue,::shortValue,::testUnsignedByte,::testUnsignedShort
- *                   UnsignedLoads
+ *                   compiler.eliminateAutobox.UnsignedLoads
  */
+
+package compiler.eliminateAutobox;
+
 import static jdk.test.lib.Asserts.assertEQ;
 
 public class UnsignedLoads {
diff --git a/test/compiler/escapeAnalysis/6689060/Test.java b/test/compiler/escapeAnalysis/6689060/Test.java
deleted file mode 100644
index 46dbc7e..0000000
--- a/test/compiler/escapeAnalysis/6689060/Test.java
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * Copyright (c) 2008, 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 6689060
- * @summary Escape Analysis does not work with Compressed Oops
- * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.dummy -XX:+AggressiveOpts Test
- */
-
-import java.lang.reflect.Array;
-
-class Point {
-  int x;
-  int y;
-  Point next;
-  int ax[];
-  int ay[];
-  Point pax[];
-  Point pay[];
-  public Point getNext() {
-    return next;
-  }
-}
-
-public class Test {
-
-  void dummy() {
-    // Empty method to verify correctness of DebugInfo.
-    // Use -XX:CompileCommand=exclude,Test.dummy
-  }
-
-  int ival(int i) {
-    return i*2;
-  }
-
-  int test80(int y, int l, int i) {
-    Point p = new Point();
-    p.ax = new int[2];
-    p.ay = new int[2];
-    int x = 3;
-    p.ax[0] = x;
-    p.ay[1] = 3 * x + y;
-    dummy();
-    return p.ax[0] * p.ay[1];
-  }
-
-  int test81(int y, int l, int i) {
-    Point p = new Point();
-    p.ax = new int[2];
-    p.ay = new int[2];
-    int x = 3;
-    p.ax[0] = x;
-    p.ay[1] = 3 * x + y;
-    dummy();
-    return p.ax[0] * p.ay[1];
-  }
-
-
-  int test44(int y) {
-    Point p1 = new Point();
-    p1.x = ival(3);
-    dummy();
-    p1.y = 3 * p1.x + y;
-    return p1.y;
-  }
-
-  int test43(int y) {
-    Point p1 = new Point();
-    if ( (y & 1) == 1 ) {
-      p1.x = ival(3);
-    } else {
-      p1.x = ival(5);
-    }
-    dummy();
-    p1.y = 3 * p1.x + y;
-    return p1.y;
-  }
-
-  int test42(int y) {
-    Point p1 = new Point();
-    p1.x = 3;
-    for (int i = 0; i < y; i++) {
-      if ( (i & 1) == 1 ) {
-        p1.x += 4;
-      }
-    }
-    p1.y = 3 * y + p1.x;
-    return p1.y;
-  }
-
-  int test40(int y) {
-    Point p1 = new Point();
-    if ( (y & 1) == 1 ) {
-      p1.x = 3;
-    } else {
-      p1.x = 5;
-    }
-    p1.y = 3 * p1.x + y;
-    return p1.y;
-  }
-
-  int test41(int y) {
-    Point p1 = new Point();
-    if ( (y & 1) == 1 ) {
-      p1.x += 4;
-    } else {
-      p1.x += 5;
-    }
-    p1.y = 3 * p1.x + y;
-    return p1.y;
-  }
-
-  Point test00(int y) {
-    int x = 3;
-    Point p = new Point();
-    p.x = x;
-    p.y = 3 * x + y;
-    return p;
-  }
-
-  Point test01(int y) {
-    int x = 3;
-    Point p = new Point();
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p;
-  }
-
-  Point test02(int y) {
-    int x = 3;
-    Point p1 = null;
-    for (int i = 0; i < y; i++) {
-      Point p2 = new Point();
-      p2.x = x;
-      p2.y = 3 * y + x;
-      p2.next = p1;
-      p1 = p2;
-    }
-    return p1;
-  }
-
-  Point test03(int y) {
-    int x = 3;
-    Point p1 = null;
-    for (int i = 0; i < y; i++) {
-      Point p2 = new Point();
-      p2.x = x;
-      p2.y = 3 * y + x;
-      p2.next = p1;
-      p1 = p2;
-    }
-    dummy();
-    return p1;
-  }
-
-  Point test04(int y) {
-    int x = 3;
-    Point p1 = null;
-    for (int i = 0; i < y; i++) {
-      Point p2 = new Point();
-      p2.x = x;
-      p2.y = 3 * y + x;
-      p2.next = p1;
-      dummy();
-      p1 = p2;
-    }
-    return p1;
-  }
-
-  int test05(int y) {
-    int x = 3;
-    Point p1 = new Point();
-    for (int i = 0; i < y; i++) {
-      Point p2 = new Point();
-      p2.x = x;
-      p2.y = 3 * y + x;
-      p1.next = p2;
-      p1 = p2;
-    }
-    return p1.y;
-  }
-
-  int test0(int y) {
-    int x = 3;
-    Point p = new Point();
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test1(int y) {
-    Point p = new Point();
-    if ( (y & 1) == 1 ) {
-      p = new Point(); // Kill previous
-    }
-    int x = 3;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test2(int y) {
-    Point p1 = new Point();
-    Point p2 = new Point();
-    p1.x = 3;
-    p2.x = 4;
-    p1.y = 3 * p2.x + y;
-    p2.y = 3 * p1.x + y;
-    dummy();
-    return p1.y * p2.y;
-  }
-
-  int test3(int y, Point p1) {
-    Point p2 = new Point();
-    p1.x = 3;
-    p2.x = 4;
-    p1.y = 3 * p2.x + y;
-    p2.y = 3 * p1.x + y;
-    dummy();
-    return p1.y * p2.y;
-  }
-
-  int test4(int y) {
-    Point p1 = new Point();
-    Point p2 = new Point();
-    if ( (y & 1) == 1 ) {
-      p1.x = 3;
-      p2.x = 4;
-    } else {
-      p1.x = 5;
-      p2.x = 6;
-    }
-    p1.y = 3 * p2.x + y;
-    p2.y = 3 * p1.x + y;
-    dummy();
-    return p1.y * p2.y;
-  }
-
-  int test5(int y, Point p1) {
-    Point p2 = new Point();
-    if ( (y & 1) == 1 ) {
-      p1.x = 3;
-      p2.x = 4;
-    } else {
-      p1.x = 5;
-      p2.x = 6;
-    }
-    p1.y = 3 * p2.x + y;
-    p2.y = 3 * p1.x + y;
-    dummy();
-    return p1.y * p2.y;
-  }
-
-  int test6(int y) {
-    Point p1 = new Point();
-    Point p2 = new Point();
-    p1.next = p2;
-    if ( (y & 1) == 1 ) {
-      p1.x = 3;
-      p1.getNext().x = 4;
-    } else {
-      p1.x = 5;
-      p1.getNext().x = 6;
-    }
-    p1.y = 3 * p2.x + y;
-    p2.y = 3 * p1.x + y;
-    dummy();
-    return p1.y * p2.y;
-  }
-
-  int test7(int y, Point p1) {
-    Point p2 = new Point();
-    p1.next = p2;
-    if ( (y & 1) == 1 ) {
-      p1.x = 3;
-      p1.getNext().x = 4;
-    } else {
-      p1.x = 5;
-      p1.getNext().x = 6;
-    }
-    p1.y = 3 * p2.x + y;
-    p2.y = 3 * p1.x + y;
-    dummy();
-    return p1.y * p2.y;
-  }
-
-  int test8(int y, int l, int i) {
-    Point p = new Point();
-    p.ax = new int[l];
-    p.ay = new int[l];
-    int x = 3;
-    p.ax[i] = x;
-    p.ay[i] = 3 * x + y;
-    dummy();
-    return p.ax[i] * p.ay[i];
-  }
-
-  int test9(int y, int l, int i) {
-    Point p = new Point();
-    p.pax = new Point[l];
-    p.pay = new Point[l];
-    p.pax[i] = new Point();
-    p.pay[i] = new Point();
-    p.pax[i].x = 3;
-    p.pay[i].x = 4;
-    p.pax[i].y = 3 * p.pay[i].x + y;
-    p.pay[i].y = 3 * p.pax[i].x + y;
-    dummy();
-    return p.pax[i].y * p.pay[i].y;
-  }
-
-  int test10(int y, int l, int i, Class cls) {
-    Point p = new Point();
-    try {
-      p.pax = (Point[])Array.newInstance(cls, l);
-      p.pax[i] = (Point)cls.newInstance();
-    }
-    catch(java.lang.InstantiationException ex) {
-      return 0;
-    }
-    catch(java.lang.IllegalAccessException ex) {
-      return 0;
-    }
-    p.pax[i].x = 3;
-    p.pax[i].y = 3 * p.pax[i].x + y;
-    dummy();
-    return p.pax[i].x * p.pax[i].y;
-  }
-
-  int test11(int y) {
-    Point p1 = new Point();
-    Point p2 = new Point();
-    p1.next = p2;
-    if ( (y & 1) == 1 ) {
-      p1.x = 3;
-      p1.next.x = 4;
-    } else {
-      p1.x = 5;
-      p1.next.x = 6;
-    }
-    p1.y = 3 * p1.next.x + y;
-    p1.next.y = 3 * p1.x + y;
-    dummy();
-    return p1.y * p1.next.y;
-  }
-
-  int test12(int y) {
-    Point p1 = new Point();
-    p1.next = p1;
-    if ( (y & 1) == 1 ) {
-      p1.x = 3;
-      p1.next.x = 4;
-    } else {
-      p1.x = 5;
-      p1.next.x = 6;
-    }
-    p1.y = 3 * p1.next.x + y;
-    p1.next.y = 3 * p1.x + y;
-    dummy();
-    return p1.y * p1.next.y;
-  }
-
-
-  public static void main(String args[]) {
-    Test tsr    = new Test();
-    Point p     = new Point();
-    Point ptmp  = p;
-    Class cls   = Point.class;
-    int y = 0;
-    for (int i=0; i<10000; i++) {
-      ptmp.next = tsr.test00(1);
-      ptmp.next = tsr.test01(1);
-      ptmp.next = tsr.test02(1);
-      ptmp.next = tsr.test03(1);
-      ptmp.next = tsr.test04(1);
-
-      y = tsr.test05(1);
-
-      y = tsr.test80(y, 1, 0);
-      y = tsr.test81(y, 1, 0);
-
-      y = tsr.test44(y);
-      y = tsr.test43(y);
-      y = tsr.test42(y);
-      y = tsr.test40(y);
-      y = tsr.test41(y);
-
-      y = tsr.test0(y);
-      y = tsr.test1(y);
-      y = tsr.test2(y);
-      y = tsr.test3(y, p);
-      y = tsr.test4(y);
-      y = tsr.test5(y, p);
-      y = tsr.test6(y);
-      y = tsr.test7(y, p);
-      y = tsr.test8(y, 1, 0);
-      y = tsr.test9(y, 1, 0);
-      y = tsr.test10(y, 1, 0, cls);
-      y = tsr.test11(y);
-      y = tsr.test12(y);
-    }
-    for (int i=0; i<10000; i++) {
-      ptmp.next = tsr.test00(1);
-      ptmp.next = tsr.test01(1);
-      ptmp.next = tsr.test02(1);
-      ptmp.next = tsr.test03(1);
-      ptmp.next = tsr.test04(1);
-
-      y = tsr.test05(1);
-
-      y = tsr.test80(y, 1, 0);
-      y = tsr.test81(y, 1, 0);
-
-      y = tsr.test44(y);
-      y = tsr.test43(y);
-      y = tsr.test42(y);
-      y = tsr.test40(y);
-      y = tsr.test41(y);
-
-      y = tsr.test0(y);
-      y = tsr.test1(y);
-      y = tsr.test2(y);
-      y = tsr.test3(y, p);
-      y = tsr.test4(y);
-      y = tsr.test5(y, p);
-      y = tsr.test6(y);
-      y = tsr.test7(y, p);
-      y = tsr.test8(y, 1, 0);
-      y = tsr.test9(y, 1, 0);
-      y = tsr.test10(y, 1, 0, cls);
-      y = tsr.test11(y);
-      y = tsr.test12(y);
-    }
-    for (int i=0; i<10000; i++) {
-      ptmp.next = tsr.test00(1);
-      ptmp.next = tsr.test01(1);
-      ptmp.next = tsr.test02(1);
-      ptmp.next = tsr.test03(1);
-      ptmp.next = tsr.test04(1);
-
-      y = tsr.test05(1);
-
-      y = tsr.test80(y, 1, 0);
-      y = tsr.test81(y, 1, 0);
-
-      y = tsr.test44(y);
-      y = tsr.test43(y);
-      y = tsr.test42(y);
-      y = tsr.test40(y);
-      y = tsr.test41(y);
-
-      y = tsr.test0(y);
-      y = tsr.test1(y);
-      y = tsr.test2(y);
-      y = tsr.test3(y, p);
-      y = tsr.test4(y);
-      y = tsr.test5(y, p);
-      y = tsr.test6(y);
-      y = tsr.test7(y, p);
-      y = tsr.test8(y, 1, 0);
-      y = tsr.test9(y, 1, 0);
-      y = tsr.test10(y, 1, 0, cls);
-      y = tsr.test11(y);
-      y = tsr.test12(y);
-    }
-
-    int z = 0;
-    y = tsr.test80(0, 1, 0);
-    z += y;
-    System.out.println("After 'test80' y=" + y);
-    y = tsr.test81(0, 1, 0);
-    z += y;
-    System.out.println("After 'test81' y=" + y);
-
-    y = tsr.test44(0);
-    z += y;
-    System.out.println("After 'test44' y=" + y);
-    y = tsr.test43(0);
-    z += y;
-    System.out.println("After 'test43' y=" + y);
-    y = tsr.test42(0);
-    z += y;
-    System.out.println("After 'test42' y=" + y);
-    y = tsr.test40(0);
-    z += y;
-    System.out.println("After 'test40' y=" + y);
-    y = tsr.test41(0);
-    z += y;
-    System.out.println("After 'test41' y=" + y);
-
-    ptmp.next = tsr.test00(1);
-    z += y;
-    System.out.println("After 'test00' p.y=" + ptmp.next.y);
-    ptmp.next = tsr.test01(1);
-    z += y;
-    System.out.println("After 'test01' p.y=" + ptmp.next.y);
-    ptmp.next = tsr.test02(1);
-    z += y;
-    System.out.println("After 'test02' p.y=" + ptmp.next.y);
-    ptmp.next = tsr.test03(1);
-    z += y;
-    System.out.println("After 'test03' p.y=" + ptmp.next.y);
-    ptmp.next = tsr.test04(1);
-    z += y;
-    System.out.println("After 'test04' p.y=" + ptmp.next.y);
-
-    y = tsr.test05(1);
-    z += y;
-    System.out.println("After 'test05' y=" + y);
-
-    y = tsr.test0(0);
-    z += y;
-    System.out.println("After 'test0' y=" + y);
-    y = tsr.test1(0);
-    z += y;
-    System.out.println("After 'test1' y=" + y);
-    y = tsr.test2(0);
-    z += y;
-    System.out.println("After 'test2' y=" + y);
-    y = tsr.test3(0, new Point());
-    z += y;
-    System.out.println("After 'test3' y=" + y);
-    y = tsr.test4(0);
-    z += y;
-    System.out.println("After 'test4' y=" + y);
-    y = tsr.test5(0, new Point());
-    z += y;
-    System.out.println("After 'test5' y=" + y);
-    y = tsr.test6(0);
-    z += y;
-    System.out.println("After 'test6' y=" + y);
-    y = tsr.test7(0, new Point());
-    z += y;
-    System.out.println("After 'test7' y=" + y);
-    y = tsr.test8(0, 1, 0);
-    z += y;
-    System.out.println("After 'test8' y=" + y);
-    y = tsr.test9(0, 1, 0);
-    z += y;
-    System.out.println("After 'test9' y=" + y);
-    y = tsr.test10(0, 1, 0, cls);
-    z += y;
-    System.out.println("After 'test10' y=" + y);
-    y = tsr.test11(0);
-    z += y;
-    System.out.println("After 'test11' y=" + y);
-    y = tsr.test12(0);
-    z += y;
-    System.out.println("After 'test12' y=" + y);
-    System.out.println("Sum of y =" + z);
-  }
-}
diff --git a/test/compiler/escapeAnalysis/6726999/Test.java b/test/compiler/escapeAnalysis/6726999/Test.java
deleted file mode 100644
index db2ba6d..0000000
--- a/test/compiler/escapeAnalysis/6726999/Test.java
+++ /dev/null
@@ -1,1419 +0,0 @@
-/*
- * Copyright (c) 2008, 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 6726999
- * @summary nsk/stress/jck12a/jck12a010 assert(n != NULL,"Bad immediate dominator info.");
- * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.dummy -XX:+AggressiveOpts Test
- */
-
-import java.lang.reflect.Array;
-
-class Point {
-  int x;
-  int y;
-}
-
-public class Test {
-
-  void dummy() {
-    // Empty method to verify correctness of DebugInfo.
-    // Use -XX:CompileCommand=exclude,Test.dummy
-  }
-
-  int test0_0_0(int y) {
-    int x = 3;
-    Point p = new Point();
-    dummy();
-    p.x = x;
-    p.y = 3 * x + y;
-    return p.x * p.y;
-  }
-
-  int test0_0_1(int y) {
-    int x = 3;
-    Point p = null;
-    dummy();
-    p = new Point();
-    dummy();
-    p.x = x;
-    p.y = 3 * x + y;
-    return p.x * p.y;
-  }
-
-  int test0_0_2(int y) {
-    int x = 3;
-    Point p = new Point();
-    dummy();
-    p = new Point();
-    dummy();
-    p.x = x;
-    p.y = 3 * x + y;
-    return p.x * p.y;
-  }
-
-  int test0_0_3(int y) {
-    int x = 3;
-    Point p[] = new Point[1];
-    p[0] = new Point();
-    dummy();
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    return p[0].x * p[0].y;
-  }
-
-  int test0_0_4(int y) {
-    int x = 3;
-    Point p[] = new Point[1];
-    dummy();
-    p[0] = new Point();
-    dummy();
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    return p[0].x * p[0].y;
-  }
-
-  int test0_0_5(int y) {
-    int x = 3;
-    Point p[] = new Point[1];
-    dummy();
-    p[0] = null;
-    dummy();
-    p[0] = new Point();
-    dummy();
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    return p[0].x * p[0].y;
-  }
-
-  int test0_0_6(int y) {
-    int x = 3;
-    Point p[] = new Point[1];
-    p[0] = new Point();
-    dummy();
-    p[0] = new Point();
-    dummy();
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    return p[0].x * p[0].y;
-  }
-
-  int test0_1_3(int y) {
-    int x = 3;
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    p[0] = p1;
-    dummy();
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    return p[0].x * p[0].y;
-  }
-
-  int test0_1_4(int y) {
-    int x = 3;
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    dummy();
-    p[0] = p1;
-    dummy();
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    return p[0].x * p[0].y;
-  }
-
-  int test0_1_5(int y) {
-    int x = 3;
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    dummy();
-    p[0] = null;
-    dummy();
-    p[0] = p1;
-    dummy();
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    return p[0].x * p[0].y;
-  }
-
-  int test0_1_6(int y) {
-    int x = 3;
-    Point p1 = new Point();
-    dummy();
-    Point p2 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    p[0] = p1;
-    dummy();
-    p[0] = p2;
-    dummy();
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    return p[0].x * p[0].y;
-  }
-
-  int test1_0_0(int y) {
-    Point p = new Point();
-    if ( (y & 1) == 1 ) {
-      p = new Point();
-    }
-    int x = 3;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test1_0_1(int y) {
-    Point p = null;
-    if ( (y & 1) == 1 ) {
-      p = new Point();
-    }
-    int x = 3;
-    if ( p == null )
-      return (3 * x + y) * x;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test1_0_2(int y) {
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      p[0] = new Point();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_0_3(int y) {
-    Point p[] = new Point[1];
-    p[0] = null;
-    if ( (y & 1) == 1 ) {
-      p[0] = new Point();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_0_4(int y) {
-    Point p[] = new Point[1];
-    p[0] = new Point();
-    if ( (y & 1) == 1 ) {
-      p[0] = new Point();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_0_5(int y) {
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      p[0] = new Point();
-    } else {
-      p[0] = null;
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_0_6(int y) {
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      p[0] = new Point();
-    } else {
-      p[0] = new Point();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_1_0(int y) {
-    Point p = new Point();
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p = new Point();
-      dummy();
-    }
-    int x = 3;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test1_1_1(int y) {
-    Point p = null;
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p = new Point();
-      dummy();
-    }
-    int x = 3;
-    if ( p == null )
-      return (3 * x + y) * x;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test1_1_2(int y) {
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = new Point();
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_1_3(int y) {
-    Point p[] = new Point[1];
-    dummy();
-    p[0] = null;
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = new Point();
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_1_4(int y) {
-    Point p[] = new Point[1];
-    dummy();
-    p[0] = new Point();
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = new Point();
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_1_5(int y) {
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = new Point();
-      dummy();
-    } else {
-      dummy();
-      p[0] = null;
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_1_6(int y) {
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = new Point();
-      dummy();
-    } else {
-      dummy();
-      p[0] = new Point();
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_2_0(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p = new Point();
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p = p1;
-      dummy();
-    }
-    int x = 3;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test1_2_1(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p = null;
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p = p1;
-      dummy();
-    }
-    int x = 3;
-    if ( p == null )
-      return (3 * x + y) * x;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test1_2_2(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = p1;
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_2_3(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    dummy();
-    p[0] = null;
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = p1;
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_2_4(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p2 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    dummy();
-    p[0] = p1;
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = p2;
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_2_5(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = p1;
-      dummy();
-    } else {
-      dummy();
-      p[0] = null;
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test1_2_6(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p2 = new Point();
-    dummy();
-    Point p[] = new Point[1];
-    if ( (y & 1) == 1 ) {
-      dummy();
-      p[0] = p1;
-      dummy();
-    } else {
-      dummy();
-      p[0] = p2;
-      dummy();
-    }
-    int x = 3;
-    if ( p[0] == null )
-      return (3 * x + y) * x;
-    p[0].x = x;
-    p[0].y = 3 * x + y;
-    dummy();
-    return p[0].x * p[0].y;
-  }
-
-  int test2_0_0(int y) {
-    Point p = new Point();
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      p = new Point();
-    }
-    int x = 3;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test2_0_1(int y) {
-    Point p = null;
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      p = new Point();
-    }
-    int x = 3;
-    if ( p == null )
-      return (3 * x + y) * x;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test2_0_2(int y) {
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      p[i] = new Point();
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_0_3(int y) {
-    Point p[] = new Point[3];
-    int j = (y & 1);
-    p[j] = null;
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      p[i] = new Point();
-    }
-    int x = 3;
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_0_4(int y) {
-    Point p[] = new Point[3];
-    int j = (y & 1);
-    p[j] = new Point();
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      p[i] = new Point();
-    }
-    int x = 3;
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_0_5(int y) {
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      p[i] = new Point();
-    }
-    for (int i = 0; i < lim; i++) {
-      p[i] = null;
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_0_6(int y) {
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      p[i] = new Point();
-    }
-    for (int i = 0; i < lim; i++) {
-      p[i] = new Point();
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_1_0(int y) {
-    Point p = new Point();
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p = new Point();
-      dummy();
-    }
-    int x = 3;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test2_1_1(int y) {
-    Point p = null;
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p = new Point();
-      dummy();
-    }
-    int x = 3;
-    if ( p == null )
-      return (3 * x + y) * x;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test2_1_2(int y) {
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = new Point();
-      dummy();
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_1_3(int y) {
-    Point p[] = new Point[3];
-    dummy();
-    int j = (y & 1);
-    p[j] = null;
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = new Point();
-      dummy();
-    }
-    int x = 3;
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_1_4(int y) {
-    Point p[] = new Point[3];
-    dummy();
-    int j = (y & 1);
-    p[j] = new Point();
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = new Point();
-      dummy();
-    }
-    int x = 3;
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_1_5(int y) {
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = new Point();
-      dummy();
-    }
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = null;
-      dummy();
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_1_6(int y) {
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = new Point();
-      dummy();
-    }
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = new Point();
-      dummy();
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_2_0(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p = new Point();
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p = p1;
-      dummy();
-    }
-    int x = 3;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test2_2_1(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p = null;
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p = p1;
-      dummy();
-    }
-    int x = 3;
-    if ( p == null )
-      return (3 * x + y) * x;
-    p.x = x;
-    p.y = 3 * x + y;
-    dummy();
-    return p.x * p.y;
-  }
-
-  int test2_2_2(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = p1;
-      dummy();
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_2_3(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[3];
-    dummy();
-    int j = (y & 1);
-    p[j] = null;
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = p1;
-      dummy();
-    }
-    int x = 3;
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_2_4(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p2 = new Point();
-    dummy();
-    Point p[] = new Point[3];
-    dummy();
-    int j = (y & 1);
-    p[j] = p1;
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = p2;
-      dummy();
-    }
-    int x = 3;
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_2_5(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = p1;
-      dummy();
-    }
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = null;
-      dummy();
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  int test2_2_6(int y) {
-    Point p1 = new Point();
-    dummy();
-    Point p2 = new Point();
-    dummy();
-    Point p[] = new Point[3];
-    int lim = (y & 3);
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = p1;
-      dummy();
-    }
-    for (int i = 0; i < lim; i++) {
-      dummy();
-      p[i] = p2;
-      dummy();
-    }
-    int x = 3;
-    int j = (y & 1);
-    if ( p[j] == null )
-      return (3 * x + y) * x;
-    p[j].x = x;
-    p[j].y = 3 * x + y;
-    dummy();
-    return p[j].x * p[0].y;
-  }
-
-  public static void main(String args[]) {
-    Test tsr    = new Test();
-    Point p     = new Point();
-    Point ptmp  = p;
-    Class cls   = Point.class;
-    int y = 0;
-    for (int i=0; i<10000; i++) {
-      y = tsr.test0_0_0(y);
-      y = tsr.test0_0_0(y);
-      y = tsr.test0_0_1(y);
-      y = tsr.test0_0_1(y);
-      y = tsr.test0_0_2(y);
-      y = tsr.test0_0_2(y);
-      y = tsr.test0_0_3(y);
-      y = tsr.test0_0_3(y);
-      y = tsr.test0_0_4(y);
-      y = tsr.test0_0_4(y);
-      y = tsr.test0_0_5(y);
-      y = tsr.test0_0_5(y);
-      y = tsr.test0_0_6(y);
-      y = tsr.test0_0_6(y);
-
-      y = tsr.test0_1_3(y);
-      y = tsr.test0_1_3(y);
-      y = tsr.test0_1_4(y);
-      y = tsr.test0_1_4(y);
-      y = tsr.test0_1_5(y);
-      y = tsr.test0_1_5(y);
-      y = tsr.test0_1_6(y);
-      y = tsr.test0_1_6(y);
-
-      y = tsr.test1_0_0(y&~1);
-      y = tsr.test1_0_1(y&~1);
-      y = tsr.test1_0_2(y&~1);
-      y = tsr.test1_0_3(y&~1);
-      y = tsr.test1_0_4(y&~1);
-      y = tsr.test1_0_5(y&~1);
-      y = tsr.test1_0_6(y&~1);
-      y = tsr.test1_0_0((y&~1)+1);
-      y = tsr.test1_0_1((y&~1)+1);
-      y = tsr.test1_0_2((y&~1)+1);
-      y = tsr.test1_0_3((y&~1)+1);
-      y = tsr.test1_0_4((y&~1)+1);
-      y = tsr.test1_0_5((y&~1)+1);
-      y = tsr.test1_0_6((y&~1)+1);
-
-      y = tsr.test1_1_0(y&~1);
-      y = tsr.test1_1_1(y&~1);
-      y = tsr.test1_1_2(y&~1);
-      y = tsr.test1_1_3(y&~1);
-      y = tsr.test1_1_4(y&~1);
-      y = tsr.test1_1_5(y&~1);
-      y = tsr.test1_1_6(y&~1);
-      y = tsr.test1_1_0((y&~1)+1);
-      y = tsr.test1_1_1((y&~1)+1);
-      y = tsr.test1_1_2((y&~1)+1);
-      y = tsr.test1_1_3((y&~1)+1);
-      y = tsr.test1_1_4((y&~1)+1);
-      y = tsr.test1_1_5((y&~1)+1);
-      y = tsr.test1_1_6((y&~1)+1);
-
-      y = tsr.test1_2_0(y&~1);
-      y = tsr.test1_2_1(y&~1);
-      y = tsr.test1_2_2(y&~1);
-      y = tsr.test1_2_3(y&~1);
-      y = tsr.test1_2_4(y&~1);
-      y = tsr.test1_2_5(y&~1);
-      y = tsr.test1_2_6(y&~1);
-      y = tsr.test1_2_0((y&~1)+1);
-      y = tsr.test1_2_1((y&~1)+1);
-      y = tsr.test1_2_2((y&~1)+1);
-      y = tsr.test1_2_3((y&~1)+1);
-      y = tsr.test1_2_4((y&~1)+1);
-      y = tsr.test1_2_5((y&~1)+1);
-      y = tsr.test1_2_6((y&~1)+1);
-
-      y = tsr.test2_0_0(y&~3);
-      y = tsr.test2_0_1(y&~3);
-      y = tsr.test2_0_2(y&~3);
-      y = tsr.test2_0_3(y&~3);
-      y = tsr.test2_0_4(y&~3);
-      y = tsr.test2_0_5(y&~3);
-      y = tsr.test2_0_6(y&~3);
-      y = tsr.test2_0_0((y&~3)+3);
-      y = tsr.test2_0_1((y&~3)+3);
-      y = tsr.test2_0_2((y&~3)+3);
-      y = tsr.test2_0_3((y&~3)+3);
-      y = tsr.test2_0_4((y&~3)+3);
-      y = tsr.test2_0_5((y&~3)+3);
-      y = tsr.test2_0_6((y&~3)+3);
-
-      y = tsr.test2_1_0(y&~3);
-      y = tsr.test2_1_1(y&~3);
-      y = tsr.test2_1_2(y&~3);
-      y = tsr.test2_1_3(y&~3);
-      y = tsr.test2_1_4(y&~3);
-      y = tsr.test2_1_5(y&~3);
-      y = tsr.test2_1_6(y&~3);
-      y = tsr.test2_1_0((y&~3)+3);
-      y = tsr.test2_1_1((y&~3)+3);
-      y = tsr.test2_1_2((y&~3)+3);
-      y = tsr.test2_1_3((y&~3)+3);
-      y = tsr.test2_1_4((y&~3)+3);
-      y = tsr.test2_1_5((y&~3)+3);
-      y = tsr.test2_1_6((y&~3)+3);
-
-      y = tsr.test2_2_0(y&~3);
-      y = tsr.test2_2_1(y&~3);
-      y = tsr.test2_2_2(y&~3);
-      y = tsr.test2_2_3(y&~3);
-      y = tsr.test2_2_4(y&~3);
-      y = tsr.test2_2_5(y&~3);
-      y = tsr.test2_2_6(y&~3);
-      y = tsr.test2_2_0((y&~3)+3);
-      y = tsr.test2_2_1((y&~3)+3);
-      y = tsr.test2_2_2((y&~3)+3);
-      y = tsr.test2_2_3((y&~3)+3);
-      y = tsr.test2_2_4((y&~3)+3);
-      y = tsr.test2_2_5((y&~3)+3);
-      y = tsr.test2_2_6((y&~3)+3);
-
-    }
-    for (int i=0; i<10000; i++) {
-      y = tsr.test0_0_0(y);
-      y = tsr.test0_0_0(y);
-      y = tsr.test0_0_1(y);
-      y = tsr.test0_0_1(y);
-      y = tsr.test0_0_2(y);
-      y = tsr.test0_0_2(y);
-      y = tsr.test0_0_3(y);
-      y = tsr.test0_0_3(y);
-      y = tsr.test0_0_4(y);
-      y = tsr.test0_0_4(y);
-      y = tsr.test0_0_5(y);
-      y = tsr.test0_0_5(y);
-      y = tsr.test0_0_6(y);
-      y = tsr.test0_0_6(y);
-
-      y = tsr.test0_1_3(y);
-      y = tsr.test0_1_3(y);
-      y = tsr.test0_1_4(y);
-      y = tsr.test0_1_4(y);
-      y = tsr.test0_1_5(y);
-      y = tsr.test0_1_5(y);
-      y = tsr.test0_1_6(y);
-      y = tsr.test0_1_6(y);
-
-      y = tsr.test1_0_0(y&~1);
-      y = tsr.test1_0_1(y&~1);
-      y = tsr.test1_0_2(y&~1);
-      y = tsr.test1_0_3(y&~1);
-      y = tsr.test1_0_4(y&~1);
-      y = tsr.test1_0_5(y&~1);
-      y = tsr.test1_0_6(y&~1);
-      y = tsr.test1_0_0((y&~1)+1);
-      y = tsr.test1_0_1((y&~1)+1);
-      y = tsr.test1_0_2((y&~1)+1);
-      y = tsr.test1_0_3((y&~1)+1);
-      y = tsr.test1_0_4((y&~1)+1);
-      y = tsr.test1_0_5((y&~1)+1);
-      y = tsr.test1_0_6((y&~1)+1);
-
-      y = tsr.test1_1_0(y&~1);
-      y = tsr.test1_1_1(y&~1);
-      y = tsr.test1_1_2(y&~1);
-      y = tsr.test1_1_3(y&~1);
-      y = tsr.test1_1_4(y&~1);
-      y = tsr.test1_1_5(y&~1);
-      y = tsr.test1_1_6(y&~1);
-      y = tsr.test1_1_0((y&~1)+1);
-      y = tsr.test1_1_1((y&~1)+1);
-      y = tsr.test1_1_2((y&~1)+1);
-      y = tsr.test1_1_3((y&~1)+1);
-      y = tsr.test1_1_4((y&~1)+1);
-      y = tsr.test1_1_5((y&~1)+1);
-      y = tsr.test1_1_6((y&~1)+1);
-
-      y = tsr.test1_2_0(y&~1);
-      y = tsr.test1_2_1(y&~1);
-      y = tsr.test1_2_2(y&~1);
-      y = tsr.test1_2_3(y&~1);
-      y = tsr.test1_2_4(y&~1);
-      y = tsr.test1_2_5(y&~1);
-      y = tsr.test1_2_6(y&~1);
-      y = tsr.test1_2_0((y&~1)+1);
-      y = tsr.test1_2_1((y&~1)+1);
-      y = tsr.test1_2_2((y&~1)+1);
-      y = tsr.test1_2_3((y&~1)+1);
-      y = tsr.test1_2_4((y&~1)+1);
-      y = tsr.test1_2_5((y&~1)+1);
-      y = tsr.test1_2_6((y&~1)+1);
-
-      y = tsr.test2_0_0(y&~3);
-      y = tsr.test2_0_1(y&~3);
-      y = tsr.test2_0_2(y&~3);
-      y = tsr.test2_0_3(y&~3);
-      y = tsr.test2_0_4(y&~3);
-      y = tsr.test2_0_5(y&~3);
-      y = tsr.test2_0_6(y&~3);
-      y = tsr.test2_0_0((y&~3)+3);
-      y = tsr.test2_0_1((y&~3)+3);
-      y = tsr.test2_0_2((y&~3)+3);
-      y = tsr.test2_0_3((y&~3)+3);
-      y = tsr.test2_0_4((y&~3)+3);
-      y = tsr.test2_0_5((y&~3)+3);
-      y = tsr.test2_0_6((y&~3)+3);
-
-      y = tsr.test2_1_0(y&~3);
-      y = tsr.test2_1_1(y&~3);
-      y = tsr.test2_1_2(y&~3);
-      y = tsr.test2_1_3(y&~3);
-      y = tsr.test2_1_4(y&~3);
-      y = tsr.test2_1_5(y&~3);
-      y = tsr.test2_1_6(y&~3);
-      y = tsr.test2_1_0((y&~3)+3);
-      y = tsr.test2_1_1((y&~3)+3);
-      y = tsr.test2_1_2((y&~3)+3);
-      y = tsr.test2_1_3((y&~3)+3);
-      y = tsr.test2_1_4((y&~3)+3);
-      y = tsr.test2_1_5((y&~3)+3);
-      y = tsr.test2_1_6((y&~3)+3);
-
-      y = tsr.test2_2_0(y&~3);
-      y = tsr.test2_2_1(y&~3);
-      y = tsr.test2_2_2(y&~3);
-      y = tsr.test2_2_3(y&~3);
-      y = tsr.test2_2_4(y&~3);
-      y = tsr.test2_2_5(y&~3);
-      y = tsr.test2_2_6(y&~3);
-      y = tsr.test2_2_0((y&~3)+3);
-      y = tsr.test2_2_1((y&~3)+3);
-      y = tsr.test2_2_2((y&~3)+3);
-      y = tsr.test2_2_3((y&~3)+3);
-      y = tsr.test2_2_4((y&~3)+3);
-      y = tsr.test2_2_5((y&~3)+3);
-      y = tsr.test2_2_6((y&~3)+3);
-
-    }
-    for (int i=0; i<10000; i++) {
-      y = tsr.test0_0_0(y);
-      y = tsr.test0_0_0(y);
-      y = tsr.test0_0_1(y);
-      y = tsr.test0_0_1(y);
-      y = tsr.test0_0_2(y);
-      y = tsr.test0_0_2(y);
-      y = tsr.test0_0_3(y);
-      y = tsr.test0_0_3(y);
-      y = tsr.test0_0_4(y);
-      y = tsr.test0_0_4(y);
-      y = tsr.test0_0_5(y);
-      y = tsr.test0_0_5(y);
-      y = tsr.test0_0_6(y);
-      y = tsr.test0_0_6(y);
-
-      y = tsr.test0_1_3(y);
-      y = tsr.test0_1_3(y);
-      y = tsr.test0_1_4(y);
-      y = tsr.test0_1_4(y);
-      y = tsr.test0_1_5(y);
-      y = tsr.test0_1_5(y);
-      y = tsr.test0_1_6(y);
-      y = tsr.test0_1_6(y);
-
-      y = tsr.test1_0_0(y&~1);
-      y = tsr.test1_0_1(y&~1);
-      y = tsr.test1_0_2(y&~1);
-      y = tsr.test1_0_3(y&~1);
-      y = tsr.test1_0_4(y&~1);
-      y = tsr.test1_0_5(y&~1);
-      y = tsr.test1_0_6(y&~1);
-      y = tsr.test1_0_0((y&~1)+1);
-      y = tsr.test1_0_1((y&~1)+1);
-      y = tsr.test1_0_2((y&~1)+1);
-      y = tsr.test1_0_3((y&~1)+1);
-      y = tsr.test1_0_4((y&~1)+1);
-      y = tsr.test1_0_5((y&~1)+1);
-      y = tsr.test1_0_6((y&~1)+1);
-
-      y = tsr.test1_1_0(y&~1);
-      y = tsr.test1_1_1(y&~1);
-      y = tsr.test1_1_2(y&~1);
-      y = tsr.test1_1_3(y&~1);
-      y = tsr.test1_1_4(y&~1);
-      y = tsr.test1_1_5(y&~1);
-      y = tsr.test1_1_6(y&~1);
-      y = tsr.test1_1_0((y&~1)+1);
-      y = tsr.test1_1_1((y&~1)+1);
-      y = tsr.test1_1_2((y&~1)+1);
-      y = tsr.test1_1_3((y&~1)+1);
-      y = tsr.test1_1_4((y&~1)+1);
-      y = tsr.test1_1_5((y&~1)+1);
-      y = tsr.test1_1_6((y&~1)+1);
-
-      y = tsr.test1_2_0(y&~1);
-      y = tsr.test1_2_1(y&~1);
-      y = tsr.test1_2_2(y&~1);
-      y = tsr.test1_2_3(y&~1);
-      y = tsr.test1_2_4(y&~1);
-      y = tsr.test1_2_5(y&~1);
-      y = tsr.test1_2_6(y&~1);
-      y = tsr.test1_2_0((y&~1)+1);
-      y = tsr.test1_2_1((y&~1)+1);
-      y = tsr.test1_2_2((y&~1)+1);
-      y = tsr.test1_2_3((y&~1)+1);
-      y = tsr.test1_2_4((y&~1)+1);
-      y = tsr.test1_2_5((y&~1)+1);
-      y = tsr.test1_2_6((y&~1)+1);
-
-      y = tsr.test2_0_0(y&~3);
-      y = tsr.test2_0_1(y&~3);
-      y = tsr.test2_0_2(y&~3);
-      y = tsr.test2_0_3(y&~3);
-      y = tsr.test2_0_4(y&~3);
-      y = tsr.test2_0_5(y&~3);
-      y = tsr.test2_0_6(y&~3);
-      y = tsr.test2_0_0((y&~3)+3);
-      y = tsr.test2_0_1((y&~3)+3);
-      y = tsr.test2_0_2((y&~3)+3);
-      y = tsr.test2_0_3((y&~3)+3);
-      y = tsr.test2_0_4((y&~3)+3);
-      y = tsr.test2_0_5((y&~3)+3);
-      y = tsr.test2_0_6((y&~3)+3);
-
-      y = tsr.test2_1_0(y&~3);
-      y = tsr.test2_1_1(y&~3);
-      y = tsr.test2_1_2(y&~3);
-      y = tsr.test2_1_3(y&~3);
-      y = tsr.test2_1_4(y&~3);
-      y = tsr.test2_1_5(y&~3);
-      y = tsr.test2_1_6(y&~3);
-      y = tsr.test2_1_0((y&~3)+3);
-      y = tsr.test2_1_1((y&~3)+3);
-      y = tsr.test2_1_2((y&~3)+3);
-      y = tsr.test2_1_3((y&~3)+3);
-      y = tsr.test2_1_4((y&~3)+3);
-      y = tsr.test2_1_5((y&~3)+3);
-      y = tsr.test2_1_6((y&~3)+3);
-
-      y = tsr.test2_2_0(y&~3);
-      y = tsr.test2_2_1(y&~3);
-      y = tsr.test2_2_2(y&~3);
-      y = tsr.test2_2_3(y&~3);
-      y = tsr.test2_2_4(y&~3);
-      y = tsr.test2_2_5(y&~3);
-      y = tsr.test2_2_6(y&~3);
-      y = tsr.test2_2_0((y&~3)+3);
-      y = tsr.test2_2_1((y&~3)+3);
-      y = tsr.test2_2_2((y&~3)+3);
-      y = tsr.test2_2_3((y&~3)+3);
-      y = tsr.test2_2_4((y&~3)+3);
-      y = tsr.test2_2_5((y&~3)+3);
-      y = tsr.test2_2_6((y&~3)+3);
-
-    }
-
-    int z = 0;
-    y = tsr.test0_0_0(0);
-    System.out.println("After 'test0_0_0' y=" + y);
-    y = tsr.test0_0_1(0);
-    System.out.println("After 'test0_0_1' y=" + y);
-    y = tsr.test0_0_2(0);
-    System.out.println("After 'test0_0_2' y=" + y);
-    y = tsr.test0_0_3(0);
-    System.out.println("After 'test0_0_3' y=" + y);
-    y = tsr.test0_0_4(0);
-    System.out.println("After 'test0_0_4' y=" + y);
-    y = tsr.test0_0_5(0);
-    System.out.println("After 'test0_0_5' y=" + y);
-    y = tsr.test0_0_6(0);
-    System.out.println("After 'test0_0_6' y=" + y);
-    y = tsr.test0_1_3(0);
-    System.out.println("After 'test0_1_3' y=" + y);
-    y = tsr.test0_1_4(0);
-    System.out.println("After 'test0_1_4' y=" + y);
-    y = tsr.test0_1_5(0);
-    System.out.println("After 'test0_1_5' y=" + y);
-    y = tsr.test0_1_6(0);
-    System.out.println("After 'test0_1_6' y=" + y);
-
-    y = tsr.test1_0_0(0);
-    System.out.println("After 'test1_0_0' y=" + y);
-    y = tsr.test1_0_1(0);
-    System.out.println("After 'test1_0_1' y=" + y);
-    y = tsr.test1_0_2(0);
-    System.out.println("After 'test1_0_2' y=" + y);
-    y = tsr.test1_0_3(0);
-    System.out.println("After 'test1_0_3' y=" + y);
-    y = tsr.test1_0_4(0);
-    System.out.println("After 'test1_0_4' y=" + y);
-    y = tsr.test1_0_5(0);
-    System.out.println("After 'test1_0_5' y=" + y);
-    y = tsr.test1_0_6(0);
-    System.out.println("After 'test1_0_6' y=" + y);
-
-    y = tsr.test1_1_0(0);
-    System.out.println("After 'test1_1_0' y=" + y);
-    y = tsr.test1_1_1(0);
-    System.out.println("After 'test1_1_1' y=" + y);
-    y = tsr.test1_1_2(0);
-    System.out.println("After 'test1_1_2' y=" + y);
-    y = tsr.test1_1_3(0);
-    System.out.println("After 'test1_1_3' y=" + y);
-    y = tsr.test1_1_4(0);
-    System.out.println("After 'test1_1_4' y=" + y);
-    y = tsr.test1_1_5(0);
-    System.out.println("After 'test1_1_5' y=" + y);
-    y = tsr.test1_1_6(0);
-    System.out.println("After 'test1_1_6' y=" + y);
-
-    y = tsr.test1_2_0(0);
-    System.out.println("After 'test1_2_0' y=" + y);
-    y = tsr.test1_2_1(0);
-    System.out.println("After 'test1_2_1' y=" + y);
-    y = tsr.test1_2_2(0);
-    System.out.println("After 'test1_2_2' y=" + y);
-    y = tsr.test1_2_3(0);
-    System.out.println("After 'test1_2_3' y=" + y);
-    y = tsr.test1_2_4(0);
-    System.out.println("After 'test1_2_4' y=" + y);
-    y = tsr.test1_2_5(0);
-    System.out.println("After 'test1_2_5' y=" + y);
-    y = tsr.test1_2_6(0);
-    System.out.println("After 'test1_2_6' y=" + y);
-
-    y = tsr.test2_0_0(0);
-    System.out.println("After 'test2_0_0' y=" + y);
-    y = tsr.test2_0_1(0);
-    System.out.println("After 'test2_0_1' y=" + y);
-    y = tsr.test2_0_2(0);
-    System.out.println("After 'test2_0_2' y=" + y);
-    y = tsr.test2_0_3(0);
-    System.out.println("After 'test2_0_3' y=" + y);
-    y = tsr.test2_0_4(0);
-    System.out.println("After 'test2_0_4' y=" + y);
-    y = tsr.test2_0_5(0);
-    System.out.println("After 'test2_0_5' y=" + y);
-    y = tsr.test2_0_6(0);
-    System.out.println("After 'test2_0_6' y=" + y);
-
-    y = tsr.test2_1_0(0);
-    System.out.println("After 'test2_1_0' y=" + y);
-    y = tsr.test2_1_1(0);
-    System.out.println("After 'test2_1_1' y=" + y);
-    y = tsr.test2_1_2(0);
-    System.out.println("After 'test2_1_2' y=" + y);
-    y = tsr.test2_1_3(0);
-    System.out.println("After 'test2_1_3' y=" + y);
-    y = tsr.test2_1_4(0);
-    System.out.println("After 'test2_1_4' y=" + y);
-    y = tsr.test2_1_5(0);
-    System.out.println("After 'test2_1_5' y=" + y);
-    y = tsr.test2_1_6(0);
-    System.out.println("After 'test2_1_6' y=" + y);
-
-    y = tsr.test2_2_0(0);
-    System.out.println("After 'test2_2_0' y=" + y);
-    y = tsr.test2_2_1(0);
-    System.out.println("After 'test2_2_1' y=" + y);
-    y = tsr.test2_2_2(0);
-    System.out.println("After 'test2_2_2' y=" + y);
-    y = tsr.test2_2_3(0);
-    System.out.println("After 'test2_2_3' y=" + y);
-    y = tsr.test2_2_4(0);
-    System.out.println("After 'test2_2_4' y=" + y);
-    y = tsr.test2_2_5(0);
-    System.out.println("After 'test2_2_5' y=" + y);
-    y = tsr.test2_2_6(0);
-    System.out.println("After 'test2_2_6' y=" + y);
-
-  }
-}
diff --git a/test/compiler/escapeAnalysis/6775880/Test.java b/test/compiler/escapeAnalysis/6775880/Test.java
deleted file mode 100644
index f5a51fe..0000000
--- a/test/compiler/escapeAnalysis/6775880/Test.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2008, 2014, 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 6775880
- * @summary EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now")
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append Test
- */
-
-public class Test {
-
-  int cnt;
-  int b[];
-  String s;
-
-  String test() {
-    String res="";
-    for (int i=0; i < cnt; i++) {
-      if (i != 0) {
-        res = res +".";
-      }
-      res = res + b[i];
-    }
-    return res;
-  }
-
-  public static void main(String[] args) {
-    Test t = new Test();
-    t.cnt = 3;
-    t.b = new int[3];
-    t.b[0] = 0;
-    t.b[1] = 1;
-    t.b[2] = 2;
-    int j=0;
-    t.s = "";
-    for (int i=0; i<10001; i++) {
-      t.s = "c";
-      t.s = t.test();
-    }
-    System.out.println("After s=" + t.s);
-  }
-}
-
-
diff --git a/test/compiler/escapeAnalysis/Test6689060.java b/test/compiler/escapeAnalysis/Test6689060.java
new file mode 100644
index 0000000..98d4847
--- /dev/null
+++ b/test/compiler/escapeAnalysis/Test6689060.java
@@ -0,0 +1,579 @@
+/*
+ * Copyright (c) 2008, 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 6689060
+ * @summary Escape Analysis does not work with Compressed Oops
+ *
+ * @run main/othervm -Xbatch -XX:+AggressiveOpts
+ *      -XX:CompileCommand=exclude,compiler.escapeAnalysis.Test6689060::dummy
+ *      compiler.escapeAnalysis.Test6689060
+ */
+
+package compiler.escapeAnalysis;
+
+import java.lang.reflect.Array;
+
+public class Test6689060 {
+    static class Point {
+        int x;
+        int y;
+        Point next;
+        int ax[];
+        int ay[];
+        Point pax[];
+        Point pay[];
+
+        public Point getNext() {
+            return next;
+        }
+    }
+
+    void dummy() {
+        // Empty method to verify correctness of DebugInfo.
+        // Use -XX:CompileCommand=exclude,Test.dummy
+    }
+
+    int ival(int i) {
+        return i * 2;
+    }
+
+    int test80(int y, int l, int i) {
+        Point p = new Point();
+        p.ax = new int[2];
+        p.ay = new int[2];
+        int x = 3;
+        p.ax[0] = x;
+        p.ay[1] = 3 * x + y;
+        dummy();
+        return p.ax[0] * p.ay[1];
+    }
+
+    int test81(int y, int l, int i) {
+        Point p = new Point();
+        p.ax = new int[2];
+        p.ay = new int[2];
+        int x = 3;
+        p.ax[0] = x;
+        p.ay[1] = 3 * x + y;
+        dummy();
+        return p.ax[0] * p.ay[1];
+    }
+
+
+    int test44(int y) {
+        Point p1 = new Point();
+        p1.x = ival(3);
+        dummy();
+        p1.y = 3 * p1.x + y;
+        return p1.y;
+    }
+
+    int test43(int y) {
+        Point p1 = new Point();
+        if ((y & 1) == 1) {
+            p1.x = ival(3);
+        } else {
+            p1.x = ival(5);
+        }
+        dummy();
+        p1.y = 3 * p1.x + y;
+        return p1.y;
+    }
+
+    int test42(int y) {
+        Point p1 = new Point();
+        p1.x = 3;
+        for (int i = 0; i < y; i++) {
+            if ((i & 1) == 1) {
+                p1.x += 4;
+            }
+        }
+        p1.y = 3 * y + p1.x;
+        return p1.y;
+    }
+
+    int test40(int y) {
+        Point p1 = new Point();
+        if ((y & 1) == 1) {
+            p1.x = 3;
+        } else {
+            p1.x = 5;
+        }
+        p1.y = 3 * p1.x + y;
+        return p1.y;
+    }
+
+    int test41(int y) {
+        Point p1 = new Point();
+        if ((y & 1) == 1) {
+            p1.x += 4;
+        } else {
+            p1.x += 5;
+        }
+        p1.y = 3 * p1.x + y;
+        return p1.y;
+    }
+
+    Point test00(int y) {
+        int x = 3;
+        Point p = new Point();
+        p.x = x;
+        p.y = 3 * x + y;
+        return p;
+    }
+
+    Point test01(int y) {
+        int x = 3;
+        Point p = new Point();
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p;
+    }
+
+    Point test02(int y) {
+        int x = 3;
+        Point p1 = null;
+        for (int i = 0; i < y; i++) {
+            Point p2 = new Point();
+            p2.x = x;
+            p2.y = 3 * y + x;
+            p2.next = p1;
+            p1 = p2;
+        }
+        return p1;
+    }
+
+    Point test03(int y) {
+        int x = 3;
+        Point p1 = null;
+        for (int i = 0; i < y; i++) {
+            Point p2 = new Point();
+            p2.x = x;
+            p2.y = 3 * y + x;
+            p2.next = p1;
+            p1 = p2;
+        }
+        dummy();
+        return p1;
+    }
+
+    Point test04(int y) {
+        int x = 3;
+        Point p1 = null;
+        for (int i = 0; i < y; i++) {
+            Point p2 = new Point();
+            p2.x = x;
+            p2.y = 3 * y + x;
+            p2.next = p1;
+            dummy();
+            p1 = p2;
+        }
+        return p1;
+    }
+
+    int test05(int y) {
+        int x = 3;
+        Point p1 = new Point();
+        for (int i = 0; i < y; i++) {
+            Point p2 = new Point();
+            p2.x = x;
+            p2.y = 3 * y + x;
+            p1.next = p2;
+            p1 = p2;
+        }
+        return p1.y;
+    }
+
+    int test0(int y) {
+        int x = 3;
+        Point p = new Point();
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test1(int y) {
+        Point p = new Point();
+        if ((y & 1) == 1) {
+            p = new Point(); // Kill previous
+        }
+        int x = 3;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test2(int y) {
+        Point p1 = new Point();
+        Point p2 = new Point();
+        p1.x = 3;
+        p2.x = 4;
+        p1.y = 3 * p2.x + y;
+        p2.y = 3 * p1.x + y;
+        dummy();
+        return p1.y * p2.y;
+    }
+
+    int test3(int y, Point p1) {
+        Point p2 = new Point();
+        p1.x = 3;
+        p2.x = 4;
+        p1.y = 3 * p2.x + y;
+        p2.y = 3 * p1.x + y;
+        dummy();
+        return p1.y * p2.y;
+    }
+
+    int test4(int y) {
+        Point p1 = new Point();
+        Point p2 = new Point();
+        if ((y & 1) == 1) {
+            p1.x = 3;
+            p2.x = 4;
+        } else {
+            p1.x = 5;
+            p2.x = 6;
+        }
+        p1.y = 3 * p2.x + y;
+        p2.y = 3 * p1.x + y;
+        dummy();
+        return p1.y * p2.y;
+    }
+
+    int test5(int y, Point p1) {
+        Point p2 = new Point();
+        if ((y & 1) == 1) {
+            p1.x = 3;
+            p2.x = 4;
+        } else {
+            p1.x = 5;
+            p2.x = 6;
+        }
+        p1.y = 3 * p2.x + y;
+        p2.y = 3 * p1.x + y;
+        dummy();
+        return p1.y * p2.y;
+    }
+
+    int test6(int y) {
+        Point p1 = new Point();
+        Point p2 = new Point();
+        p1.next = p2;
+        if ((y & 1) == 1) {
+            p1.x = 3;
+            p1.getNext().x = 4;
+        } else {
+            p1.x = 5;
+            p1.getNext().x = 6;
+        }
+        p1.y = 3 * p2.x + y;
+        p2.y = 3 * p1.x + y;
+        dummy();
+        return p1.y * p2.y;
+    }
+
+    int test7(int y, Point p1) {
+        Point p2 = new Point();
+        p1.next = p2;
+        if ((y & 1) == 1) {
+            p1.x = 3;
+            p1.getNext().x = 4;
+        } else {
+            p1.x = 5;
+            p1.getNext().x = 6;
+        }
+        p1.y = 3 * p2.x + y;
+        p2.y = 3 * p1.x + y;
+        dummy();
+        return p1.y * p2.y;
+    }
+
+    int test8(int y, int l, int i) {
+        Point p = new Point();
+        p.ax = new int[l];
+        p.ay = new int[l];
+        int x = 3;
+        p.ax[i] = x;
+        p.ay[i] = 3 * x + y;
+        dummy();
+        return p.ax[i] * p.ay[i];
+    }
+
+    int test9(int y, int l, int i) {
+        Point p = new Point();
+        p.pax = new Point[l];
+        p.pay = new Point[l];
+        p.pax[i] = new Point();
+        p.pay[i] = new Point();
+        p.pax[i].x = 3;
+        p.pay[i].x = 4;
+        p.pax[i].y = 3 * p.pay[i].x + y;
+        p.pay[i].y = 3 * p.pax[i].x + y;
+        dummy();
+        return p.pax[i].y * p.pay[i].y;
+    }
+
+    int test10(int y, int l, int i, Class cls) {
+        Point p = new Point();
+        try {
+            p.pax = (Point[]) Array.newInstance(cls, l);
+            p.pax[i] = (Point) cls.newInstance();
+        } catch (java.lang.InstantiationException ex) {
+            return 0;
+        } catch (java.lang.IllegalAccessException ex) {
+            return 0;
+        }
+        p.pax[i].x = 3;
+        p.pax[i].y = 3 * p.pax[i].x + y;
+        dummy();
+        return p.pax[i].x * p.pax[i].y;
+    }
+
+    int test11(int y) {
+        Point p1 = new Point();
+        Point p2 = new Point();
+        p1.next = p2;
+        if ((y & 1) == 1) {
+            p1.x = 3;
+            p1.next.x = 4;
+        } else {
+            p1.x = 5;
+            p1.next.x = 6;
+        }
+        p1.y = 3 * p1.next.x + y;
+        p1.next.y = 3 * p1.x + y;
+        dummy();
+        return p1.y * p1.next.y;
+    }
+
+    int test12(int y) {
+        Point p1 = new Point();
+        p1.next = p1;
+        if ((y & 1) == 1) {
+            p1.x = 3;
+            p1.next.x = 4;
+        } else {
+            p1.x = 5;
+            p1.next.x = 6;
+        }
+        p1.y = 3 * p1.next.x + y;
+        p1.next.y = 3 * p1.x + y;
+        dummy();
+        return p1.y * p1.next.y;
+    }
+
+
+    public static void main(String args[]) {
+        Test6689060 tsr = new Test6689060();
+        Point p = new Point();
+        Point ptmp = p;
+        Class cls = Point.class;
+        int y = 0;
+        for (int i = 0; i < 10000; i++) {
+            ptmp.next = tsr.test00(1);
+            ptmp.next = tsr.test01(1);
+            ptmp.next = tsr.test02(1);
+            ptmp.next = tsr.test03(1);
+            ptmp.next = tsr.test04(1);
+
+            y = tsr.test05(1);
+
+            y = tsr.test80(y, 1, 0);
+            y = tsr.test81(y, 1, 0);
+
+            y = tsr.test44(y);
+            y = tsr.test43(y);
+            y = tsr.test42(y);
+            y = tsr.test40(y);
+            y = tsr.test41(y);
+
+            y = tsr.test0(y);
+            y = tsr.test1(y);
+            y = tsr.test2(y);
+            y = tsr.test3(y, p);
+            y = tsr.test4(y);
+            y = tsr.test5(y, p);
+            y = tsr.test6(y);
+            y = tsr.test7(y, p);
+            y = tsr.test8(y, 1, 0);
+            y = tsr.test9(y, 1, 0);
+            y = tsr.test10(y, 1, 0, cls);
+            y = tsr.test11(y);
+            y = tsr.test12(y);
+        }
+        for (int i = 0; i < 10000; i++) {
+            ptmp.next = tsr.test00(1);
+            ptmp.next = tsr.test01(1);
+            ptmp.next = tsr.test02(1);
+            ptmp.next = tsr.test03(1);
+            ptmp.next = tsr.test04(1);
+
+            y = tsr.test05(1);
+
+            y = tsr.test80(y, 1, 0);
+            y = tsr.test81(y, 1, 0);
+
+            y = tsr.test44(y);
+            y = tsr.test43(y);
+            y = tsr.test42(y);
+            y = tsr.test40(y);
+            y = tsr.test41(y);
+
+            y = tsr.test0(y);
+            y = tsr.test1(y);
+            y = tsr.test2(y);
+            y = tsr.test3(y, p);
+            y = tsr.test4(y);
+            y = tsr.test5(y, p);
+            y = tsr.test6(y);
+            y = tsr.test7(y, p);
+            y = tsr.test8(y, 1, 0);
+            y = tsr.test9(y, 1, 0);
+            y = tsr.test10(y, 1, 0, cls);
+            y = tsr.test11(y);
+            y = tsr.test12(y);
+        }
+        for (int i = 0; i < 10000; i++) {
+            ptmp.next = tsr.test00(1);
+            ptmp.next = tsr.test01(1);
+            ptmp.next = tsr.test02(1);
+            ptmp.next = tsr.test03(1);
+            ptmp.next = tsr.test04(1);
+
+            y = tsr.test05(1);
+
+            y = tsr.test80(y, 1, 0);
+            y = tsr.test81(y, 1, 0);
+
+            y = tsr.test44(y);
+            y = tsr.test43(y);
+            y = tsr.test42(y);
+            y = tsr.test40(y);
+            y = tsr.test41(y);
+
+            y = tsr.test0(y);
+            y = tsr.test1(y);
+            y = tsr.test2(y);
+            y = tsr.test3(y, p);
+            y = tsr.test4(y);
+            y = tsr.test5(y, p);
+            y = tsr.test6(y);
+            y = tsr.test7(y, p);
+            y = tsr.test8(y, 1, 0);
+            y = tsr.test9(y, 1, 0);
+            y = tsr.test10(y, 1, 0, cls);
+            y = tsr.test11(y);
+            y = tsr.test12(y);
+        }
+
+        int z = 0;
+        y = tsr.test80(0, 1, 0);
+        z += y;
+        System.out.println("After 'test80' y=" + y);
+        y = tsr.test81(0, 1, 0);
+        z += y;
+        System.out.println("After 'test81' y=" + y);
+
+        y = tsr.test44(0);
+        z += y;
+        System.out.println("After 'test44' y=" + y);
+        y = tsr.test43(0);
+        z += y;
+        System.out.println("After 'test43' y=" + y);
+        y = tsr.test42(0);
+        z += y;
+        System.out.println("After 'test42' y=" + y);
+        y = tsr.test40(0);
+        z += y;
+        System.out.println("After 'test40' y=" + y);
+        y = tsr.test41(0);
+        z += y;
+        System.out.println("After 'test41' y=" + y);
+
+        ptmp.next = tsr.test00(1);
+        z += y;
+        System.out.println("After 'test00' p.y=" + ptmp.next.y);
+        ptmp.next = tsr.test01(1);
+        z += y;
+        System.out.println("After 'test01' p.y=" + ptmp.next.y);
+        ptmp.next = tsr.test02(1);
+        z += y;
+        System.out.println("After 'test02' p.y=" + ptmp.next.y);
+        ptmp.next = tsr.test03(1);
+        z += y;
+        System.out.println("After 'test03' p.y=" + ptmp.next.y);
+        ptmp.next = tsr.test04(1);
+        z += y;
+        System.out.println("After 'test04' p.y=" + ptmp.next.y);
+
+        y = tsr.test05(1);
+        z += y;
+        System.out.println("After 'test05' y=" + y);
+
+        y = tsr.test0(0);
+        z += y;
+        System.out.println("After 'test0' y=" + y);
+        y = tsr.test1(0);
+        z += y;
+        System.out.println("After 'test1' y=" + y);
+        y = tsr.test2(0);
+        z += y;
+        System.out.println("After 'test2' y=" + y);
+        y = tsr.test3(0, new Point());
+        z += y;
+        System.out.println("After 'test3' y=" + y);
+        y = tsr.test4(0);
+        z += y;
+        System.out.println("After 'test4' y=" + y);
+        y = tsr.test5(0, new Point());
+        z += y;
+        System.out.println("After 'test5' y=" + y);
+        y = tsr.test6(0);
+        z += y;
+        System.out.println("After 'test6' y=" + y);
+        y = tsr.test7(0, new Point());
+        z += y;
+        System.out.println("After 'test7' y=" + y);
+        y = tsr.test8(0, 1, 0);
+        z += y;
+        System.out.println("After 'test8' y=" + y);
+        y = tsr.test9(0, 1, 0);
+        z += y;
+        System.out.println("After 'test9' y=" + y);
+        y = tsr.test10(0, 1, 0, cls);
+        z += y;
+        System.out.println("After 'test10' y=" + y);
+        y = tsr.test11(0);
+        z += y;
+        System.out.println("After 'test11' y=" + y);
+        y = tsr.test12(0);
+        z += y;
+        System.out.println("After 'test12' y=" + y);
+        System.out.println("Sum of y =" + z);
+    }
+}
diff --git a/test/compiler/escapeAnalysis/Test6726999.java b/test/compiler/escapeAnalysis/Test6726999.java
new file mode 100644
index 0000000..becc1d8
--- /dev/null
+++ b/test/compiler/escapeAnalysis/Test6726999.java
@@ -0,0 +1,1421 @@
+/*
+ * Copyright (c) 2008, 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 6726999
+ * @summary nsk/stress/jck12a/jck12a010 assert(n != NULL,"Bad immediate dominator info.");
+ *
+ * @run main/othervm -Xbatch -XX:+AggressiveOpts
+ *      -XX:CompileCommand=exclude,compiler.escapeAnalysis.Test6726999::dummy
+ *      compiler.escapeAnalysis.Test6726999
+ */
+
+package compiler.escapeAnalysis;
+
+public class Test6726999 {
+    static class Point {
+        int x;
+        int y;
+    }
+
+    void dummy() {
+        // Empty method to verify correctness of DebugInfo.
+        // Use -XX:CompileCommand=exclude,Test.dummy
+    }
+
+    int test0_0_0(int y) {
+        int x = 3;
+        Point p = new Point();
+        dummy();
+        p.x = x;
+        p.y = 3 * x + y;
+        return p.x * p.y;
+    }
+
+    int test0_0_1(int y) {
+        int x = 3;
+        Point p = null;
+        dummy();
+        p = new Point();
+        dummy();
+        p.x = x;
+        p.y = 3 * x + y;
+        return p.x * p.y;
+    }
+
+    int test0_0_2(int y) {
+        int x = 3;
+        Point p = new Point();
+        dummy();
+        p = new Point();
+        dummy();
+        p.x = x;
+        p.y = 3 * x + y;
+        return p.x * p.y;
+    }
+
+    int test0_0_3(int y) {
+        int x = 3;
+        Point p[] = new Point[1];
+        p[0] = new Point();
+        dummy();
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        return p[0].x * p[0].y;
+    }
+
+    int test0_0_4(int y) {
+        int x = 3;
+        Point p[] = new Point[1];
+        dummy();
+        p[0] = new Point();
+        dummy();
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        return p[0].x * p[0].y;
+    }
+
+    int test0_0_5(int y) {
+        int x = 3;
+        Point p[] = new Point[1];
+        dummy();
+        p[0] = null;
+        dummy();
+        p[0] = new Point();
+        dummy();
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        return p[0].x * p[0].y;
+    }
+
+    int test0_0_6(int y) {
+        int x = 3;
+        Point p[] = new Point[1];
+        p[0] = new Point();
+        dummy();
+        p[0] = new Point();
+        dummy();
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        return p[0].x * p[0].y;
+    }
+
+    int test0_1_3(int y) {
+        int x = 3;
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        p[0] = p1;
+        dummy();
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        return p[0].x * p[0].y;
+    }
+
+    int test0_1_4(int y) {
+        int x = 3;
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        dummy();
+        p[0] = p1;
+        dummy();
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        return p[0].x * p[0].y;
+    }
+
+    int test0_1_5(int y) {
+        int x = 3;
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        dummy();
+        p[0] = null;
+        dummy();
+        p[0] = p1;
+        dummy();
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        return p[0].x * p[0].y;
+    }
+
+    int test0_1_6(int y) {
+        int x = 3;
+        Point p1 = new Point();
+        dummy();
+        Point p2 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        p[0] = p1;
+        dummy();
+        p[0] = p2;
+        dummy();
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        return p[0].x * p[0].y;
+    }
+
+    int test1_0_0(int y) {
+        Point p = new Point();
+        if ((y & 1) == 1) {
+            p = new Point();
+        }
+        int x = 3;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test1_0_1(int y) {
+        Point p = null;
+        if ((y & 1) == 1) {
+            p = new Point();
+        }
+        int x = 3;
+        if (p == null)
+            return (3 * x + y) * x;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test1_0_2(int y) {
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            p[0] = new Point();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_0_3(int y) {
+        Point p[] = new Point[1];
+        p[0] = null;
+        if ((y & 1) == 1) {
+            p[0] = new Point();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_0_4(int y) {
+        Point p[] = new Point[1];
+        p[0] = new Point();
+        if ((y & 1) == 1) {
+            p[0] = new Point();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_0_5(int y) {
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            p[0] = new Point();
+        } else {
+            p[0] = null;
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_0_6(int y) {
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            p[0] = new Point();
+        } else {
+            p[0] = new Point();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_1_0(int y) {
+        Point p = new Point();
+        if ((y & 1) == 1) {
+            dummy();
+            p = new Point();
+            dummy();
+        }
+        int x = 3;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test1_1_1(int y) {
+        Point p = null;
+        if ((y & 1) == 1) {
+            dummy();
+            p = new Point();
+            dummy();
+        }
+        int x = 3;
+        if (p == null)
+            return (3 * x + y) * x;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test1_1_2(int y) {
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = new Point();
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_1_3(int y) {
+        Point p[] = new Point[1];
+        dummy();
+        p[0] = null;
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = new Point();
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_1_4(int y) {
+        Point p[] = new Point[1];
+        dummy();
+        p[0] = new Point();
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = new Point();
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_1_5(int y) {
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = new Point();
+            dummy();
+        } else {
+            dummy();
+            p[0] = null;
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_1_6(int y) {
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = new Point();
+            dummy();
+        } else {
+            dummy();
+            p[0] = new Point();
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_2_0(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p = new Point();
+        if ((y & 1) == 1) {
+            dummy();
+            p = p1;
+            dummy();
+        }
+        int x = 3;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test1_2_1(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p = null;
+        if ((y & 1) == 1) {
+            dummy();
+            p = p1;
+            dummy();
+        }
+        int x = 3;
+        if (p == null)
+            return (3 * x + y) * x;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test1_2_2(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = p1;
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_2_3(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        dummy();
+        p[0] = null;
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = p1;
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_2_4(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p2 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        dummy();
+        p[0] = p1;
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = p2;
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_2_5(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = p1;
+            dummy();
+        } else {
+            dummy();
+            p[0] = null;
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test1_2_6(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p2 = new Point();
+        dummy();
+        Point p[] = new Point[1];
+        if ((y & 1) == 1) {
+            dummy();
+            p[0] = p1;
+            dummy();
+        } else {
+            dummy();
+            p[0] = p2;
+            dummy();
+        }
+        int x = 3;
+        if (p[0] == null)
+            return (3 * x + y) * x;
+        p[0].x = x;
+        p[0].y = 3 * x + y;
+        dummy();
+        return p[0].x * p[0].y;
+    }
+
+    int test2_0_0(int y) {
+        Point p = new Point();
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            p = new Point();
+        }
+        int x = 3;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test2_0_1(int y) {
+        Point p = null;
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            p = new Point();
+        }
+        int x = 3;
+        if (p == null)
+            return (3 * x + y) * x;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test2_0_2(int y) {
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            p[i] = new Point();
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_0_3(int y) {
+        Point p[] = new Point[3];
+        int j = (y & 1);
+        p[j] = null;
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            p[i] = new Point();
+        }
+        int x = 3;
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_0_4(int y) {
+        Point p[] = new Point[3];
+        int j = (y & 1);
+        p[j] = new Point();
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            p[i] = new Point();
+        }
+        int x = 3;
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_0_5(int y) {
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            p[i] = new Point();
+        }
+        for (int i = 0; i < lim; i++) {
+            p[i] = null;
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_0_6(int y) {
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            p[i] = new Point();
+        }
+        for (int i = 0; i < lim; i++) {
+            p[i] = new Point();
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_1_0(int y) {
+        Point p = new Point();
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p = new Point();
+            dummy();
+        }
+        int x = 3;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test2_1_1(int y) {
+        Point p = null;
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p = new Point();
+            dummy();
+        }
+        int x = 3;
+        if (p == null)
+            return (3 * x + y) * x;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test2_1_2(int y) {
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = new Point();
+            dummy();
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_1_3(int y) {
+        Point p[] = new Point[3];
+        dummy();
+        int j = (y & 1);
+        p[j] = null;
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = new Point();
+            dummy();
+        }
+        int x = 3;
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_1_4(int y) {
+        Point p[] = new Point[3];
+        dummy();
+        int j = (y & 1);
+        p[j] = new Point();
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = new Point();
+            dummy();
+        }
+        int x = 3;
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_1_5(int y) {
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = new Point();
+            dummy();
+        }
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = null;
+            dummy();
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_1_6(int y) {
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = new Point();
+            dummy();
+        }
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = new Point();
+            dummy();
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_2_0(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p = new Point();
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p = p1;
+            dummy();
+        }
+        int x = 3;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test2_2_1(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p = null;
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p = p1;
+            dummy();
+        }
+        int x = 3;
+        if (p == null)
+            return (3 * x + y) * x;
+        p.x = x;
+        p.y = 3 * x + y;
+        dummy();
+        return p.x * p.y;
+    }
+
+    int test2_2_2(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = p1;
+            dummy();
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_2_3(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[3];
+        dummy();
+        int j = (y & 1);
+        p[j] = null;
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = p1;
+            dummy();
+        }
+        int x = 3;
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_2_4(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p2 = new Point();
+        dummy();
+        Point p[] = new Point[3];
+        dummy();
+        int j = (y & 1);
+        p[j] = p1;
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = p2;
+            dummy();
+        }
+        int x = 3;
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_2_5(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = p1;
+            dummy();
+        }
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = null;
+            dummy();
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    int test2_2_6(int y) {
+        Point p1 = new Point();
+        dummy();
+        Point p2 = new Point();
+        dummy();
+        Point p[] = new Point[3];
+        int lim = (y & 3);
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = p1;
+            dummy();
+        }
+        for (int i = 0; i < lim; i++) {
+            dummy();
+            p[i] = p2;
+            dummy();
+        }
+        int x = 3;
+        int j = (y & 1);
+        if (p[j] == null)
+            return (3 * x + y) * x;
+        p[j].x = x;
+        p[j].y = 3 * x + y;
+        dummy();
+        return p[j].x * p[0].y;
+    }
+
+    public static void main(String args[]) {
+        Test6726999 tsr = new Test6726999();
+        Point p = new Point();
+        Point ptmp = p;
+        Class cls = Point.class;
+        int y = 0;
+        for (int i = 0; i < 10000; i++) {
+            y = tsr.test0_0_0(y);
+            y = tsr.test0_0_0(y);
+            y = tsr.test0_0_1(y);
+            y = tsr.test0_0_1(y);
+            y = tsr.test0_0_2(y);
+            y = tsr.test0_0_2(y);
+            y = tsr.test0_0_3(y);
+            y = tsr.test0_0_3(y);
+            y = tsr.test0_0_4(y);
+            y = tsr.test0_0_4(y);
+            y = tsr.test0_0_5(y);
+            y = tsr.test0_0_5(y);
+            y = tsr.test0_0_6(y);
+            y = tsr.test0_0_6(y);
+
+            y = tsr.test0_1_3(y);
+            y = tsr.test0_1_3(y);
+            y = tsr.test0_1_4(y);
+            y = tsr.test0_1_4(y);
+            y = tsr.test0_1_5(y);
+            y = tsr.test0_1_5(y);
+            y = tsr.test0_1_6(y);
+            y = tsr.test0_1_6(y);
+
+            y = tsr.test1_0_0(y & ~1);
+            y = tsr.test1_0_1(y & ~1);
+            y = tsr.test1_0_2(y & ~1);
+            y = tsr.test1_0_3(y & ~1);
+            y = tsr.test1_0_4(y & ~1);
+            y = tsr.test1_0_5(y & ~1);
+            y = tsr.test1_0_6(y & ~1);
+            y = tsr.test1_0_0((y & ~1) + 1);
+            y = tsr.test1_0_1((y & ~1) + 1);
+            y = tsr.test1_0_2((y & ~1) + 1);
+            y = tsr.test1_0_3((y & ~1) + 1);
+            y = tsr.test1_0_4((y & ~1) + 1);
+            y = tsr.test1_0_5((y & ~1) + 1);
+            y = tsr.test1_0_6((y & ~1) + 1);
+
+            y = tsr.test1_1_0(y & ~1);
+            y = tsr.test1_1_1(y & ~1);
+            y = tsr.test1_1_2(y & ~1);
+            y = tsr.test1_1_3(y & ~1);
+            y = tsr.test1_1_4(y & ~1);
+            y = tsr.test1_1_5(y & ~1);
+            y = tsr.test1_1_6(y & ~1);
+            y = tsr.test1_1_0((y & ~1) + 1);
+            y = tsr.test1_1_1((y & ~1) + 1);
+            y = tsr.test1_1_2((y & ~1) + 1);
+            y = tsr.test1_1_3((y & ~1) + 1);
+            y = tsr.test1_1_4((y & ~1) + 1);
+            y = tsr.test1_1_5((y & ~1) + 1);
+            y = tsr.test1_1_6((y & ~1) + 1);
+
+            y = tsr.test1_2_0(y & ~1);
+            y = tsr.test1_2_1(y & ~1);
+            y = tsr.test1_2_2(y & ~1);
+            y = tsr.test1_2_3(y & ~1);
+            y = tsr.test1_2_4(y & ~1);
+            y = tsr.test1_2_5(y & ~1);
+            y = tsr.test1_2_6(y & ~1);
+            y = tsr.test1_2_0((y & ~1) + 1);
+            y = tsr.test1_2_1((y & ~1) + 1);
+            y = tsr.test1_2_2((y & ~1) + 1);
+            y = tsr.test1_2_3((y & ~1) + 1);
+            y = tsr.test1_2_4((y & ~1) + 1);
+            y = tsr.test1_2_5((y & ~1) + 1);
+            y = tsr.test1_2_6((y & ~1) + 1);
+
+            y = tsr.test2_0_0(y & ~3);
+            y = tsr.test2_0_1(y & ~3);
+            y = tsr.test2_0_2(y & ~3);
+            y = tsr.test2_0_3(y & ~3);
+            y = tsr.test2_0_4(y & ~3);
+            y = tsr.test2_0_5(y & ~3);
+            y = tsr.test2_0_6(y & ~3);
+            y = tsr.test2_0_0((y & ~3) + 3);
+            y = tsr.test2_0_1((y & ~3) + 3);
+            y = tsr.test2_0_2((y & ~3) + 3);
+            y = tsr.test2_0_3((y & ~3) + 3);
+            y = tsr.test2_0_4((y & ~3) + 3);
+            y = tsr.test2_0_5((y & ~3) + 3);
+            y = tsr.test2_0_6((y & ~3) + 3);
+
+            y = tsr.test2_1_0(y & ~3);
+            y = tsr.test2_1_1(y & ~3);
+            y = tsr.test2_1_2(y & ~3);
+            y = tsr.test2_1_3(y & ~3);
+            y = tsr.test2_1_4(y & ~3);
+            y = tsr.test2_1_5(y & ~3);
+            y = tsr.test2_1_6(y & ~3);
+            y = tsr.test2_1_0((y & ~3) + 3);
+            y = tsr.test2_1_1((y & ~3) + 3);
+            y = tsr.test2_1_2((y & ~3) + 3);
+            y = tsr.test2_1_3((y & ~3) + 3);
+            y = tsr.test2_1_4((y & ~3) + 3);
+            y = tsr.test2_1_5((y & ~3) + 3);
+            y = tsr.test2_1_6((y & ~3) + 3);
+
+            y = tsr.test2_2_0(y & ~3);
+            y = tsr.test2_2_1(y & ~3);
+            y = tsr.test2_2_2(y & ~3);
+            y = tsr.test2_2_3(y & ~3);
+            y = tsr.test2_2_4(y & ~3);
+            y = tsr.test2_2_5(y & ~3);
+            y = tsr.test2_2_6(y & ~3);
+            y = tsr.test2_2_0((y & ~3) + 3);
+            y = tsr.test2_2_1((y & ~3) + 3);
+            y = tsr.test2_2_2((y & ~3) + 3);
+            y = tsr.test2_2_3((y & ~3) + 3);
+            y = tsr.test2_2_4((y & ~3) + 3);
+            y = tsr.test2_2_5((y & ~3) + 3);
+            y = tsr.test2_2_6((y & ~3) + 3);
+
+        }
+        for (int i = 0; i < 10000; i++) {
+            y = tsr.test0_0_0(y);
+            y = tsr.test0_0_0(y);
+            y = tsr.test0_0_1(y);
+            y = tsr.test0_0_1(y);
+            y = tsr.test0_0_2(y);
+            y = tsr.test0_0_2(y);
+            y = tsr.test0_0_3(y);
+            y = tsr.test0_0_3(y);
+            y = tsr.test0_0_4(y);
+            y = tsr.test0_0_4(y);
+            y = tsr.test0_0_5(y);
+            y = tsr.test0_0_5(y);
+            y = tsr.test0_0_6(y);
+            y = tsr.test0_0_6(y);
+
+            y = tsr.test0_1_3(y);
+            y = tsr.test0_1_3(y);
+            y = tsr.test0_1_4(y);
+            y = tsr.test0_1_4(y);
+            y = tsr.test0_1_5(y);
+            y = tsr.test0_1_5(y);
+            y = tsr.test0_1_6(y);
+            y = tsr.test0_1_6(y);
+
+            y = tsr.test1_0_0(y & ~1);
+            y = tsr.test1_0_1(y & ~1);
+            y = tsr.test1_0_2(y & ~1);
+            y = tsr.test1_0_3(y & ~1);
+            y = tsr.test1_0_4(y & ~1);
+            y = tsr.test1_0_5(y & ~1);
+            y = tsr.test1_0_6(y & ~1);
+            y = tsr.test1_0_0((y & ~1) + 1);
+            y = tsr.test1_0_1((y & ~1) + 1);
+            y = tsr.test1_0_2((y & ~1) + 1);
+            y = tsr.test1_0_3((y & ~1) + 1);
+            y = tsr.test1_0_4((y & ~1) + 1);
+            y = tsr.test1_0_5((y & ~1) + 1);
+            y = tsr.test1_0_6((y & ~1) + 1);
+
+            y = tsr.test1_1_0(y & ~1);
+            y = tsr.test1_1_1(y & ~1);
+            y = tsr.test1_1_2(y & ~1);
+            y = tsr.test1_1_3(y & ~1);
+            y = tsr.test1_1_4(y & ~1);
+            y = tsr.test1_1_5(y & ~1);
+            y = tsr.test1_1_6(y & ~1);
+            y = tsr.test1_1_0((y & ~1) + 1);
+            y = tsr.test1_1_1((y & ~1) + 1);
+            y = tsr.test1_1_2((y & ~1) + 1);
+            y = tsr.test1_1_3((y & ~1) + 1);
+            y = tsr.test1_1_4((y & ~1) + 1);
+            y = tsr.test1_1_5((y & ~1) + 1);
+            y = tsr.test1_1_6((y & ~1) + 1);
+
+            y = tsr.test1_2_0(y & ~1);
+            y = tsr.test1_2_1(y & ~1);
+            y = tsr.test1_2_2(y & ~1);
+            y = tsr.test1_2_3(y & ~1);
+            y = tsr.test1_2_4(y & ~1);
+            y = tsr.test1_2_5(y & ~1);
+            y = tsr.test1_2_6(y & ~1);
+            y = tsr.test1_2_0((y & ~1) + 1);
+            y = tsr.test1_2_1((y & ~1) + 1);
+            y = tsr.test1_2_2((y & ~1) + 1);
+            y = tsr.test1_2_3((y & ~1) + 1);
+            y = tsr.test1_2_4((y & ~1) + 1);
+            y = tsr.test1_2_5((y & ~1) + 1);
+            y = tsr.test1_2_6((y & ~1) + 1);
+
+            y = tsr.test2_0_0(y & ~3);
+            y = tsr.test2_0_1(y & ~3);
+            y = tsr.test2_0_2(y & ~3);
+            y = tsr.test2_0_3(y & ~3);
+            y = tsr.test2_0_4(y & ~3);
+            y = tsr.test2_0_5(y & ~3);
+            y = tsr.test2_0_6(y & ~3);
+            y = tsr.test2_0_0((y & ~3) + 3);
+            y = tsr.test2_0_1((y & ~3) + 3);
+            y = tsr.test2_0_2((y & ~3) + 3);
+            y = tsr.test2_0_3((y & ~3) + 3);
+            y = tsr.test2_0_4((y & ~3) + 3);
+            y = tsr.test2_0_5((y & ~3) + 3);
+            y = tsr.test2_0_6((y & ~3) + 3);
+
+            y = tsr.test2_1_0(y & ~3);
+            y = tsr.test2_1_1(y & ~3);
+            y = tsr.test2_1_2(y & ~3);
+            y = tsr.test2_1_3(y & ~3);
+            y = tsr.test2_1_4(y & ~3);
+            y = tsr.test2_1_5(y & ~3);
+            y = tsr.test2_1_6(y & ~3);
+            y = tsr.test2_1_0((y & ~3) + 3);
+            y = tsr.test2_1_1((y & ~3) + 3);
+            y = tsr.test2_1_2((y & ~3) + 3);
+            y = tsr.test2_1_3((y & ~3) + 3);
+            y = tsr.test2_1_4((y & ~3) + 3);
+            y = tsr.test2_1_5((y & ~3) + 3);
+            y = tsr.test2_1_6((y & ~3) + 3);
+
+            y = tsr.test2_2_0(y & ~3);
+            y = tsr.test2_2_1(y & ~3);
+            y = tsr.test2_2_2(y & ~3);
+            y = tsr.test2_2_3(y & ~3);
+            y = tsr.test2_2_4(y & ~3);
+            y = tsr.test2_2_5(y & ~3);
+            y = tsr.test2_2_6(y & ~3);
+            y = tsr.test2_2_0((y & ~3) + 3);
+            y = tsr.test2_2_1((y & ~3) + 3);
+            y = tsr.test2_2_2((y & ~3) + 3);
+            y = tsr.test2_2_3((y & ~3) + 3);
+            y = tsr.test2_2_4((y & ~3) + 3);
+            y = tsr.test2_2_5((y & ~3) + 3);
+            y = tsr.test2_2_6((y & ~3) + 3);
+
+        }
+        for (int i = 0; i < 10000; i++) {
+            y = tsr.test0_0_0(y);
+            y = tsr.test0_0_0(y);
+            y = tsr.test0_0_1(y);
+            y = tsr.test0_0_1(y);
+            y = tsr.test0_0_2(y);
+            y = tsr.test0_0_2(y);
+            y = tsr.test0_0_3(y);
+            y = tsr.test0_0_3(y);
+            y = tsr.test0_0_4(y);
+            y = tsr.test0_0_4(y);
+            y = tsr.test0_0_5(y);
+            y = tsr.test0_0_5(y);
+            y = tsr.test0_0_6(y);
+            y = tsr.test0_0_6(y);
+
+            y = tsr.test0_1_3(y);
+            y = tsr.test0_1_3(y);
+            y = tsr.test0_1_4(y);
+            y = tsr.test0_1_4(y);
+            y = tsr.test0_1_5(y);
+            y = tsr.test0_1_5(y);
+            y = tsr.test0_1_6(y);
+            y = tsr.test0_1_6(y);
+
+            y = tsr.test1_0_0(y & ~1);
+            y = tsr.test1_0_1(y & ~1);
+            y = tsr.test1_0_2(y & ~1);
+            y = tsr.test1_0_3(y & ~1);
+            y = tsr.test1_0_4(y & ~1);
+            y = tsr.test1_0_5(y & ~1);
+            y = tsr.test1_0_6(y & ~1);
+            y = tsr.test1_0_0((y & ~1) + 1);
+            y = tsr.test1_0_1((y & ~1) + 1);
+            y = tsr.test1_0_2((y & ~1) + 1);
+            y = tsr.test1_0_3((y & ~1) + 1);
+            y = tsr.test1_0_4((y & ~1) + 1);
+            y = tsr.test1_0_5((y & ~1) + 1);
+            y = tsr.test1_0_6((y & ~1) + 1);
+
+            y = tsr.test1_1_0(y & ~1);
+            y = tsr.test1_1_1(y & ~1);
+            y = tsr.test1_1_2(y & ~1);
+            y = tsr.test1_1_3(y & ~1);
+            y = tsr.test1_1_4(y & ~1);
+            y = tsr.test1_1_5(y & ~1);
+            y = tsr.test1_1_6(y & ~1);
+            y = tsr.test1_1_0((y & ~1) + 1);
+            y = tsr.test1_1_1((y & ~1) + 1);
+            y = tsr.test1_1_2((y & ~1) + 1);
+            y = tsr.test1_1_3((y & ~1) + 1);
+            y = tsr.test1_1_4((y & ~1) + 1);
+            y = tsr.test1_1_5((y & ~1) + 1);
+            y = tsr.test1_1_6((y & ~1) + 1);
+
+            y = tsr.test1_2_0(y & ~1);
+            y = tsr.test1_2_1(y & ~1);
+            y = tsr.test1_2_2(y & ~1);
+            y = tsr.test1_2_3(y & ~1);
+            y = tsr.test1_2_4(y & ~1);
+            y = tsr.test1_2_5(y & ~1);
+            y = tsr.test1_2_6(y & ~1);
+            y = tsr.test1_2_0((y & ~1) + 1);
+            y = tsr.test1_2_1((y & ~1) + 1);
+            y = tsr.test1_2_2((y & ~1) + 1);
+            y = tsr.test1_2_3((y & ~1) + 1);
+            y = tsr.test1_2_4((y & ~1) + 1);
+            y = tsr.test1_2_5((y & ~1) + 1);
+            y = tsr.test1_2_6((y & ~1) + 1);
+
+            y = tsr.test2_0_0(y & ~3);
+            y = tsr.test2_0_1(y & ~3);
+            y = tsr.test2_0_2(y & ~3);
+            y = tsr.test2_0_3(y & ~3);
+            y = tsr.test2_0_4(y & ~3);
+            y = tsr.test2_0_5(y & ~3);
+            y = tsr.test2_0_6(y & ~3);
+            y = tsr.test2_0_0((y & ~3) + 3);
+            y = tsr.test2_0_1((y & ~3) + 3);
+            y = tsr.test2_0_2((y & ~3) + 3);
+            y = tsr.test2_0_3((y & ~3) + 3);
+            y = tsr.test2_0_4((y & ~3) + 3);
+            y = tsr.test2_0_5((y & ~3) + 3);
+            y = tsr.test2_0_6((y & ~3) + 3);
+
+            y = tsr.test2_1_0(y & ~3);
+            y = tsr.test2_1_1(y & ~3);
+            y = tsr.test2_1_2(y & ~3);
+            y = tsr.test2_1_3(y & ~3);
+            y = tsr.test2_1_4(y & ~3);
+            y = tsr.test2_1_5(y & ~3);
+            y = tsr.test2_1_6(y & ~3);
+            y = tsr.test2_1_0((y & ~3) + 3);
+            y = tsr.test2_1_1((y & ~3) + 3);
+            y = tsr.test2_1_2((y & ~3) + 3);
+            y = tsr.test2_1_3((y & ~3) + 3);
+            y = tsr.test2_1_4((y & ~3) + 3);
+            y = tsr.test2_1_5((y & ~3) + 3);
+            y = tsr.test2_1_6((y & ~3) + 3);
+
+            y = tsr.test2_2_0(y & ~3);
+            y = tsr.test2_2_1(y & ~3);
+            y = tsr.test2_2_2(y & ~3);
+            y = tsr.test2_2_3(y & ~3);
+            y = tsr.test2_2_4(y & ~3);
+            y = tsr.test2_2_5(y & ~3);
+            y = tsr.test2_2_6(y & ~3);
+            y = tsr.test2_2_0((y & ~3) + 3);
+            y = tsr.test2_2_1((y & ~3) + 3);
+            y = tsr.test2_2_2((y & ~3) + 3);
+            y = tsr.test2_2_3((y & ~3) + 3);
+            y = tsr.test2_2_4((y & ~3) + 3);
+            y = tsr.test2_2_5((y & ~3) + 3);
+            y = tsr.test2_2_6((y & ~3) + 3);
+
+        }
+
+        int z = 0;
+        y = tsr.test0_0_0(0);
+        System.out.println("After 'test0_0_0' y=" + y);
+        y = tsr.test0_0_1(0);
+        System.out.println("After 'test0_0_1' y=" + y);
+        y = tsr.test0_0_2(0);
+        System.out.println("After 'test0_0_2' y=" + y);
+        y = tsr.test0_0_3(0);
+        System.out.println("After 'test0_0_3' y=" + y);
+        y = tsr.test0_0_4(0);
+        System.out.println("After 'test0_0_4' y=" + y);
+        y = tsr.test0_0_5(0);
+        System.out.println("After 'test0_0_5' y=" + y);
+        y = tsr.test0_0_6(0);
+        System.out.println("After 'test0_0_6' y=" + y);
+        y = tsr.test0_1_3(0);
+        System.out.println("After 'test0_1_3' y=" + y);
+        y = tsr.test0_1_4(0);
+        System.out.println("After 'test0_1_4' y=" + y);
+        y = tsr.test0_1_5(0);
+        System.out.println("After 'test0_1_5' y=" + y);
+        y = tsr.test0_1_6(0);
+        System.out.println("After 'test0_1_6' y=" + y);
+
+        y = tsr.test1_0_0(0);
+        System.out.println("After 'test1_0_0' y=" + y);
+        y = tsr.test1_0_1(0);
+        System.out.println("After 'test1_0_1' y=" + y);
+        y = tsr.test1_0_2(0);
+        System.out.println("After 'test1_0_2' y=" + y);
+        y = tsr.test1_0_3(0);
+        System.out.println("After 'test1_0_3' y=" + y);
+        y = tsr.test1_0_4(0);
+        System.out.println("After 'test1_0_4' y=" + y);
+        y = tsr.test1_0_5(0);
+        System.out.println("After 'test1_0_5' y=" + y);
+        y = tsr.test1_0_6(0);
+        System.out.println("After 'test1_0_6' y=" + y);
+
+        y = tsr.test1_1_0(0);
+        System.out.println("After 'test1_1_0' y=" + y);
+        y = tsr.test1_1_1(0);
+        System.out.println("After 'test1_1_1' y=" + y);
+        y = tsr.test1_1_2(0);
+        System.out.println("After 'test1_1_2' y=" + y);
+        y = tsr.test1_1_3(0);
+        System.out.println("After 'test1_1_3' y=" + y);
+        y = tsr.test1_1_4(0);
+        System.out.println("After 'test1_1_4' y=" + y);
+        y = tsr.test1_1_5(0);
+        System.out.println("After 'test1_1_5' y=" + y);
+        y = tsr.test1_1_6(0);
+        System.out.println("After 'test1_1_6' y=" + y);
+
+        y = tsr.test1_2_0(0);
+        System.out.println("After 'test1_2_0' y=" + y);
+        y = tsr.test1_2_1(0);
+        System.out.println("After 'test1_2_1' y=" + y);
+        y = tsr.test1_2_2(0);
+        System.out.println("After 'test1_2_2' y=" + y);
+        y = tsr.test1_2_3(0);
+        System.out.println("After 'test1_2_3' y=" + y);
+        y = tsr.test1_2_4(0);
+        System.out.println("After 'test1_2_4' y=" + y);
+        y = tsr.test1_2_5(0);
+        System.out.println("After 'test1_2_5' y=" + y);
+        y = tsr.test1_2_6(0);
+        System.out.println("After 'test1_2_6' y=" + y);
+
+        y = tsr.test2_0_0(0);
+        System.out.println("After 'test2_0_0' y=" + y);
+        y = tsr.test2_0_1(0);
+        System.out.println("After 'test2_0_1' y=" + y);
+        y = tsr.test2_0_2(0);
+        System.out.println("After 'test2_0_2' y=" + y);
+        y = tsr.test2_0_3(0);
+        System.out.println("After 'test2_0_3' y=" + y);
+        y = tsr.test2_0_4(0);
+        System.out.println("After 'test2_0_4' y=" + y);
+        y = tsr.test2_0_5(0);
+        System.out.println("After 'test2_0_5' y=" + y);
+        y = tsr.test2_0_6(0);
+        System.out.println("After 'test2_0_6' y=" + y);
+
+        y = tsr.test2_1_0(0);
+        System.out.println("After 'test2_1_0' y=" + y);
+        y = tsr.test2_1_1(0);
+        System.out.println("After 'test2_1_1' y=" + y);
+        y = tsr.test2_1_2(0);
+        System.out.println("After 'test2_1_2' y=" + y);
+        y = tsr.test2_1_3(0);
+        System.out.println("After 'test2_1_3' y=" + y);
+        y = tsr.test2_1_4(0);
+        System.out.println("After 'test2_1_4' y=" + y);
+        y = tsr.test2_1_5(0);
+        System.out.println("After 'test2_1_5' y=" + y);
+        y = tsr.test2_1_6(0);
+        System.out.println("After 'test2_1_6' y=" + y);
+
+        y = tsr.test2_2_0(0);
+        System.out.println("After 'test2_2_0' y=" + y);
+        y = tsr.test2_2_1(0);
+        System.out.println("After 'test2_2_1' y=" + y);
+        y = tsr.test2_2_2(0);
+        System.out.println("After 'test2_2_2' y=" + y);
+        y = tsr.test2_2_3(0);
+        System.out.println("After 'test2_2_3' y=" + y);
+        y = tsr.test2_2_4(0);
+        System.out.println("After 'test2_2_4' y=" + y);
+        y = tsr.test2_2_5(0);
+        System.out.println("After 'test2_2_5' y=" + y);
+        y = tsr.test2_2_6(0);
+        System.out.println("After 'test2_2_6' y=" + y);
+
+    }
+}
diff --git a/test/compiler/escapeAnalysis/Test6775880.java b/test/compiler/escapeAnalysis/Test6775880.java
new file mode 100644
index 0000000..31e0afa
--- /dev/null
+++ b/test/compiler/escapeAnalysis/Test6775880.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2008, 2014, 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 6775880
+ * @summary EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now")
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot
+ *    -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append
+ *    compiler.escapeAnalysis.Test6775880
+ */
+
+package compiler.escapeAnalysis;
+
+public class Test6775880 {
+
+    int cnt;
+    int b[];
+    String s;
+
+    String test() {
+        String res = "";
+        for (int i = 0; i < cnt; i++) {
+            if (i != 0) {
+                res = res + ".";
+            }
+            res = res + b[i];
+        }
+        return res;
+    }
+
+    public static void main(String[] args) {
+        Test6775880 t = new Test6775880();
+        t.cnt = 3;
+        t.b = new int[3];
+        t.b[0] = 0;
+        t.b[1] = 1;
+        t.b[2] = 2;
+        int j = 0;
+        t.s = "";
+        for (int i = 0; i < 10001; i++) {
+            t.s = "c";
+            t.s = t.test();
+        }
+        System.out.println("After s=" + t.s);
+    }
+}
+
+
diff --git a/test/compiler/escapeAnalysis/6895383/Test.java b/test/compiler/escapeAnalysis/Test6895383.java
similarity index 86%
rename from test/compiler/escapeAnalysis/6895383/Test.java
rename to test/compiler/escapeAnalysis/Test6895383.java
index a1a20e9..24462a6 100644
--- a/test/compiler/escapeAnalysis/6895383/Test.java
+++ b/test/compiler/escapeAnalysis/Test6895383.java
@@ -27,15 +27,17 @@
  * @bug 6895383
  * @summary JCK test throws NPE for method compiled with Escape Analysis
  *
- * @run main/othervm -Xcomp Test
+ * @run main/othervm -Xcomp compiler.escapeAnalysis.Test6895383
  */
 
-import java.util.*;
-import java.util.concurrent.*;
+package compiler.escapeAnalysis;
 
-public class Test {
+import java.util.LinkedList;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+public class Test6895383 {
     public static void main(String argv[]) {
-        Test test = new Test();
+        Test6895383 test = new Test6895383();
         test.testRemove1_IndexOutOfBounds();
         test.testAddAll1_IndexOutOfBoundsException();
     }
diff --git a/test/compiler/escapeAnalysis/6896727/Test.java b/test/compiler/escapeAnalysis/Test6896727.java
similarity index 92%
rename from test/compiler/escapeAnalysis/6896727/Test.java
rename to test/compiler/escapeAnalysis/Test6896727.java
index c2eb93b..042ab2a 100644
--- a/test/compiler/escapeAnalysis/6896727/Test.java
+++ b/test/compiler/escapeAnalysis/Test6896727.java
@@ -26,10 +26,14 @@
  * @test
  * @bug 6896727
  * @summary nsk/logging/LoggingPermission/LoggingPermission/logperm002 fails with G1, EscapeAnalisys w/o COOPs
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+DoEscapeAnalysis Test
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+DoEscapeAnalysis
+ *      compiler.escapeAnalysis.Test6896727
  */
 
-public class Test {
+package compiler.escapeAnalysis;
+
+public class Test6896727 {
 
     final static String testString = "abracadabra";
     public static void main(String args[]) {
diff --git a/test/compiler/escapeAnalysis/Test8020215.java b/test/compiler/escapeAnalysis/Test8020215.java
index 11e9786..3c60922 100644
--- a/test/compiler/escapeAnalysis/Test8020215.java
+++ b/test/compiler/escapeAnalysis/Test8020215.java
@@ -25,9 +25,12 @@
  * @test
  * @bug 8020215
  * @summary Different execution plan when using JIT vs interpreter
- * @run main Test8020215
+ *
+ * @run main compiler.escapeAnalysis.Test8020215
  */
 
+package compiler.escapeAnalysis;
+
 import java.util.ArrayList;
 import java.util.List;
 
diff --git a/test/compiler/escapeAnalysis/TestAllocatedEscapesPtrComparison.java b/test/compiler/escapeAnalysis/TestAllocatedEscapesPtrComparison.java
index 04dea1e..0d2fd47 100644
--- a/test/compiler/escapeAnalysis/TestAllocatedEscapesPtrComparison.java
+++ b/test/compiler/escapeAnalysis/TestAllocatedEscapesPtrComparison.java
@@ -24,11 +24,16 @@
 /*
  * @test
  * @bug 8043354
- * @summary  bcEscapeAnalyzer allocated_escapes not conservative enough
- * @run main/othervm -XX:CompileOnly=.visitAndPop TestAllocatedEscapesPtrComparison
+ * @summary bcEscapeAnalyzer allocated_escapes not conservative enough
+ *
+ * @run main/othervm
+ *      -XX:CompileCommand=compileonly,compiler.escapeAnalysis.TestAllocatedEscapesPtrComparison::visitAndPop
+ *      compiler.escapeAnalysis.TestAllocatedEscapesPtrComparison
  * @author Chuck Rasbold rasbold@google.com
  */
 
+package compiler.escapeAnalysis;
+
 /*
  * Test always passes with -XX:-OptmimizePtrCompare
  */
diff --git a/test/compiler/escapeAnalysis/TestEABadMergeMem.java b/test/compiler/escapeAnalysis/TestEABadMergeMem.java
index 236cbe7..e578ff9 100644
--- a/test/compiler/escapeAnalysis/TestEABadMergeMem.java
+++ b/test/compiler/escapeAnalysis/TestEABadMergeMem.java
@@ -25,10 +25,14 @@
  * @test
  * @bug 8134031
  * @summary Bad rewiring of memory edges when we split unique types during EA
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestEABadMergeMem::m_notinlined TestEABadMergeMem
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *      -XX:CompileCommand=dontinline,compiler.escapeAnalysis.TestEABadMergeMem::m_notinlined
+ *      compiler.escapeAnalysis.TestEABadMergeMem
  */
 
+package compiler.escapeAnalysis;
+
 public class TestEABadMergeMem {
 
     static class Box {
diff --git a/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java b/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java
index 7eac5e0..50c7b8c 100644
--- a/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java
+++ b/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java
@@ -25,8 +25,14 @@
  * @test
  * @bug 8073956
  * @summary Tests C2 EA with allocated object escaping through a call.
- * @run main/othervm -XX:CompileCommand=dontinline,TestEscapeThroughInvoke::create TestEscapeThroughInvoke
+ *
+ * @run main/othervm
+ *      -XX:CompileCommand=dontinline,compiler.escapeAnalysis.TestEscapeThroughInvoke::create
+ *      compiler.escapeAnalysis.TestEscapeThroughInvoke
  */
+
+package compiler.escapeAnalysis;
+
 public class TestEscapeThroughInvoke {
     private A a;
 
@@ -55,20 +61,21 @@
         result.saveInto(a, dummy); // result escapes into 'a' here
         return result;
     }
-}
 
-class A {
-    private A saved;
+    static class A {
+        private A saved;
 
-    public A(Integer dummy) { }
+        public A(Integer dummy) {
+        }
 
-    public void saveInto(A other, Integer dummy) {
-        other.saved = this;
-    }
+        public void saveInto(A other, Integer dummy) {
+            other.saved = this;
+        }
 
-    public void check(A other) {
-        if (this.saved != other) {
-            throw new RuntimeException("TEST FAILED: Objects not equal.");
+        public void check(A other) {
+            if (this.saved != other) {
+                throw new RuntimeException("TEST FAILED: Objects not equal.");
+            }
         }
     }
 }
diff --git a/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java b/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
index 73ca08f..2701512 100644
--- a/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
+++ b/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
@@ -26,13 +26,20 @@
  * @bug 8038048
  * @summary assert(null_obj->escape_state() == PointsToNode::NoEscape,etc)
  * @modules java.base/jdk.internal.misc
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DoEscapeAnalysis -XX:-TieredCompilation -Xbatch TestUnsafePutAddressNullObjMustNotEscape
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DoEscapeAnalysis
+ *      -XX:-TieredCompilation -Xbatch
+ *      compiler.escapeAnalysis.TestUnsafePutAddressNullObjMustNotEscape
+ *
  * @author Richard Reingruber richard DOT reingruber AT sap DOT com
  */
 
-import java.lang.reflect.Field;
+package compiler.escapeAnalysis;
+
 import jdk.internal.misc.Unsafe;
 
+import java.lang.reflect.Field;
+
 public class TestUnsafePutAddressNullObjMustNotEscape {
 
     public static Unsafe usafe;
diff --git a/test/compiler/escapeAnalysis/6716441/Tester.java b/test/compiler/escapeAnalysis/cr6716441/Tester.java
similarity index 99%
rename from test/compiler/escapeAnalysis/6716441/Tester.java
rename to test/compiler/escapeAnalysis/cr6716441/Tester.java
index 9e26607..15f4a06 100644
--- a/test/compiler/escapeAnalysis/6716441/Tester.java
+++ b/test/compiler/escapeAnalysis/cr6716441/Tester.java
@@ -25,11 +25,15 @@
  * @test
  * @bug 6716441
  * @summary error in meet with +DoEscapeAnalysis
- * @run main/othervm -Xcomp -XX:+AggressiveOpts Tester
+ *
+ * @run main/othervm -Xcomp -XX:+AggressiveOpts
+ *      compiler.escapeAnalysis.cr6716441.Tester
  */
 
 /* Complexity upper bound: 70070 ops */
 
+package compiler.escapeAnalysis.cr6716441;
+
 class Tester_Class_0 {
     Object var_1;
 
diff --git a/test/compiler/escapeAnalysis/6795161/Test.java b/test/compiler/escapeAnalysis/cr6795161/Test.java
similarity index 90%
rename from test/compiler/escapeAnalysis/6795161/Test.java
rename to test/compiler/escapeAnalysis/cr6795161/Test.java
index 598e54a..8c5bbd4 100644
--- a/test/compiler/escapeAnalysis/6795161/Test.java
+++ b/test/compiler/escapeAnalysis/cr6795161/Test.java
@@ -26,9 +26,14 @@
  * @test
  * @bug 6795161
  * @summary Escape analysis leads to data corruption
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:CompileOnly=Test -XX:+DoEscapeAnalysis Test
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+DoEscapeAnalysis
+ *      -XX:CompileCommand=compileonly,compiler.escapeAnalysis.cr6795161.Test::*
+ *      compiler.escapeAnalysis.cr6795161.Test
  */
 
+package compiler.escapeAnalysis.cr6795161;
+
 class Test_Class_1 {
     static String var_1;
 
diff --git a/test/compiler/exceptions/CatchInlineExceptions.java b/test/compiler/exceptions/CatchInlineExceptions.java
index 64e986f..80bad92 100644
--- a/test/compiler/exceptions/CatchInlineExceptions.java
+++ b/test/compiler/exceptions/CatchInlineExceptions.java
@@ -25,13 +25,15 @@
  * @test
  * @bug 8059299
  * @summary assert(adr_type != NULL) failed: expecting TypeKlassPtr
- * @run main/othervm -Xbatch CatchInlineExceptions
+ *
+ * @run main/othervm -Xbatch compiler.exceptions.CatchInlineExceptions
  */
 
-class Exception1 extends Exception {};
-class Exception2 extends Exception {};
+package compiler.exceptions;
 
 public class CatchInlineExceptions {
+    static class Exception1 extends Exception {};
+    static class Exception2 extends Exception {};
     private static int counter0;
     private static int counter1;
     private static int counter2;
diff --git a/test/compiler/exceptions/SumTest.java b/test/compiler/exceptions/SumTest.java
index d4555aa..dce72a8 100644
--- a/test/compiler/exceptions/SumTest.java
+++ b/test/compiler/exceptions/SumTest.java
@@ -25,9 +25,12 @@
  * @test
  * @bug 8066900
  * @summary FP registers are not properly restored by C1 when handling exceptions
- * @run main/othervm -Xbatch SumTest
  *
+ * @run main/othervm -Xbatch compiler.exceptions.SumTest
  */
+
+package compiler.exceptions;
+
 public class SumTest {
     private static class Sum {
 
diff --git a/test/compiler/exceptions/TestRecursiveReplacedException.java b/test/compiler/exceptions/TestRecursiveReplacedException.java
index 950ed18..84e766a 100644
--- a/test/compiler/exceptions/TestRecursiveReplacedException.java
+++ b/test/compiler/exceptions/TestRecursiveReplacedException.java
@@ -25,10 +25,14 @@
  * @test
  * @bug 8054224
  * @summary Recursive method compiled by C1 is unable to catch StackOverflowError
- * @run main/othervm -Xcomp -XX:CompileOnly=Test.run -XX:+TieredCompilation -XX:TieredStopAtLevel=2 -Xss512K TestRecursiveReplacedException
  *
+ * @run main/othervm -Xcomp -XX:+TieredCompilation -XX:TieredStopAtLevel=2 -Xss512K
+ *      -XX:CompileCommand=compileonly,compiler.exceptions.TestRecursiveReplacedException::run
+ *      compiler.exceptions.TestRecursiveReplacedException
  */
 
+package compiler.exceptions;
+
 public class TestRecursiveReplacedException {
 
     public static void main(String args[]) {
diff --git a/test/compiler/floatingpoint/ModNaN.java b/test/compiler/floatingpoint/ModNaN.java
index ed38714..a1bdcdc 100644
--- a/test/compiler/floatingpoint/ModNaN.java
+++ b/test/compiler/floatingpoint/ModNaN.java
@@ -24,10 +24,14 @@
 /**
  * @test
  * @bug 8015396
- * @ignore 8145543
  * @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X)
- * @run main ModNaN
+ *
+ * @ignore 8145543
+ * @run main compiler.floatingpoint.ModNaN
  */
+
+package compiler.floatingpoint;
+
 public class ModNaN {
     /* This bug was seen in the field for a particular version of the VM,
      * but never reproduced internally, and the reason was never known,
diff --git a/test/compiler/floatingpoint/NaNTest.java b/test/compiler/floatingpoint/NaNTest.java
index 04549b4..058c4fb 100644
--- a/test/compiler/floatingpoint/NaNTest.java
+++ b/test/compiler/floatingpoint/NaNTest.java
@@ -24,8 +24,12 @@
  * @test
  * @bug 8076373
  * @summary Verify if signaling NaNs are preserved.
- * @run main NaNTest
+ *
+ * @run main compiler.floatingpoint.NaNTest
  */
+
+package compiler.floatingpoint;
+
 public class NaNTest {
     static void testFloat() {
         int originalValue = 0x7f800001;
diff --git a/test/compiler/floatingpoint/Test15FloatJNIArgs.java b/test/compiler/floatingpoint/Test15FloatJNIArgs.java
index 9cb9243..7b4b51a 100644
--- a/test/compiler/floatingpoint/Test15FloatJNIArgs.java
+++ b/test/compiler/floatingpoint/Test15FloatJNIArgs.java
@@ -25,11 +25,14 @@
  * @bug 8139258
  * @summary Regression test for 8139258 which failed to properly pass float args
  *          to a jni function on ppc64le.
- * @run main/othervm/native -Xint Test15FloatJNIArgs
- * @run main/othervm/native -XX:+TieredCompilation -Xcomp Test15FloatJNIArgs
- * @run main/othervm/native -XX:-TieredCompilation -Xcomp Test15FloatJNIArgs
+ *
+ * @run main/othervm/native -Xint compiler.floatingpoint.Test15FloatJNIArgs
+ * @run main/othervm/native -XX:+TieredCompilation -Xcomp compiler.floatingpoint.Test15FloatJNIArgs
+ * @run main/othervm/native -XX:-TieredCompilation -Xcomp compiler.floatingpoint.Test15FloatJNIArgs
  */
 
+package compiler.floatingpoint;
+
 public class Test15FloatJNIArgs {
     static {
         try {
diff --git a/test/compiler/floatingpoint/TestPow2.java b/test/compiler/floatingpoint/TestPow2.java
index 01b094e..28e4f4c 100644
--- a/test/compiler/floatingpoint/TestPow2.java
+++ b/test/compiler/floatingpoint/TestPow2.java
@@ -27,18 +27,22 @@
  * @summary X^2 special case for C2 yields different result than interpreter
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build TestPow2
+ *          java.management
+ *
+ * @build compiler.floatingpoint.TestPow2
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestPow2
- *
+ *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.floatingpoint.TestPow2
  */
 
-import java.lang.reflect.*;
-import sun.hotspot.WhiteBox;
+package compiler.floatingpoint;
+
 import compiler.whitebox.CompilerWhiteBoxTest;
+import sun.hotspot.WhiteBox;
+
+import java.lang.reflect.Method;
 
 public class TestPow2 {
 
diff --git a/test/compiler/floatingpoint/libTest15FloatJNIArgs.c b/test/compiler/floatingpoint/libTest15FloatJNIArgs.c
index e316279..c18c53c 100644
--- a/test/compiler/floatingpoint/libTest15FloatJNIArgs.c
+++ b/test/compiler/floatingpoint/libTest15FloatJNIArgs.c
@@ -27,7 +27,7 @@
 extern "C" {
 #endif
 
-JNIEXPORT jfloat JNICALL Java_Test15FloatJNIArgs_add15floats
+JNIEXPORT jfloat JNICALL Java_compiler_floatingpoint_Test15FloatJNIArgs_add15floats
   (JNIEnv *env, jclass cls,
    jfloat  f1, jfloat  f2, jfloat  f3, jfloat  f4,
    jfloat  f5, jfloat  f6, jfloat  f7, jfloat  f8,
diff --git a/test/compiler/gcbarriers/G1CrashTest.java b/test/compiler/gcbarriers/G1CrashTest.java
index e8c6f01..e98e3cf 100644
--- a/test/compiler/gcbarriers/G1CrashTest.java
+++ b/test/compiler/gcbarriers/G1CrashTest.java
@@ -27,11 +27,14 @@
  * @bug 8023472
  * @summary C2 optimization breaks with G1
  *
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Dcount=100000 G1CrashTest
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *      -Dcount=100000 compiler.gcbarriers.G1CrashTest
  *
  * @author pbiswal@palantir.com
  */
 
+package compiler.gcbarriers;
+
 public class G1CrashTest {
     static Object[] set = new Object[11];
 
diff --git a/test/compiler/gcbarriers/PreserveFPRegistersTest.java b/test/compiler/gcbarriers/PreserveFPRegistersTest.java
index cf63431..483f99d 100644
--- a/test/compiler/gcbarriers/PreserveFPRegistersTest.java
+++ b/test/compiler/gcbarriers/PreserveFPRegistersTest.java
@@ -25,15 +25,25 @@
 /**
  * @test
  * @bug 8148175
- * @ignore 8153194
- * @run main/othervm/timeout=300 -Xbatch -Xmx128m PreserveFPRegistersTest
+ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @library /testlibrary /test/lib
+ * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions
+ *      -XX:+WhiteBoxAPI -Xmx300m -XX:+UseG1GC
+ *      compiler.gcbarriers.PreserveFPRegistersTest
  */
+
+package compiler.gcbarriers;
+
+import sun.hotspot.WhiteBox;
+
 public class PreserveFPRegistersTest {
 
     public static void main(String... args) throws InterruptedException {
         new PreserveFPRegistersTest().go();
     }
 
+    private static WhiteBox wb = WhiteBox.getWhiteBox();
+
     public final Object[][] storage;
 
     /**
@@ -52,18 +62,32 @@
     public final int regionCount;
 
     PreserveFPRegistersTest() {
-        long regionSize = 1_000_000; //WB.g1RegionSize();
-
+        long regionSize = wb.g1RegionSize();
         Runtime rt = Runtime.getRuntime();
         long used = rt.totalMemory() - rt.freeMemory();
         long totalFree = rt.maxMemory() - used;
         regionCount = (int) ( (totalFree / regionSize) * 0.9);
-        int refSize = 4;
-
+        int refSize = wb.getHeapOopSize();
         N = (int) ((regionSize / K ) / refSize) - 5;
-        storage = new Object[regionCount * K][];
-        for (int i = 0; i < storage.length; i++) {
-            storage[i] = new Object[N];
+
+        System.out.println("%% Memory");
+        System.out.println("%%   used          :        " + used / 1024 + "M");
+        System.out.println("%%   available     :        " + totalFree / 1024 + "M");
+        System.out.println("%%   G1 Region Size:        " + regionSize / 1024 + "M");
+        System.out.println("%%   region count  :        " + regionCount);
+
+        System.out.println("%% Objects storage");
+        System.out.println("%%   N (array length)      : " + N);
+        System.out.println("%%   K (objects in regions): " + K);
+        System.out.println("%%   Reference size        : " + refSize);
+
+        try {
+            storage = new Object[regionCount * K][];
+            for (int i = 0; i < storage.length; i++) {
+                storage[i] = new Object[N];
+            }
+        } catch(OutOfMemoryError e) {
+            throw new AssertionError("Test Failed with unexpected OutOfMemoryError exception");
         }
     }
 
diff --git a/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java b/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java
index 821ac79..ba888ab 100644
--- a/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java
+++ b/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java
@@ -26,18 +26,21 @@
  * @bug 8031695
  * @summary CHA ignores default methods during analysis leading to incorrect code generation
  *
- * @run main/othervm -Xbatch DefaultAndConcreteMethodsCHA
+ * @run main/othervm -Xbatch compiler.inlining.DefaultAndConcreteMethodsCHA
  */
-interface I {
-    default int m() { return 0; }
-}
 
-class A implements I {}
-
-class C extends A { }
-class D extends A { public int m() { return 1; } }
+package compiler.inlining;
 
 public class DefaultAndConcreteMethodsCHA {
+    interface I {
+        default int m() { return 0; }
+    }
+
+    static class A implements I {}
+
+    static class C extends A { }
+    static class D extends A { public int m() { return 1; } }
+
     public static int test(A obj) {
         return obj.m();
     }
diff --git a/test/compiler/inlining/DefaultMethodsDependencies.java b/test/compiler/inlining/DefaultMethodsDependencies.java
index 5bdc60f..0402034 100644
--- a/test/compiler/inlining/DefaultMethodsDependencies.java
+++ b/test/compiler/inlining/DefaultMethodsDependencies.java
@@ -25,10 +25,15 @@
  * @test
  * @bug 8069263
  * @summary Deoptimization between array allocation and arraycopy may result in non initialized array
- * @run main/othervm -XX:-BackgroundCompilation -XX:CompileOnly=DefaultMethodsDependencies::test -XX:CompileOnly=DefaultMethodsDependencies$I2::m1 DefaultMethodsDependencies
  *
+ * @run main/othervm -XX:-BackgroundCompilation
+ *      -XX:CompileCommand=compileonly,compiler.inlining.DefaultMethodsDependencies::test
+ *      -XX:CompileCommand=compileonly,compiler.inlining.DefaultMethodsDependencies$I2::m1
+ *      compiler.inlining.DefaultMethodsDependencies
  */
 
+package compiler.inlining;
+
 public class DefaultMethodsDependencies {
 
     interface I1 {
diff --git a/test/compiler/inlining/InlineAccessors.java b/test/compiler/inlining/InlineAccessors.java
index 387a513..10d9f8e 100644
--- a/test/compiler/inlining/InlineAccessors.java
+++ b/test/compiler/inlining/InlineAccessors.java
@@ -27,11 +27,14 @@
  * @summary Method::is_accessor should cover getters and setters for all types
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm InlineAccessors
+ *
+ * @run driver compiler.inlining.InlineAccessors
  */
-import java.lang.invoke.*;
-import jdk.test.lib.*;
-import static jdk.test.lib.Asserts.*;
+
+package compiler.inlining;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
 
 public class InlineAccessors {
     public static void main(String[] args) throws Exception {
@@ -42,7 +45,7 @@
                 "-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
                 "-server", "-XX:-TieredCompilation", "-Xbatch", "-Xcomp",
                 "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
-                    "InlineAccessors$Launcher");
+                    Launcher.class.getName());
 
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
 
diff --git a/test/compiler/inlining/InlineDefaultMethod.java b/test/compiler/inlining/InlineDefaultMethod.java
index 609eaf2..7a6899a 100644
--- a/test/compiler/inlining/InlineDefaultMethod.java
+++ b/test/compiler/inlining/InlineDefaultMethod.java
@@ -25,29 +25,32 @@
  * @test
  * @bug 8026735
  * @summary CHA in C1 should make correct decisions about default methods
- * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod::test -XX:TieredStopAtLevel=1 InlineDefaultMethod
+ *
+ * @run main/othervm -Xcomp -XX:TieredStopAtLevel=1
+ *      -XX:CompileCommand=compileonly,compiler.inlining.InlineDefaultMethod::test
+ *      compiler.inlining.InlineDefaultMethod
  */
 
-
-interface InterfaceWithDefaultMethod0 {
-    default public int defaultMethod() {
-        return 1;
-    }
-}
-
-interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { }
-
-abstract class Subtype implements InterfaceWithDefaultMethod1 { }
-
-class Decoy extends Subtype {
-    public int defaultMethod() {
-        return 2;
-    }
-}
-
-class Instance extends Subtype { }
-
+package compiler.inlining;
 public class InlineDefaultMethod {
+    interface InterfaceWithDefaultMethod0 {
+        default public int defaultMethod() {
+            return 1;
+        }
+    }
+
+    interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { }
+
+    static abstract class Subtype implements InterfaceWithDefaultMethod1 { }
+
+    static class Decoy extends Subtype {
+        public int defaultMethod() {
+            return 2;
+        }
+    }
+
+    static class Instance extends Subtype { }
+
     public static int test(InterfaceWithDefaultMethod1 x) {
         return x.defaultMethod();
     }
diff --git a/test/compiler/inlining/InlineDefaultMethod1.java b/test/compiler/inlining/InlineDefaultMethod1.java
index d0cadb8..7a97e82 100644
--- a/test/compiler/inlining/InlineDefaultMethod1.java
+++ b/test/compiler/inlining/InlineDefaultMethod1.java
@@ -25,25 +25,32 @@
  * @test
  * @bug 8036100
  * @summary Default method returns true for a while, and then returns false
- * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod1::test
- *                   -XX:CompileOnly=I1::m -XX:CompileOnly=I2::m
- *                   InlineDefaultMethod1
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.inlining.InlineDefaultMethod1::test
+ *      -XX:CompileCommand=compileonly,compiler.inlining.InlineDefaultMethod1$I1::m
+ *      -XX:CompileCommand=compileonly,compiler.inlining.InlineDefaultMethod1$I2::m
+ *      compiler.inlining.InlineDefaultMethod1
  */
-interface I1 {
-    default public int m() { return 0; }
-}
 
-interface I2 extends I1 {
-    default public int m() { return 1; }
-}
-
-abstract class A implements I1 {
-}
-
-class B extends A implements I2 {
-}
+package compiler.inlining;
 
 public class InlineDefaultMethod1 {
+    interface I1 {
+        default public int m() { return 0; }
+    }
+
+    interface I2 extends I1 {
+        default public int m() { return 1; }
+    }
+
+    static abstract class A implements I1 {
+    }
+
+    static class B extends A implements I2 {
+    }
+
+
     public static void test(A obj) {
         int id = obj.m();
         if (id != 1) {
diff --git a/test/compiler/integerArithmetic/TestIntegerComparison.java b/test/compiler/integerArithmetic/TestIntegerComparison.java
index b38da49..8e16997 100644
--- a/test/compiler/integerArithmetic/TestIntegerComparison.java
+++ b/test/compiler/integerArithmetic/TestIntegerComparison.java
@@ -24,34 +24,42 @@
 /*
  * @test TestIntegerComparison
  * @bug 8043284 8042786
- * @summary "Tests optimizations of signed and unsigned integer comparison."
- * @run main/othervm -Xcomp -XX:CompileOnly=TestIntegerComparison::testSigned,TestIntegerComparison::testUnsigned TestIntegerComparison
+ * @summary Tests optimizations of signed and unsigned integer comparison.
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.integerArithmetic.TestIntegerComparison::testSigned
+ *      -XX:CompileCommand=compileonly,compiler.integerArithmetic.TestIntegerComparison::testUnsigned
+ *      compiler.integerArithmetic.TestIntegerComparison
  */
-public class TestIntegerComparison {
-  /**
-   * Tests optimization of signed integer comparison (see BoolNode::Ideal).
-   * The body of the if statement is unreachable and should not be compiled.
-   * @param c Character (value in the integer range [0, 65535])
-   */
-  public static void testSigned(char c) {
-    // The following addition may overflow. The result is in one
-    // of the two ranges [IntMax] and [IntMin, IntMin + CharMax - 1].
-    int result = c + Integer.MAX_VALUE;
-    // CmpINode has to consider both result ranges instead of only
-    // the general [IntMin, IntMax] range to be able to prove that
-    // result is always unequal to CharMax.
-    if (result == Character.MAX_VALUE) {
-      // Unreachable
-      throw new RuntimeException("Should not reach here!");
-    }
-  }
+package compiler.integerArithmetic;
 
-  /**
-   * Tests optimization of unsigned integer comparison (see CmpUNode::Value).
-   * The body of the if statement is unreachable and should not be compiled.
-   * @param c Character (value in the integer range [0, 65535])
-   */
-  public static void testUnsigned(char c) {
+public class TestIntegerComparison {
+    /**
+     * Tests optimization of signed integer comparison (see BoolNode::Ideal).
+     * The body of the if statement is unreachable and should not be compiled.
+     *
+     * @param c Character (value in the integer range [0, 65535])
+     */
+    public static void testSigned(char c) {
+        // The following addition may overflow. The result is in one
+        // of the two ranges [IntMax] and [IntMin, IntMin + CharMax - 1].
+        int result = c + Integer.MAX_VALUE;
+        // CmpINode has to consider both result ranges instead of only
+        // the general [IntMin, IntMax] range to be able to prove that
+        // result is always unequal to CharMax.
+        if (result == Character.MAX_VALUE) {
+            // Unreachable
+            throw new RuntimeException("Should not reach here!");
+        }
+    }
+
+    /**
+     * Tests optimization of unsigned integer comparison (see CmpUNode::Value).
+     * The body of the if statement is unreachable and should not be compiled.
+     *
+     * @param c Character (value in the integer range [0, 65535])
+     */
+    public static void testUnsigned(char c) {
     /*
      * The following if statement consisting of two CmpIs is replaced
      * by a CmpU during optimization (see 'IfNode::fold_compares').
@@ -72,21 +80,21 @@
      * that due to the overflow the signed comparison result < 98 is
      * always false.
      */
-    int result = c - (Character.MAX_VALUE - Integer.MIN_VALUE) + 2;
-    if (1 < result && result < 100) {
-      // Unreachable
-      throw new RuntimeException("Should not reach here!");
+        int result = c - (Character.MAX_VALUE - Integer.MIN_VALUE) + 2;
+        if (1 < result && result < 100) {
+            // Unreachable
+            throw new RuntimeException("Should not reach here!");
+        }
     }
-  }
 
-  /**
-   * Tests optimizations of signed and unsigned integer comparison.
-   */
-  public static void main(String[] args) {
-    // We use characters to get a limited integer range for free
-    for (int i = Character.MIN_VALUE; i <= Character.MAX_VALUE; ++i) {
-      testSigned((char) i);
-      testUnsigned((char) i);
+    /**
+     * Tests optimizations of signed and unsigned integer comparison.
+     */
+    public static void main(String[] args) {
+        // We use characters to get a limited integer range for free
+        for (int i = Character.MIN_VALUE; i <= Character.MAX_VALUE; ++i) {
+            testSigned((char) i);
+            testUnsigned((char) i);
+        }
     }
-  }
 }
diff --git a/test/compiler/interpreter/DisableOSRTest.java b/test/compiler/interpreter/DisableOSRTest.java
new file mode 100644
index 0000000..8bdd1ce
--- /dev/null
+++ b/test/compiler/interpreter/DisableOSRTest.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2016 SAP SE. 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 8159620
+ * @summary testing that -XX:-UseOnStackReplacement works with both -XX:(+/-)TieredCompilation
+ * @modules java.base/jdk.internal.misc
+ * @library /testlibrary /test/lib /
+ *
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation
+ *                   -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:-UseOnStackReplacement
+ *                   compiler.interpreter.DisableOSRTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation
+ *                   -XX:-BackgroundCompilation -XX:+TieredCompilation -XX:-UseOnStackReplacement
+ *                   compiler.interpreter.DisableOSRTest
+ */
+
+package compiler.interpreter;
+
+import sun.hotspot.WhiteBox;
+
+import java.lang.reflect.Method;
+import java.util.Random;
+
+public class DisableOSRTest {
+    private static final WhiteBox WB = WhiteBox.getWhiteBox();
+    private static final Random RANDOM = new Random();
+
+    public static int foo() {
+        return RANDOM.nextInt();
+    }
+
+    public static void main(String[] args) throws Exception {
+        Method m = DisableOSRTest.class.getMethod("main", String[].class);
+
+        for (int i = 0; i < 100_000; i++) {
+            foo();
+        }
+
+        if (WB.isMethodCompiled(m, true /* isOsr */)) {
+            throw new RuntimeException("\"" + m + "\" shouldn't be OSR compiled if running with -XX:-UseOnStackReplacement!");
+        }
+    }
+}
diff --git a/test/compiler/interpreter/6539464/Test.java b/test/compiler/interpreter/Test6539464.java
similarity index 88%
rename from test/compiler/interpreter/6539464/Test.java
rename to test/compiler/interpreter/Test6539464.java
index 6a33dfd..baf0e06 100644
--- a/test/compiler/interpreter/6539464/Test.java
+++ b/test/compiler/interpreter/Test6539464.java
@@ -26,10 +26,14 @@
  * @bug 6539464
  * @summary Math.log() produces inconsistent results between successive runs.
  *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test.main Test
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.interpreter.Test6539464::main
+ *      compiler.interpreter.Test6539464
  */
 
-public class Test {
+package compiler.interpreter;
+
+public class Test6539464 {
     static double log_value = 17197;
     static double log_result = Math.log(log_value);
 
diff --git a/test/compiler/interpreter/6833129/Test.java b/test/compiler/interpreter/Test6833129.java
similarity index 94%
rename from test/compiler/interpreter/6833129/Test.java
rename to test/compiler/interpreter/Test6833129.java
index 0283d7b..e887c2d 100644
--- a/test/compiler/interpreter/6833129/Test.java
+++ b/test/compiler/interpreter/Test6833129.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 6833129
  * @summary Object.clone() and Arrays.copyOf ignore coping with -XX:+DeoptimizeALot
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot Test
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot
+ *      compiler.interpreter.Test6833129
  */
 
-public class Test{
+package compiler.interpreter;
+
+public class Test6833129 {
     public static void init(int src[]) {
         for (int i =0; i<src.length; i++) {
             src[i] =  i;
diff --git a/test/compiler/interpreter/7116216/LargeFrame.java b/test/compiler/interpreter/cr7116216/LargeFrame.java
similarity index 99%
rename from test/compiler/interpreter/7116216/LargeFrame.java
rename to test/compiler/interpreter/cr7116216/LargeFrame.java
index eb39b06..8be37c5 100644
--- a/test/compiler/interpreter/7116216/LargeFrame.java
+++ b/test/compiler/interpreter/cr7116216/LargeFrame.java
@@ -22,6 +22,8 @@
  *
  */
 
+package compiler.interpreter.cr7116216;
+
 public class LargeFrame {
 
     public static void method_with_many_locals(Object r1, int r2, int r3, int r4, int r5, int r6, int r7, Object r8) {
diff --git a/test/compiler/interpreter/7116216/StackOverflow.java b/test/compiler/interpreter/cr7116216/StackOverflow.java
similarity index 94%
rename from test/compiler/interpreter/7116216/StackOverflow.java
rename to test/compiler/interpreter/cr7116216/StackOverflow.java
index 934eb59..975b1f2 100644
--- a/test/compiler/interpreter/7116216/StackOverflow.java
+++ b/test/compiler/interpreter/cr7116216/StackOverflow.java
@@ -26,10 +26,12 @@
  * @test
  * @bug 7116216
  * @summary The vm crashes when GC happens during throwing a StackOverflow exception
- *
- * @run main/othervm -Xcomp -Xbatch StackOverflow
+ * @library /
+ * @run main/othervm -Xcomp -Xbatch compiler.interpreter.cr7116216.StackOverflow
  */
 
+package compiler.interpreter.cr7116216;
+
 public class StackOverflow {
     static String stackOverflow_largeFrame_liveOopForGC;
 
diff --git a/test/compiler/intrinsics/IntrinsicAvailableTest.java b/test/compiler/intrinsics/IntrinsicAvailableTest.java
index 42ddab0..dd55d54 100644
--- a/test/compiler/intrinsics/IntrinsicAvailableTest.java
+++ b/test/compiler/intrinsics/IntrinsicAvailableTest.java
@@ -26,34 +26,35 @@
  * @bug 8130832
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary /test/lib /
- * @build IntrinsicAvailableTest
+ *
+ * @build compiler.intrinsics.IntrinsicAvailableTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   -XX:+UseCRC32Intrinsics
- *                   IntrinsicAvailableTest
+ *                   compiler.intrinsics.IntrinsicAvailableTest
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
  *                   -XX:-UseCRC32Intrinsics
- *                   IntrinsicAvailableTest
+ *                   compiler.intrinsics.IntrinsicAvailableTest
  */
 
+
+package compiler.intrinsics;
+
+import compiler.whitebox.CompilerWhiteBoxTest;
+import jdk.test.lib.Platform;
+
 import java.lang.reflect.Executable;
 import java.util.concurrent.Callable;
-import java.util.Objects;
-
-import jdk.test.lib.*;
-import compiler.whitebox.CompilerWhiteBoxTest;
 
 public class IntrinsicAvailableTest extends CompilerWhiteBoxTest {
-    protected String VMName;
 
     public IntrinsicAvailableTest(IntrinsicAvailableTestTestCase testCase) {
         super(testCase);
-        VMName = System.getProperty("java.vm.name");
     }
 
     public static class IntrinsicAvailableTestTestCase implements TestCase {
diff --git a/test/compiler/intrinsics/IntrinsicDisabledTest.java b/test/compiler/intrinsics/IntrinsicDisabledTest.java
index 638301a..7cbe3cb 100644
--- a/test/compiler/intrinsics/IntrinsicDisabledTest.java
+++ b/test/compiler/intrinsics/IntrinsicDisabledTest.java
@@ -26,9 +26,10 @@
  * @bug 8138651
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary /test/lib
- * @build IntrinsicDisabledTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.IntrinsicDisabledTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
@@ -36,16 +37,17 @@
  *                   -XX:DisableIntrinsic=_putIntVolatile
  *                   -XX:CompileCommand=option,jdk.internal.misc.Unsafe::putChar,ccstrlist,DisableIntrinsic,_getCharVolatile,_getInt
  *                   -XX:CompileCommand=option,jdk.internal.misc.Unsafe::putCharVolatile,ccstrlist,DisableIntrinsic,_getIntVolatile
- *                   IntrinsicDisabledTest
+ *                   compiler.intrinsics.IntrinsicDisabledTest
  */
 
+package compiler.intrinsics;
+
+import jdk.test.lib.Platform;
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Executable;
 import java.util.Objects;
 
-import sun.hotspot.WhiteBox;
-
-import jdk.test.lib.Platform;
-
 public class IntrinsicDisabledTest {
 
     private static final WhiteBox wb = WhiteBox.getWhiteBox();
diff --git a/test/compiler/intrinsics/6982370/Test6982370.java b/test/compiler/intrinsics/Test6982370.java
similarity index 97%
rename from test/compiler/intrinsics/6982370/Test6982370.java
rename to test/compiler/intrinsics/Test6982370.java
index a3264ab..9c1a59e 100644
--- a/test/compiler/intrinsics/6982370/Test6982370.java
+++ b/test/compiler/intrinsics/Test6982370.java
@@ -27,9 +27,12 @@
  * @bug 6982370
  * @summary SIGBUS in jbyte_fill
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+OptimizeFill -Xbatch Test6982370
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+OptimizeFill -Xbatch
+ *      compiler.intrinsics.Test6982370
  */
 
+package compiler.intrinsics;
+
 import java.util.Arrays;
 
 /**
diff --git a/test/compiler/intrinsics/8005419/Test8005419.java b/test/compiler/intrinsics/Test8005419.java
similarity index 97%
rename from test/compiler/intrinsics/8005419/Test8005419.java
rename to test/compiler/intrinsics/Test8005419.java
index 201153e..4fc5dc9 100644
--- a/test/compiler/intrinsics/8005419/Test8005419.java
+++ b/test/compiler/intrinsics/Test8005419.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8005419
  * @summary Improve intrinsics code performance on x86 by using AVX2
- * @run main/othervm -Xbatch -Xmx64m Test8005419
  *
+ * @run main/othervm -Xbatch -Xmx64m compiler.intrinsics.Test8005419
  */
 
+package compiler.intrinsics;
+
 public class Test8005419 {
     public static int SIZE = 64;
 
diff --git a/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java b/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java
similarity index 88%
rename from test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java
rename to test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java
index cd8445b..01f3ce7 100644
--- a/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java
+++ b/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java
@@ -1,31 +1,49 @@
-//
-// Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
-// Copyright (c) 2015, Red Hat Inc. 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.
-//
-//
+/*
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Red Hat Inc. 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 8130150 8131779 8139907
+ * @summary Verify that the Montgomery multiply and square intrinsic works and correctly checks their arguments.
+ * @requires vm.flavor == "server"
+ * @modules java.base/jdk.internal.misc
+ * @library /testlibrary /test/lib
+ *
+ * @build compiler.intrinsics.bigInteger.MontgomeryMultiplyTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *      compiler.intrinsics.bigInteger.MontgomeryMultiplyTest
+ */
+
+package compiler.intrinsics.bigInteger;
+
+import jdk.test.lib.Platform;
+import sun.hotspot.WhiteBox;
 
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Field;
@@ -34,23 +52,6 @@
 import java.util.Arrays;
 import java.util.Random;
 
-import sun.hotspot.WhiteBox;
-
-import jdk.test.lib.Platform;
-
-/**
- * @test
- * @bug 8130150 8131779 8139907
- * @summary Verify that the Montgomery multiply and square intrinsic works and correctly checks their arguments.
- * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib
- * @library /testlibrary
- * @build MontgomeryMultiplyTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MontgomeryMultiplyTest
- */
-
 public class MontgomeryMultiplyTest {
 
     private static final WhiteBox wb = WhiteBox.getWhiteBox();
@@ -314,9 +315,11 @@
     }
 
     public static void main(String args[]) {
-        if (Platform.isServer() &&
-            wb.isIntrinsicAvailable(getExecutable(true), COMP_LEVEL_FULL_OPTIMIZATION) &&
-            wb.isIntrinsicAvailable(getExecutable(false), COMP_LEVEL_FULL_OPTIMIZATION)) {
+        if (!Platform.isServer()) {
+            throw new Error("TESTBUG: Not server VM");
+        }
+        if (wb.isIntrinsicAvailable(getExecutable(true), COMP_LEVEL_FULL_OPTIMIZATION) &&
+                wb.isIntrinsicAvailable(getExecutable(false), COMP_LEVEL_FULL_OPTIMIZATION)) {
             try {
                 new MontgomeryMultiplyTest().testMontgomeryMultiplyChecks();
                 new MontgomeryMultiplyTest().testResultValues();
diff --git a/test/compiler/intrinsics/muladd/TestMulAdd.java b/test/compiler/intrinsics/bigInteger/TestMulAdd.java
similarity index 91%
rename from test/compiler/intrinsics/muladd/TestMulAdd.java
rename to test/compiler/intrinsics/bigInteger/TestMulAdd.java
index 4b310e9..0bc6a80 100644
--- a/test/compiler/intrinsics/muladd/TestMulAdd.java
+++ b/test/compiler/intrinsics/bigInteger/TestMulAdd.java
@@ -29,8 +29,8 @@
  *
  * @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch
  *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-UseSquareToLenIntrinsic -XX:-UseMultiplyToLenIntrinsic
- *      -XX:CompileCommand=dontinline,TestMulAdd::main
- *      -XX:CompileCommand=option,TestMulAdd::base_multiply,ccstr,DisableIntrinsic,_mulAdd
+ *      -XX:CompileCommand=dontinline,compiler.intrinsics.bigInteger.TestMulAdd::main
+ *      -XX:CompileCommand=option,compiler.intrinsics.bigInteger.TestMulAdd::base_multiply,ccstr,DisableIntrinsic,_mulAdd
  *      -XX:CompileCommand=option,java.math.BigInteger::multiply,ccstr,DisableIntrinsic,_mulAdd
  *      -XX:CompileCommand=option,java.math.BigInteger::square,ccstr,DisableIntrinsic,_mulAdd
  *      -XX:CompileCommand=option,java.math.BigInteger::squareToLen,ccstr,DisableIntrinsic,_mulAdd
@@ -38,11 +38,14 @@
  *      -XX:CompileCommand=inline,java.math.BigInteger::multiply
  *      -XX:CompileCommand=inline,java.math.BigInteger::square
  *      -XX:CompileCommand=inline,java.math.BigInteger::squareToLen
- *      -XX:CompileCommand=inline,java.math.BigInteger::mulAdd TestMulAdd
+ *      -XX:CompileCommand=inline,java.math.BigInteger::mulAdd
+ *      compiler.intrinsics.bigInteger.TestMulAdd
  */
 
+package compiler.intrinsics.bigInteger;
+
+import java.math.BigInteger;
 import java.util.Random;
-import java.math.*;
 
 public class TestMulAdd {
 
diff --git a/test/compiler/intrinsics/multiplytolen/TestMultiplyToLen.java b/test/compiler/intrinsics/bigInteger/TestMultiplyToLen.java
similarity index 92%
rename from test/compiler/intrinsics/multiplytolen/TestMultiplyToLen.java
rename to test/compiler/intrinsics/bigInteger/TestMultiplyToLen.java
index a3b4bac..54963f5 100644
--- a/test/compiler/intrinsics/multiplytolen/TestMultiplyToLen.java
+++ b/test/compiler/intrinsics/bigInteger/TestMultiplyToLen.java
@@ -28,15 +28,18 @@
  * @summary Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
  *
  * @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch
- *      -XX:CompileCommand=exclude,TestMultiplyToLen::main
- *      -XX:CompileCommand=option,TestMultiplyToLen::base_multiply,ccstr,DisableIntrinsic,_multiplyToLen
+ *      -XX:CompileCommand=exclude,compiler.intrinsics.bigInteger.TestMultiplyToLen::main
+ *      -XX:CompileCommand=option,compiler.intrinsics.bigInteger.TestMultiplyToLen::base_multiply,ccstr,DisableIntrinsic,_multiplyToLen
  *      -XX:CompileCommand=option,java.math.BigInteger::multiply,ccstr,DisableIntrinsic,_multiplyToLen
- *      -XX:CompileCommand=inline,java.math.BigInteger::multiply TestMultiplyToLen
+ *      -XX:CompileCommand=inline,java.math.BigInteger::multiply
+ *      compiler.intrinsics.bigInteger.TestMultiplyToLen
  */
 
+package compiler.intrinsics.bigInteger;
+
+import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.Random;
-import java.math.*;
 
 public class TestMultiplyToLen {
 
diff --git a/test/compiler/intrinsics/multiplytolen/TestMultiplyToLenReturnProfile.java b/test/compiler/intrinsics/bigInteger/TestMultiplyToLenReturnProfile.java
similarity index 89%
rename from test/compiler/intrinsics/multiplytolen/TestMultiplyToLenReturnProfile.java
rename to test/compiler/intrinsics/bigInteger/TestMultiplyToLenReturnProfile.java
index 555bead..693cfe5 100644
--- a/test/compiler/intrinsics/multiplytolen/TestMultiplyToLenReturnProfile.java
+++ b/test/compiler/intrinsics/bigInteger/TestMultiplyToLenReturnProfile.java
@@ -26,12 +26,15 @@
  * @test
  * @bug 8057758
  * @summary MultiplyToLen sets its return type to have a bottom offset which confuses code generation
- * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 TestMultiplyToLenReturnProfile
  *
+ * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *      -XX:TypeProfileLevel=222
+ *      compiler.intrinsics.bigInteger.TestMultiplyToLenReturnProfile
  */
 
+package compiler.intrinsics.bigInteger;
 
-import java.math.*;
+import java.math.BigInteger;
 
 public class TestMultiplyToLenReturnProfile {
 
diff --git a/test/compiler/intrinsics/squaretolen/TestSquareToLen.java b/test/compiler/intrinsics/bigInteger/TestSquareToLen.java
similarity index 91%
rename from test/compiler/intrinsics/squaretolen/TestSquareToLen.java
rename to test/compiler/intrinsics/bigInteger/TestSquareToLen.java
index 79ebbe3..049e0af 100644
--- a/test/compiler/intrinsics/squaretolen/TestSquareToLen.java
+++ b/test/compiler/intrinsics/bigInteger/TestSquareToLen.java
@@ -28,18 +28,21 @@
  * @summary Add C2 x86 intrinsic for BigInteger::squareToLen() method
  *
  * @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch
- *      -XX:CompileCommand=exclude,TestSquareToLen::main
- *      -XX:CompileCommand=option,TestSquareToLen::base_multiply,ccstr,DisableIntrinsic,_squareToLen
+ *      -XX:CompileCommand=exclude,compiler.intrinsics.bigInteger.TestSquareToLen::main
+ *      -XX:CompileCommand=option,compiler.intrinsics.bigInteger.TestSquareToLen::base_multiply,ccstr,DisableIntrinsic,_squareToLen
  *      -XX:CompileCommand=option,java.math.BigInteger::multiply,ccstr,DisableIntrinsic,_squareToLen
  *      -XX:CompileCommand=option,java.math.BigInteger::square,ccstr,DisableIntrinsic,_squareToLen
  *      -XX:CompileCommand=option,java.math.BigInteger::squareToLen,ccstr,DisableIntrinsic,_squareToLen
  *      -XX:CompileCommand=inline,java.math.BigInteger::multiply
  *      -XX:CompileCommand=inline,java.math.BigInteger::square
- *      -XX:CompileCommand=inline,java.math.BigInteger::squareToLen TestSquareToLen
+ *      -XX:CompileCommand=inline,java.math.BigInteger::squareToLen
+ *      compiler.intrinsics.bigInteger.TestSquareToLen
  */
 
+package compiler.intrinsics.bigInteger;
+
+import java.math.BigInteger;
 import java.util.Random;
-import java.math.*;
 
 public class TestSquareToLen {
 
diff --git a/test/compiler/intrinsics/bmi/BMITestRunner.java b/test/compiler/intrinsics/bmi/BMITestRunner.java
index defe4a2..7ca7784 100644
--- a/test/compiler/intrinsics/bmi/BMITestRunner.java
+++ b/test/compiler/intrinsics/bmi/BMITestRunner.java
@@ -22,10 +22,13 @@
  *
  */
 
+package compiler.intrinsics.bmi;
+
 import jdk.test.lib.Asserts;
 import jdk.test.lib.OutputAnalyzer;
 import jdk.test.lib.ProcessTools;
 import jdk.test.lib.Utils;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
diff --git a/test/compiler/intrinsics/bmi/Expr.java b/test/compiler/intrinsics/bmi/Expr.java
index 2d4a84a..46d644e 100644
--- a/test/compiler/intrinsics/bmi/Expr.java
+++ b/test/compiler/intrinsics/bmi/Expr.java
@@ -22,11 +22,12 @@
  *
  */
 
+package compiler.intrinsics.bmi;
+
 /**
  * Expression that should be replaced by particular instrinsic
  * or intruction during compilation.
  */
-
 public abstract class Expr {
 
     public static class MemI {
diff --git a/test/compiler/intrinsics/bmi/TestAndnI.java b/test/compiler/intrinsics/bmi/TestAndnI.java
index 31df862..bb8f971 100644
--- a/test/compiler/intrinsics/bmi/TestAndnI.java
+++ b/test/compiler/intrinsics/bmi/TestAndnI.java
@@ -30,13 +30,17 @@
  * @library /testlibrary /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestAndnI BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @build compiler.intrinsics.bmi.TestAndnI
+ *        compiler.intrinsics.bmi.BMITestRunner
+ *        compiler.intrinsics.bmi.Expr
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestAndnI
+ *                   -XX:+WhiteBoxAPI compiler.intrinsics.bmi.TestAndnI
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestAndnI {
diff --git a/test/compiler/intrinsics/bmi/TestAndnL.java b/test/compiler/intrinsics/bmi/TestAndnL.java
index 8f81d11..9409510 100644
--- a/test/compiler/intrinsics/bmi/TestAndnL.java
+++ b/test/compiler/intrinsics/bmi/TestAndnL.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of ANDN instruction
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestAndnL BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestAndnL
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestAndnL
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestAndnL
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestAndnL {
diff --git a/test/compiler/intrinsics/bmi/TestBlsiI.java b/test/compiler/intrinsics/bmi/TestBlsiI.java
index 72d2bfa..a7bad9e 100644
--- a/test/compiler/intrinsics/bmi/TestBlsiI.java
+++ b/test/compiler/intrinsics/bmi/TestBlsiI.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSI instruction
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestBlsiI BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestBlsiI
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestBlsiI
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestBlsiI
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestBlsiI {
diff --git a/test/compiler/intrinsics/bmi/TestBlsiL.java b/test/compiler/intrinsics/bmi/TestBlsiL.java
index 8813732..90254f5 100644
--- a/test/compiler/intrinsics/bmi/TestBlsiL.java
+++ b/test/compiler/intrinsics/bmi/TestBlsiL.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSI instruction
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestBlsiL BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *
+ * @build compiler.intrinsics.bmi.TestBlsiL
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestBlsiL
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestBlsiL
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestBlsiL {
diff --git a/test/compiler/intrinsics/bmi/TestBlsmskI.java b/test/compiler/intrinsics/bmi/TestBlsmskI.java
index bf6339c..818c141 100644
--- a/test/compiler/intrinsics/bmi/TestBlsmskI.java
+++ b/test/compiler/intrinsics/bmi/TestBlsmskI.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSMSK instruction
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestBlsmskI BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestBlsmskI
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestBlsmskI
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestBlsmskI
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestBlsmskI {
diff --git a/test/compiler/intrinsics/bmi/TestBlsmskL.java b/test/compiler/intrinsics/bmi/TestBlsmskL.java
index 62b799c..8c5c6b5 100644
--- a/test/compiler/intrinsics/bmi/TestBlsmskL.java
+++ b/test/compiler/intrinsics/bmi/TestBlsmskL.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSMSK instruction
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestBlsmskL BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestBlsmskL
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestBlsmskL
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestBlsmskL
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestBlsmskL {
diff --git a/test/compiler/intrinsics/bmi/TestBlsrI.java b/test/compiler/intrinsics/bmi/TestBlsrI.java
index 916cde5..1d759d6 100644
--- a/test/compiler/intrinsics/bmi/TestBlsrI.java
+++ b/test/compiler/intrinsics/bmi/TestBlsrI.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSR instruction
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestBlsrI BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestBlsrI
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestBlsrI
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestBlsrI
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestBlsrI {
diff --git a/test/compiler/intrinsics/bmi/TestBlsrL.java b/test/compiler/intrinsics/bmi/TestBlsrL.java
index cbc4eec..f299a77 100644
--- a/test/compiler/intrinsics/bmi/TestBlsrL.java
+++ b/test/compiler/intrinsics/bmi/TestBlsrL.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSR instruction
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestBlsrL BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestBlsrL
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestBlsrL
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestBlsrL
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestBlsrL {
diff --git a/test/compiler/intrinsics/bmi/TestLzcntI.java b/test/compiler/intrinsics/bmi/TestLzcntI.java
index 613f1db..31ac4ea 100644
--- a/test/compiler/intrinsics/bmi/TestLzcntI.java
+++ b/test/compiler/intrinsics/bmi/TestLzcntI.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestLzcntI BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestLzcntI
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestLzcntI
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestLzcntI
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestLzcntI {
diff --git a/test/compiler/intrinsics/bmi/TestLzcntL.java b/test/compiler/intrinsics/bmi/TestLzcntL.java
index 1e15c48..f27f845 100644
--- a/test/compiler/intrinsics/bmi/TestLzcntL.java
+++ b/test/compiler/intrinsics/bmi/TestLzcntL.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestLzcntL BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestLzcntL
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestLzcntL
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestLzcntL
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestLzcntL {
diff --git a/test/compiler/intrinsics/bmi/TestTzcntI.java b/test/compiler/intrinsics/bmi/TestTzcntI.java
index a051099..c75e28d 100644
--- a/test/compiler/intrinsics/bmi/TestTzcntI.java
+++ b/test/compiler/intrinsics/bmi/TestTzcntI.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestTzcntI BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestTzcntI BMITestRunner Expr
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestTzcntI
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestTzcntI
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestTzcntI {
diff --git a/test/compiler/intrinsics/bmi/TestTzcntL.java b/test/compiler/intrinsics/bmi/TestTzcntL.java
index 788e00f..f561681 100644
--- a/test/compiler/intrinsics/bmi/TestTzcntL.java
+++ b/test/compiler/intrinsics/bmi/TestTzcntL.java
@@ -27,16 +27,20 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestTzcntL BMITestRunner Expr
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @build compiler.intrinsics.bmi.TestTzcntL
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestTzcntL
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.bmi.TestTzcntL
  */
 
+package compiler.intrinsics.bmi;
+
 import sun.hotspot.cpuinfo.CPUInfo;
 
 public class TestTzcntL {
diff --git a/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java b/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java
index 0e224f8..ae940d7 100644
--- a/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java
+++ b/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build AndnTestI
+ *
+ * @build compiler.intrinsics.bmi.verifycode.AndnTestI
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                                 -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestI
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions
+ *      compiler.intrinsics.bmi.verifycode.AndnTestI
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestAndnI;
+
 import java.lang.reflect.Method;
 
 public class AndnTestI extends BmiIntrinsicBase.BmiTestCase {
diff --git a/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java b/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java
index 369c033..cf2729e 100644
--- a/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java
+++ b/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build AndnTestL
+ *
+ * @build compiler.intrinsics.bmi.verifycode.AndnTestL
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                                 -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestL
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions
+ *      compiler.intrinsics.bmi.verifycode.AndnTestL
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestAndnL;
+
 import java.lang.reflect.Method;
 
 public class AndnTestL extends AndnTestI {
diff --git a/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java b/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
index 62860da..944d874 100644
--- a/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build BlsiTestI
+ *
+ * @build compiler.intrinsics.bmi.verifycode.BlsiTestI
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsiTestI
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions
+ *      compiler.intrinsics.bmi.verifycode.BlsiTestI
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestBlsiI;
+
 import java.lang.reflect.Method;
 
 public class BlsiTestI extends BmiIntrinsicBase.BmiTestCase {
diff --git a/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java b/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
index ef665a1..5d98755 100644
--- a/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build BlsiTestL
+ *
+ * @build compiler.intrinsics.bmi.verifycode.BlsiTestL
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsiTestL
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions
+ *      compiler.intrinsics.bmi.verifycode.BlsiTestL
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestBlsiL;
+
 import java.lang.reflect.Method;
 
 public class BlsiTestL extends BlsiTestI {
diff --git a/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java b/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
index e780495..0ed1d9d 100644
--- a/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java
@@ -24,16 +24,22 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build BlsmskTestI
+ *
+ * @build compiler.intrinsics.bmi.verifycode.BlsmskTestI
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsmskTestI
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions
+ *      compiler.intrinsics.bmi.verifycode.BlsmskTestI
  */
 
+package compiler.intrinsics.bmi.verifycode;
+import compiler.intrinsics.bmi.TestBlsmskI;
+
 import java.lang.reflect.Method;
 
 public class BlsmskTestI extends BmiIntrinsicBase.BmiTestCase {
diff --git a/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java b/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
index 6f43468..9554c5e 100644
--- a/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build BlsmskTestL
+ *
+ * @build compiler.intrinsics.bmi.verifycode.BlsmskTestL
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsmskTestL
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions
+ *      compiler.intrinsics.bmi.verifycode.BlsmskTestL
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestBlsmskL;
+
 import java.lang.reflect.Method;
 
 public class BlsmskTestL extends BlsmskTestI {
diff --git a/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java b/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
index a6791b0..b11e275 100644
--- a/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build BlsrTestI
+ *
+ * @build compiler.intrinsics.bmi.verifycode.BlsrTestI
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsrTestI
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions
+ *      compiler.intrinsics.bmi.verifycode.BlsrTestI
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestBlsrI;
+
 import java.lang.reflect.Method;
 
 public class BlsrTestI extends BmiIntrinsicBase.BmiTestCase {
diff --git a/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java b/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
index cd34faf..08038e1 100644
--- a/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
+++ b/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build BlsrTestL
+ *
+ * @build compiler.intrinsics.bmi.verifycode.BlsrTestL
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions BlsrTestL
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions
+ *      compiler.intrinsics.bmi.verifycode.BlsrTestL
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestBlsrL;
+
 import java.lang.reflect.Method;
 
 public class BlsrTestL extends BlsrTestI {
diff --git a/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java b/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
index 8ecb518..a118de0 100644
--- a/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
+++ b/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
@@ -22,17 +22,21 @@
  *
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.whitebox.CompilerWhiteBoxTest;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Platform;
 import jdk.test.lib.Utils;
 import sun.hotspot.code.NMethod;
 import sun.hotspot.cpuinfo.CPUInfo;
 
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodType;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
 import java.util.concurrent.Callable;
 import java.util.function.Function;
-import compiler.whitebox.CompilerWhiteBoxTest;
 
 public class BmiIntrinsicBase extends CompilerWhiteBoxTest {
 
@@ -56,8 +60,11 @@
         }
 
         if (!Platform.isServer()) {
-            System.out.println("Not server VM, test SKIPPED");
-            return;
+            throw new Error("TESTBUG: Not server VM");
+        }
+
+        if (Platform.isInt()) {
+            throw new Error("TESTBUG: test can not be run in interpreter");
         }
 
         if (!CPUInfo.hasFeature(bmiTestCase.getCpuFlag())) {
@@ -72,22 +79,12 @@
 
         System.out.println(testCase.name());
 
-        switch (MODE) {
-            case "compiled mode":
-            case "mixed mode":
-                if (TIERED_COMPILATION && TIERED_STOP_AT_LEVEL != CompilerWhiteBoxTest.COMP_LEVEL_MAX) {
-                    System.out.println("TieredStopAtLevel value (" + TIERED_STOP_AT_LEVEL + ") is too low, test SKIPPED");
-                    return;
-                }
-                deoptimize();
-                compileAtLevelAndCheck(CompilerWhiteBoxTest.COMP_LEVEL_MAX);
-                break;
-            case "interpreted mode": // test is not applicable in this mode;
-                System.err.println("Warning: This test is not applicable in mode: " + MODE);
-                break;
-            default:
-                throw new AssertionError("Test bug, unknown VM mode: " + MODE);
+        if (TIERED_COMPILATION && TIERED_STOP_AT_LEVEL != CompilerWhiteBoxTest.COMP_LEVEL_MAX) {
+            System.out.println("TieredStopAtLevel value (" + TIERED_STOP_AT_LEVEL + ") is too low, test SKIPPED");
+            return;
         }
+        deoptimize();
+        compileAtLevelAndCheck(CompilerWhiteBoxTest.COMP_LEVEL_MAX);
     }
 
     protected void compileAtLevelAndCheck(int level) {
diff --git a/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java b/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
index f23792a..e2ba693 100644
--- a/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
+++ b/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build LZcntTestI
+ *
+ * @build compiler.intrinsics.bmi.verifycode.LZcntTestI
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestI
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction
+ *      compiler.intrinsics.bmi.verifycode.LZcntTestI
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestLzcntI;
+
 import java.lang.reflect.Method;
 
 public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 {
diff --git a/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java b/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
index 71a0fc0..d68a32f 100644
--- a/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
+++ b/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build LZcntTestL
+ *
+ * @build compiler.intrinsics.bmi.verifycode.LZcntTestL
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestL
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction
+ *      compiler.intrinsics.bmi.verifycode.LZcntTestL
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestLzcntL;
+
 import java.lang.reflect.Method;
 
 public class LZcntTestL extends LZcntTestI {
diff --git a/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java b/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
index 1f71f43..4ab25be 100644
--- a/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
+++ b/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java
@@ -24,15 +24,21 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TZcntTestI
+ *
+ * @build compiler.intrinsics.bmi.verifycode.TZcntTestI
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestI
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction
+ *      compiler.intrinsics.bmi.verifycode.TZcntTestI
  */
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestTzcntI;
 
 import java.lang.reflect.Method;
 
diff --git a/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java b/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
index ca77c2a..02359f6 100644
--- a/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
+++ b/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java
@@ -24,16 +24,23 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /test/lib / ..
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TZcntTestL
+ *
+ * @build compiler.intrinsics.bmi.verifycode.TZcntTestL
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestL
+ *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction
+ *      compiler.intrinsics.bmi.verifycode.TZcntTestL
  */
 
+package compiler.intrinsics.bmi.verifycode;
+
+import compiler.intrinsics.bmi.TestTzcntL;
+
 import java.lang.reflect.Method;
 
 public class TZcntTestL extends TZcntTestI {
diff --git a/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java b/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java
similarity index 78%
rename from test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java
rename to test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java
index 90b4fa1..cb6d70c 100644
--- a/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java
+++ b/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java
@@ -24,31 +24,36 @@
 /*
  * @test NullCheckDroppingsTest
  * @bug 8054492
- * @summary "Casting can result in redundant null checks in generated code"
+ * @summary Casting can result in redundant null checks in generated code
+ * @requires vm.flavor == "server"
  * @library /testlibrary /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
  * @build ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.*
- * @build NullCheckDroppingsTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main ClassFileInstaller jdk.test.lib.Platform
+ * @build compiler.intrinsics.klass.CastNullCheckDroppingsTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ *                                jdk.test.lib.Platform
  * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -Xmixed -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:CompileThreshold=1000
- *                   -XX:CompileCommand=exclude,NullCheckDroppingsTest::runTest NullCheckDroppingsTest
+ *                   -XX:CompileCommand=exclude,compiler.intrinsics.klass.CastNullCheckDroppingsTest::runTest
+ *                   compiler.intrinsics.klass.CastNullCheckDroppingsTest
  */
 
+package compiler.intrinsics.klass;
+
+import jdk.test.lib.Platform;
 import sun.hotspot.WhiteBox;
 import sun.hotspot.code.NMethod;
-import jdk.test.lib.Platform;
 
-import java.lang.reflect.Method;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
+import java.lang.reflect.Method;
 import java.util.function.BiFunction;
 
-public class NullCheckDroppingsTest {
+public class CastNullCheckDroppingsTest {
 
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
 
@@ -59,7 +64,7 @@
 
     static {
         try {
-            SET_SSINK = MethodHandles.lookup().findSetter(NullCheckDroppingsTest.class, "ssink", String.class);
+            SET_SSINK = MethodHandles.lookup().findSetter(CastNullCheckDroppingsTest.class, "ssink", String.class);
             MH_CAST = MethodHandles.lookup().findVirtual(Class.class,
                                                          "cast",
                                                          MethodType.methodType(Object.class, Object.class));
@@ -81,43 +86,41 @@
     int[]   asink;
 
     public static void main(String[] args) throws Exception {
-
-        // Only test C2 in Server VM
         if (!Platform.isServer()) {
-            return;
+            throw new Error("TESTBUG: Not server VM");
         }
         // Make sure background compilation is disabled
         if (WHITE_BOX.getBooleanVMFlag("BackgroundCompilation")) {
-            throw new AssertionError("Background compilation enabled");
+            throw new Error("TESTBUG: Background compilation enabled");
         }
         // Make sure Tiered compilation is disabled
         if (WHITE_BOX.getBooleanVMFlag("TieredCompilation")) {
-            throw new AssertionError("Tiered compilation enabled");
+            throw new Error("TESTBUG: Tiered compilation enabled");
         }
 
-        Method methodClassCast = NullCheckDroppingsTest.class.getDeclaredMethod("testClassCast", String.class);
-        Method methodMHCast    = NullCheckDroppingsTest.class.getDeclaredMethod("testMHCast",    String.class);
-        Method methodMHSetter  = NullCheckDroppingsTest.class.getDeclaredMethod("testMHSetter",  String.class);
-        Method methodFunction  = NullCheckDroppingsTest.class.getDeclaredMethod("testFunction",  String.class);
+        Method methodClassCast = CastNullCheckDroppingsTest.class.getDeclaredMethod("testClassCast", String.class);
+        Method methodMHCast    = CastNullCheckDroppingsTest.class.getDeclaredMethod("testMHCast",    String.class);
+        Method methodMHSetter  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testMHSetter",  String.class);
+        Method methodFunction  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testFunction",  String.class);
 
-        NullCheckDroppingsTest t = new NullCheckDroppingsTest();
+        CastNullCheckDroppingsTest t = new CastNullCheckDroppingsTest();
         t.runTest(methodClassCast, false);
         t.runTest(methodMHCast,    false);
         t.runTest(methodMHSetter,  false);
         t.runTest(methodFunction,  false);
 
         // Edge cases
-        Method methodClassCastNull = NullCheckDroppingsTest.class.getDeclaredMethod("testClassCastNull", String.class);
-        Method methodNullClassCast = NullCheckDroppingsTest.class.getDeclaredMethod("testNullClassCast", String.class);
-        Method methodClassCastObj  = NullCheckDroppingsTest.class.getDeclaredMethod("testClassCastObj",  Object.class);
-        Method methodObjClassCast  = NullCheckDroppingsTest.class.getDeclaredMethod("testObjClassCast",  String.class);
-        Method methodVarClassCast  = NullCheckDroppingsTest.class.getDeclaredMethod("testVarClassCast",  String.class);
-        Method methodClassCastInt  = NullCheckDroppingsTest.class.getDeclaredMethod("testClassCastInt",  Object.class);
-        Method methodIntClassCast  = NullCheckDroppingsTest.class.getDeclaredMethod("testIntClassCast",  Object.class);
-        Method methodClassCastint  = NullCheckDroppingsTest.class.getDeclaredMethod("testClassCastint",  Object.class);
-        Method methodintClassCast  = NullCheckDroppingsTest.class.getDeclaredMethod("testintClassCast",  Object.class);
-        Method methodClassCastPrim = NullCheckDroppingsTest.class.getDeclaredMethod("testClassCastPrim", Object.class);
-        Method methodPrimClassCast = NullCheckDroppingsTest.class.getDeclaredMethod("testPrimClassCast", Object.class);
+        Method methodClassCastNull = CastNullCheckDroppingsTest.class.getDeclaredMethod("testClassCastNull", String.class);
+        Method methodNullClassCast = CastNullCheckDroppingsTest.class.getDeclaredMethod("testNullClassCast", String.class);
+        Method methodClassCastObj  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testClassCastObj",  Object.class);
+        Method methodObjClassCast  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testObjClassCast",  String.class);
+        Method methodVarClassCast  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testVarClassCast",  String.class);
+        Method methodClassCastInt  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testClassCastInt",  Object.class);
+        Method methodIntClassCast  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testIntClassCast",  Object.class);
+        Method methodClassCastint  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testClassCastint",  Object.class);
+        Method methodintClassCast  = CastNullCheckDroppingsTest.class.getDeclaredMethod("testintClassCast",  Object.class);
+        Method methodClassCastPrim = CastNullCheckDroppingsTest.class.getDeclaredMethod("testClassCastPrim", Object.class);
+        Method methodPrimClassCast = CastNullCheckDroppingsTest.class.getDeclaredMethod("testPrimClassCast", Object.class);
 
         t.runTest(methodClassCastNull, false);
         t.runTest(methodNullClassCast, false);
diff --git a/test/compiler/intrinsics/class/TestClassIsPrimitive.java b/test/compiler/intrinsics/klass/TestIsPrimitive.java
similarity index 94%
rename from test/compiler/intrinsics/class/TestClassIsPrimitive.java
rename to test/compiler/intrinsics/klass/TestIsPrimitive.java
index 76a2812..5c6ac89 100644
--- a/test/compiler/intrinsics/class/TestClassIsPrimitive.java
+++ b/test/compiler/intrinsics/klass/TestIsPrimitive.java
@@ -27,15 +27,20 @@
  * @bug 8150669
  * @summary C1 intrinsic for Class.isPrimitive
  * @modules java.base/jdk.internal.misc
- * @run main/othervm -ea -Diters=200   -Xint                   TestClassIsPrimitive
- * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1 TestClassIsPrimitive
- * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 TestClassIsPrimitive
+ *
+ * @run main/othervm -ea -Diters=200   -Xint
+ *      compiler.intrinsics.klass.TestIsPrimitive
+ * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1
+ *      compiler.intrinsics.klass.TestIsPrimitive
+ * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4
+ *      compiler.intrinsics.klass.TestIsPrimitive
  */
-import java.lang.reflect.Field;
-import java.lang.reflect.Array;
+
+package compiler.intrinsics.klass;
+
 import java.util.concurrent.Callable;
 
-public class TestClassIsPrimitive {
+public class TestIsPrimitive {
     static final int ITERS = Integer.getInteger("iters", 1);
 
     public static void main(String... args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/AddExactICondTest.java b/test/compiler/intrinsics/mathexact/AddExactICondTest.java
index 8862160..db2bd17 100644
--- a/test/compiler/intrinsics/mathexact/AddExactICondTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactICondTest.java
@@ -25,11 +25,12 @@
  * @test
  * @bug 8024924
  * @summary Test non constant addExact
- * @compile AddExactICondTest.java
- * @run main AddExactICondTest
  *
+ * @run main compiler.intrinsics.mathexact.AddExactICondTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class AddExactICondTest {
   public static int result = 0;
 
diff --git a/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java b/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
index 0e9b702..c8f3c1a 100644
--- a/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8024924
  * @summary Test constant addExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile AddExactIConstantTest.java Verify.java
- * @run main AddExactIConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.AddExactIConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class AddExactIConstantTest {
   public static void main(String[] args) {
       Verify.ConstantTest.verify(new Verify.AddExactI());
diff --git a/test/compiler/intrinsics/mathexact/AddExactILoadTest.java b/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
index 2c353d6..517abe2 100644
--- a/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8024924
  * @summary Test non constant addExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile AddExactILoadTest.java Verify.java
- * @run main AddExactILoadTest
  *
+ * @run main compiler.intrinsics.mathexact.AddExactILoadTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class AddExactILoadTest {
   public static void main(String[] args) {
       Verify.LoadTest.init();
diff --git a/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java b/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
index 4093783..a655e1e 100644
--- a/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8024924
  * @summary Test non constant addExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile AddExactILoopDependentTest.java Verify.java
- * @run main AddExactILoopDependentTest
  *
+ * @run main compiler.intrinsics.mathexact.AddExactILoopDependentTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class AddExactILoopDependentTest {
   public static void main(String[] args) {
     Verify.LoopDependentTest.verify(new Verify.AddExactI());
diff --git a/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java b/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
index 64d518e..d1f0d42 100644
--- a/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8024924
  * @summary Test non constant addExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile AddExactINonConstantTest.java Verify.java
- * @run main AddExactINonConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.AddExactINonConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class AddExactINonConstantTest {
   public static void main(String[] args) {
       Verify.NonConstantTest.verify(new Verify.AddExactI());
diff --git a/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java b/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
index f1fe0c6..649962d 100644
--- a/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
@@ -25,15 +25,17 @@
  * @test
  * @bug 8025657
  * @summary Test repeating addExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile AddExactIRepeatTest.java Verify.java
- * @run main AddExactIRepeatTest
  *
+ * @run main compiler.intrinsics.mathexact.AddExactIRepeatTest
  */
 
+package compiler.intrinsics.mathexact;
+
 import jdk.test.lib.Utils;
+
 import java.util.Random;
 
 public class AddExactIRepeatTest {
diff --git a/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java b/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
index 8e28266..10cf900 100644
--- a/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test constant addExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile AddExactLConstantTest.java Verify.java
- * @run main AddExactLConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.AddExactLConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class AddExactLConstantTest {
     public static void main(String[] args) {
         Verify.ConstantLongTest.verify(new Verify.AddExactL());
diff --git a/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java b/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
index 969899c..32765a5 100644
--- a/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test non constant addExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile AddExactLNonConstantTest.java Verify.java
- * @run main AddExactLNonConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.AddExactLNonConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class AddExactLNonConstantTest {
     public static void main(String[] args) {
         Verify.NonConstantLongTest.verify(new Verify.AddExactL());
diff --git a/test/compiler/intrinsics/mathexact/CompareTest.java b/test/compiler/intrinsics/mathexact/CompareTest.java
index f6785c0..cd9f30b 100644
--- a/test/compiler/intrinsics/mathexact/CompareTest.java
+++ b/test/compiler/intrinsics/mathexact/CompareTest.java
@@ -25,11 +25,13 @@
  * @test
  * @bug 8026722
  * @summary Verify that the compare after addExact is a signed compare
- * @compile CompareTest.java
- * @run main CompareTest
  *
+ * @run main compiler.intrinsics.mathexact.CompareTest
  */
 
+
+package compiler.intrinsics.mathexact;
+
 public class CompareTest {
     public static long store = 0;
     public static long addValue = 1231;
diff --git a/test/compiler/intrinsics/mathexact/DecExactITest.java b/test/compiler/intrinsics/mathexact/DecExactITest.java
index fd76e36..2f77174 100644
--- a/test/compiler/intrinsics/mathexact/DecExactITest.java
+++ b/test/compiler/intrinsics/mathexact/DecExactITest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test decrementExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile DecExactITest.java Verify.java
- * @run main DecExactITest
  *
+ * @run main compiler.intrinsics.mathexact.DecExactITest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class DecExactITest {
     public static int[] values = {1, 1, 1, 1};
     public static int[] minvalues = {Integer.MIN_VALUE, Integer.MIN_VALUE};
diff --git a/test/compiler/intrinsics/mathexact/DecExactLTest.java b/test/compiler/intrinsics/mathexact/DecExactLTest.java
index 2399b9b..a24db22 100644
--- a/test/compiler/intrinsics/mathexact/DecExactLTest.java
+++ b/test/compiler/intrinsics/mathexact/DecExactLTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test decrementExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile DecExactLTest.java Verify.java
- * @run main DecExactLTest
  *
+ * @run main compiler.intrinsics.mathexact.DecExactLTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class DecExactLTest {
     public static long[] values = {1, 1, 1, 1};
     public static long[] minvalues = {Long.MIN_VALUE, Long.MIN_VALUE};
diff --git a/test/compiler/intrinsics/mathexact/GVNTest.java b/test/compiler/intrinsics/mathexact/GVNTest.java
index 23fba15..99cebc2 100644
--- a/test/compiler/intrinsics/mathexact/GVNTest.java
+++ b/test/compiler/intrinsics/mathexact/GVNTest.java
@@ -25,11 +25,12 @@
  * @test
  * @bug 8028207
  * @summary Verify that GVN doesn't mess up the two addExacts
- * @compile GVNTest.java
- * @run main GVNTest
  *
+ * @run main compiler.intrinsics.mathexact.GVNTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class GVNTest {
   public static int result = 0;
   public static int value = 93;
diff --git a/test/compiler/intrinsics/mathexact/IncExactITest.java b/test/compiler/intrinsics/mathexact/IncExactITest.java
index d4f5a80..8d38cf4 100644
--- a/test/compiler/intrinsics/mathexact/IncExactITest.java
+++ b/test/compiler/intrinsics/mathexact/IncExactITest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test incrementExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile IncExactITest.java Verify.java
- * @run main IncExactITest
+ *
+ * @run main compiler.intrinsics.mathexact.IncExactITest
  *
  */
 
+package compiler.intrinsics.mathexact;
 
 public class IncExactITest {
     public static int[] values = {1, 1, 1, 1};
diff --git a/test/compiler/intrinsics/mathexact/IncExactLTest.java b/test/compiler/intrinsics/mathexact/IncExactLTest.java
index a4b456f..3634764 100644
--- a/test/compiler/intrinsics/mathexact/IncExactLTest.java
+++ b/test/compiler/intrinsics/mathexact/IncExactLTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test incrementExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile IncExactLTest.java Verify.java
- * @run main IncExactLTest
  *
+ * @run main compiler.intrinsics.mathexact.IncExactLTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class IncExactLTest {
     public static long[] values = {1, 1, 1, 1};
     public static void main(String[] args) {
diff --git a/test/compiler/intrinsics/mathexact/MulExactICondTest.java b/test/compiler/intrinsics/mathexact/MulExactICondTest.java
index 5f3e1e6..d2da958 100644
--- a/test/compiler/intrinsics/mathexact/MulExactICondTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactICondTest.java
@@ -25,11 +25,12 @@
  * @test
  * @bug 8026844
  * @summary Test multiplyExact as condition
- * @compile MulExactICondTest.java
- * @run main MulExactICondTest
  *
+ * @run main compiler.intrinsics.mathexact.MulExactICondTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class MulExactICondTest {
     public static int result = 0;
 
diff --git a/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java b/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
index 9b0ef70..d30cb0d 100644
--- a/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test constant multiplyExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile MulExactIConstantTest.java Verify.java
- * @run main MulExactIConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.MulExactIConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class MulExactIConstantTest {
     public static void main(String[] args) {
         Verify.ConstantTest.verify(new Verify.MulExactI());
diff --git a/test/compiler/intrinsics/mathexact/MulExactILoadTest.java b/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
index 5b24bb6..7db6a1d 100644
--- a/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test multiplyExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile MulExactILoadTest.java Verify.java
- * @run main MulExactILoadTest
  *
+ * @run main compiler.intrinsics.mathexact.MulExactILoadTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class MulExactILoadTest {
     public static void main(String[] args) {
         Verify.LoadTest.init();
diff --git a/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java b/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
index c37ee65..086b530 100644
--- a/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
@@ -25,13 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test loop dependent multiplyExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile MulExactILoopDependentTest.java Verify.java
- * @run main MulExactILoopDependentTest
  *
+ * @run main compiler.intrinsics.mathexact.MulExactILoopDependentTest
  */
+
+package compiler.intrinsics.mathexact;
+
 public class MulExactILoopDependentTest {
     public static void main(String[] args) {
         Verify.LoopDependentTest.verify(new Verify.MulExactI());
diff --git a/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java b/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
index ed0e4f9..2ef12ea 100644
--- a/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test non constant multiplyExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile MulExactINonConstantTest.java Verify.java
- * @run main MulExactINonConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.MulExactINonConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class MulExactINonConstantTest {
     public static void main(String[] args) {
         Verify.NonConstantTest.verify(new Verify.MulExactI());
diff --git a/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java b/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
index d404cac..f1174d7 100644
--- a/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
@@ -25,15 +25,17 @@
  * @test
  * @bug 8026844
  * @summary Test repeating multiplyExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile MulExactIRepeatTest.java Verify.java
- * @run main MulExactIRepeatTest
  *
+ * @run main compiler.intrinsics.mathexact.MulExactIRepeatTest
  */
 
+package compiler.intrinsics.mathexact;
+
 import jdk.test.lib.Utils;
+
 import java.util.Random;
 
 public class MulExactIRepeatTest {
diff --git a/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java b/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
index f45f31d..b340670 100644
--- a/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test constant mulExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile MulExactLConstantTest.java Verify.java
- * @run main MulExactLConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.MulExactLConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class MulExactLConstantTest {
     public static void main(String[] args) {
         Verify.ConstantLongTest.verify(new Verify.MulExactL());
diff --git a/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java b/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
index 4dee223..ef6acae 100644
--- a/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test non constant mulExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile MulExactLNonConstantTest.java Verify.java
- * @run main MulExactLNonConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.MulExactLNonConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class MulExactLNonConstantTest {
     public static void main(String[] args) {
         Verify.NonConstantLongTest.verify(new Verify.MulExactL());
diff --git a/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java b/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
index fc285e1..85ef97a 100644
--- a/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test constant negExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile NegExactIConstantTest.java Verify.java
- * @run main NegExactIConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.NegExactIConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class NegExactIConstantTest {
     public static void main(String[] args) {
         Verify.ConstantTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI()));
diff --git a/test/compiler/intrinsics/mathexact/NegExactILoadTest.java b/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
index 74aeb86..9b00f83 100644
--- a/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test negExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile NegExactILoadTest.java Verify.java
- * @run main NegExactILoadTest
  *
+ * @run main compiler.intrinsics.mathexact.NegExactILoadTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class NegExactILoadTest {
     public static void main(String[] args) {
       Verify.LoadTest.init();
diff --git a/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java b/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
index 1d7a1e3..48b02c0 100644
--- a/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
@@ -25,13 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test negExact loop dependent
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile NegExactILoopDependentTest.java Verify.java
- * @run main NegExactILoopDependentTest
  *
+ * @run main compiler.intrinsics.mathexact.NegExactILoopDependentTest
  */
+
+package compiler.intrinsics.mathexact;
+
 public class NegExactILoopDependentTest {
     public static void main(String[] args) {
         Verify.LoopDependentTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI()));
diff --git a/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java b/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
index b7f7736..34a20d6 100644
--- a/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test non constant negExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile NegExactINonConstantTest.java Verify.java
- * @run main NegExactINonConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.NegExactINonConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class NegExactINonConstantTest {
     public static void main(String[] args) {
         Verify.NonConstantTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI()));
diff --git a/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java b/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
index b10da7b..b1d086a 100644
--- a/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test constant negExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile NegExactLConstantTest.java Verify.java
- * @run main NegExactLConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.NegExactLConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class NegExactLConstantTest {
     public static void main(String[] args) {
         Verify.ConstantLongTest.verify(new Verify.UnaryToBinaryLong(new Verify.NegExactL()));
diff --git a/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java b/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
index c3ecae7..f28d298 100644
--- a/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test constant negExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile NegExactLNonConstantTest.java Verify.java
- * @run main NegExactLNonConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.NegExactLNonConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class NegExactLNonConstantTest {
     public static void main(String[] args) {
         Verify.NonConstantLongTest.verify(new Verify.UnaryToBinaryLong(new Verify.NegExactL()));
diff --git a/test/compiler/intrinsics/mathexact/NestedMathExactTest.java b/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
index 211dc8b..0ae5396 100644
--- a/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
+++ b/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
@@ -25,11 +25,12 @@
  * @test
  * @bug 8027444
  * @summary Test nested loops
- * @compile NestedMathExactTest.java
- * @run main NestedMathExactTest
  *
+ * @run main compiler.intrinsics.mathexact.NestedMathExactTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class NestedMathExactTest {
     public static final int LIMIT = 100;
     public static int[] result = new int[LIMIT];
diff --git a/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java b/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
index b3b0c0d..758e33a 100644
--- a/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
+++ b/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
@@ -25,11 +25,12 @@
  * @test
  * @bug 8028198
  * @summary Verify that split through phi does the right thing
- * @compile SplitThruPhiTest.java
- * @run main SplitThruPhiTest
  *
+ * @run main compiler.intrinsics.mathexact.SplitThruPhiTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class SplitThruPhiTest {
   public static volatile int value = 19;
   public static int store = 0;
diff --git a/test/compiler/intrinsics/mathexact/SubExactICondTest.java b/test/compiler/intrinsics/mathexact/SubExactICondTest.java
index 249b459..95a177f 100644
--- a/test/compiler/intrinsics/mathexact/SubExactICondTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactICondTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test subtractExact as condition
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile SubExactICondTest.java Verify.java
- * @run main SubExactICondTest
  *
+ * @run main compiler.intrinsics.mathexact.SubExactICondTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class SubExactICondTest {
   public static int result = 0;
 
diff --git a/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java b/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
index cb4cd77..bcb9a1a 100644
--- a/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test constant subtractExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile SubExactIConstantTest.java Verify.java
- * @run main SubExactIConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.SubExactIConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class SubExactIConstantTest {
   public static void main(String[] args) {
       Verify.ConstantTest.verify(new Verify.SubExactI());
diff --git a/test/compiler/intrinsics/mathexact/SubExactILoadTest.java b/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
index e88486a..186f629 100644
--- a/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test non constant subtractExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile SubExactILoadTest.java Verify.java
- * @run main SubExactILoadTest
  *
+ * @run main compiler.intrinsics.mathexact.SubExactILoadTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class SubExactILoadTest {
   public static void main(String[] args) {
       Verify.LoadTest.init();
diff --git a/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java b/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
index 4afec64..880425e 100644
--- a/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test non constant subtractExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile SubExactILoopDependentTest.java Verify.java
- * @run main SubExactILoopDependentTest
  *
+ * @run main compiler.intrinsics.mathexact.SubExactILoopDependentTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class SubExactILoopDependentTest {
   public static void main(String[] args) {
       Verify.LoopDependentTest.verify(new Verify.SubExactI());
diff --git a/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java b/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
index a9c1efb..222649d 100644
--- a/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
@@ -25,14 +25,15 @@
  * @test
  * @bug 8026844
  * @summary Test non constant subtractExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile SubExactINonConstantTest.java Verify.java
- * @run main SubExactINonConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.SubExactINonConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class SubExactINonConstantTest {
     public static void main(String[] args) {
         Verify.NonConstantTest.verify(new Verify.SubExactI());
diff --git a/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java b/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
index 1e13314..49631cf 100644
--- a/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
@@ -25,15 +25,17 @@
  * @test
  * @bug 8026844
  * @summary Test repeating subtractExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile SubExactIRepeatTest.java Verify.java
- * @run main SubExactIRepeatTest
  *
+ * @run main compiler.intrinsics.mathexact.SubExactIRepeatTest
  */
 
+package compiler.intrinsics.mathexact;
+
 import jdk.test.lib.Utils;
+
 import java.util.Random;
 
 public class SubExactIRepeatTest {
diff --git a/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java b/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
index d973027..996dab7 100644
--- a/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
@@ -26,14 +26,15 @@
  * @bug 8026844
  * @bug 8027353
  * @summary Test constant subtractExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile SubExactLConstantTest.java Verify.java
- * @run main SubExactLConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.SubExactLConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class SubExactLConstantTest {
     public static void main(String[] args) {
         Verify.ConstantLongTest.verify(new Verify.SubExactL());
diff --git a/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java b/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
index be9badc..d1d1173 100644
--- a/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
@@ -26,14 +26,15 @@
  * @bug 8026844
  * @bug 8027353
  * @summary Test non constant subtractExact
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @compile SubExactLNonConstantTest.java Verify.java
- * @run main SubExactLNonConstantTest
  *
+ * @run main compiler.intrinsics.mathexact.SubExactLNonConstantTest
  */
 
+package compiler.intrinsics.mathexact;
+
 public class SubExactLNonConstantTest {
     public static void main(String[] args) {
         Verify.NonConstantLongTest.verify(new Verify.SubExactL());
diff --git a/test/compiler/intrinsics/mathexact/Verify.java b/test/compiler/intrinsics/mathexact/Verify.java
index 98d3b0b..c8e0cb3 100644
--- a/test/compiler/intrinsics/mathexact/Verify.java
+++ b/test/compiler/intrinsics/mathexact/Verify.java
@@ -21,7 +21,10 @@
  * questions.
  */
 
+package compiler.intrinsics.mathexact;
+
 import jdk.test.lib.Utils;
+
 import java.util.Random;
 
 /**
diff --git a/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
index b9b643d..5b701af 100644
--- a/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build AddExactIntTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.AddExactIntTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics AddExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.AddExactIntTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics AddExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.AddExactIntTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class AddExactIntTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
index 45f78d4..48dfddd 100644
--- a/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build AddExactLongTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.AddExactLongTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics AddExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.AddExactLongTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics AddExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.AddExactLongTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class AddExactLongTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
index 15f2d74..ff17806 100644
--- a/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build DecrementExactIntTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.DecrementExactIntTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics DecrementExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.DecrementExactIntTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics DecrementExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.DecrementExactIntTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class DecrementExactIntTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
index 97fad80..2683a59 100644
--- a/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build DecrementExactLongTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.DecrementExactLongTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics DecrementExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.DecrementExactLongTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics DecrementExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.DecrementExactLongTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class DecrementExactLongTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
index b1125c0..4c6569a 100644
--- a/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build IncrementExactIntTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.IncrementExactIntTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics IncrementExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.IncrementExactIntTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics IncrementExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.IncrementExactIntTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class IncrementExactIntTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
index 79f2497..fa67b74 100644
--- a/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build IncrementExactLongTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.IncrementExactLongTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics IncrementExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.IncrementExactLongTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics IncrementExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.IncrementExactLongTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class IncrementExactLongTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java b/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java
index f902164..b5aeffb 100644
--- a/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java
+++ b/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java
@@ -21,22 +21,21 @@
  * questions.
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
+import compiler.testlibrary.intrinsics.Verifier;
+import compiler.whitebox.CompilerWhiteBoxTest;
 import jdk.test.lib.Platform;
 
 import java.io.FileOutputStream;
 import java.lang.reflect.Executable;
 import java.util.Properties;
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-import compiler.testlibrary.intrinsics.Verifier;
-
 public abstract class IntrinsicBase extends CompilerWhiteBoxTest {
-    protected String javaVmName;
     protected String useMathExactIntrinsics;
 
     protected IntrinsicBase(TestCase testCase) {
         super(testCase);
-        javaVmName = System.getProperty("java.vm.name");
         useMathExactIntrinsics = getVMOption("UseMathExactIntrinsics");
     }
 
@@ -45,39 +44,32 @@
         //java.lang.Math should be loaded to allow a compilation of the methods that use Math's method
         System.out.println("class java.lang.Math should be loaded. Proof: " + Math.class);
         printEnvironmentInfo();
+        if (Platform.isInt()) {
+            throw new Error("TESTBUG: test can not be run in interpreter");
+        }
 
         int expectedIntrinsicCount = 0;
 
-        switch (MODE) {
-            case "compiled mode":
-            case "mixed mode":
-                if (isServerVM()) {
-                    if (TIERED_COMPILATION) {
-                        int max_level = TIERED_STOP_AT_LEVEL;
-                        expectedIntrinsicCount = (max_level == COMP_LEVEL_MAX) ? 1 : 0;
-                        for (int i = CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE; i <= max_level; ++i) {
-                            deoptimize();
-                            compileAtLevel(i);
-                        }
-                    } else {
-                        expectedIntrinsicCount = 1;
-                        deoptimize();
-                        compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_MAX);
-                    }
-                } else {
+        if (Platform.isServer()) {
+            if (TIERED_COMPILATION) {
+                int max_level = TIERED_STOP_AT_LEVEL;
+                expectedIntrinsicCount = (max_level == COMP_LEVEL_MAX) ? 1 : 0;
+                for (int i = CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE; i <= max_level; ++i) {
                     deoptimize();
-                    compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE);
+                    compileAtLevel(i);
                 }
+            } else {
+                expectedIntrinsicCount = 1;
+                deoptimize();
+                compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_MAX);
+            }
+        } else {
+            deoptimize();
+            compileAtLevel(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE);
+        }
 
-                if (!isIntrinsicAvailable()) {
-                    expectedIntrinsicCount = 0;
-                }
-                break;
-            case "interpreted mode": //test is not applicable in this mode;
-                System.err.println("Warning: This test is not applicable in mode: " + MODE);
-                break;
-            default:
-                throw new RuntimeException("Test bug, unknown VM mode: " + MODE);
+        if (!isIntrinsicAvailable()) {
+            expectedIntrinsicCount = 0;
         }
 
         System.out.println("Expected intrinsic count is " + expectedIntrinsicCount + " name " + getIntrinsicId());
@@ -92,9 +84,8 @@
     }
 
     protected void printEnvironmentInfo() {
-        System.out.println("java.vm.name=" + javaVmName);
         System.out.println("os.arch=" + Platform.getOsArch());
-        System.out.println("java.vm.info=" + MODE);
+        System.out.println("java.vm.info=" + Platform.vmInfo);
         System.out.println("useMathExactIntrinsics=" + useMathExactIntrinsics);
     }
 
@@ -124,10 +115,6 @@
 
     protected abstract String getIntrinsicId();
 
-    protected boolean isServerVM() {
-        return javaVmName.toLowerCase().contains("server");
-    }
-
     static class IntTest extends IntrinsicBase {
 
         protected boolean isIntrinsicAvailable; // The tested intrinsic is available on the current platform.
diff --git a/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java b/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java
index 7148a56..0174a9f 100644
--- a/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java
+++ b/test/compiler/intrinsics/mathexact/sanity/MathIntrinsic.java
@@ -21,9 +21,12 @@
  * questions.
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
+import compiler.whitebox.CompilerWhiteBoxTest;
+
 import java.lang.reflect.Executable;
 import java.util.concurrent.Callable;
-import compiler.whitebox.CompilerWhiteBoxTest;
 
 public class MathIntrinsic {
 
diff --git a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
index c3aec62..3883868 100644
--- a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build MultiplyExactIntTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.MultiplyExactIntTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics MultiplyExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.MultiplyExactIntTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics MultiplyExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.MultiplyExactIntTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class MultiplyExactIntTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
index bc49440..5000ea8 100644
--- a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build MultiplyExactLongTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.MultiplyExactLongTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics MultiplyExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.MultiplyExactLongTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics MultiplyExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.MultiplyExactLongTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class MultiplyExactLongTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
index d39d108..a67b499 100644
--- a/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build NegateExactIntTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.NegateExactIntTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics NegateExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.NegateExactIntTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics NegateExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.NegateExactIntTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class NegateExactIntTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
index 8ad985b..038f014 100644
--- a/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build NegateExactLongTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.NegateExactLongTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics NegateExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.NegateExactLongTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics NegateExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.NegateExactLongTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class NegateExactLongTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
index cf7f2f1..c74b7f7 100644
--- a/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
@@ -26,20 +26,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build SubtractExactIntTest
+ *
+ * @build compiler.intrinsics.mathexact.sanity.SubtractExactIntTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics SubtractExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.SubtractExactIntTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics SubtractExactIntTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.SubtractExactIntTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class SubtractExactIntTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
index d71ee75..263059d 100644
--- a/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
@@ -26,20 +26,24 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build SubtractExactLongTest
+ * @build compiler.intrinsics.mathexact.sanity.SubtractExactLongTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics SubtractExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.SubtractExactLongTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
- *                   -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
- *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics SubtractExactLongTest
+ *                   -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod
+ *                   -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics
+ *                   compiler.intrinsics.mathexact.sanity.SubtractExactLongTest
  * @run driver compiler.testlibrary.intrinsics.Verifier hs_neg.log hs.log
  */
 
+package compiler.intrinsics.mathexact.sanity;
+
 public class SubtractExactLongTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/intrinsics/clone/TestObjectClone.java b/test/compiler/intrinsics/object/TestClone.java
similarity index 69%
rename from test/compiler/intrinsics/clone/TestObjectClone.java
rename to test/compiler/intrinsics/object/TestClone.java
index 1e40e84..1e96632 100644
--- a/test/compiler/intrinsics/clone/TestObjectClone.java
+++ b/test/compiler/intrinsics/object/TestClone.java
@@ -28,39 +28,45 @@
  * @summary assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm -XX:-TieredCompilation -Xbatch -XX:CompileOnly=TestObjectClone::f TestObjectClone
+ *
+ * @run main/othervm -XX:-TieredCompilation -Xbatch
+ *      -XX:CompileCommand=compileonly,compiler.intrinsics.object.TestClone::f
+ *      compiler.intrinsics.object.TestClone
  */
+
+package compiler.intrinsics.object;
+
 import jdk.test.lib.Asserts;
 
-public class TestObjectClone implements Cloneable {
-    static class A extends TestObjectClone {}
-    static class B extends TestObjectClone {
+public class TestClone implements Cloneable {
+    static class A extends TestClone {}
+    static class B extends TestClone {
         public B clone() {
-            return (B)TestObjectClone.b;
+            return (B)TestClone.b;
         }
     }
-    static class C extends TestObjectClone {
+    static class C extends TestClone {
         public C clone() {
-            return (C)TestObjectClone.c;
+            return (C)TestClone.c;
         }
     }
-    static class D extends TestObjectClone {
+    static class D extends TestClone {
         public D clone() {
-            return (D)TestObjectClone.d;
+            return (D)TestClone.d;
         }
     }
-    static TestObjectClone a = new A(), b = new B(), c = new C(), d = new D();
+    static TestClone a = new A(), b = new B(), c = new C(), d = new D();
 
-    public static Object f(TestObjectClone o) throws CloneNotSupportedException {
+    public static Object f(TestClone o) throws CloneNotSupportedException {
         // Polymorphic call site: >90% Object::clone / <10% other methods
         return o.clone();
     }
 
     public static void main(String[] args) throws Exception {
-        TestObjectClone[] params1 = {a, a, a, a, a, a, a, a, a, a, a,
-                          a, a, a, a, a, a, a, a, a, a, a,
-                          a, a, a, a, a, a, a, a, a, a, a,
-                          b, c, d};
+        TestClone[] params1 = {a, a, a, a, a, a, a, a, a, a, a,
+                               a, a, a, a, a, a, a, a, a, a, a,
+                               a, a, a, a, a, a, a, a, a, a, a,
+                               b, c, d};
 
         for (int i = 0; i < 15000; i++) {
             f(params1[i % params1.length]);
diff --git a/test/compiler/intrinsics/hashcode/TestHashCode.java b/test/compiler/intrinsics/object/TestHashCode.java
similarity index 87%
rename from test/compiler/intrinsics/hashcode/TestHashCode.java
rename to test/compiler/intrinsics/object/TestHashCode.java
index f7d5450..f011ccd 100644
--- a/test/compiler/intrinsics/hashcode/TestHashCode.java
+++ b/test/compiler/intrinsics/object/TestHashCode.java
@@ -25,10 +25,15 @@
  * @test
  * @bug 8011646
  * @summary SEGV in compiled code with loop predication
- * @run main/othervm  -XX:-TieredCompilation -XX:CompileOnly=TestHashCode.m1,Object.hashCode TestHashCode
  *
+ * @run main/othervm  -XX:-TieredCompilation
+ *      -XX:CompileCommand=compileonly,java.lang.Object::hashCode
+ *      -XX:CompileCommand=compileonly,compiler.intrinsics.object.TestHashCode::m1
+ *      compiler.intrinsics.object.TestHashCode
  */
 
+package compiler.intrinsics.object;
+
 public class TestHashCode {
     static class A {
         int i;
diff --git a/test/compiler/intrinsics/sha/TestSHA.java b/test/compiler/intrinsics/sha/TestSHA.java
index 08af909..155218d 100644
--- a/test/compiler/intrinsics/sha/TestSHA.java
+++ b/test/compiler/intrinsics/sha/TestSHA.java
@@ -27,26 +27,58 @@
  * @bug 8035968
  * @summary C2 support for SHA on SPARC
  *
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1   TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-224 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-256 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-384 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-512 TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-1
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-224
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-256
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-384
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-512
+ *      compiler.intrinsics.sha.TestSHA
  *
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1   -Doffset=1 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-224 -Doffset=1 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-256 -Doffset=1 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-384 -Doffset=1 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-512 -Doffset=1 TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-1   -Doffset=1
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-224 -Doffset=1
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-256 -Doffset=1
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-384 -Doffset=1
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-512 -Doffset=1
+ *      compiler.intrinsics.sha.TestSHA
  *
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1   -Dalgorithm2=SHA-256 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1   -Dalgorithm2=SHA-512 TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-256 -Dalgorithm2=SHA-512 TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-1   -Dalgorithm2=SHA-256
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-1   -Dalgorithm2=SHA-512
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-256 -Dalgorithm2=SHA-512
+ *      compiler.intrinsics.sha.TestSHA
  *
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1   -Dalgorithm2=MD5     TestSHA
- * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=MD5     -Dalgorithm2=SHA-1   TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=SHA-1   -Dalgorithm2=MD5
+ *      compiler.intrinsics.sha.TestSHA
+ * @run main/othervm/timeout=600 -Xbatch
+ *      -Dalgorithm=MD5     -Dalgorithm2=SHA-1
+ *      compiler.intrinsics.sha.TestSHA
  */
 
+package compiler.intrinsics.sha;
+
 import java.security.MessageDigest;
 import java.util.Arrays;
 
@@ -70,7 +102,7 @@
         }
     }
 
-    static void testSHA(String provider, String algorithm, int msgSize,
+    public static void testSHA(String provider, String algorithm, int msgSize,
                         int offset, int iters, int warmupIters) throws Exception {
         System.out.println("provider = " + provider);
         System.out.println("algorithm = " + algorithm);
diff --git a/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java b/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java
index cb0856c..7dd2154 100644
--- a/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java
+++ b/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java
@@ -21,9 +21,11 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli;
+
+import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
-import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 
 import java.util.function.BooleanSupplier;
 
@@ -34,17 +36,17 @@
  * from several test cases shared among different tests.
  */
 public class SHAOptionsBase extends CommandLineOptionTest {
-    protected static final String USE_SHA_OPTION = "UseSHA";
-    protected static final String USE_SHA1_INTRINSICS_OPTION
+    public static final String USE_SHA_OPTION = "UseSHA";
+    public static final String USE_SHA1_INTRINSICS_OPTION
             = "UseSHA1Intrinsics";
-    protected static final String USE_SHA256_INTRINSICS_OPTION
+    public static final String USE_SHA256_INTRINSICS_OPTION
             = "UseSHA256Intrinsics";
-    protected static final String USE_SHA512_INTRINSICS_OPTION
+    public static final String USE_SHA512_INTRINSICS_OPTION
             = "UseSHA512Intrinsics";
 
     // Intrinsics flags are of diagnostic type
     // and must be preceded by UnlockDiagnosticVMOptions.
-    protected static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS
+    public static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS
             = "-XX:+UnlockDiagnosticVMOptions";
 
     // Note that strings below will be passed to
@@ -71,7 +73,7 @@
      * @return A warning message that will be printed out to VM output if CPU
      *         instructions required by the option are not supported.
      */
-    protected static String getWarningForUnsupportedCPU(String optionName) {
+    public static String getWarningForUnsupportedCPU(String optionName) {
         if (Platform.isSparc() || Platform.isAArch64() ||
             Platform.isX64() || Platform.isX86()) {
             switch (optionName) {
@@ -101,7 +103,7 @@
      * @return The predicate on availability of CPU instructions required by the
      *         option.
      */
-    protected static BooleanSupplier getPredicateForOption(String optionName) {
+    public static BooleanSupplier getPredicateForOption(String optionName) {
         switch (optionName) {
             case SHAOptionsBase.USE_SHA_OPTION:
                 return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE;
diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java
index 7fc3642..44fd2f3 100644
--- a/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java
@@ -28,12 +28,19 @@
  * @library /testlibrary /test/lib testcases /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseSHA1IntrinsicsOptionOnSupportedCPU
+ *
+ * @build compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnSupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseSHA1IntrinsicsOptionOnSupportedCPU
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnSupportedCPU
  */
+
+package compiler.intrinsics.sha.cli;
+
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForSupportedCPU;
+
 public class TestUseSHA1IntrinsicsOptionOnSupportedCPU {
     public static void main(String args[]) throws Throwable {
         new SHAOptionsBase(new GenericTestCaseForSupportedCPU(
diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java
index 34b6680..a4d7f2a 100644
--- a/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java
@@ -28,13 +28,23 @@
  * @library /testlibrary /test/lib testcases /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseSHA1IntrinsicsOptionOnUnsupportedCPU
+ *
+ * @build compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnUnsupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseSHA1IntrinsicsOptionOnUnsupportedCPU
+ *                   compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnUnsupportedCPU
  */
+
+package compiler.intrinsics.sha.cli;
+
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedSparcCPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
+import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU;
+
 public class TestUseSHA1IntrinsicsOptionOnUnsupportedCPU {
     public static void main(String args[]) throws Throwable {
         new SHAOptionsBase(
diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java
index 4710600..33e19ec 100644
--- a/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java
@@ -28,13 +28,19 @@
  * @library /testlibrary /test/lib testcases /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseSHA256IntrinsicsOptionOnSupportedCPU
+ *
+ * @build compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnSupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseSHA256IntrinsicsOptionOnSupportedCPU
+ *                   compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnSupportedCPU
  */
+
+package compiler.intrinsics.sha.cli;
+
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForSupportedCPU;
+
 public class TestUseSHA256IntrinsicsOptionOnSupportedCPU {
     public static void main(String args[]) throws Throwable {
         new SHAOptionsBase(new GenericTestCaseForSupportedCPU(
diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java
index a23dd21..c9f5ec5 100644
--- a/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java
@@ -28,13 +28,23 @@
  * @library /testlibrary /test/lib testcases /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseSHA256IntrinsicsOptionOnUnsupportedCPU
+ *
+ * @build compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnUnsupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseSHA256IntrinsicsOptionOnUnsupportedCPU
+ *                   compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnUnsupportedCPU
  */
+
+package compiler.intrinsics.sha.cli;
+
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedSparcCPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
+import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU;
+
 public class TestUseSHA256IntrinsicsOptionOnUnsupportedCPU {
     public static void main(String args[]) throws Throwable {
         new SHAOptionsBase(
diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java
index fb7c065..b5f2ac2 100644
--- a/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java
@@ -28,13 +28,19 @@
  * @library /testlibrary /test/lib testcases /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseSHA512IntrinsicsOptionOnSupportedCPU
+ *
+ * @build compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnSupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseSHA512IntrinsicsOptionOnSupportedCPU
+ *                   compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnSupportedCPU
  */
+
+package compiler.intrinsics.sha.cli;
+
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForSupportedCPU;
+
 public class TestUseSHA512IntrinsicsOptionOnSupportedCPU {
     public static void main(String args[]) throws Throwable {
         new SHAOptionsBase(new GenericTestCaseForSupportedCPU(
diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java
index d57c63e..26c989e 100644
--- a/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java
@@ -28,13 +28,23 @@
  * @library /testlibrary /test/lib testcases /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseSHA512IntrinsicsOptionOnUnsupportedCPU
+ *
+ * @build compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnUnsupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseSHA512IntrinsicsOptionOnUnsupportedCPU
+ *                   compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnUnsupportedCPU
  */
+
+package compiler.intrinsics.sha.cli;
+
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedSparcCPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
+import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU;
+
 public class TestUseSHA512IntrinsicsOptionOnUnsupportedCPU {
     public static void main(String args[]) throws Throwable {
         new SHAOptionsBase(
diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java
index 5903dfb..7938712 100644
--- a/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java
@@ -28,12 +28,20 @@
  * @library /testlibrary /test/lib testcases /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseSHAOptionOnSupportedCPU
+ *
+ * @build compiler.intrinsics.sha.cli.TestUseSHAOptionOnSupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseSHAOptionOnSupportedCPU
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.sha.cli.TestUseSHAOptionOnSupportedCPU
  */
+
+package compiler.intrinsics.sha.cli;
+
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForSupportedCPU;
+import compiler.intrinsics.sha.cli.testcases.UseSHASpecificTestCaseForSupportedCPU;
+
 public class TestUseSHAOptionOnSupportedCPU {
     public static void main(String args[]) throws Throwable {
         new SHAOptionsBase(
diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java
index 3fed6d2..4a5a34c 100644
--- a/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java
@@ -28,12 +28,22 @@
  * @library /testlibrary /test/lib testcases /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseSHAOptionOnUnsupportedCPU
+ * @build compiler.intrinsics.sha.cli.TestUseSHAOptionOnUnsupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseSHAOptionOnUnsupportedCPU
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.intrinsics.sha.cli.TestUseSHAOptionOnUnsupportedCPU
  */
+
+package compiler.intrinsics.sha.cli;
+
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedSparcCPU;
+import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
+import compiler.intrinsics.sha.cli.testcases.UseSHASpecificTestCaseForUnsupportedCPU;
+
 public class TestUseSHAOptionOnUnsupportedCPU {
     public static void main(String args[]) throws Throwable {
         new SHAOptionsBase(
diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java
index 09dc581..24487f8 100644
--- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java
+++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java
@@ -21,6 +21,9 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli.testcases;
+
+import compiler.intrinsics.sha.cli.SHAOptionsBase;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java
index 553cfaf..de67a39 100644
--- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java
@@ -21,6 +21,9 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli.testcases;
+
+import compiler.intrinsics.sha.cli.SHAOptionsBase;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java
index 8fabc79..64e60e8 100644
--- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java
+++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java
@@ -21,6 +21,9 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli.testcases;
+
+import compiler.intrinsics.sha.cli.SHAOptionsBase;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java
index 1254b8a..4698160 100644
--- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java
+++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java
@@ -21,6 +21,9 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli.testcases;
+
+import compiler.intrinsics.sha.cli.SHAOptionsBase;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java
index 599be2c..2b90bed 100644
--- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java
+++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java
@@ -21,12 +21,15 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli.testcases;
+
+import compiler.intrinsics.sha.cli.SHAOptionsBase;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.OrPredicate;
 import jdk.test.lib.cli.predicate.NotPredicate;
+import jdk.test.lib.cli.predicate.OrPredicate;
 
 /**
  * Generic test case for SHA-related options targeted to X86 CPUs that don't
diff --git a/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java
index a4dfe43..3618147 100644
--- a/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java
@@ -21,13 +21,16 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli.testcases;
+
+import compiler.intrinsics.sha.cli.SHAOptionsBase;
+import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.OrPredicate;
 import jdk.test.lib.cli.predicate.NotPredicate;
-import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
+import jdk.test.lib.cli.predicate.OrPredicate;
 
 /**
  * Test case specific to UseSHA*Intrinsics options targeted to SPARC and AArch64
diff --git a/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java b/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java
index f4ed3bb..0a13cdb 100644
--- a/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java
@@ -21,13 +21,16 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli.testcases;
+
+import compiler.intrinsics.sha.cli.SHAOptionsBase;
+import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
 import jdk.test.lib.cli.predicate.OrPredicate;
-import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 
 /**
  * UseSHA specific test case targeted to SPARC and AArch64 CPUs which
diff --git a/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java
index bc3068d..55e0f5b 100644
--- a/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java
+++ b/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java
@@ -21,14 +21,17 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.cli.testcases;
+
+import compiler.intrinsics.sha.cli.SHAOptionsBase;
+import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.Platform;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.OrPredicate;
 import jdk.test.lib.cli.predicate.NotPredicate;
-import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
+import jdk.test.lib.cli.predicate.OrPredicate;
 
 /**
  * UseSHA specific test case targeted to SPARC and AArch64 CPUs which don't
diff --git a/test/compiler/intrinsics/sha/sanity/SHASanityTestBase.java b/test/compiler/intrinsics/sha/sanity/SHASanityTestBase.java
index d60671c..c476d27 100644
--- a/test/compiler/intrinsics/sha/sanity/SHASanityTestBase.java
+++ b/test/compiler/intrinsics/sha/sanity/SHASanityTestBase.java
@@ -21,6 +21,10 @@
  * questions.
  */
 
+package compiler.intrinsics.sha.sanity;
+
+import compiler.intrinsics.sha.TestSHA;
+import compiler.testlibrary.intrinsics.Verifier;
 import sun.hotspot.WhiteBox;
 
 import java.io.FileOutputStream;
@@ -29,8 +33,6 @@
 import java.util.Properties;
 import java.util.function.BooleanSupplier;
 
-import compiler.testlibrary.intrinsics.Verifier;
-
 /**
  * Base class for sanity tests on SHA intrinsics support.
  */
diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java
index 98ae9c3..71fd922 100644
--- a/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java
+++ b/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-1 intrinsic is actually used.
- * @library /testlibrary /test/lib / ../
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA1Intrinsics
+ *
+ * @build compiler.testlibrary.intrinsics.Verifier
+ *        compiler.intrinsics.sha.sanity.TestSHA1Intrinsics
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -38,7 +40,8 @@
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
  *                   -XX:CompileOnly=sun/security/provider/SHA
  *                   -XX:+UseSHA1Intrinsics
- *                   -Dalgorithm=SHA-1 TestSHA1Intrinsics
+ *                   -Dalgorithm=SHA-1
+ *                   compiler.intrinsics.sha.sanity.TestSHA1Intrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
@@ -46,11 +49,14 @@
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
  *                   -XX:CompileOnly=sun/security/provider/SHA
  *                   -XX:-UseSHA1Intrinsics
- *                   -Dalgorithm=SHA-1 TestSHA1Intrinsics
+ *                   -Dalgorithm=SHA-1
+ *                   compiler.intrinsics.sha.sanity.TestSHA1Intrinsics
  * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE
  *                   compiler.testlibrary.intrinsics.Verifier positive.log negative.log
  */
 
+package compiler.intrinsics.sha.sanity;
+
 import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 
 public class TestSHA1Intrinsics {
diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java
index 4869303..ffc8185 100644
--- a/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java
+++ b/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-1 multi block intrinsic is actually used.
- * @library /testlibrary /test/lib / ../
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA1MultiBlockIntrinsics
+ *
+ * @build compiler.testlibrary.intrinsics.Verifier
+ *        compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -39,7 +41,8 @@
  *                   -XX:CompileOnly=sun/security/provider/SHA
  *                   -XX:+UseSHA1Intrinsics -XX:-UseSHA256Intrinsics
  *                   -XX:-UseSHA512Intrinsics
- *                   -Dalgorithm=SHA-1 TestSHA1MultiBlockIntrinsics
+ *                   -Dalgorithm=SHA-1
+ *                   compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
@@ -47,19 +50,21 @@
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
  *                   -XX:CompileOnly=sun/security/provider/SHA
  *                   -XX:+UseSHA1Intrinsics -Dalgorithm=SHA-1
- *                   TestSHA1MultiBlockIntrinsics
+ *                   compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
  *                   -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA
- *                   -Dalgorithm=SHA-1 TestSHA1MultiBlockIntrinsics
+ *                   -Dalgorithm=SHA-1
+ *                   compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics
  * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE
  *                   compiler.testlibrary.intrinsics.Verifier positive.log positive_def.log
  *                   negative.log
  */
 
+package compiler.intrinsics.sha.sanity;
 import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 
 public class TestSHA1MultiBlockIntrinsics {
diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java
index 5137333..85aa415 100644
--- a/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java
+++ b/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-256 intrinsic is actually used.
- * @library /testlibrary /test/lib / ../
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA256Intrinsics
+ *
+ * @build compiler.testlibrary.intrinsics.Verifier
+ *        compiler.intrinsics.sha.sanity.TestSHA256Intrinsics
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -36,38 +38,44 @@
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_224.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA2
  *                   -XX:+UseSHA256Intrinsics
- *                   -Dalgorithm=SHA-224 TestSHA256Intrinsics
+ *                   -Dalgorithm=SHA-224
+ *                   compiler.intrinsics.sha.sanity.TestSHA256Intrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative_224.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA2
  *                   -XX:-UseSHA256Intrinsics
- *                   -Dalgorithm=SHA-224 TestSHA256Intrinsics
+ *                   -Dalgorithm=SHA-224
+ *                   compiler.intrinsics.sha.sanity.TestSHA256Intrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_256.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA2
  *                   -XX:+UseSHA256Intrinsics
- *                   -Dalgorithm=SHA-256 TestSHA256Intrinsics
+ *                   -Dalgorithm=SHA-256
+ *                   compiler.intrinsics.sha.sanity.TestSHA256Intrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative_256.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA2
  *                   -XX:-UseSHA256Intrinsics
- *                   -Dalgorithm=SHA-256 TestSHA256Intrinsics
+ *                   -Dalgorithm=SHA-256
+ *                   compiler.intrinsics.sha.sanity.TestSHA256Intrinsics
  * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE
  *                    compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log
  *                    negative_224.log negative_256.log
  */
 
+package compiler.intrinsics.sha.sanity;
+
 import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 
 public class TestSHA256Intrinsics {
diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java
index 214f666..292e0d0 100644
--- a/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java
+++ b/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-256 multi block intrinsic is actually used.
- * @library /testlibrary /test/lib / ../
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA256MultiBlockIntrinsics
+ *
+ * @build compiler.testlibrary.intrinsics.Verifier
+ *        compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -36,34 +38,37 @@
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_224.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA2
  *                   -XX:+UseSHA256Intrinsics -XX:-UseSHA1Intrinsics
  *                   -XX:-UseSHA512Intrinsics
- *                   -Dalgorithm=SHA-224 TestSHA256MultiBlockIntrinsics
+ *                   -Dalgorithm=SHA-224
+ *                   compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_224_def.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA2
  *                   -XX:+UseSHA256Intrinsics -Dalgorithm=SHA-224
- *                   TestSHA256MultiBlockIntrinsics
+ *                   compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative_224.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA
- *                   -Dalgorithm=SHA-224 TestSHA256MultiBlockIntrinsics
+ *                   -XX:CompileOnly=sun/security/provider/SHA2 -XX:-UseSHA
+ *                   -Dalgorithm=SHA-224
+ *                   compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_256.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA2
  *                   -XX:+UseSHA256Intrinsics -XX:-UseSHA1Intrinsics
  *                   -XX:-UseSHA512Intrinsics
- *                   -Dalgorithm=SHA-256 TestSHA256MultiBlockIntrinsics
+ *                   -Dalgorithm=SHA-256
+ *                   compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
@@ -71,20 +76,22 @@
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
  *                   -XX:CompileOnly=sun/security/provider/SHA
  *                   -XX:+UseSHA256Intrinsics -Dalgorithm=SHA-256
- *                   TestSHA256MultiBlockIntrinsics
+ *                   compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative_256.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
  *                   -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA
- *                   -Dalgorithm=SHA-256 TestSHA256MultiBlockIntrinsics
+ *                   -Dalgorithm=SHA-256
+ *                   compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics
  * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE
  *                   compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log
  *                   positive_224_def.log positive_256_def.log negative_224.log
  *                   negative_256.log
  */
 
+package compiler.intrinsics.sha.sanity;
 import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 
 public class TestSHA256MultiBlockIntrinsics {
diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java
index 5ac5fc5..de8be87 100644
--- a/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java
+++ b/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-512 intrinsic is actually used.
- * @library /testlibrary /test/lib / ../
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA512Intrinsics
+ *
+ * @build compiler.testlibrary.intrinsics.Verifier
+ *        compiler.intrinsics.sha.sanity.TestSHA512Intrinsics
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -36,38 +38,44 @@
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_384.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA5
  *                   -XX:+UseSHA512Intrinsics
- *                   -Dalgorithm=SHA-384 TestSHA512Intrinsics
+ *                   -Dalgorithm=SHA-384
+ *                   compiler.intrinsics.sha.sanity.TestSHA512Intrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative_384.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA5
  *                   -XX:-UseSHA512Intrinsics
- *                   -Dalgorithm=SHA-384 TestSHA512Intrinsics
+ *                   -Dalgorithm=SHA-384
+ *                   compiler.intrinsics.sha.sanity.TestSHA512Intrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_512.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA5
  *                   -XX:+UseSHA512Intrinsics
- *                   -Dalgorithm=SHA-512 TestSHA512Intrinsics
+ *                   -Dalgorithm=SHA-512
+ *                   compiler.intrinsics.sha.sanity.TestSHA512Intrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative_512.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA5
  *                   -XX:-UseSHA512Intrinsics
- *                   -Dalgorithm=SHA-512 TestSHA512Intrinsics
+ *                   -Dalgorithm=SHA-512
+ *                   compiler.intrinsics.sha.sanity.TestSHA512Intrinsics
  * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE
  *                    compiler.testlibrary.intrinsics.Verifier positive_384.log positive_512.log
  *                    negative_384.log negative_512.log
  */
 
+package compiler.intrinsics.sha.sanity;
+
 import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 
 public class TestSHA512Intrinsics {
diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java
index 7226483..0086412 100644
--- a/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java
+++ b/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-512 multi block intrinsic is actually used.
- * @library /testlibrary /test/lib / ../
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA512MultiBlockIntrinsics
+ *
+ * @build compiler.testlibrary.intrinsics.Verifier
+ *        compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -36,55 +38,61 @@
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_384.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA5
  *                   -XX:+UseSHA512Intrinsics -XX:-UseSHA1Intrinsics
  *                   -XX:-UseSHA256Intrinsics
- *                   -Dalgorithm=SHA-384 TestSHA512MultiBlockIntrinsics
+ *                   -Dalgorithm=SHA-384
+ *                   compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_384_def.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA5
  *                   -XX:+UseSHA512Intrinsics -Dalgorithm=SHA-384
- *                   TestSHA512MultiBlockIntrinsics
+ *                   compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative_384.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA
- *                   -Dalgorithm=SHA-384 TestSHA1Intrinsics
+ *                   -XX:CompileOnly=sun/security/provider/SHA5 -XX:-UseSHA
+ *                   -Dalgorithm=SHA-384
+ *                   compiler.intrinsics.sha.sanity.TestSHA1Intrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_512.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA5
  *                   -XX:+UseSHA512Intrinsics -XX:-UseSHA1Intrinsics
  *                   -XX:-UseSHA256Intrinsics
- *                   -Dalgorithm=SHA-512 TestSHA512MultiBlockIntrinsics
+ *                   -Dalgorithm=SHA-512
+ *                   compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=positive_512_def.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA
+ *                   -XX:CompileOnly=sun/security/provider/SHA5
  *                   -XX:+UseSHA512Intrinsics -Dalgorithm=SHA-512
- *                   TestSHA512MultiBlockIntrinsics
+ *                   compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500
  *                   -XX:Tier4InvocationThreshold=500
  *                   -XX:+LogCompilation -XX:LogFile=negative_512.log
  *                   -XX:CompileOnly=sun/security/provider/DigestBase
- *                   -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA
- *                   -Dalgorithm=SHA-512 TestSHA512MultiBlockIntrinsics
+ *                   -XX:CompileOnly=sun/security/provider/SHA5 -XX:-UseSHA
+ *                   -Dalgorithm=SHA-512
+ *                   compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics
  * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE
  *                    compiler.testlibrary.intrinsics.Verifier positive_384.log positive_512.log
  *                    positive_384_def.log positive_512_def.log negative_384.log
  *                    negative_512.log
  */
 
+package compiler.intrinsics.sha.sanity;
+
 import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
 
 public class TestSHA512MultiBlockIntrinsics {
diff --git a/test/compiler/intrinsics/string/TestHasNegatives.java b/test/compiler/intrinsics/string/TestHasNegatives.java
index 587eb0c..df75e4d 100644
--- a/test/compiler/intrinsics/string/TestHasNegatives.java
+++ b/test/compiler/intrinsics/string/TestHasNegatives.java
@@ -28,13 +28,13 @@
  * @bug 8054307
  * @summary Validates StringCoding.hasNegatives intrinsic with a small range of tests.
  * @library /compiler/patches
+ *
  * @build java.base/java.lang.Helper
  * @build compiler.intrinsics.string.TestHasNegatives
  * @run main compiler.intrinsics.string.TestHasNegatives
  */
-package compiler.intrinsics.string;
 
-import java.lang.Helper;
+package compiler.intrinsics.string;
 
 /*
  * @summary Validates StringCoding.hasNegatives intrinsic with a small
diff --git a/test/compiler/intrinsics/string/TestStringConstruction.java b/test/compiler/intrinsics/string/TestStringConstruction.java
index 20c010d..bdd0205 100644
--- a/test/compiler/intrinsics/string/TestStringConstruction.java
+++ b/test/compiler/intrinsics/string/TestStringConstruction.java
@@ -25,8 +25,16 @@
  * @test
  * @bug 8142303
  * @summary Tests handling of invalid array indices in C2 intrinsic if explicit range check in Java code is not inlined.
- * @run main/othervm -XX:CompileCommand=inline,java.lang.String::* -XX:CompileCommand=inline,java.lang.StringUTF16::* -XX:CompileCommand=exclude,java.lang.String::checkBoundsOffCount TestStringConstruction
+ *
+ * @run main/othervm
+ *      -XX:CompileCommand=inline,java.lang.String::*
+ *      -XX:CompileCommand=inline,java.lang.StringUTF16::*
+ *      -XX:CompileCommand=exclude,java.lang.String::checkBoundsOffCount
+ *      compiler.intrinsics.string.TestStringConstruction
  */
+
+package compiler.intrinsics.string;
+
 public class TestStringConstruction {
 
     public static void main(String[] args) {
diff --git a/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java b/test/compiler/intrinsics/string/TestStringEqualsBadLength.java
similarity index 95%
rename from test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java
rename to test/compiler/intrinsics/string/TestStringEqualsBadLength.java
index 0de5175..08f9986 100644
--- a/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java
+++ b/test/compiler/intrinsics/string/TestStringEqualsBadLength.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 8027445
  * @summary String.equals() may be called with a length whose upper bits are not cleared
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestStringEqualsBadLength
  *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      compiler.intrinsics.string.TestStringEqualsBadLength
  */
 
+package compiler.intrinsics.string;
+
 import java.util.Arrays;
 
 public class TestStringEqualsBadLength {
diff --git a/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java b/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java
index f3cb516..6918b52 100644
--- a/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java
+++ b/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java
@@ -21,16 +21,20 @@
  * questions.
  */
 
-import jdk.test.lib.Asserts;
-
 /*
  * @test
  * @bug 8144212
  * @summary Check for correct memory flow with the String compress/inflate intrinsics.
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main TestStringIntrinsicMemoryFlow
+ *
+ * @run main compiler.intrinsics.string.TestStringIntrinsicMemoryFlow
  */
+
+package compiler.intrinsics.string;
+
+import jdk.test.lib.Asserts;
+
 public class TestStringIntrinsicMemoryFlow {
 
     public static void main(String[] args) {
diff --git a/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java b/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java
index d4e1fb0..c5ed25c 100644
--- a/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java
+++ b/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java
@@ -27,15 +27,16 @@
  * @test
  * @bug 8155608
  * @summary Verifies that string intrinsics throw array out of bounds exceptions.
- * @library /compiler/patches /testlibrary /test/lib /
+ * @library /compiler/patches /testlibrary /test/lib
  * @build java.base/java.lang.Helper
  * @build compiler.intrinsics.string.TestStringIntrinsicRangeChecks
- * @run main compiler.intrinsics.string.TestStringIntrinsicRangeChecks
+ * @run main/othervm -Xbatch -XX:CompileThreshold=100 -XX:-TieredCompilation compiler.intrinsics.string.TestStringIntrinsicRangeChecks
  */
 package compiler.intrinsics.string;
 
 import java.lang.Helper;
-import java.lang.reflect.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 
 public class TestStringIntrinsicRangeChecks {
     // Prepare test arrays
diff --git a/test/compiler/intrinsics/string/TestStringIntrinsics.java b/test/compiler/intrinsics/string/TestStringIntrinsics.java
index 9fe60b5..36cf682 100644
--- a/test/compiler/intrinsics/string/TestStringIntrinsics.java
+++ b/test/compiler/intrinsics/string/TestStringIntrinsics.java
@@ -21,16 +21,23 @@
  * questions.
  */
 
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.Arrays;
-
 /*
  * @test
  * @bug 8054307
  * @summary Tests correctness of string related intrinsics and C2 optimizations.
- * @run main/timeout=240 TestStringIntrinsics
+ *
+ * @run main/timeout=240 compiler.intrinsics.string.TestStringIntrinsics
  */
+
+package compiler.intrinsics.string;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
 public class TestStringIntrinsics {
 
     public enum Operation {
diff --git a/test/compiler/intrinsics/string/TestStringIntrinsics2.java b/test/compiler/intrinsics/string/TestStringIntrinsics2.java
index ca8ca1c..ef3ffe1 100644
--- a/test/compiler/intrinsics/string/TestStringIntrinsics2.java
+++ b/test/compiler/intrinsics/string/TestStringIntrinsics2.java
@@ -28,8 +28,9 @@
  * @summary PPC64: fix string intrinsics after CompactStrings change
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary /test/lib
+ *
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  *
  * @run main/othervm
@@ -39,20 +40,23 @@
  *        -XX:+WhiteBoxAPI
  *        -XX:MaxInlineSize=70
  *        -XX:MinInliningThreshold=0
- *        TestStringIntrinsics2
+ *        compiler.intrinsics.string.TestStringIntrinsics2
  */
 
+package compiler.intrinsics.string;
+
+import sun.hotspot.WhiteBox;
+
 import java.lang.annotation.ElementType;
-import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
-import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.function.Consumer;
-import java.util.function.Function;
 
-import static jdk.test.lib.Asserts.*;
-import sun.hotspot.WhiteBox;
+import static jdk.test.lib.Asserts.assertEquals;
+import static jdk.test.lib.Asserts.assertFalse;
+import static jdk.test.lib.Asserts.assertTrue;
 
 public class TestStringIntrinsics2 {
     // ------------------------------------------------------------------------
diff --git a/test/compiler/intrinsics/unsafe/AllocateUninitializedArray.java b/test/compiler/intrinsics/unsafe/AllocateUninitializedArray.java
index 404ccc6..98fd5a3 100644
--- a/test/compiler/intrinsics/unsafe/AllocateUninitializedArray.java
+++ b/test/compiler/intrinsics/unsafe/AllocateUninitializedArray.java
@@ -27,12 +27,19 @@
  * @bug 8150465
  * @summary Unsafe methods to produce uninitialized arrays
  * @modules java.base/jdk.internal.misc
- * @run main/othervm -ea -Diters=200   -Xint                   AllocateUninitializedArray
- * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1 AllocateUninitializedArray
- * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 AllocateUninitializedArray
+ *
+ * @run main/othervm -ea -Diters=200   -Xint
+ *      compiler.intrinsics.unsafe.AllocateUninitializedArray
+ * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1
+ *      compiler.intrinsics.unsafe.AllocateUninitializedArray
+ * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4
+ *      compiler.intrinsics.unsafe.AllocateUninitializedArray
  */
-import java.lang.reflect.Field;
+
+package compiler.intrinsics.unsafe;
+
 import java.lang.reflect.Array;
+import java.lang.reflect.Field;
 import java.util.concurrent.Callable;
 
 public class AllocateUninitializedArray {
diff --git a/test/compiler/intrinsics/unsafe/ByteBufferTest.java b/test/compiler/intrinsics/unsafe/ByteBufferTest.java
new file mode 100644
index 0000000..6294e90
--- /dev/null
+++ b/test/compiler/intrinsics/unsafe/ByteBufferTest.java
@@ -0,0 +1,750 @@
+/*
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Red Hat Inc. 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.
+ */
+
+import jdk.test.lib.Utils;
+
+import java.nio.Buffer;
+import java.nio.BufferOverflowException;
+import java.nio.BufferUnderflowException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.CharBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+import java.nio.ShortBuffer;
+import java.util.Arrays;
+import java.util.Random;
+
+import static java.nio.ByteOrder.BIG_ENDIAN;
+import static java.nio.ByteOrder.LITTLE_ENDIAN;
+
+// A wrapper for a ByteBuffer which maintains a backing array and a
+// position.  Whenever this wrapper is written the backing array and
+// the wrapped byte buffer are updated together, and whenever it is
+// read we check that the ByteBuffer and the backing array are identical.
+
+class MyByteBuffer {
+    final ByteBuffer buf;
+    final byte[] bytes;
+    int pos;
+    ByteOrder byteOrder = BIG_ENDIAN;
+
+    MyByteBuffer(ByteBuffer buf) {
+        this.buf = buf;
+        this.bytes = new byte[buf.capacity()];
+        pos = 0;
+    }
+
+    public final MyByteBuffer order(ByteOrder bo) {
+        byteOrder = bo;
+        buf.order(bo);
+        return this;
+    }
+
+    static MyByteBuffer allocate(int capacity) {
+        return new MyByteBuffer(ByteBuffer.allocate(capacity));
+    }
+
+    static MyByteBuffer allocateDirect(int capacity) {
+        return new MyByteBuffer(ByteBuffer.allocateDirect(capacity));
+    }
+
+    int capacity() { return bytes.length; }
+    int position() {
+        if (buf.position() != pos)
+            throw new RuntimeException();
+        return buf.position();
+    }
+
+    byte[] actualArray() {
+        buf.rewind();
+        byte[] actual = new byte[bytes.length];
+        buf.get(actual, 0, actual.length);
+        buf.rewind();
+
+        return actual;
+    }
+    byte[] expectedArray() { return bytes; }
+
+    private static byte long7(long x) { return (byte)(x >> 56); }
+    private static byte long6(long x) { return (byte)(x >> 48); }
+    private static byte long5(long x) { return (byte)(x >> 40); }
+    private static byte long4(long x) { return (byte)(x >> 32); }
+    private static byte long3(long x) { return (byte)(x >> 24); }
+    private static byte long2(long x) { return (byte)(x >> 16); }
+    private static byte long1(long x) { return (byte)(x >>  8); }
+    private static byte long0(long x) { return (byte)(x      ); }
+
+    private static byte int3(int x) { return (byte)(x >> 24); }
+    private static byte int2(int x) { return (byte)(x >> 16); }
+    private static byte int1(int x) { return (byte)(x >>  8); }
+    private static byte int0(int x) { return (byte)(x      ); }
+
+    private static byte short1(short x) { return (byte)(x >> 8); }
+    private static byte short0(short x) { return (byte)(x     ); }
+
+    byte _get(long i) { return bytes[(int)i]; }
+    void _put(long i, byte x) { bytes[(int)i] = x; }
+
+    private void putLongX(long a, long x) {
+        if (byteOrder == BIG_ENDIAN) {
+            x = Long.reverseBytes(x);
+        }
+        _put(a + 7, long7(x));
+        _put(a + 6, long6(x));
+        _put(a + 5, long5(x));
+        _put(a + 4, long4(x));
+        _put(a + 3, long3(x));
+        _put(a + 2, long2(x));
+        _put(a + 1, long1(x));
+        _put(a    , long0(x));
+    }
+
+    private void putIntX(long a, int x) {
+        if (byteOrder == BIG_ENDIAN) {
+            x = Integer.reverseBytes(x);
+        }
+        _put(a + 3, int3(x));
+        _put(a + 2, int2(x));
+        _put(a + 1, int1(x));
+        _put(a    , int0(x));
+    }
+
+    private void putShortX(int bi, short x) {
+        if (byteOrder == BIG_ENDIAN) {
+            x = Short.reverseBytes(x);
+        }
+        _put(bi    , short0(x));
+        _put(bi + 1, short1(x));
+    }
+
+    static private int makeInt(byte b3, byte b2, byte b1, byte b0) {
+        return (((b3       ) << 24) |
+                ((b2 & 0xff) << 16) |
+                ((b1 & 0xff) <<  8) |
+                ((b0 & 0xff)      ));
+    }
+    int getIntX(long a) {
+        int x = makeInt(_get(a + 3),
+                _get(a + 2),
+                _get(a + 1),
+                _get(a));
+        if (byteOrder == BIG_ENDIAN) {
+            x = Integer.reverseBytes(x);
+        }
+        return x;
+    }
+
+    static private long makeLong(byte b7, byte b6, byte b5, byte b4,
+                                 byte b3, byte b2, byte b1, byte b0)
+    {
+        return ((((long)b7       ) << 56) |
+                (((long)b6 & 0xff) << 48) |
+                (((long)b5 & 0xff) << 40) |
+                (((long)b4 & 0xff) << 32) |
+                (((long)b3 & 0xff) << 24) |
+                (((long)b2 & 0xff) << 16) |
+                (((long)b1 & 0xff) <<  8) |
+                (((long)b0 & 0xff)      ));
+    }
+
+    long getLongX(long a) {
+        long x = makeLong(_get(a + 7),
+                _get(a + 6),
+                _get(a + 5),
+                _get(a + 4),
+                _get(a + 3),
+                _get(a + 2),
+                _get(a + 1),
+                _get(a));
+        if (byteOrder == BIG_ENDIAN) {
+            x = Long.reverseBytes(x);
+        }
+        return x;
+    }
+
+    static private short makeShort(byte b1, byte b0) {
+        return (short)((b1 << 8) | (b0 & 0xff));
+    }
+
+    short getShortX(long a) {
+        short x = makeShort(_get(a + 1),
+                            _get(a    ));
+        if (byteOrder == BIG_ENDIAN) {
+            x = Short.reverseBytes(x);
+        }
+        return x;
+    }
+
+    double getDoubleX(long a) {
+        long x = getLongX(a);
+        return Double.longBitsToDouble(x);
+    }
+
+    double getFloatX(long a) {
+        int x = getIntX(a);
+        return Float.intBitsToFloat(x);
+    }
+
+    void ck(long x, long y) {
+        if (x != y) {
+            throw new RuntimeException(" x = " + Long.toHexString(x) + ", y = " + Long.toHexString(y));
+        }
+    }
+
+    void ck(double x, double y) {
+        if (x == x && y == y && x != y) {
+            ck(x, y);
+        }
+    }
+
+    // Method accessors
+
+    long getLong(int i) { ck(buf.getLong(i), getLongX(i)); return buf.getLong(i); }
+    int getInt(int i) { ck(buf.getInt(i), getIntX(i)); return buf.getInt(i); }
+    short getShort(int i) { ck(buf.getShort(i), getShortX(i)); return buf.getShort(i); }
+    char getChar(int i) { ck(buf.getChar(i), (char)getShortX(i)); return buf.getChar(i); }
+    double getDouble(int i) { ck(buf.getDouble(i), getDoubleX(i)); return buf.getDouble(i); }
+    float getFloat(int i) { ck(buf.getFloat(i), getFloatX(i)); return buf.getFloat(i); }
+
+    void putLong(int i, long x) { buf.putLong(i, x); putLongX(i, x); }
+    void putInt(int i, int x) { buf.putInt(i, x); putIntX(i, x); }
+    void putShort(int i, short x) { buf.putShort(i, x); putShortX(i, x); }
+    void putChar(int i, char x) { buf.putChar(i, x); putShortX(i, (short)x); }
+    void putDouble(int i, double x) { buf.putDouble(i, x); putLongX(i, Double.doubleToRawLongBits(x)); }
+    void putFloat(int i, float x) { buf.putFloat(i, x); putIntX(i, Float.floatToRawIntBits(x)); }
+
+    long getLong() { ck(buf.getLong(buf.position()), getLongX(pos)); long x = buf.getLong(); pos += 8; return x; }
+    int getInt() { ck(buf.getInt(buf.position()), getIntX(pos)); int x = buf.getInt(); pos += 4; return x; }
+    short getShort() { ck(buf.getShort(buf.position()), getShortX(pos)); short x = buf.getShort(); pos += 2; return x; }
+    char getChar() {  ck(buf.getChar(buf.position()), (char)getShortX(pos)); char x = buf.getChar(); pos += 2; return x; }
+    double getDouble() { ck(buf.getDouble(buf.position()), getDoubleX(pos)); double x = buf.getDouble(); pos += 8; return x; }
+    float getFloat() { ck(buf.getFloat(buf.position()), getFloatX(pos)); float x = buf.getFloat(); pos += 4; return x; }
+
+    void putLong(long x) { putLongX(pos, x); pos += 8; buf.putLong(x); }
+    void putInt(int x) { putIntX(pos, x); pos += 4; buf.putInt(x); }
+    void putShort(short x) { putShortX(pos, x); pos += 2; buf.putShort(x); }
+    void putChar(char x) { putShortX(pos, (short)x); pos += 2; buf.putChar(x); }
+    void putDouble(double x) { putLongX(pos, Double.doubleToRawLongBits(x)); pos += 8; buf.putDouble(x); }
+    void putFloat(float x) { putIntX(pos, Float.floatToRawIntBits(x)); pos += 4; buf.putFloat(x); }
+
+    // View accessors
+
+    long getLong(LongBuffer vb, int i) { ck(vb.get(i / 8), getLongX(i)); return vb.get(i / 8); }
+    int getInt(IntBuffer vb, int i) { ck(vb.get(i / 4), getIntX(i)); return vb.get(i / 4); }
+    short getShort(ShortBuffer vb, int i) { ck(vb.get(i / 2), getShortX(i)); return vb.get(i / 2); }
+    char getChar(CharBuffer vb, int i) { ck(vb.get(i / 2), (char)getShortX(i)); return vb.get(i / 2); }
+    double getDouble(DoubleBuffer vb, int i) { ck(vb.get(i / 8), getDoubleX(i)); return vb.get(i / 8); }
+    float getFloat(FloatBuffer vb, int i) { ck(vb.get(i / 4), getFloatX(i)); return vb.get(i / 4); }
+
+    void putLong(LongBuffer vb, int i, long x) { vb.put(i / 8, x); putLongX(i, x); }
+    void putInt(IntBuffer vb, int i, int x) { vb.put(i / 4, x); putIntX(i, x); }
+    void putShort(ShortBuffer vb, int i, short x) { vb.put(i / 2, x); putShortX(i, x); }
+    void putChar(CharBuffer vb, int i, char x) { vb.put(i / 2, x); putShortX(i, (short)x); }
+    void putDouble(DoubleBuffer vb, int i, double x) { vb.put(i / 8, x); putLongX(i, Double.doubleToRawLongBits(x)); }
+    void putFloat(FloatBuffer vb, int i, float x) { vb.put(i / 4, x); putIntX(i, Float.floatToRawIntBits(x)); }
+
+    long getLong(LongBuffer v) { ck(v.get(v.position()), getLongX(pos)); long x = v.get(); pos += 8; return x; }
+    int getInt(IntBuffer v) { ck(v.get(v.position()), getIntX(pos)); int x = v.get(); pos += 4; return x; }
+    short getShort(ShortBuffer v) { ck(v.get(v.position()), getShortX(pos)); short x = v.get(); pos += 2; return x; }
+    char getChar(CharBuffer v) { ck(v.get(v.position()), (char)getShortX(pos)); char x = v.get(); pos += 2; return x; }
+    double getDouble(DoubleBuffer v) { ck(v.get(v.position()), getDoubleX(pos)); double x = v.get(); pos += 8; return x; }
+    float getFloat(FloatBuffer v) { ck(v.get(v.position()), getFloatX(pos)); float x = v.get(); pos += 4; return x; }
+
+    void putLong(LongBuffer v, long x) { putLongX(pos, x); pos += 8; v.put(x); }
+    void putInt(IntBuffer v, int x) { putIntX(pos, x); pos += 4; v.put(x); }
+    void putShort(ShortBuffer v, short x) { putShortX(pos, x); pos += 2; v.put(x); }
+    void putChar(CharBuffer v, char x) { putShortX(pos, (short)x); pos += 2; v.put(x); }
+    void putDouble(DoubleBuffer v, double x) { putLongX(pos, Double.doubleToRawLongBits(x)); pos += 8; v.put(x); }
+    void putFloat(FloatBuffer v, float x) { putIntX(pos, Float.floatToRawIntBits(x)); pos += 4; v.put(x); }
+
+    void rewind() { pos = 0; buf.rewind(); }
+}
+
+public abstract class ByteBufferTest implements Runnable {
+
+    Random random = Utils.getRandomInstance();
+    MyByteBuffer data;
+
+    static int randomOffset(Random r, MyByteBuffer buf, int size) {
+        return r.nextInt(buf.capacity() - size);
+    }
+
+    static int randomAlignedOffset(Random r, MyByteBuffer buf, int unitSize) {
+        return r.nextInt(buf.capacity() / unitSize) * unitSize;
+    }
+
+    long iterations;
+
+    ByteBufferTest(long iterations, boolean direct) {
+        this.iterations = iterations;
+        data = direct
+               ? MyByteBuffer.allocateDirect(1024)
+               : MyByteBuffer.allocate(1024);
+    }
+
+    // The core of the test.  Walk over the buffer reading and writing
+    // random data, XORing it as we go.  We can detect writes in the
+    // wrong place, writes which are too long or too short, and reads
+    // or writes of the wrong data,
+    void step(Random r) {
+        stepUsingAccessors(r);
+        stepUsingViews(r);
+    }
+
+    void stepUsingAccessors(Random r) {
+        data.order((r.nextInt() & 1) != 0 ? BIG_ENDIAN : LITTLE_ENDIAN);
+
+        data.rewind();
+        while (data.position() < data.capacity())
+            data.putLong(data.getLong() ^ random.nextLong());
+
+        data.rewind();
+        while (data.position() < data.capacity())
+            data.putInt(data.getInt() ^ random.nextInt());
+
+        data.rewind();
+        while (data.position() < data.capacity())
+            data.putShort((short)(data.getShort() ^ random.nextInt()));
+
+        data.rewind();
+        while (data.position() < data.capacity())
+            data.putChar((char)(data.getChar() ^ random.nextInt()));
+
+        data.rewind();
+        while (data.position() < data.capacity())
+            data.putDouble(combine(data.getDouble(), random.nextLong()));
+
+        data.rewind();
+        while (data.position() < data.capacity())
+            data.putFloat(combine(data.getFloat(), random.nextInt()));
+
+        for (int i = 0; i < 100; i++) {
+            int offset = randomOffset(r, data, Long.BYTES);
+            data.putLong(offset, data.getLong(offset) ^ random.nextLong());
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomOffset(r, data, Integer.BYTES);
+            data.putInt(offset, data.getInt(offset) ^ random.nextInt());
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomOffset(r, data, Short.BYTES);
+            data.putShort(offset, (short)(data.getShort(offset) ^ random.nextInt()));
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomOffset(r, data, Character.BYTES);
+            data.putChar(offset, (char)(data.getChar(offset) ^ random.nextInt()));
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomOffset(r, data, Double.BYTES);
+            data.putDouble(offset, combine(data.getDouble(offset), random.nextLong()));
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomOffset(r, data, Float.BYTES);
+            data.putFloat(offset, combine(data.getFloat(offset), random.nextInt()));
+        }
+    }
+
+    void stepUsingViews(Random r) {
+        data.order((r.nextInt() & 1) != 0 ? BIG_ENDIAN : LITTLE_ENDIAN);
+
+        data.rewind();
+        LongBuffer lbuf = data.buf.asLongBuffer();
+        while (lbuf.position() < data.capacity() / Long.BYTES)
+            data.putLong(lbuf, data.getLong(lbuf) ^ random.nextLong());
+
+        data.rewind();
+        IntBuffer ibuf = data.buf.asIntBuffer();
+        while (ibuf.position() < data.capacity() / Integer.BYTES)
+            data.putInt(ibuf, data.getInt(ibuf) ^ random.nextInt());
+
+        data.rewind();
+        ShortBuffer sbuf = data.buf.asShortBuffer();
+        while (sbuf.position() < data.capacity() / Short.BYTES)
+            data.putShort(sbuf, (short)(data.getShort(sbuf) ^ random.nextInt()));
+
+        data.rewind();
+        CharBuffer cbuf = data.buf.asCharBuffer();
+        while (cbuf.position() < data.capacity() / Character.BYTES)
+            data.putChar(cbuf, (char)(data.getChar(cbuf) ^ random.nextInt()));
+
+        data.rewind();
+        DoubleBuffer dbuf = data.buf.asDoubleBuffer();
+        while (dbuf.position() < data.capacity() / Double.BYTES)
+            data.putDouble(dbuf, combine(data.getDouble(dbuf), random.nextLong()));
+
+        data.rewind();
+        FloatBuffer fbuf = data.buf.asFloatBuffer();
+        while (fbuf.position() < data.capacity() / Float.BYTES)
+            data.putFloat(fbuf, combine(data.getFloat(fbuf), random.nextInt()));
+
+        for (int i = 0; i < 100; i++) {
+            int offset = randomAlignedOffset(r, data, Long.BYTES);
+            data.putLong(lbuf, offset, data.getLong(lbuf, offset) ^ random.nextLong());
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomAlignedOffset(r, data, Integer.BYTES);
+            data.putInt(ibuf, offset, data.getInt(ibuf, offset) ^ random.nextInt());
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomAlignedOffset(r, data, Short.BYTES);
+            data.putShort(sbuf, offset, (short)(data.getShort(sbuf, offset) ^ random.nextInt()));
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomAlignedOffset(r, data, Character.BYTES);
+            data.putChar(cbuf, offset, (char)(data.getChar(cbuf, offset) ^ random.nextInt()));
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomAlignedOffset(r, data, Double.BYTES);
+            data.putDouble(dbuf, offset, combine(data.getDouble(dbuf, offset), random.nextLong()));
+        }
+        for (int i = 0; i < 100; i++) {
+            int offset = randomAlignedOffset(r, data, Float.BYTES);
+            data.putFloat(fbuf, offset, combine(data.getFloat(fbuf, offset), random.nextInt()));
+        }
+    }
+
+    // XOR the bit pattern of a double and a long, returning the
+    // result as a double.
+    //
+    // We convert signalling NaNs to quiet NaNs.  We need to do this
+    // because some platforms (in particular legacy 80x87) do not
+    // provide transparent conversions between integer and
+    // floating-point types even when using raw conversions but
+    // quietly convert sNaN to qNaN.  This causes spurious test
+    // failures when the template interpreter uses 80x87 and the JITs
+    // use XMM registers.
+    //
+    public double combine(double prev, long bits) {
+        bits ^= Double.doubleToRawLongBits(prev);
+        double result = Double.longBitsToDouble(bits);
+        if (Double.isNaN(result)) {
+            result = Double.longBitsToDouble(bits | 0x8000000000000l);
+        }
+        return result;
+    }
+
+    // XOR the bit pattern of a float and an int, returning the result
+    // as a float.  Convert sNaNs to qNaNs.
+    public Float combine(float prev, int bits) {
+        bits ^= Float.floatToRawIntBits(prev);
+        Float result = Float.intBitsToFloat(bits);
+        if (Float.isNaN(result)) {
+            result = Float.intBitsToFloat(bits | 0x400000);
+        }
+        return result;
+    }
+
+    enum PrimitiveType {
+        BYTE(1), CHAR(2), SHORT(2), INT(4), LONG(8), FLOAT(4), DOUBLE(8);
+
+        public final int size;
+        PrimitiveType(int size) {
+            this.size = size;
+        }
+    }
+
+    Buffer asView(ByteBuffer b, PrimitiveType t) {
+        switch (t) {
+            case BYTE: return b;
+            case CHAR: return b.asCharBuffer();
+            case SHORT: return b.asShortBuffer();
+            case INT: return b.asIntBuffer();
+            case LONG: return b.asLongBuffer();
+            case FLOAT: return b.asFloatBuffer();
+            case DOUBLE: return b.asDoubleBuffer();
+        }
+        throw new InternalError("Should not reach here");
+    }
+
+    void getOne(ByteBuffer b, PrimitiveType t) {
+        switch (t) {
+        case BYTE: b.get(); break;
+        case CHAR: b.getChar(); break;
+        case SHORT: b.getShort(); break;
+        case INT: b.getInt(); break;
+        case LONG: b.getLong(); break;
+        case FLOAT: b.getFloat(); break;
+        case DOUBLE: b.getDouble(); break;
+        }
+    }
+
+    void putOne(ByteBuffer b, PrimitiveType t) {
+        switch (t) {
+        case BYTE: b.put((byte)0); break;
+        case CHAR: b.putChar('0'); break;
+        case SHORT: b.putShort((short)0); break;
+        case INT: b.putInt(0); break;
+        case LONG: b.putLong(0); break;
+        case FLOAT: b.putFloat(0); break;
+        case DOUBLE: b.putDouble(0); break;
+        }
+    }
+
+    void asViewGetOne(ByteBuffer b, PrimitiveType t) {
+        switch (t) {
+            case BYTE: b.get(); break;
+            case CHAR: b.asCharBuffer().get(); break;
+            case SHORT: b.asShortBuffer().get(); break;
+            case INT: b.asIntBuffer().get(); break;
+            case LONG: b.asLongBuffer().get(); break;
+            case FLOAT: b.asFloatBuffer().get(); break;
+            case DOUBLE: b.asDoubleBuffer().get(); break;
+        }
+    }
+
+    void asViewPutOne(ByteBuffer b, PrimitiveType t) {
+        switch (t) {
+            case BYTE: b.put((byte)0); break;
+            case CHAR: b.asCharBuffer().put('0'); break;
+            case SHORT: b.asShortBuffer().put((short)0); break;
+            case INT: b.asIntBuffer().put(0); break;
+            case LONG: b.asLongBuffer().put(0); break;
+            case FLOAT: b.asFloatBuffer().put(0); break;
+            case DOUBLE: b.asDoubleBuffer().put(0); break;
+        }
+    }
+
+    void getOne(ByteBuffer b, PrimitiveType t, int index) {
+        switch (t) {
+        case BYTE: b.get(index); break;
+        case CHAR: b.getChar(index); break;
+        case SHORT: b.getShort(index); break;
+        case INT: b.getInt(index); break;
+        case LONG: b.getLong(index); break;
+        case FLOAT: b.getFloat(index); break;
+        case DOUBLE: b.getDouble(index); break;
+        }
+    }
+
+    void putOne(ByteBuffer b, PrimitiveType t, int index) {
+        switch (t) {
+        case BYTE: b.put(index, (byte)0); break;
+        case CHAR: b.putChar(index, '0'); break;
+        case SHORT: b.putShort(index, (short)0); break;
+        case INT: b.putInt(index, 0); break;
+        case LONG: b.putLong(index, 0); break;
+        case FLOAT: b.putFloat(index, 0); break;
+        case DOUBLE: b.putDouble(index, 0); break;
+        }
+    }
+
+    void asViewGetOne(Buffer v, PrimitiveType t, int index) {
+        switch (t) {
+            case BYTE: ((ByteBuffer) v).get(index); break;
+            case CHAR: ((CharBuffer) v).get(index); break;
+            case SHORT: ((ShortBuffer) v).get(index); break;
+            case INT: ((IntBuffer) v).get(index); break;
+            case LONG: ((LongBuffer) v).get(index); break;
+            case FLOAT: ((FloatBuffer) v).get(index); break;
+            case DOUBLE: ((DoubleBuffer) v).get(index); break;
+        }
+    }
+
+    void asViewPutOne(Buffer v, PrimitiveType t, int index) {
+        switch (t) {
+            case BYTE: ((ByteBuffer) v).put(index, (byte)0); break;
+            case CHAR: ((CharBuffer) v).put(index, '0'); break;
+            case SHORT: ((ShortBuffer) v).put(index, (short)0); break;
+            case INT: ((IntBuffer) v).put(index, 0); break;
+            case LONG: ((LongBuffer) v).put(index, 0); break;
+            case FLOAT: ((FloatBuffer) v).put(index, 0); break;
+            case DOUBLE: ((DoubleBuffer) v).put(index, 0); break;
+        }
+    }
+
+    void checkBoundaryConditions() {
+        for (int i = 0; i < 100; i++) {
+            int bufSize = random.nextInt(16);
+            ByteBuffer buf = data.buf.isDirect()
+                    ? ByteBuffer.allocateDirect(bufSize)
+                    : ByteBuffer.allocate(bufSize);
+            for (PrimitiveType t : PrimitiveType.values()) {
+                buf.rewind();
+                Buffer viewBuf = asView(buf, t);
+                for (int j = 0; j < 100; j++) {
+                    int offset = random.nextInt(32) - 8;
+                    int threw = 0;
+                    int checks = 6;
+                    try {
+                        try {
+                            buf.position(offset);
+                            getOne(buf, t);
+                        }
+                        catch (BufferUnderflowException e) {
+                            if (offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+                        catch (IllegalArgumentException e) {
+                            if (offset >= 0 && offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+
+                        try {
+                            buf.position(offset);
+                            asViewGetOne(buf, t);
+                        }
+                        catch (BufferUnderflowException e) {
+                            if (offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+                        catch (IllegalArgumentException e) {
+                            if (offset >= 0 && offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+
+                        try {
+                            buf.position(offset);
+                            putOne(buf, t);
+                        }
+                        catch (BufferOverflowException e) {
+                            if (offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+                        catch (IllegalArgumentException e) {
+                            if (offset >= 0 && offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+
+                        try {
+                            buf.position(offset);
+                            asViewPutOne(buf, t);
+                        }
+                        catch (BufferOverflowException e) {
+                            if (offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+                        catch (IllegalArgumentException e) {
+                            if (offset >= 0 && offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+
+                        try {
+                            putOne(buf, t, offset);
+                        }
+                        catch (IndexOutOfBoundsException e) {
+                            if (offset >= 0 && offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+
+                        try {
+                            getOne(buf, t, offset);
+                        }
+                        catch (IndexOutOfBoundsException e) {
+                            if (offset >= 0 && offset + t.size < bufSize)
+                                throw new RuntimeException
+                                        ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                            threw++;
+                        }
+
+                        // If offset is aligned access using the view
+                        if (offset % t.size == 0) {
+                            checks = 8;
+                            int viewOffset = offset / t.size;
+
+
+                            try {
+                                asViewPutOne(viewBuf, t, viewOffset);
+                            }
+                            catch (IndexOutOfBoundsException e) {
+                                if (offset >= 0 && offset + t.size < bufSize)
+                                    throw new RuntimeException
+                                            ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                                threw++;
+                            }
+
+                            try {
+                                asViewGetOne(viewBuf, t, viewOffset);
+                            }
+                            catch (IndexOutOfBoundsException e) {
+                                if (offset >= 0 && offset + t.size < bufSize)
+                                    throw new RuntimeException
+                                            ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
+                                threw++;
+                            }
+                        }
+
+                        if (threw == 0) {
+                            // Make sure that we should not have thrown.
+                            if (offset < 0 || offset + t.size > bufSize) {
+                                throw new RuntimeException
+                                        ("should have thrown but did not, type = " + t
+                                         + ", offset = " + offset + ", bufSize = " + bufSize);
+                            }
+                        }
+                        else if (threw != checks) {
+                            // If one of the {get,put} operations threw
+                            // due to an invalid offset then all four of
+                            // them should have thrown.
+                            throw new RuntimeException
+                                    ("should have thrown but at least one did not, type = " + t
+                                     + ", offset = " + offset + ", bufSize = " + bufSize);
+                        }
+                    }
+                    catch (Throwable th) {
+                        throw new RuntimeException
+                                ("unexpected throw: type  = " + t + ", offset = " + offset + ", bufSize = " + bufSize, th);
+
+                    }
+                }
+            }
+        }
+    }
+
+    public void run() {
+        checkBoundaryConditions();
+
+        for (int i = 0; i < data.capacity(); i += 8) {
+            data.putLong(i, random.nextLong());
+        }
+
+        for (int i = 0; i < iterations; i++) {
+            step(random);
+        }
+
+        if (!Arrays.equals(data.actualArray(), data.expectedArray())) {
+            throw new RuntimeException();
+        }
+    }
+}
diff --git a/test/compiler/intrinsics/unsafe/DirectByteBufferTest.java b/test/compiler/intrinsics/unsafe/DirectByteBufferTest.java
new file mode 100644
index 0000000..5c27653
--- /dev/null
+++ b/test/compiler/intrinsics/unsafe/DirectByteBufferTest.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, Red Hat Inc. 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 8026049 8151163
+ * @modules java.base/jdk.internal.misc
+ * @library /testlibrary
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses -Djdk.test.lib.random.seed=0 DirectByteBufferTest
+ * @run main/othervm -Djdk.test.lib.random.seed=0 DirectByteBufferTest
+ * @summary Verify that direct byte buffers are correctly accessed.
+ */
+
+public class DirectByteBufferTest extends ByteBufferTest {
+
+    public DirectByteBufferTest(long iterations, boolean direct) {
+        super(iterations, direct);
+    }
+
+    public static void main(String[] args) {
+        // The number of iterations is high to ensure that tiered
+        // compilation kicks in all the way up to C2.
+        long iterations = 100000;
+        if (args.length > 0)
+            iterations = Long.parseLong(args[0]);
+
+        new DirectByteBufferTest(iterations, true).run();
+    }
+}
diff --git a/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java b/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java
index 7c46ab1..e09fa47 100644
--- a/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java
+++ b/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java
@@ -1,506 +1,44 @@
-//
-// Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
-// Copyright (c) 2015, Red Hat Inc. 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.
-//
-//
-
-import java.nio.BufferOverflowException;
-import java.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
-import static java.nio.ByteOrder.BIG_ENDIAN;
-import static java.nio.ByteOrder.LITTLE_ENDIAN;
-import java.nio.ByteOrder;
-import java.util.Arrays;
-import java.util.Random;
-import jdk.test.lib.Utils;
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, Red Hat Inc. 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 8026049
+ * @bug 8026049 8151163
+ * @summary Verify that byte buffers are correctly accessed.
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses -Djdk.test.lib.random.seed=0 HeapByteBufferTest
- * @run main/othervm -Djdk.test.lib.random.seed=0 HeapByteBufferTest
- * @summary Verify that byte buffers are correctly accessed.
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses -Djdk.test.lib.random.seed=0
+ *      HeapByteBufferTest
+ * @run main/othervm -Djdk.test.lib.random.seed=0
+ *      HeapByteBufferTest
  */
 
-// A wrapper for a ByteBuffer which maintains a backing array and a
-// position.  Whenever this wrapper is written the backing array and
-// the wrapped byte buffer are updated together, and whenever it is
-// read we check that the ByteBuffer and the backing array are identical.
+public class HeapByteBufferTest extends ByteBufferTest {
 
-class MyByteBuffer {
-    final ByteBuffer buf;
-    final byte[] bytes;
-    int pos;
-    ByteOrder byteOrder = BIG_ENDIAN;
-
-    MyByteBuffer(ByteBuffer buf, byte[] bytes) {
-        this.buf = buf;
-        this.bytes = Arrays.copyOf(bytes, bytes.length);
-        pos = 0;
-    }
-
-    public final MyByteBuffer order(ByteOrder bo) {
-        byteOrder = bo;
-        buf.order(bo);
-        return this;
-    }
-
-    static MyByteBuffer wrap(byte[] bytes) {
-        return new MyByteBuffer(ByteBuffer.wrap(bytes), bytes);
-    }
-
-    int capacity() { return bytes.length; }
-    int position() {
-        if (buf.position() != pos)
-            throw new RuntimeException();
-        return buf.position();
-    }
-
-    byte[] array() { return buf.array(); }
-    byte[] backingArray() { return bytes; }
-
-    private static byte long7(long x) { return (byte)(x >> 56); }
-    private static byte long6(long x) { return (byte)(x >> 48); }
-    private static byte long5(long x) { return (byte)(x >> 40); }
-    private static byte long4(long x) { return (byte)(x >> 32); }
-    private static byte long3(long x) { return (byte)(x >> 24); }
-    private static byte long2(long x) { return (byte)(x >> 16); }
-    private static byte long1(long x) { return (byte)(x >>  8); }
-    private static byte long0(long x) { return (byte)(x      ); }
-
-    private static byte int3(int x) { return (byte)(x >> 24); }
-    private static byte int2(int x) { return (byte)(x >> 16); }
-    private static byte int1(int x) { return (byte)(x >>  8); }
-    private static byte int0(int x) { return (byte)(x      ); }
-
-    private static byte short1(short x) { return (byte)(x >> 8); }
-    private static byte short0(short x) { return (byte)(x     ); }
-
-    byte _get(long i) { return bytes[(int)i]; }
-    void _put(long i, byte x) { bytes[(int)i] = x; }
-
-    private void putLongX(long a, long x) {
-        if (byteOrder == BIG_ENDIAN) {
-            x = Long.reverseBytes(x);
-        }
-        _put(a + 7, long7(x));
-        _put(a + 6, long6(x));
-        _put(a + 5, long5(x));
-        _put(a + 4, long4(x));
-        _put(a + 3, long3(x));
-        _put(a + 2, long2(x));
-        _put(a + 1, long1(x));
-        _put(a    , long0(x));
-    }
-
-    private void putIntX(long a, int x) {
-        if (byteOrder == BIG_ENDIAN) {
-            x = Integer.reverseBytes(x);
-        }
-        _put(a + 3, int3(x));
-        _put(a + 2, int2(x));
-        _put(a + 1, int1(x));
-        _put(a    , int0(x));
-    }
-
-    private void putShortX(int bi, short x) {
-        if (byteOrder == BIG_ENDIAN) {
-            x = Short.reverseBytes(x);
-        }
-        _put(bi    , short0(x));
-        _put(bi + 1, short1(x));
-    }
-
-    static private int makeInt(byte b3, byte b2, byte b1, byte b0) {
-        return (((b3       ) << 24) |
-                ((b2 & 0xff) << 16) |
-                ((b1 & 0xff) <<  8) |
-                ((b0 & 0xff)      ));
-    }
-    int getIntX(long a) {
-        int x = makeInt(_get(a + 3),
-                _get(a + 2),
-                _get(a + 1),
-                _get(a));
-        if (byteOrder == BIG_ENDIAN) {
-            x = Integer.reverseBytes(x);
-        }
-        return x;
-    }
-
-    static private long makeLong(byte b7, byte b6, byte b5, byte b4,
-                                 byte b3, byte b2, byte b1, byte b0)
-    {
-        return ((((long)b7       ) << 56) |
-                (((long)b6 & 0xff) << 48) |
-                (((long)b5 & 0xff) << 40) |
-                (((long)b4 & 0xff) << 32) |
-                (((long)b3 & 0xff) << 24) |
-                (((long)b2 & 0xff) << 16) |
-                (((long)b1 & 0xff) <<  8) |
-                (((long)b0 & 0xff)      ));
-    }
-
-    long getLongX(long a) {
-        long x = makeLong(_get(a + 7),
-                _get(a + 6),
-                _get(a + 5),
-                _get(a + 4),
-                _get(a + 3),
-                _get(a + 2),
-                _get(a + 1),
-                _get(a));
-        if (byteOrder == BIG_ENDIAN) {
-            x = Long.reverseBytes(x);
-        }
-        return x;
-    }
-
-    static private short makeShort(byte b1, byte b0) {
-        return (short)((b1 << 8) | (b0 & 0xff));
-    }
-
-    short getShortX(long a) {
-        short x = makeShort(_get(a + 1),
-                            _get(a    ));
-        if (byteOrder == BIG_ENDIAN) {
-            x = Short.reverseBytes(x);
-        }
-        return x;
-    }
-
-    double getDoubleX(long a) {
-        long x = getLongX(a);
-        return Double.longBitsToDouble(x);
-    }
-
-    double getFloatX(long a) {
-        int x = getIntX(a);
-        return Float.intBitsToFloat(x);
-    }
-
-    void ck(long x, long y) {
-        if (x != y) {
-            throw new RuntimeException(" x = " + Long.toHexString(x) + ", y = " + Long.toHexString(y));
-        }
-    }
-
-    void ck(double x, double y) {
-        if (x == x && y == y && x != y) {
-            ck(x, y);
-        }
-    }
-
-    long getLong(int i) { ck(buf.getLong(i), getLongX(i)); return buf.getLong(i); }
-    int getInt(int i) { ck(buf.getInt(i), getIntX(i)); return buf.getInt(i); }
-    short getShort(int i) { ck(buf.getShort(i), getShortX(i)); return buf.getShort(i); }
-    char getChar(int i) { ck(buf.getChar(i), (char)getShortX(i)); return buf.getChar(i); }
-    double getDouble(int i) { ck(buf.getDouble(i), getDoubleX(i)); return buf.getDouble(i); }
-    float getFloat(int i) { ck(buf.getFloat(i), getFloatX(i)); return buf.getFloat(i); }
-
-    void putLong(int i, long x) { buf.putLong(i, x); putLongX(i, x); }
-    void putInt(int i, int x) { buf.putInt(i, x); putIntX(i, x); }
-    void putShort(int i, short x) { buf.putShort(i, x); putShortX(i, x); }
-    void putChar(int i, char x) { buf.putChar(i, x); putShortX(i, (short)x); }
-    void putDouble(int i, double x) { buf.putDouble(i, x); putLongX(i, Double.doubleToRawLongBits(x)); }
-    void putFloat(int i, float x) { buf.putFloat(i, x); putIntX(i, Float.floatToRawIntBits(x)); }
-
-    long getLong() { ck(buf.getLong(buf.position()), getLongX(pos)); long x = buf.getLong(); pos += 8; return x; }
-    int getInt() { ck(buf.getInt(buf.position()), getIntX(pos)); int x = buf.getInt(); pos += 4; return x; }
-    short getShort() { ck(buf.getShort(buf.position()), getShortX(pos)); short x = buf.getShort(); pos += 2; return x; }
-    char getChar() {  ck(buf.getChar(buf.position()), (char)getShortX(pos)); char x = buf.getChar(); pos += 2; return x; }
-    double getDouble() { ck(buf.getDouble(buf.position()), getDoubleX(pos)); double x = buf.getDouble(); pos += 8; return x; }
-    float getFloat() { ck(buf.getFloat(buf.position()), getFloatX(pos)); float x = buf.getFloat(); pos += 4; return x; }
-
-    void putLong(long x) { putLongX(pos, x); pos += 8; buf.putLong(x); }
-    void putInt(int x) { putIntX(pos, x); pos += 4; buf.putInt(x); }
-    void putShort(short x) { putShortX(pos, x); pos += 2; buf.putShort(x); }
-    void putChar(char x) { putShortX(pos, (short)x); pos += 2; buf.putChar(x); }
-    void putDouble(double x) { putLongX(pos, Double.doubleToRawLongBits(x)); pos += 8; buf.putDouble(x); }
-    void putFloat(float x) { putIntX(pos, Float.floatToRawIntBits(x)); pos += 4; buf.putFloat(x); }
-
-    void rewind() { pos = 0; buf.rewind(); }
-}
-
-public class HeapByteBufferTest implements Runnable {
-
-    Random random = Utils.getRandomInstance();
-    MyByteBuffer data = MyByteBuffer.wrap(new byte[1024]);
-
-    int randomOffset(Random r, MyByteBuffer buf, int size) {
-        return r.nextInt(buf.capacity() - size);
-    }
-
-    long iterations;
-
-    HeapByteBufferTest(long iterations) {
-        this.iterations = iterations;
-    }
-
-    // The core of the test.  Walk over the buffer reading and writing
-    // random data, XORing it as we go.  We can detect writes in the
-    // wrong place, writes which are too long or too short, and reads
-    // or writes of the wrong data,
-    void step(Random r) {
-        data.order((r.nextInt() & 1) != 0 ? BIG_ENDIAN : LITTLE_ENDIAN);
-
-        data.rewind();
-        while (data.position() < data.capacity())
-            data.putLong(data.getLong() ^ random.nextLong());
-
-        data.rewind();
-        while (data.position() < data.capacity())
-            data.putInt(data.getInt() ^ random.nextInt());
-
-        data.rewind();
-        while (data.position() < data.capacity())
-            data.putShort((short)(data.getShort() ^ random.nextInt()));
-
-        data.rewind();
-        while (data.position() < data.capacity())
-            data.putChar((char)(data.getChar() ^ random.nextInt()));
-
-        data.rewind();
-        while (data.position() < data.capacity()) {
-            data.putDouble(combine(data.getDouble(), random.nextLong()));
-        }
-
-        data.rewind();
-        while (data.position() < data.capacity())
-            data.putFloat(combine(data.getFloat(), random.nextInt()));
-
-        for (int i = 0; i < 100; i++) {
-            int offset = randomOffset(r, data, 8);
-            data.putLong(offset, data.getLong(offset) ^ random.nextLong());
-        }
-        for (int i = 0; i < 100; i++) {
-            int offset = randomOffset(r, data, 4);
-            data.putInt(offset, data.getInt(offset) ^ random.nextInt());
-        }
-        for (int i = 0; i < 100; i++) {
-            int offset = randomOffset(r, data, 2);
-            data.putShort(offset, (short)(data.getShort(offset) ^ random.nextInt()));
-        }
-        for (int i = 0; i < 100; i++) {
-            int offset = randomOffset(r, data, 2);
-            data.putChar(offset, (char)(data.getChar(offset) ^ random.nextInt()));
-        }
-        for (int i = 0; i < 100; i++) {
-            int offset = randomOffset(r, data, 8);
-            data.putDouble(offset, combine(data.getDouble(offset), random.nextLong()));
-        }
-        for (int i = 0; i < 100; i++) {
-            int offset = randomOffset(r, data, 4);
-            data.putFloat(offset, combine(data.getFloat(offset), random.nextInt()));
-        }
-    }
-
-    // XOR the bit pattern of a double and a long, returning the
-    // result as a double.
-    //
-    // We convert signalling NaNs to quiet NaNs.  We need to do this
-    // because some platforms (in particular legacy 80x87) do not
-    // provide transparent conversions between integer and
-    // floating-point types even when using raw conversions but
-    // quietly convert sNaN to qNaN.  This causes spurious test
-    // failures when the template interpreter uses 80x87 and the JITs
-    // use XMM registers.
-    //
-    public double combine(double prev, long bits) {
-        bits ^= Double.doubleToRawLongBits(prev);
-        double result = Double.longBitsToDouble(bits);
-        if (Double.isNaN(result)) {
-            result = Double.longBitsToDouble(bits | 0x8000000000000l);
-        }
-        return result;
-    }
-
-    // XOR the bit pattern of a float and an int, returning the result
-    // as a float.  Convert sNaNs to qNaNs.
-    public Float combine(float prev, int bits) {
-        bits ^= Float.floatToRawIntBits(prev);
-        Float result = Float.intBitsToFloat(bits);
-        if (Float.isNaN(result)) {
-            result = Float.intBitsToFloat(bits | 0x400000);
-        }
-        return result;
-    }
-
-    enum PrimitiveType {
-        BYTE(1), CHAR(2), SHORT(2), INT(4), LONG(8), FLOAT(4), DOUBLE(8);
-
-        public final int size;
-        PrimitiveType(int size) {
-            this.size = size;
-        }
-    }
-
-    void getOne(ByteBuffer b, PrimitiveType t) {
-        switch (t) {
-        case BYTE: b.get(); break;
-        case CHAR: b.getChar(); break;
-        case SHORT: b.getShort(); break;
-        case INT: b.getInt(); break;
-        case LONG: b.getLong(); break;
-        case FLOAT: b.getFloat(); break;
-        case DOUBLE: b.getDouble(); break;
-        }
-    }
-
-    void putOne(ByteBuffer b, PrimitiveType t) {
-        switch (t) {
-        case BYTE: b.put((byte)0); break;
-        case CHAR: b.putChar('0'); break;
-        case SHORT: b.putShort((short)0); break;
-        case INT: b.putInt(0); break;
-        case LONG: b.putLong(0); break;
-        case FLOAT: b.putFloat(0); break;
-        case DOUBLE: b.putDouble(0); break;
-        }
-    }
-
-    void getOne(ByteBuffer b, PrimitiveType t, int index) {
-        switch (t) {
-        case BYTE: b.get(index); break;
-        case CHAR: b.getChar(index); break;
-        case SHORT: b.getShort(index); break;
-        case INT: b.getInt(index); break;
-        case LONG: b.getLong(index); break;
-        case FLOAT: b.getFloat(index); break;
-        case DOUBLE: b.getDouble(index); break;
-        }
-    }
-
-    void putOne(ByteBuffer b, PrimitiveType t, int index) {
-        switch (t) {
-        case BYTE: b.put(index, (byte)0); break;
-        case CHAR: b.putChar(index, '0'); break;
-        case SHORT: b.putShort(index, (short)0); break;
-        case INT: b.putInt(index, 0); break;
-        case LONG: b.putLong(index, 0); break;
-        case FLOAT: b.putFloat(index, 0); break;
-        case DOUBLE: b.putDouble(index, 0); break;
-        }
-    }
-
-    void checkBoundaryConditions() {
-        for (int i = 0; i < 100; i++) {
-            int bufSize = random.nextInt(16);
-            byte[] bytes = new byte[bufSize];
-            ByteBuffer buf = ByteBuffer.wrap(bytes);
-            for (int j = 0; j < 100; j++) {
-                int offset = random.nextInt(32) - 8;
-                for (PrimitiveType t : PrimitiveType.values()) {
-                    int threw = 0;
-                    try {
-                        try {
-                            buf.position(offset);
-                            getOne(buf, t);
-                        } catch (BufferUnderflowException e) {
-                            if (offset + t.size < bufSize)
-                                throw new RuntimeException
-                                    ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
-                            threw++;
-                        } catch (IllegalArgumentException e) {
-                            if (offset >= 0 && offset + t.size < bufSize)
-                                throw new RuntimeException
-                                    ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
-                            threw++;
-                        }
-
-                        try {
-                            buf.position(offset);
-                            putOne(buf, t);
-                        } catch (BufferOverflowException e) {
-                            if (offset + t.size < bufSize)
-                                throw new RuntimeException
-                                    ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
-                            threw++;
-                        } catch (IllegalArgumentException e) {
-                            if (offset >= 0 && offset + t.size < bufSize)
-                                throw new RuntimeException
-                                    ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
-                            threw++;
-                        }
-
-                        try {
-                            putOne(buf, t, offset);
-                        } catch (IndexOutOfBoundsException e) {
-                            if (offset >= 0 && offset + t.size < bufSize)
-                                throw new RuntimeException
-                                    ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
-                            threw++;
-                        }
-
-                        try {
-                            getOne(buf, t, offset);
-                        } catch (IndexOutOfBoundsException e) {
-                            if (offset >= 0 && offset + t.size < bufSize)
-                                throw new RuntimeException
-                                    ("type = " + t + ", offset = " + offset + ", bufSize = " + bufSize, e);
-                            threw++;
-                        }
-
-                        if (threw == 0) {
-                            // Make sure that we should not have thrown.
-                            if (offset < 0 || offset + t.size > bufSize) {
-                                throw new RuntimeException
-                                    ("should have thrown but did not, type = " + t
-                                     + ", offset = " + offset + ", bufSize = " + bufSize);
-                            }
-                        } else if (threw != 4) {
-                            // If one of the {get,put} operations threw
-                            // due to an invalid offset then all four of
-                            // them should have thrown.
-                            throw new RuntimeException
-                                ("should have thrown but at least one did not, type = " + t
-                                 + ", offset = " + offset + ", bufSize = " + bufSize);
-                        }
-                    } catch (Throwable th) {
-                        throw new RuntimeException
-                            ("unexpected throw: type  = " + t + ", offset = " + offset + ", bufSize = " + bufSize, th);
-
-                    }
-                }
-            }
-        }
-    }
-
-    public void run() {
-        checkBoundaryConditions();
-
-        for (int i = 0; i < data.capacity(); i += 8) {
-            data.putLong(i, random.nextLong());
-        }
-
-        for (int i = 0; i < iterations; i++) {
-            step(random);
-        }
-
-        if (!Arrays.equals(data.array(), data.backingArray())) {
-            throw new RuntimeException();
-        }
+    public HeapByteBufferTest(long iterations, boolean direct) {
+        super(iterations, direct);
     }
 
     public static void main(String[] args) {
@@ -510,6 +48,6 @@
         if (args.length > 0)
             iterations = Long.parseLong(args[0]);
 
-        new HeapByteBufferTest(iterations).run();
+        new HeapByteBufferTest(iterations, false).run();
     }
 }
diff --git a/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java b/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java
index 78ef24a..7830744 100644
--- a/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java
+++ b/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java
@@ -25,16 +25,18 @@
 /**
  * @test
  * @bug 8142386
+ * @summary Unsafe access to an array is wrongly marked as mismatched
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary /test/lib
- * @summary Unsafe access to an array is wrongly marked as mismatched
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation TestUnsafeMismatchedArrayFieldAccess
  *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation
+ *      compiler.intrinsics.unsafe.TestUnsafeMismatchedArrayFieldAccess
  */
 
-import java.lang.reflect.*;
-import jdk.test.lib.Utils;
+package compiler.intrinsics.unsafe;
+
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Utils;
 
 public class TestUnsafeMismatchedArrayFieldAccess {
 
diff --git a/test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java b/test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java
index d1ca58c..7fbd718 100644
--- a/test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java
+++ b/test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java
@@ -27,14 +27,20 @@
  * @bug 8136473
  * @summary Mismatched stores on same slice possible with Unsafe.Put*Unaligned methods
  * @modules java.base/jdk.internal.misc
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestUnsafeUnalignedMismatchedAccesses
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses TestUnsafeUnalignedMismatchedAccesses
  *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      compiler.intrinsics.unsafe.TestUnsafeUnalignedMismatchedAccesses
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses
+ *      compiler.intrinsics.unsafe.TestUnsafeUnalignedMismatchedAccesses
  */
 
-import java.lang.reflect.*;
+package compiler.intrinsics.unsafe;
+
 import jdk.internal.misc.Unsafe;
 
+import java.lang.reflect.Field;
+
 public class TestUnsafeUnalignedMismatchedAccesses {
 
     private static final Unsafe UNSAFE;
diff --git a/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java b/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java
index 7599781..faa5a0b 100644
--- a/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java
+++ b/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java
@@ -26,12 +26,15 @@
  * @bug 6653795
  * @summary C2 intrinsic for Unsafe.getAddress performs pointer sign extension on 32-bit systems
  * @modules java.base/jdk.internal.misc
- * @run main UnsafeGetAddressTest
  *
+ * @run main compiler.intrinsics.unsafe.UnsafeGetAddressTest
  */
 
+package compiler.intrinsics.unsafe;
+
 import jdk.internal.misc.Unsafe;
-import java.lang.reflect.*;
+
+import java.lang.reflect.Field;
 
 public class UnsafeGetAddressTest {
     private static Unsafe unsafe;
diff --git a/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java b/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java
index 224d22c..458e405 100644
--- a/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java
+++ b/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java
@@ -27,9 +27,13 @@
  * @bug 8143930
  * @summary C1 LinearScan asserts when compiling two back-to-back CompareAndSwapLongs
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=200000 -XX:TieredStopAtLevel=1 UnsafeTwoCASLong
+ *
+ * @run testng/othervm -Diters=200000 -XX:TieredStopAtLevel=1
+ *      compiler.intrinsics.unsafe.UnsafeTwoCASLong
  */
 
+package compiler.intrinsics.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/intrinsics/adler32/TestAdler32.java b/test/compiler/intrinsics/zip/TestAdler32.java
similarity index 98%
rename from test/compiler/intrinsics/adler32/TestAdler32.java
rename to test/compiler/intrinsics/zip/TestAdler32.java
index 7607cb2..6688e96 100644
--- a/test/compiler/intrinsics/adler32/TestAdler32.java
+++ b/test/compiler/intrinsics/zip/TestAdler32.java
@@ -26,12 +26,14 @@
  * @bug 8132081
  * @summary C2 support for Adler32 on SPARC
  *
- * @run main/othervm/timeout=600 -Xbatch TestAdler32 -m
+ * @run main/othervm/timeout=600 -Xbatch compiler.intrinsics.zip.TestAdler32 -m
  */
 
+package compiler.intrinsics.zip;
+
 import java.nio.ByteBuffer;
-import java.util.zip.Checksum;
 import java.util.zip.Adler32;
+import java.util.zip.Checksum;
 
 public class TestAdler32 {
     public static void main(String[] args) {
diff --git a/test/compiler/intrinsics/crc32/TestCRC32.java b/test/compiler/intrinsics/zip/TestCRC32.java
similarity index 98%
rename from test/compiler/intrinsics/crc32/TestCRC32.java
rename to test/compiler/intrinsics/zip/TestCRC32.java
index f7ecc24..626f506 100644
--- a/test/compiler/intrinsics/crc32/TestCRC32.java
+++ b/test/compiler/intrinsics/zip/TestCRC32.java
@@ -26,12 +26,14 @@
  * @bug 8143012
  * @summary CRC32 Intrinsics support on SPARC
  *
- * @run main/othervm/timeout=720 -Xbatch TestCRC32 -m
+ * @run main/othervm/timeout=720 -Xbatch compiler.intrinsics.zip.TestCRC32 -m
  */
 
+package compiler.intrinsics.zip;
+
 import java.nio.ByteBuffer;
-import java.util.zip.Checksum;
 import java.util.zip.CRC32;
+import java.util.zip.Checksum;
 
 public class TestCRC32 {
     public static void main(String[] args) {
diff --git a/test/compiler/intrinsics/crc32c/TestCRC32C.java b/test/compiler/intrinsics/zip/TestCRC32C.java
similarity index 98%
rename from test/compiler/intrinsics/crc32c/TestCRC32C.java
rename to test/compiler/intrinsics/zip/TestCRC32C.java
index 676f541..2f280aa 100644
--- a/test/compiler/intrinsics/crc32c/TestCRC32C.java
+++ b/test/compiler/intrinsics/zip/TestCRC32C.java
@@ -26,12 +26,14 @@
  * @bug 8073583
  * @summary C2 support for CRC32C on SPARC
  *
- * @run main/othervm/timeout=600 -Xbatch TestCRC32C -m
+ * @run main/othervm/timeout=600 -Xbatch compiler.intrinsics.zip.TestCRC32C -m
  */
 
+package compiler.intrinsics.zip;
+
 import java.nio.ByteBuffer;
-import java.util.zip.Checksum;
 import java.util.zip.CRC32C;
+import java.util.zip.Checksum;
 
 public class TestCRC32C {
     public static void main(String[] args) {
diff --git a/test/compiler/jsr292/CallSiteDepContextTest.java b/test/compiler/jsr292/CallSiteDepContextTest.java
index 152b28d..80650b9 100644
--- a/test/compiler/jsr292/CallSiteDepContextTest.java
+++ b/test/compiler/jsr292/CallSiteDepContextTest.java
@@ -25,16 +25,23 @@
  * @test
  * @bug 8057967
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
- * @library patches
+ *          java.base/jdk.internal.org.objectweb.asm
+ * @library patches /
+ *
  * @build java.base/java.lang.invoke.MethodHandleHelper
  * @run main/bootclasspath/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:class+unload
  *                                 -XX:+PrintCompilation -XX:+TraceDependencies -XX:+TraceReferenceGC
- *                                 -verbose:gc compiler.jsr292.CallSiteDepContextTest
+ *                                 -verbose:gc
+ *                                 compiler.jsr292.CallSiteDepContextTest
  */
 
 package compiler.jsr292;
 
+import jdk.internal.misc.Unsafe;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
 import java.lang.invoke.CallSite;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandleHelper;
@@ -46,10 +53,11 @@
 import java.lang.ref.ReferenceQueue;
 import java.lang.reflect.Field;
 
-import jdk.internal.org.objectweb.asm.*;
-import jdk.internal.misc.Unsafe;
-
-import static jdk.internal.org.objectweb.asm.Opcodes.*;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER;
+import static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKESTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.IRETURN;
 
 public class CallSiteDepContextTest {
     static final Unsafe               UNSAFE = Unsafe.getUnsafe();
diff --git a/test/compiler/jsr292/ConcurrentClassLoadingTest.java b/test/compiler/jsr292/ConcurrentClassLoadingTest.java
index cf591ff..c1f92ef 100644
--- a/test/compiler/jsr292/ConcurrentClassLoadingTest.java
+++ b/test/compiler/jsr292/ConcurrentClassLoadingTest.java
@@ -25,12 +25,17 @@
  * @test
  * @bug 8022595
  * @summary JSR292: deadlock during class loading of MethodHandles, MethodHandleImpl & MethodHandleNatives
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main/othervm ConcurrentClassLoadingTest
+ *
+ * @run main/othervm compiler.jsr292.ConcurrentClassLoadingTest
  */
+
+package compiler.jsr292;
+
 import jdk.test.lib.Utils;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
diff --git a/test/compiler/jsr292/ContinuousCallSiteTargetChange.java b/test/compiler/jsr292/ContinuousCallSiteTargetChange.java
index 3b009e9..f932b62 100644
--- a/test/compiler/jsr292/ContinuousCallSiteTargetChange.java
+++ b/test/compiler/jsr292/ContinuousCallSiteTargetChange.java
@@ -24,11 +24,21 @@
 /**
  * @test
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary
- * @run main ContinuousCallSiteTargetChange
+ * @library /testlibrary /
+ *
+ * @run driver compiler.jsr292.ContinuousCallSiteTargetChange
  */
-import java.lang.invoke.*;
-import jdk.test.lib.*;
+
+package compiler.jsr292;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
+import java.lang.invoke.CallSite;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.invoke.MutableCallSite;
 
 public class ContinuousCallSiteTargetChange {
     static void testServer() throws Exception {
@@ -37,7 +47,7 @@
                 "-server", "-XX:-TieredCompilation", "-Xbatch",
                 "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
                 "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
-                "ContinuousCallSiteTargetChange$Test", "100");
+                Test.class.getName(), "100");
 
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
 
@@ -53,7 +63,7 @@
                 "-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch",
                 "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
                 "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
-                "ContinuousCallSiteTargetChange$Test", "100");
+                Test.class.getName(), "100");
 
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
 
diff --git a/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java b/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java
index 8581064..aa7102b 100644
--- a/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java
+++ b/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java
@@ -27,14 +27,17 @@
  * @bug 8026124
  * @summary Javascript file provoked assertion failure in linkResolver.cpp
  * @modules jdk.scripting.nashorn/jdk.nashorn.tools
- * @run main/othervm CreatesInterfaceDotEqualsCallInfo
+ *
+ * @run main/othervm compiler.jsr292.CreatesInterfaceDotEqualsCallInfo
  */
 
+package compiler.jsr292;
+
 public class CreatesInterfaceDotEqualsCallInfo {
-  public static void main(String[] args) throws java.io.IOException {
-    String[] jsargs = { System.getProperty("test.src", ".") +
-                        "/createsInterfaceDotEqualsCallInfo.js" };
-    jdk.nashorn.tools.Shell.main(System.in, System.out, System.err, jsargs);
-    System.out.println("PASS, did not crash running Javascript");
-  }
+    public static void main(String[] args) throws java.io.IOException {
+        String[] jsargs = {System.getProperty("test.src", ".") +
+                "/createsInterfaceDotEqualsCallInfo.js"};
+        jdk.nashorn.tools.Shell.main(System.in, System.out, System.err, jsargs);
+        System.out.println("PASS, did not crash running Javascript");
+    }
 }
diff --git a/test/compiler/jsr292/InvokerGC.java b/test/compiler/jsr292/InvokerGC.java
index bcd63dd..b1b1cd8 100644
--- a/test/compiler/jsr292/InvokerGC.java
+++ b/test/compiler/jsr292/InvokerGC.java
@@ -25,16 +25,22 @@
  * @test
  * @bug 8067247
  * @modules java.base/jdk.internal.misc
- * @library /test/lib /
+ * @library /test/lib
+ *
  * @run main/bootclasspath/othervm -Xcomp -Xbatch
- *      -XX:CompileCommand=compileonly,InvokerGC::test
  *      -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *      InvokerGC
+ *      -XX:CompileCommand=compileonly,compiler.jsr292.InvokerGC::test
+ *      compiler.jsr292.InvokerGC
  */
 
-import java.lang.invoke.*;
+package compiler.jsr292;
+
 import sun.hotspot.WhiteBox;
 
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
 public class InvokerGC {
     static final WhiteBox WB = WhiteBox.getWhiteBox();
 
diff --git a/test/compiler/jsr292/LongReferenceCastingTest.java b/test/compiler/jsr292/LongReferenceCastingTest.java
index 218b096..9512393 100644
--- a/test/compiler/jsr292/LongReferenceCastingTest.java
+++ b/test/compiler/jsr292/LongReferenceCastingTest.java
@@ -22,14 +22,20 @@
  *
  */
 
-import java.lang.invoke.*;
-
 /**
  * @test
  * @bug 8148752
  * @summary Test correct casting of MH arguments during inlining.
- * @run main LongReferenceCastingTest
+ *
+ * @run main compiler.jsr292.LongReferenceCastingTest
  */
+
+package compiler.jsr292;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
 public class LongReferenceCastingTest {
     static final String MY_STRING = "myString";
     static final MethodHandle MH;
diff --git a/test/compiler/jsr292/MHInlineTest.java b/test/compiler/jsr292/MHInlineTest.java
index 915c8f1..150b79e 100644
--- a/test/compiler/jsr292/MHInlineTest.java
+++ b/test/compiler/jsr292/MHInlineTest.java
@@ -26,21 +26,30 @@
  * @bug 8062280
  * @summary C2: inlining failure due to access checks being too strict
  * @modules java.base/jdk.internal.misc
- * @library /testlibrary
- * @run main/othervm MHInlineTest
+ * @library /testlibrary /
+ *
+ * @run main/othervm compiler.jsr292.MHInlineTest
  */
-import java.lang.invoke.*;
-import jdk.test.lib.*;
-import static jdk.test.lib.Asserts.*;
+
+package compiler.jsr292;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+import static jdk.test.lib.Asserts.assertEquals;
 
 public class MHInlineTest {
     public static void main(String[] args) throws Exception {
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
                 "-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
-                "-server", "-XX:-TieredCompilation", "-Xbatch",
+                "-XX:-TieredCompilation", "-Xbatch",
                 "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
-                "-XX:CompileCommand=dontinline,MHInlineTest::test*",
-                    "MHInlineTest$Launcher");
+                "-XX:CompileCommand=dontinline,compiler.jsr292.MHInlineTest::test*",
+                    Launcher.class.getName());
 
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
 
@@ -48,13 +57,13 @@
 
         // The test is applicable only to C2 (present in Server VM).
         if (analyzer.getStderr().contains("Server VM")) {
-            analyzer.shouldContain("MHInlineTest$B::public_x (3 bytes)   inline (hot)");
-            analyzer.shouldContain("MHInlineTest$B::protected_x (3 bytes)   inline (hot)");
-            analyzer.shouldContain("MHInlineTest$B::package_x (3 bytes)   inline (hot)");
-            analyzer.shouldContain("MHInlineTest$A::package_final_x (3 bytes)   inline (hot)");
-            analyzer.shouldContain("MHInlineTest$B::private_x (3 bytes)   inline (hot)");
-            analyzer.shouldContain("MHInlineTest$B::private_static_x (3 bytes)   inline (hot)");
-            analyzer.shouldContain("MHInlineTest$A::package_static_x (3 bytes)   inline (hot)");
+            analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::public_x (3 bytes)   inline (hot)");
+            analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::protected_x (3 bytes)   inline (hot)");
+            analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::package_x (3 bytes)   inline (hot)");
+            analyzer.shouldContain("compiler.jsr292.MHInlineTest$A::package_final_x (3 bytes)   inline (hot)");
+            analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::private_x (3 bytes)   inline (hot)");
+            analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::private_static_x (3 bytes)   inline (hot)");
+            analyzer.shouldContain("compiler.jsr292.MHInlineTest$A::package_static_x (3 bytes)   inline (hot)");
         }
     }
 
diff --git a/test/compiler/jsr292/NonInlinedCall/Agent.java b/test/compiler/jsr292/NonInlinedCall/Agent.java
index e9f2f46..93540ea 100644
--- a/test/compiler/jsr292/NonInlinedCall/Agent.java
+++ b/test/compiler/jsr292/NonInlinedCall/Agent.java
@@ -23,13 +23,13 @@
 
 package compiler.jsr292.NonInlinedCall;
 
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.OutputAnalyzer;
+
 import java.io.File;
 import java.io.PrintStream;
 import java.util.Arrays;
 
-import jdk.test.lib.JDKToolLauncher;
-import jdk.test.lib.OutputAnalyzer;
-
 public class Agent {
     public static void main(String[] args) throws Exception {
         String jarName = args[0];
diff --git a/test/compiler/jsr292/NonInlinedCall/GCTest.java b/test/compiler/jsr292/NonInlinedCall/GCTest.java
index 3a93fe7..02b06fa 100644
--- a/test/compiler/jsr292/NonInlinedCall/GCTest.java
+++ b/test/compiler/jsr292/NonInlinedCall/GCTest.java
@@ -26,7 +26,8 @@
  * @bug 8072008
  * @library /testlibrary /test/lib ../patches
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.vm.annotation
+ *          java.base/jdk.internal.vm.annotation
+ *
  * @build java.base/java.lang.invoke.MethodHandleHelper
  * @build sun.hotspot.WhiteBox
  * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions
@@ -38,22 +39,20 @@
 
 package compiler.jsr292.NonInlinedCall;
 
+import jdk.internal.vm.annotation.DontInline;
+import jdk.internal.vm.annotation.Stable;
+import sun.hotspot.WhiteBox;
+
+import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandleHelper;
 import java.lang.invoke.MethodHandleHelper.NonInlinedReinvoker;
 import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodHandle;
-
 import java.lang.invoke.MethodType;
 import java.lang.ref.PhantomReference;
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 
-import jdk.internal.vm.annotation.DontInline;
-import jdk.internal.vm.annotation.Stable;
-
-import sun.hotspot.WhiteBox;
-
-import static jdk.test.lib.Asserts.*;
+import static jdk.test.lib.Asserts.assertEquals;
 
 public class GCTest {
     static final MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP;
diff --git a/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
index d413d38..15ca369 100644
--- a/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
+++ b/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
@@ -26,10 +26,11 @@
  * @bug 8072008
  * @library /testlibrary /test/lib / ../patches
  * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.vm.annotation
+ *          java.base/jdk.internal.vm.annotation
+ *
  * @build java.base/java.lang.invoke.MethodHandleHelper
- * @build sun.hotspot.WhiteBox
- * @build compiler.jsr292.NonInlinedCall.InvokeTest
+ *        sun.hotspot.WhiteBox
+ *        compiler.jsr292.NonInlinedCall.InvokeTest
  * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions
  *                                 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                                 -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
@@ -38,17 +39,16 @@
 
 package compiler.jsr292.NonInlinedCall;
 
+import jdk.internal.vm.annotation.DontInline;
+import sun.hotspot.WhiteBox;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandleHelper;
 import java.lang.invoke.MethodHandleHelper.NonInlinedReinvoker;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 
-import jdk.internal.vm.annotation.DontInline;
-
-import sun.hotspot.WhiteBox;
-
-import static jdk.test.lib.Asserts.*;
+import static jdk.test.lib.Asserts.assertEquals;
 
 public class InvokeTest {
     static MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP;
diff --git a/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
index cb77918..dbd9f92 100644
--- a/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
+++ b/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
@@ -29,13 +29,16 @@
  *          java.base/jdk.internal.vm.annotation
  * @library /testlibrary /test/lib / ../patches
  * @requires vm.flavor != "minimal"
+ *
  * @build sun.hotspot.WhiteBox
- * @build java.base/java.lang.invoke.MethodHandleHelper
- * @build compiler.jsr292.NonInlinedCall.RedefineTest
- * @run main compiler.jsr292.NonInlinedCall.Agent agent.jar compiler.jsr292.NonInlinedCall.RedefineTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- *                              compiler.jsr292.NonInlinedCall.RedefineTest
+ *        java.base/java.lang.invoke.MethodHandleHelper
+ *        compiler.jsr292.NonInlinedCall.RedefineTest
+ * @run driver compiler.jsr292.NonInlinedCall.Agent
+ *             agent.jar
+ *             compiler.jsr292.NonInlinedCall.RedefineTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ *                                compiler.jsr292.NonInlinedCall.RedefineTest
  * @run main/bootclasspath/othervm -javaagent:agent.jar
  *                                 -XX:+IgnoreUnrecognizedVMOptions
  *                                 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@@ -45,20 +48,23 @@
 
 package compiler.jsr292.NonInlinedCall;
 
+import jdk.internal.misc.Unsafe;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.vm.annotation.DontInline;
 import sun.hotspot.WhiteBox;
 
 import java.lang.instrument.ClassDefinition;
 import java.lang.instrument.Instrumentation;
 import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodHandleHelper;
+import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 
-import jdk.internal.misc.Unsafe;
-import jdk.internal.vm.annotation.DontInline;
-import jdk.internal.org.objectweb.asm.*;
-
-import static jdk.internal.org.objectweb.asm.Opcodes.*;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER;
+import static jdk.internal.org.objectweb.asm.Opcodes.IRETURN;
 
 public class RedefineTest {
     static final MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP;
diff --git a/test/compiler/jsr292/NullConstantReceiver.java b/test/compiler/jsr292/NullConstantReceiver.java
index 067c620..42c2b87 100644
--- a/test/compiler/jsr292/NullConstantReceiver.java
+++ b/test/compiler/jsr292/NullConstantReceiver.java
@@ -24,9 +24,12 @@
 /**
  * @test
  * @bug 8059556
- * @run main/othervm -Xbatch NullConstantReceiver
+ *
+ * @run main/othervm -Xbatch compiler.jsr292.NullConstantReceiver
  */
 
+package compiler.jsr292;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
diff --git a/test/compiler/jsr292/PollutedTrapCounts.java b/test/compiler/jsr292/PollutedTrapCounts.java
index b368b2f..9090513 100644
--- a/test/compiler/jsr292/PollutedTrapCounts.java
+++ b/test/compiler/jsr292/PollutedTrapCounts.java
@@ -26,10 +26,18 @@
  * @bug 8074551
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main PollutedTrapCounts
+ *
+ * @run driver compiler.jsr292.PollutedTrapCounts
  */
-import java.lang.invoke.*;
-import jdk.test.lib.*;
+
+package compiler.jsr292;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
 
 public class PollutedTrapCounts {
     public static void main(String[] args) throws Exception {
@@ -38,7 +46,7 @@
                 "-XX:-TieredCompilation", "-Xbatch",
                 "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
                 "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
-                    "PollutedTrapCounts$Test");
+                    Test.class.getName());
 
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
 
diff --git a/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java b/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
index cf20e8f..a8d142e 100644
--- a/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
+++ b/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
@@ -25,27 +25,42 @@
  * @test
  * @bug 8042235
  * @summary redefining method used by multiple MethodHandles crashes VM
+ * @library /
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.compiler
  *          java.instrument
  *          java.management
- * @compile -XDignore.symbol.file RedefineMethodUsedByMultipleMethodHandles.java
- * @run main/othervm RedefineMethodUsedByMultipleMethodHandles
+ *
+ * @run main/othervm compiler.jsr292.RedefineMethodUsedByMultipleMethodHandles
  */
 
-import java.io.*;
-import java.lang.instrument.*;
-import java.lang.invoke.*;
+package compiler.jsr292;
+
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+import javax.tools.ToolProvider;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.instrument.ClassFileTransformer;
+import java.lang.instrument.IllegalClassFormatException;
+import java.lang.instrument.Instrumentation;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodHandles.Lookup;
-import java.lang.management.*;
-import java.lang.reflect.*;
-import java.nio.file.*;
-import java.security.*;
-import java.util.jar.*;
-
-import javax.tools.*;
-
-import jdk.internal.org.objectweb.asm.*;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.security.ProtectionDomain;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
 
 public class RedefineMethodUsedByMultipleMethodHandles {
 
diff --git a/test/compiler/jsr292/7082949/Test7082949.java b/test/compiler/jsr292/Test7082949.java
similarity index 89%
rename from test/compiler/jsr292/7082949/Test7082949.java
rename to test/compiler/jsr292/Test7082949.java
index 41b7911..b699ba5 100644
--- a/test/compiler/jsr292/7082949/Test7082949.java
+++ b/test/compiler/jsr292/Test7082949.java
@@ -27,12 +27,15 @@
  * @bug 7082949
  * @summary JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
  *
- * @run main Test7082949
+ * @run main compiler.jsr292.Test7082949
  */
 
-import java.lang.invoke.*;
-import static java.lang.invoke.MethodHandles.*;
-import static java.lang.invoke.MethodType.*;
+package compiler.jsr292;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+
+import static java.lang.invoke.MethodType.methodType;
 
 public class Test7082949 implements Runnable {
     public static void main(String... args) throws Throwable {
diff --git a/test/compiler/jsr292/VMAnonymousClasses.java b/test/compiler/jsr292/VMAnonymousClasses.java
index abb9b5d..c79deeb 100644
--- a/test/compiler/jsr292/VMAnonymousClasses.java
+++ b/test/compiler/jsr292/VMAnonymousClasses.java
@@ -26,13 +26,16 @@
  * @bug 8058828
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.misc
- * @run main/bootclasspath/othervm -Xbatch VMAnonymousClasses
+ *
+ * @run main/bootclasspath/othervm -Xbatch compiler.jsr292.VMAnonymousClasses
  */
 
+package compiler.jsr292;
+
+import jdk.internal.misc.Unsafe;
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.misc.Unsafe;
 
 import java.lang.invoke.ConstantCallSite;
 import java.lang.invoke.MethodHandle;
diff --git a/test/compiler/jsr292/6990212/Test6990212.java b/test/compiler/jsr292/cr6990212/Test6990212.java
similarity index 90%
rename from test/compiler/jsr292/6990212/Test6990212.java
rename to test/compiler/jsr292/cr6990212/Test6990212.java
index bdb28c5..e9cd8c8 100644
--- a/test/compiler/jsr292/6990212/Test6990212.java
+++ b/test/compiler/jsr292/cr6990212/Test6990212.java
@@ -27,10 +27,14 @@
  * @bug 6990212
  * @summary JSR 292 JVMTI MethodEnter hook is not called for JSR 292 bootstrap and target methods
  *
- * @run main Test6990212
+ * @run main compiler.jsr292.cr6990212.Test6990212
  */
 
-import java.lang.invoke.*;
+package compiler.jsr292.cr6990212;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
 
 interface intf {
     public Object target();
diff --git a/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java b/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java
index 3903f6f..c9b572b 100644
--- a/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java
+++ b/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java
@@ -1,12 +1,3 @@
-import java.io.BufferedOutputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.jar.JarEntry;
-import java.util.jar.JarOutputStream;
-
 /*
  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +22,17 @@
  *
  */
 
+package compiler.jsr292.methodHandleExceptions;
+
+import java.io.BufferedOutputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+
 /**
  * A ByteClassLoader is used to define classes from collections of bytes, as
  * well as loading classes in the usual way. It includes options to write the
diff --git a/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java b/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
index 93fe9bd..a00e6ab 100644
--- a/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
+++ b/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
@@ -21,28 +21,47 @@
  * questions.
  *
  */
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
+
+/**
+ * @test
+ * @bug 8025260 8016839
+ * @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ * @library / .
+ *
+ * @build p.*
+ * @run main/othervm compiler.jsr292.methodHandleExceptions.TestAMEnotNPE
+ * @run main/othervm -Xint compiler.jsr292.methodHandleExceptions.TestAMEnotNPE
+ * @run main/othervm -Xcomp compiler.jsr292.methodHandleExceptions.TestAMEnotNPE
+ */
+
+package compiler.jsr292.methodHandleExceptions;
+
+import p.Dok;
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.internal.org.objectweb.asm.Handle;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.org.objectweb.asm.Opcodes;
-import p.Dok;
 
-/**
- * @test @bug 8025260 8016839
- * @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException
- *
- * @modules java.base/jdk.internal.org.objectweb.asm
- * @compile -XDignore.symbol.file TestAMEnotNPE.java ByteClassLoader.java p/C.java p/Dok.java p/E.java p/F.java p/I.java p/Tdirect.java p/Treflect.java
- *
- * @run main/othervm TestAMEnotNPE
- * @run main/othervm -Xint TestAMEnotNPE
- * @run main/othervm -Xcomp TestAMEnotNPE
- */
-public class TestAMEnotNPE implements Opcodes {
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PRIVATE;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER;
+import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.IRETURN;
+import static jdk.internal.org.objectweb.asm.Opcodes.LLOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.RETURN;
+import static jdk.internal.org.objectweb.asm.Opcodes.V1_8;
+
+public class TestAMEnotNPE {
 
     static boolean writeJarFiles = false;
     static boolean readJarFiles = false;
@@ -115,7 +134,7 @@
             System.out.flush();
             Thread.sleep(250); // This de-interleaves output and error in Netbeans, sigh.
             for (Throwable th : lt)
-              System.err.println(th);
+                System.err.println(th);
             throw new Error("Test failed, there were " + lt.size() + " failures listed above");
         } else {
             System.out.println("ALL PASS, HOORAY!");
@@ -191,7 +210,7 @@
      * @throws Exception
      */
     public static byte[] bytesForSomeDsubSomethingSomeAccess
-            (String d_name, String sub_what, int method_acc)
+    (String d_name, String sub_what, int method_acc)
             throws Exception {
 
         ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES
diff --git a/test/compiler/jsr292/methodHandleExceptions/p/C.java b/test/compiler/jsr292/methodHandleExceptions/p/C.java
index ab0e1aa..6eddea4 100644
--- a/test/compiler/jsr292/methodHandleExceptions/p/C.java
+++ b/test/compiler/jsr292/methodHandleExceptions/p/C.java
@@ -30,6 +30,6 @@
  * an abstract method error if called.
  *
  */
-public abstract class C implements p.I {
+public abstract class C implements I {
        public abstract int m();
 }
diff --git a/test/compiler/jsr292/methodHandleExceptions/p/Dok.java b/test/compiler/jsr292/methodHandleExceptions/p/Dok.java
index f9fa4c2..9d00701 100644
--- a/test/compiler/jsr292/methodHandleExceptions/p/Dok.java
+++ b/test/compiler/jsr292/methodHandleExceptions/p/Dok.java
@@ -21,11 +21,12 @@
  * questions.
  *
  */
+
 package p;
 
 /**
  * Test class -- implements I, extends E, both define m, so all should be well.
  */
-public class Dok extends p.E {
+public class Dok extends E {
 
 }
diff --git a/test/compiler/jsr292/methodHandleExceptions/p/E.java b/test/compiler/jsr292/methodHandleExceptions/p/E.java
index 6b1f8f9..2211b6b 100644
--- a/test/compiler/jsr292/methodHandleExceptions/p/E.java
+++ b/test/compiler/jsr292/methodHandleExceptions/p/E.java
@@ -31,7 +31,7 @@
  * of course is NOT usually the case in this test).
  *
  */
-public abstract class E implements p.I {
+public abstract class E implements I {
        public int m() {
            return 2;
        }
diff --git a/test/compiler/jsr292/methodHandleExceptions/p/F.java b/test/compiler/jsr292/methodHandleExceptions/p/F.java
index 86b6c65..bd8dd1a 100644
--- a/test/compiler/jsr292/methodHandleExceptions/p/F.java
+++ b/test/compiler/jsr292/methodHandleExceptions/p/F.java
@@ -34,7 +34,7 @@
  * m.
  *
  */
-public abstract class F implements p.I {
+public abstract class F implements I {
        final public int m() {
            return 2;
        }
diff --git a/test/compiler/jsr292/methodHandleExceptions/p/Tdirect.java b/test/compiler/jsr292/methodHandleExceptions/p/Tdirect.java
index 088e1fa..2a45dee 100644
--- a/test/compiler/jsr292/methodHandleExceptions/p/Tdirect.java
+++ b/test/compiler/jsr292/methodHandleExceptions/p/Tdirect.java
@@ -28,7 +28,7 @@
  * Invokes I.m directly using invokeInterface bytecodes.
  */
 public class Tdirect {
-     public static int test(p.I i) {
+     public static int test(I i) {
          int accum = 0;
          for (int j = 0; j < 100000; j++) {
              accum += i.m();
@@ -36,7 +36,7 @@
         return accum;
     }
 
-     public static int test(p.I ii, byte b, char c, short s, int i, long l,
+     public static int test(I ii, byte b, char c, short s, int i, long l,
              Object o1, Object o2, Object o3, Object o4, Object o5, Object o6) {
          int accum = 0;
          for (int j = 0; j < 100000; j++) {
diff --git a/test/compiler/jsr292/methodHandleExceptions/p/Treflect.java b/test/compiler/jsr292/methodHandleExceptions/p/Treflect.java
index a4f754a..9468a2d 100644
--- a/test/compiler/jsr292/methodHandleExceptions/p/Treflect.java
+++ b/test/compiler/jsr292/methodHandleExceptions/p/Treflect.java
@@ -21,6 +21,7 @@
  * questions.
  *
  */
+
 package p;
 
 import java.lang.reflect.InvocationTargetException;
@@ -31,9 +32,9 @@
  */
 public class Treflect {
 
-    public static int test(p.I ii) throws Throwable {
+    public static int test(I ii) throws Throwable {
         int accum = 0;
-        Method m = p.I.class.getMethod("m");
+        Method m = I.class.getMethod("m");
         try {
             for (int j = 0; j < 100000; j++) {
                 Object o = m.invoke(ii);
@@ -45,10 +46,10 @@
         return accum;
     }
 
-    public static int test(p.I ii, byte b, char c, short s, int i, long l,
+    public static int test(I ii, byte b, char c, short s, int i, long l,
             Object o1, Object o2, Object o3, Object o4, Object o5, Object o6)
             throws Throwable {
-        Method m = p.I.class.getMethod("m", Byte.TYPE, Character.TYPE,
+        Method m = I.class.getMethod("m", Byte.TYPE, Character.TYPE,
                 Short.TYPE, Integer.TYPE, Long.TYPE,
                 Object.class, Object.class, Object.class,
                 Object.class, Object.class, Object.class);
diff --git a/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java b/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java
index 57eed05..28036f3 100644
--- a/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java
+++ b/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java
@@ -52,8 +52,8 @@
 
 package compiler.jvmci;
 
-import jdk.vm.ci.runtime.JVMCI;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.runtime.JVMCI;
 
 public class JVM_GetJVMCIRuntimeTest implements Runnable {
     private static final boolean IS_POSITIVE = Boolean.getBoolean(
diff --git a/test/compiler/jvmci/SecurityRestrictionsTest.java b/test/compiler/jvmci/SecurityRestrictionsTest.java
index 22263a7..529f7ac 100644
--- a/test/compiler/jvmci/SecurityRestrictionsTest.java
+++ b/test/compiler/jvmci/SecurityRestrictionsTest.java
@@ -56,14 +56,11 @@
 package compiler.jvmci;
 
 import jdk.test.lib.Utils;
-import java.lang.InternalError;
-import java.lang.reflect.Constructor;
+
 import java.security.AccessControlException;
 import java.security.Permission;
 import java.util.PropertyPermission;
 import java.util.function.Consumer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 public class SecurityRestrictionsTest {
 
diff --git a/test/compiler/jvmci/common/CTVMUtilities.java b/test/compiler/jvmci/common/CTVMUtilities.java
index 6c33016..03335f6 100644
--- a/test/compiler/jvmci/common/CTVMUtilities.java
+++ b/test/compiler/jvmci/common/CTVMUtilities.java
@@ -23,18 +23,6 @@
 
 package compiler.jvmci.common;
 
-import java.io.IOException;
-import java.lang.reflect.Module;
-import java.lang.reflect.Field;
-import java.lang.reflect.Executable;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Parameter;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeMap;
-
 import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.org.objectweb.asm.ClassVisitor;
 import jdk.internal.org.objectweb.asm.ClassWriter;
@@ -47,6 +35,18 @@
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Executable;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Module;
+import java.lang.reflect.Parameter;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
 public class CTVMUtilities {
     /*
      * A method to return HotSpotResolvedJavaMethod object using class object
diff --git a/test/compiler/jvmci/common/JVMCIHelpers.java b/test/compiler/jvmci/common/JVMCIHelpers.java
index 7d9abd4..47164ca 100644
--- a/test/compiler/jvmci/common/JVMCIHelpers.java
+++ b/test/compiler/jvmci/common/JVMCIHelpers.java
@@ -23,14 +23,12 @@
 
 package compiler.jvmci.common;
 
-import jdk.vm.ci.code.Architecture;
 import jdk.vm.ci.code.CompilationRequest;
 import jdk.vm.ci.code.CompilationRequestResult;
 import jdk.vm.ci.hotspot.services.HotSpotVMEventListener;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.runtime.JVMCICompiler;
-import jdk.vm.ci.runtime.services.JVMCICompilerFactory;
 import jdk.vm.ci.runtime.JVMCIRuntime;
+import jdk.vm.ci.runtime.services.JVMCICompilerFactory;
 
 /*
  * A stub classes to be able to use jvmci
diff --git a/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java b/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
index e35c516..f2b4092 100644
--- a/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
+++ b/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
@@ -28,7 +28,6 @@
 import jdk.vm.ci.code.TargetDescription;
 import jdk.vm.ci.meta.ConstantPool;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.SpeculationLog;
 
 /**
  * A simple "proxy" class to get test access to CompilerToVM package-private methods
diff --git a/test/compiler/jvmci/common/testcases/TestCase.java b/test/compiler/jvmci/common/testcases/TestCase.java
index d08fe31..af11b03 100644
--- a/test/compiler/jvmci/common/testcases/TestCase.java
+++ b/test/compiler/jvmci/common/testcases/TestCase.java
@@ -25,13 +25,9 @@
 package compiler.jvmci.common.testcases;
 
 import java.lang.reflect.Executable;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.List;
-import java.util.ArrayList;
 import java.util.Set;
 
 /**
diff --git a/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java b/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java
index daeaaed..e9608ee 100644
--- a/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java
+++ b/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java
@@ -32,11 +32,12 @@
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.AllocateCompileIdTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -47,22 +48,21 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Pair;
+import jdk.test.lib.Utils;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import sun.hotspot.code.NMethod;
 
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
-import java.util.List;
 import java.util.HashSet;
+import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Pair;
-import jdk.test.lib.Utils;
-import sun.hotspot.code.NMethod;
-
 public class AllocateCompileIdTest {
 
     private static final int SOME_REPEAT_VALUE = 5;
diff --git a/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java b/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java
index 7a313d4..dea8cb2 100644
--- a/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java
+++ b/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java
@@ -33,11 +33,12 @@
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.CanInlineMethodTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -47,14 +48,15 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.test.lib.Asserts;
-import sun.hotspot.WhiteBox;
 
 public class CanInlineMethodTest {
 
diff --git a/test/compiler/jvmci/compilerToVM/CollectCountersTest.java b/test/compiler/jvmci/compilerToVM/CollectCountersTest.java
index 8bd98dc..46beea7 100644
--- a/test/compiler/jvmci/compilerToVM/CollectCountersTest.java
+++ b/test/compiler/jvmci/compilerToVM/CollectCountersTest.java
@@ -45,8 +45,8 @@
 
 package compiler.jvmci.compilerToVM;
 
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
 
 public class CollectCountersTest {
     private static final int EXPECTED = Integer.getInteger(
diff --git a/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java b/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java
index fa6483c..697aee2 100644
--- a/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java
+++ b/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java
@@ -26,13 +26,14 @@
 
 import compiler.jvmci.common.CTVMUtilities;
 import compiler.testlibrary.CompilerUtils;
+import jdk.test.lib.Pair;
 import jdk.test.lib.Utils;
 import jdk.vm.ci.code.InstalledCode;
 import sun.hotspot.WhiteBox;
 import sun.hotspot.code.NMethod;
 
-import java.lang.reflect.Executable;
 import java.lang.reflect.Constructor;
+import java.lang.reflect.Executable;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
@@ -42,7 +43,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import jdk.test.lib.Pair;
 
 /**
  * A test case for tests which require compiled code.
diff --git a/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java b/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java
index d3f8500..224ff9d 100644
--- a/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java
+++ b/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java
@@ -24,15 +24,31 @@
 
 package compiler.jvmci.compilerToVM;
 
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
+import jdk.internal.reflect.ConstantPool;
+import jdk.internal.reflect.ConstantPool.Tag;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import sun.hotspot.WhiteBox;
-import jdk.internal.reflect.ConstantPool;
-import jdk.internal.reflect.ConstantPool.Tag;
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_DOUBLE;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FLOAT;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTEGER;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVALID;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_LONG;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODHANDLE;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODTYPE;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_NAMEANDTYPE;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_STRING;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_UTF8;
 
 /**
  * Common class for jdk.vm.ci.hotspot.CompilerToVM constant pool tests
diff --git a/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java b/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java
index fc33560..f615832 100644
--- a/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java
+++ b/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java
@@ -27,19 +27,28 @@
 import compiler.jvmci.common.testcases.MultipleImplementer2;
 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
-import java.util.HashMap;
-import java.util.Map;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.reflect.ConstantPool;
+import jdk.internal.reflect.ConstantPool.Tag;
 import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.ResolvedJavaType;
 import jdk.vm.ci.runtime.JVMCI;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.org.objectweb.asm.Opcodes;
 import sun.hotspot.WhiteBox;
-import jdk.internal.reflect.ConstantPool;
-import jdk.internal.reflect.ConstantPool.Tag;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODHANDLE;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODTYPE;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_STRING;
 
 /**
  * Class contains hard-coded constant pool tables for dummy classes used for
diff --git a/test/compiler/jvmci/compilerToVM/DebugOutputTest.java b/test/compiler/jvmci/compilerToVM/DebugOutputTest.java
index 477c912..b2477b7 100644
--- a/test/compiler/jvmci/compilerToVM/DebugOutputTest.java
+++ b/test/compiler/jvmci/compilerToVM/DebugOutputTest.java
@@ -38,11 +38,11 @@
 
 package compiler.jvmci.compilerToVM;
 
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.test.lib.ProcessTools;
-import java.util.Arrays;
 import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.Utils;
+import jdk.test.lib.ProcessTools;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+
+import java.util.Arrays;
 
 public class DebugOutputTest {
     public static void main(String[] args) {
diff --git a/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java
index aeb384d..8bb3820 100644
--- a/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java
+++ b/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java
@@ -33,12 +33,13 @@
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
+ *
  * @ignore 8139700
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.DisassembleCodeBlobTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -47,13 +48,13 @@
 
 package compiler.jvmci.compilerToVM;
 
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.code.InstalledCode;
 import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
+import jdk.vm.ci.code.InstalledCode;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import sun.hotspot.code.NMethod;
 
 import java.util.List;
-import jdk.test.lib.Utils;
 
 public class DisassembleCodeBlobTest {
 
diff --git a/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java b/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java
index a3ab66a..2390557 100644
--- a/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java
+++ b/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java
@@ -33,11 +33,12 @@
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.DoNotInlineOrCompileTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -47,14 +48,15 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.test.lib.Asserts;
-import sun.hotspot.WhiteBox;
 
 public class DoNotInlineOrCompileTest {
 
diff --git a/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java
index 5ea1bbd..c6a36fc 100644
--- a/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java
+++ b/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java
@@ -1,22 +1,17 @@
 package compiler.jvmci.compilerToVM;
 
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Pair;
+import jdk.test.lib.Utils;
 import jdk.vm.ci.code.InstalledCode;
 import jdk.vm.ci.code.InvalidInstalledCodeException;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
-import jdk.test.lib.Pair;
 import sun.hotspot.code.NMethod;
 
 import java.lang.reflect.Constructor;
-import java.lang.reflect.Executable;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /*
  * @test
@@ -33,8 +28,8 @@
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
diff --git a/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java b/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java
index 7b23709..3c818d9 100644
--- a/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java
+++ b/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java
@@ -40,19 +40,20 @@
 
 package compiler.jvmci.compilerToVM;
 
+import compiler.jvmci.common.CTVMUtilities;
 import compiler.jvmci.common.testcases.MultipleImplementer1;
 import compiler.jvmci.common.testcases.SingleImplementer;
-import compiler.jvmci.common.testcases.SingleSubclass;
-import compiler.jvmci.common.CTVMUtilities;
 import compiler.jvmci.common.testcases.SingleImplementerInterface;
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Set;
+import compiler.jvmci.common.testcases.SingleSubclass;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
+
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Set;
 
 public class FindUniqueConcreteMethodTest {
     public static void main(String args[]) {
diff --git a/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java b/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java
index a72d0c4..6bd182b 100644
--- a/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java
@@ -43,12 +43,13 @@
 
 import compiler.jvmci.common.CTVMUtilities;
 import compiler.jvmci.common.testcases.TestCase;
-import java.lang.reflect.Executable;
-import java.lang.reflect.Modifier;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.internal.org.objectweb.asm.Opcodes;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+
+import java.lang.reflect.Executable;
+import java.lang.reflect.Modifier;
 
 public class GetBytecodeTest {
 
diff --git a/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java b/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java
index 2eec0da..c20b668 100644
--- a/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java
@@ -43,13 +43,14 @@
 import compiler.jvmci.common.testcases.MultipleImplementersInterfaceExtender;
 import compiler.jvmci.common.testcases.SingleImplementer;
 import compiler.jvmci.common.testcases.SingleImplementerInterface;
-import java.util.HashSet;
-import java.util.Set;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
+
+import java.util.HashSet;
+import java.util.Set;
 
 public class GetClassInitializerTest {
 
diff --git a/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java b/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
index 00be361..ceb35fe 100644
--- a/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
@@ -31,12 +31,13 @@
  * @modules java.base/jdk.internal.misc
  * @modules jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject
  * @build compiler.jvmci.compilerToVM.GetConstantPoolTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -44,15 +45,15 @@
  */
 package compiler.jvmci.compilerToVM;
 
-import java.lang.reflect.Field;
-import jdk.vm.ci.meta.ConstantPool;
+import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Utils;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject;
-import jdk.test.lib.Utils;
+import jdk.vm.ci.meta.ConstantPool;
 import sun.hotspot.WhiteBox;
-import jdk.internal.misc.Unsafe;
+
+import java.lang.reflect.Field;
 
 /**
  * Tests for jdk.vm.ci.hotspot.CompilerToVM::getConstantPool method
diff --git a/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java b/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java
index 2d7d511..3e5ada1 100644
--- a/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java
@@ -42,14 +42,15 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+
 import java.io.IOException;
 import java.lang.reflect.Executable;
 import java.net.Socket;
 import java.util.HashMap;
 import java.util.Map;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.test.lib.Asserts;
 
 public class GetExceptionTableTest {
 
diff --git a/test/compiler/jvmci/compilerToVM/GetImplementorTest.java b/test/compiler/jvmci/compilerToVM/GetImplementorTest.java
index e907eb8..dd0841d 100644
--- a/test/compiler/jvmci/compilerToVM/GetImplementorTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetImplementorTest.java
@@ -39,8 +39,8 @@
 
 import compiler.jvmci.common.testcases.AbstractClass;
 import compiler.jvmci.common.testcases.AbstractClassExtender;
-import compiler.jvmci.common.testcases.DoNotImplementInterface;
 import compiler.jvmci.common.testcases.DoNotExtendClass;
+import compiler.jvmci.common.testcases.DoNotImplementInterface;
 import compiler.jvmci.common.testcases.MultipleImplementer1;
 import compiler.jvmci.common.testcases.MultipleImplementer2;
 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
@@ -48,13 +48,14 @@
 import compiler.jvmci.common.testcases.SingleImplementerInterface;
 import compiler.jvmci.common.testcases.SingleSubclass;
 import compiler.jvmci.common.testcases.SingleSubclassedClass;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
+
 import java.util.HashSet;
 import java.util.Set;
 import java.util.stream.Stream;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
 
 public class GetImplementorTest {
     public static void main(String args[]) {
diff --git a/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java b/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java
index c121881..ac99a5c 100644
--- a/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java
@@ -44,9 +44,9 @@
 
 import compiler.jvmci.common.CTVMUtilities;
 import compiler.jvmci.common.testcases.TestCase;
+import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.test.lib.Asserts;
 
 import java.lang.reflect.Executable;
 import java.util.Arrays;
diff --git a/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java b/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java
index 4fb64f7..7d3b097 100644
--- a/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java
@@ -47,9 +47,9 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 
 import java.lang.reflect.Executable;
 import java.util.HashMap;
diff --git a/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java b/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java
index 44574b0..fcdf29e 100644
--- a/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java
@@ -37,8 +37,8 @@
 
 package compiler.jvmci.compilerToVM;
 
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
 
 public class GetMaxCallTargetOffsetTest {
     public static void main(String args[]) {
diff --git a/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java b/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java
index 7809e94..b0c0d50 100644
--- a/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java
@@ -42,11 +42,12 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
-import java.lang.reflect.Method;
+import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotStackFrameReference;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.test.lib.Asserts;
+
+import java.lang.reflect.Method;
 
 public class GetNextStackFrameTest {
     private static final int RECURSION_AMOUNT = 3;
diff --git a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java
index 7fc31de..c863339 100644
--- a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java
@@ -42,9 +42,10 @@
 
 package compiler.jvmci.compilerToVM;
 
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+
 import java.util.HashMap;
 import java.util.Map;
 
diff --git a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java
index 8353fc5..a893c71 100644
--- a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java
@@ -29,12 +29,12 @@
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
  * @modules jdk.vm.ci/jdk.vm.ci.hotspot
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  *        jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject
  * @build compiler.jvmci.compilerToVM.GetResolvedJavaMethodTest
- * @run main ClassFileInstaller
- *      sun.hotspot.WhiteBox
- *      sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -43,13 +43,13 @@
 
 package compiler.jvmci.compilerToVM;
 
+import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 import jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
 import sun.hotspot.WhiteBox;
-import jdk.internal.misc.Unsafe;
 
 import java.lang.reflect.Field;
 
diff --git a/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java b/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
index 98b3385..2ed3686 100644
--- a/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
@@ -24,20 +24,20 @@
 /*
  * @test
  * @bug 8136421
- * @ignore 8158860
  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  * @library / /testlibrary /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
  * @modules jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
+ * @ignore 8158860
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  *        jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject
  * @build compiler.jvmci.compilerToVM.GetResolvedJavaTypeTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller
- *      sun.hotspot.WhiteBox
- *      sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -52,16 +52,17 @@
 
 package compiler.jvmci.compilerToVM;
 
-import java.lang.reflect.Field;
-import jdk.vm.ci.meta.ConstantPool;
+import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
+import jdk.vm.ci.meta.ConstantPool;
 import sun.hotspot.WhiteBox;
-import jdk.internal.misc.Unsafe;
+
+import java.lang.reflect.Field;
 
 public class GetResolvedJavaTypeTest {
     private static enum TestCase {
diff --git a/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java b/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java
index da0feed..ec4458a 100644
--- a/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java
@@ -42,17 +42,17 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
+import compiler.jvmci.common.testcases.TestCase;
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.HashMap;
 import java.util.Map;
 
-import compiler.jvmci.common.testcases.TestCase;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.test.lib.Asserts;
-
 public class GetStackTraceElementTest {
 
     public static void main(String[] args) {
diff --git a/test/compiler/jvmci/compilerToVM/GetSymbolTest.java b/test/compiler/jvmci/compilerToVM/GetSymbolTest.java
index 69a45d1..78922fa 100644
--- a/test/compiler/jvmci/compilerToVM/GetSymbolTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetSymbolTest.java
@@ -41,9 +41,13 @@
 
 package compiler.jvmci.compilerToVM;
 
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import compiler.jvmci.common.CTVMUtilities;
 import compiler.jvmci.common.testcases.SingleImplementer;
+import jdk.test.lib.Utils;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.meta.ConstantPool;
+
 import java.lang.reflect.Field;
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
@@ -52,9 +56,6 @@
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.meta.ConstantPool;
-import jdk.test.lib.Utils;
 
 public class GetSymbolTest {
     private static final int CONSTANT_POOL_UTF8_TAG = 1; // see jvms, section 4.4
diff --git a/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java b/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java
index 163f6bd..a8a83d1 100644
--- a/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java
+++ b/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java
@@ -40,7 +40,10 @@
 
 package compiler.jvmci.compilerToVM;
 
+import compiler.jvmci.common.CTVMUtilities;
 import compiler.jvmci.common.testcases.AbstractClass;
+import compiler.jvmci.common.testcases.AnotherSingleImplementer;
+import compiler.jvmci.common.testcases.AnotherSingleImplementerInterface;
 import compiler.jvmci.common.testcases.DoNotExtendClass;
 import compiler.jvmci.common.testcases.MultipleAbstractImplementer;
 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
@@ -49,18 +52,16 @@
 import compiler.jvmci.common.testcases.SingleImplementerInterface;
 import compiler.jvmci.common.testcases.SingleSubclass;
 import compiler.jvmci.common.testcases.SingleSubclassedClass;
-import compiler.jvmci.common.CTVMUtilities;
-import compiler.jvmci.common.testcases.AnotherSingleImplementer;
-import compiler.jvmci.common.testcases.AnotherSingleImplementerInterface;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
+
 import java.lang.reflect.Method;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.stream.Stream;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
 
 public class GetVtableIndexForInterfaceTest {
     private static final int INVALID_VTABLE_INDEX = -4; // see method.hpp: VtableIndexFlag
diff --git a/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java b/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java
index 84acf8c..7349647 100644
--- a/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java
+++ b/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java
@@ -33,11 +33,12 @@
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -48,18 +49,17 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
+import compiler.testlibrary.CompilerUtils;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import sun.hotspot.code.NMethod;
 
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
 import java.util.List;
 
-import compiler.testlibrary.CompilerUtils;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
-import sun.hotspot.code.NMethod;
-
 public class HasCompiledCodeForOSRTest {
     public static void main(String[] args) {
         List<CompileCodeTestCase> testCases = createTestCases();
diff --git a/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java b/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java
index 2f4e921..dfb0d78 100644
--- a/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java
+++ b/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java
@@ -43,13 +43,14 @@
 import compiler.jvmci.common.testcases.MultipleImplementer1;
 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
 import compiler.jvmci.common.testcases.SingleImplementerInterface;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
+
 import java.util.HashSet;
 import java.util.Set;
 import java.util.stream.Stream;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
 
 public class HasFinalizableSubclassTest {
     public static void main(String args[]) {
diff --git a/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java b/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java
index 3a4597d..c4626d2 100644
--- a/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java
+++ b/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java
@@ -37,19 +37,10 @@
 
 package compiler.jvmci.compilerToVM;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-import java.util.function.Consumer;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
 import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
 import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
-import jdk.internal.misc.Unsafe;
 
 public class InitializeConfigurationTest {
     public static void main(String args[]) {
diff --git a/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java b/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java
index 881e339..23ff0b9 100644
--- a/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java
+++ b/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java
@@ -34,12 +34,13 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
  *          jdk.vm.ci/jdk.vm.ci.runtime
+ *
  * @ignore 8139700
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.InvalidateInstalledCodeTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -49,18 +50,18 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
-import jdk.vm.ci.code.InstalledCode;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Utils;
-import sun.hotspot.code.NMethod;
-
-import java.util.List;
 import jdk.vm.ci.code.CodeCacheProvider;
 import jdk.vm.ci.code.CompilationResult;
+import jdk.vm.ci.code.InstalledCode;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotCompilationRequest;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import sun.hotspot.code.NMethod;
+
+import java.util.List;
 
 public class InvalidateInstalledCodeTest {
     private static final CodeCacheProvider CACHE_PROVIDER
diff --git a/test/compiler/jvmci/compilerToVM/IsMatureTest.java b/test/compiler/jvmci/compilerToVM/IsMatureTest.java
index a05ee02..1855ca2 100644
--- a/test/compiler/jvmci/compilerToVM/IsMatureTest.java
+++ b/test/compiler/jvmci/compilerToVM/IsMatureTest.java
@@ -26,14 +26,15 @@
  * @bug 8136421
  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  * @library / /testlibrary /test/lib
- * @library ../common/patches
+ *          ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.vm.ci/jdk.vm.ci.hotspot
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
- * @build compiler.jvmci.compilerToVM.IsMatureTest
- * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *        compiler.jvmci.compilerToVM.IsMatureTest
+ *        sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -44,16 +45,15 @@
 
 import compiler.jvmci.common.testcases.SimpleClass;
 import compiler.whitebox.CompilerWhiteBoxTest;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.test.lib.Asserts;
+import jdk.test.lib.Platform;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import sun.hotspot.WhiteBox;
 
 import java.lang.reflect.Executable;
 
 public class IsMatureTest {
     private static final WhiteBox WB = WhiteBox.getWhiteBox();
-    private static final boolean IS_XCOMP
-            = System.getProperty("java.vm.info").contains("compiled mode");
     private static final boolean TIERED
             = WB.getBooleanVMFlag("TieredCompilation");
 
@@ -82,7 +82,7 @@
                     "Multiple times invoked method should have method data");
             /* a method is not mature in Xcomp mode with tiered compilation disabled,
                see NonTieredCompPolicy::is_mature */
-            Asserts.assertEQ(isMature, !(IS_XCOMP && !TIERED),
+            Asserts.assertEQ(isMature, !(Platform.isComp() && !TIERED),
                     "Unexpected isMature state for multiple times invoked method");
         }
     }
diff --git a/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java b/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java
index 61405cb..ef32f13 100644
--- a/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java
+++ b/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java
@@ -43,8 +43,8 @@
 
 package compiler.jvmci.compilerToVM;
 
-import jdk.vm.ci.runtime.JVMCI;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.runtime.JVMCI;
 
 import java.lang.reflect.Method;
 
diff --git a/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java
index e7db5ed..f036f0e 100644
--- a/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java
@@ -36,11 +36,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.LookupKlassInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@@ -49,17 +50,19 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.vm.ci.meta.ConstantPool;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS;
+
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupKlassInPool} method
  */
diff --git a/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java
index 284a3e3..6e17296 100644
--- a/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java
@@ -35,11 +35,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.LookupKlassRefIndexInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.LookupKlassRefIndexInPoolTest
@@ -47,17 +48,21 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.meta.ConstantPool;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
+
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupKlassRefIndexInPool} method
  */
diff --git a/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java
index 6659178..4b4c498 100644
--- a/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java
@@ -35,11 +35,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.meta
  *          jdk.vm.ci/jdk.vm.ci.runtime
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.LookupMethodInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.LookupMethodInPoolTest
@@ -47,18 +48,21 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 import jdk.vm.ci.meta.ConstantPool;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
+
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupMethodInPool} method
  */
diff --git a/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java
index 52405b0..88cc694 100644
--- a/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java
@@ -35,11 +35,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.LookupNameAndTypeRefIndexInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.LookupNameAndTypeRefIndexInPoolTest
@@ -47,17 +48,22 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.meta.ConstantPool;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
+
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupNameAndTypeRefIndexInPool} method
  */
diff --git a/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java
index 96d05f5..a43a453 100644
--- a/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java
@@ -35,11 +35,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.LookupNameInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.LookupNameInPoolTest
@@ -47,16 +48,21 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
+import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.meta.ConstantPool;
-import jdk.test.lib.Asserts;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
 
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupNameInPool} method
diff --git a/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java
index 4f67c5a..d5afc82 100644
--- a/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java
@@ -35,11 +35,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.LookupSignatureInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.LookupSignatureInPoolTest
@@ -47,17 +48,22 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.meta.ConstantPool;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
+
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupSignatureInPool} method
  */
diff --git a/test/compiler/jvmci/compilerToVM/LookupTypeTest.java b/test/compiler/jvmci/compilerToVM/LookupTypeTest.java
index 22fa694..437b561 100644
--- a/test/compiler/jvmci/compilerToVM/LookupTypeTest.java
+++ b/test/compiler/jvmci/compilerToVM/LookupTypeTest.java
@@ -40,12 +40,13 @@
 import compiler.jvmci.common.testcases.DoNotExtendClass;
 import compiler.jvmci.common.testcases.MultiSubclassedClass;
 import compiler.jvmci.common.testcases.SingleSubclass;
-import java.util.HashSet;
-import java.util.Set;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Utils;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
+
+import java.util.HashSet;
+import java.util.Set;
 
 public class LookupTypeTest {
     public static void main(String args[]) {
diff --git a/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java b/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
index 9ffd281..7607d39 100644
--- a/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
+++ b/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
@@ -25,6 +25,8 @@
  * @test
  * @bug 8136421
  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
+ *         & (vm.compMode != "Xcomp" | vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true)
+ * @summary no "-Xcomp -XX:-TieredCompilation" combination allowed until JDK-8140018 is resolved
  * @library / /testlibrary /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
@@ -33,16 +35,17 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xmixed -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:CompileCommand=exclude,*::check
- *                   -XX:+DoEscapeAnalysis
+ *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
  *                   -Xbatch
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false
  *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
@@ -50,7 +53,7 @@
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:CompileCommand=exclude,*::check
- *                   -XX:+DoEscapeAnalysis
+ *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
  *                   -Xbatch
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true
  *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
@@ -58,18 +61,17 @@
 
 package compiler.jvmci.compilerToVM;
 
-import java.lang.reflect.Method;
-import jdk.vm.ci.hotspot.HotSpotStackFrameReference;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.test.lib.Asserts;
-
 import compiler.jvmci.common.CTVMUtilities;
 import compiler.testlibrary.CompilerUtils;
 import compiler.whitebox.CompilerWhiteBoxTest;
-
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotStackFrameReference;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
 import sun.hotspot.WhiteBox;
 
+import java.lang.reflect.Method;
+
 public class MaterializeVirtualObjectTest {
     private static final WhiteBox WB;
     private static final Method METHOD;
diff --git a/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java b/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java
index cf244d1..e732faa 100644
--- a/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java
+++ b/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java
@@ -43,13 +43,14 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
-import java.lang.reflect.Method;
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+
 import java.lang.reflect.Executable;
+import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.test.lib.Asserts;
 
 public class MethodIsIgnoredBySecurityStackWalkTest {
 
diff --git a/test/compiler/jvmci/compilerToVM/ReprofileTest.java b/test/compiler/jvmci/compilerToVM/ReprofileTest.java
index 169dcf7..d9aa0b1 100644
--- a/test/compiler/jvmci/compilerToVM/ReprofileTest.java
+++ b/test/compiler/jvmci/compilerToVM/ReprofileTest.java
@@ -25,7 +25,7 @@
 /**
  * @test
  * @bug 8136421
- * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
+ * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64") & (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 3)
  * @library /testlibrary /test/lib /
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
@@ -34,33 +34,32 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
  *          jdk.vm.ci/jdk.vm.ci.meta
- * @ignore 8157861
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  * @build compiler.jvmci.compilerToVM.ReprofileTest
- * @run main ClassFileInstaller
- *      sun.hotspot.WhiteBox
- *      sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                   -Xmixed
+ *                   -Xmixed -Xbatch
  *                   compiler.jvmci.compilerToVM.ReprofileTest
  */
 
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
+import compiler.whitebox.CompilerWhiteBoxTest;
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.meta.ProfilingInfo;
+
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.meta.ProfilingInfo;
-import jdk.test.lib.Asserts;
-
 public class ReprofileTest {
 
     public static void main(String[] args) {
diff --git a/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java b/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java
index 1e86d3e..ba23d6a 100644
--- a/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java
@@ -34,11 +34,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.ResolveConstantInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@@ -47,17 +48,20 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.meta.ConstantPool;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodType;
 import java.util.HashMap;
 import java.util.Map;
-import jdk.test.lib.Asserts;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.meta.ConstantPool;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODHANDLE;
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODTYPE;
 
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.resolveConstantInPool} method
diff --git a/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java b/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java
index 62a1427..6d60354 100644
--- a/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java
@@ -35,11 +35,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.meta
  *          jdk.vm.ci/jdk.vm.ci.runtime
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.ResolveFieldInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.ResolveFieldInPoolTest
@@ -47,21 +48,23 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
+import jdk.internal.misc.Unsafe;
 import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.vm.ci.meta.ConstantPool;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
-import jdk.internal.misc.Unsafe;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
 
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.resolveFieldInPool} method
diff --git a/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java b/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java
index 4ac3c87..389f558 100644
--- a/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java
+++ b/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java
@@ -40,6 +40,7 @@
 
 package compiler.jvmci.compilerToVM;
 
+import compiler.jvmci.common.CTVMUtilities;
 import compiler.jvmci.common.testcases.AbstractClass;
 import compiler.jvmci.common.testcases.AbstractClassExtender;
 import compiler.jvmci.common.testcases.MultipleImplementer1;
@@ -49,15 +50,15 @@
 import compiler.jvmci.common.testcases.SingleImplementerInterface;
 import compiler.jvmci.common.testcases.SingleSubclass;
 import compiler.jvmci.common.testcases.SingleSubclassedClass;
-import compiler.jvmci.common.CTVMUtilities;
-import java.util.HashSet;
-import java.util.Set;
+import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.Utils;
-import jdk.internal.misc.Unsafe;
+
+import java.util.HashSet;
+import java.util.Set;
 
 public class ResolveMethodTest {
     private static final Unsafe UNSAFE = Utils.getUnsafe();
diff --git a/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java b/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java
index a284b5c..49a3cbd 100644
--- a/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java
@@ -35,11 +35,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.ResolvePossiblyCachedConstantInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.ResolvePossiblyCachedConstantInPoolTest
@@ -47,17 +48,19 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import jdk.test.lib.Asserts;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.meta.ConstantPool;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_STRING;
+
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.resolvePossiblyCachedConstantInPool} method
  */
diff --git a/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java b/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java
index 12055f5..26fc8f8 100644
--- a/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java
+++ b/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java
@@ -35,11 +35,12 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.meta
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.ResolveTypeInPoolTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@@ -48,17 +49,19 @@
 
 package compiler.jvmci.compilerToVM;
 
-import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
-import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator;
-import java.util.HashMap;
-import java.util.Map;
+import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
 import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.vm.ci.meta.ConstantPool;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS;
+
 /**
  * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.resolveTypeInPool} method
  */
diff --git a/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java b/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java
index 1ec2722..cbca06a 100644
--- a/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java
+++ b/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java
@@ -45,8 +45,8 @@
 
 package compiler.jvmci.compilerToVM;
 
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
 
 public class ShouldDebugNonSafepointsTest {
     private static final boolean EXPECTED = Boolean.getBoolean("compiler"
diff --git a/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java b/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java
index ebaf429..c86ff4d 100644
--- a/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java
+++ b/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java
@@ -33,11 +33,12 @@
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.ShouldInlineMethodTest
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
@@ -47,14 +48,15 @@
 package compiler.jvmci.compilerToVM;
 
 import compiler.jvmci.common.CTVMUtilities;
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Executable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import jdk.vm.ci.hotspot.CompilerToVMHelper;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
-import jdk.test.lib.Asserts;
-import sun.hotspot.WhiteBox;
 
 public class ShouldInlineMethodTest {
 
diff --git a/test/compiler/jvmci/errors/CodeInstallerTest.java b/test/compiler/jvmci/errors/CodeInstallerTest.java
index fd361bc..7e7dfcd 100644
--- a/test/compiler/jvmci/errors/CodeInstallerTest.java
+++ b/test/compiler/jvmci/errors/CodeInstallerTest.java
@@ -23,8 +23,6 @@
 
 package compiler.jvmci.errors;
 
-import java.lang.reflect.Method;
-
 import jdk.vm.ci.code.Architecture;
 import jdk.vm.ci.code.CodeCacheProvider;
 import jdk.vm.ci.code.Register;
@@ -41,9 +39,10 @@
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.runtime.JVMCI;
 import jdk.vm.ci.runtime.JVMCIBackend;
-
 import org.junit.Assert;
 
+import java.lang.reflect.Method;
+
 public class CodeInstallerTest {
 
     protected final Architecture arch;
diff --git a/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/test/compiler/jvmci/errors/TestInvalidCompilationResult.java
index bc2eae3..1f696df 100644
--- a/test/compiler/jvmci/errors/TestInvalidCompilationResult.java
+++ b/test/compiler/jvmci/errors/TestInvalidCompilationResult.java
@@ -51,7 +51,6 @@
 import jdk.vm.ci.hotspot.HotSpotConstant;
 import jdk.vm.ci.meta.Assumptions.Assumption;
 import jdk.vm.ci.meta.VMConstant;
-
 import org.junit.Test;
 
 /**
diff --git a/test/compiler/jvmci/errors/TestInvalidDebugInfo.java b/test/compiler/jvmci/errors/TestInvalidDebugInfo.java
index 7beb74f..e4a4d46 100644
--- a/test/compiler/jvmci/errors/TestInvalidDebugInfo.java
+++ b/test/compiler/jvmci/errors/TestInvalidDebugInfo.java
@@ -58,7 +58,6 @@
 import jdk.vm.ci.meta.ResolvedJavaType;
 import jdk.vm.ci.meta.Value;
 import jdk.vm.ci.meta.ValueKind;
-
 import org.junit.Test;
 
 /**
diff --git a/test/compiler/jvmci/errors/TestInvalidOopMap.java b/test/compiler/jvmci/errors/TestInvalidOopMap.java
index fdb056e..ad1a1d5 100644
--- a/test/compiler/jvmci/errors/TestInvalidOopMap.java
+++ b/test/compiler/jvmci/errors/TestInvalidOopMap.java
@@ -52,7 +52,6 @@
 import jdk.vm.ci.meta.Assumptions.Assumption;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.PlatformKind;
-
 import org.junit.Test;
 
 /**
diff --git a/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java b/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java
index 54d9518..bcfc52f 100644
--- a/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java
+++ b/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java
@@ -28,30 +28,33 @@
  * @library / /testlibrary
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
-            java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
  *          jdk.vm.ci/jdk.vm.ci.meta
  *          jdk.vm.ci/jdk.vm.ci.runtime
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.common.JVMCIHelpers
- *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
- * @run main jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/
- * @run main jdk.test.lib.FileInstaller ./JvmciNotifyBootstrapFinishedEventTest.config
+ *        compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
+ * @run driver jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/
+ * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyBootstrapFinishedEventTest.config
  *     ./META-INF/services/jdk.vm.ci.hotspot.services.HotSpotVMEventListener
- * @run main ClassFileInstaller
- *     compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler
- *     compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory
- *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
- *     jdk.test.lib.Asserts
- *     jdk.test.lib.Utils
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ * @run driver ClassFileInstaller
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener
+ *      compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
+ *      jdk.test.lib.Asserts
+ *      jdk.test.lib.Utils
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
  *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
  *     -Dcompiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap=false
  *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
  *     -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI
  *     -Dcompiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap=true
diff --git a/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java
index b6c47bf..6f5c83a 100644
--- a/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java
+++ b/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java
@@ -32,29 +32,37 @@
  *          java.base/jdk.internal.org.objectweb.asm.tree
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.vm.ci/jdk.vm.ci.code.site
  *          jdk.vm.ci/jdk.vm.ci.meta
  *          jdk.vm.ci/jdk.vm.ci.runtime
- * @ignore 8144964
+ *
  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.common.JVMCIHelpers
  *     compiler.jvmci.events.JvmciNotifyInstallEventTest
- * @run main jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/
- * @run main jdk.test.lib.FileInstaller ./JvmciNotifyInstallEventTest.config
- *     ./META-INF/services/jdk.vm.ci.hotspot.HotSpotVMEventListener
- * @run main ClassFileInstaller
- *     compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler
- *     compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory
+ * @run driver jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/
+ * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyInstallEventTest.config
+ *     ./META-INF/services/jdk.vm.ci.hotspot.services.HotSpotVMEventListener
+ * @run driver ClassFileInstaller
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult
+ *       compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener
+ *      compiler.jvmci.events.JvmciNotifyInstallEventTest
+ *      compiler.jvmci.common.CTVMUtilities
+ *      compiler.jvmci.common.testcases.SimpleClass
+ *      jdk.test.lib.Asserts
+ *      jdk.test.lib.Utils
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions
+ *     -Xbootclasspath/a:. -Xmixed
+ *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
+ *     -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
  *     compiler.jvmci.events.JvmciNotifyInstallEventTest
- *     compiler.jvmci.common.CTVMUtilities
- *     compiler.jvmci.common.testcases.SimpleClass
- *     jdk.test.lib.Asserts
- *     jdk.test.lib.Utils
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
  *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
  *     -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
  *     compiler.jvmci.events.JvmciNotifyInstallEventTest
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
  *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:JVMCINMethodSizeLimit=0
  *     -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
@@ -70,22 +78,23 @@
 import compiler.jvmci.common.CTVMUtilities;
 import compiler.jvmci.common.testcases.SimpleClass;
 import jdk.test.lib.Asserts;
-import java.lang.reflect.Method;
 import jdk.test.lib.Utils;
-import jdk.vm.ci.hotspot.HotSpotVMEventListener;
 import jdk.vm.ci.code.CompiledCode;
 import jdk.vm.ci.code.InstalledCode;
 import jdk.vm.ci.code.site.DataPatch;
 import jdk.vm.ci.code.site.Site;
-import jdk.vm.ci.meta.Assumptions.Assumption;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider;
 import jdk.vm.ci.hotspot.HotSpotCompiledCode;
 import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.hotspot.services.HotSpotVMEventListener;
+import jdk.vm.ci.meta.Assumptions.Assumption;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
 
-public class JvmciNotifyInstallEventTest implements HotSpotVMEventListener {
+import java.lang.reflect.Method;
+
+public class JvmciNotifyInstallEventTest extends HotSpotVMEventListener {
     private static final String METHOD_NAME = "testMethod";
     private static final boolean FAIL_ON_INIT = !Boolean.getBoolean(
             "compiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit");
diff --git a/test/compiler/jvmci/events/JvmciShutdownEventTest.java b/test/compiler/jvmci/events/JvmciShutdownEventTest.java
index 744ddc6..d01d278 100644
--- a/test/compiler/jvmci/events/JvmciShutdownEventTest.java
+++ b/test/compiler/jvmci/events/JvmciShutdownEventTest.java
@@ -31,21 +31,22 @@
  *          jdk.vm.ci/jdk.vm.ci.code
  *          jdk.vm.ci/jdk.vm.ci.meta
  *          jdk.vm.ci/jdk.vm.ci.runtime
+ *
  * @build compiler.jvmci.common.JVMCIHelpers
  *        compiler.jvmci.events.JvmciShutdownEventListener
  *        compiler.jvmci.events.JvmciShutdownEventTest
- * @run main jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/
- * @run main jdk.test.lib.FileInstaller ./JvmciShutdownEventTest.config
+ * @run driver jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/
+ * @run driver jdk.test.lib.FileInstaller ./JvmciShutdownEventTest.config
  *     ./META-INF/services/jdk.vm.ci.hotspot.services.HotSpotVMEventListener
- * @run main ClassFileInstaller
- *     compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler
- *     compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory
- *     compiler.jvmci.events.JvmciShutdownEventListener
+ * @run driver ClassFileInstaller
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult
+ *      compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener
+ *      compiler.jvmci.events.JvmciShutdownEventListener
  * @run main/othervm compiler.jvmci.events.JvmciShutdownEventTest
  */
 
- // as soon as CODETOOLS-7901589 fixed, '@run main/othervm' at L43 should be replaced w/ '@run driver'
-
 package compiler.jvmci.events;
 
 import jdk.test.lib.ExitCode;
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c b/test/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c
new file mode 100644
index 0000000..55572e6
--- /dev/null
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c
@@ -0,0 +1,196 @@
+/*
+ * 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.
+ *
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+
+#include "jni.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+jfloat JNICALL SS(jfloat f1, jfloat f2) {
+  return f1 + f2;
+}
+
+JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getFF(JNIEnv *env, jclass clazz) {
+  return (jlong)(intptr_t)SS;
+}
+
+JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1FF(JNIEnv *env, jclass clazz, jfloat a, jfloat b) {
+  return SS(a, b);
+}
+
+jfloat JNICALL SDILDS(jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return (jfloat)(a + b + c + d + e + f);
+}
+
+JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getSDILDS(JNIEnv *env, jclass clazz) {
+  return (jlong)(intptr_t)SDILDS;
+}
+
+JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1SDILDS(JNIEnv *env, jclass clazz,
+                                                                          jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return SDILDS(a, b, c, d, e, f);
+}
+
+jfloat JNICALL F32SDILDS(jfloat f00, jfloat f01, jfloat f02, jfloat f03, jfloat f04, jfloat f05, jfloat f06, jfloat f07,
+                         jfloat f08, jfloat f09, jfloat f0a, jfloat f0b, jfloat f0c, jfloat f0d, jfloat f0e, jfloat f0f,
+                         jfloat f10, jfloat f11, jfloat f12, jfloat f13, jfloat f14, jfloat f15, jfloat f16, jfloat f17,
+                         jfloat f18, jfloat f19, jfloat f1a, jfloat f1b, jfloat f1c, jfloat f1d, jfloat f1e, jfloat f1f,
+                         jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return (jfloat)(f00 + f01 + f02 + f03 + f04 + f05 + f06 + f07 +
+                  f08 + f09 + f0a + f0b + f0c + f0d + f0e + f0f +
+                  f10 + f11 + f12 + f13 + f14 + f15 + f16 + f17 +
+                  f18 + f19 + f1a + f1b + f1c + f1d + f1e + f1f +
+                  a +   b +   c +   d +   e + f);
+}
+
+JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getF32SDILDS(JNIEnv *env, jclass clazz) {
+  return (jlong)(intptr_t)F32SDILDS;
+}
+
+JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1F32SDILDS(JNIEnv *env, jclass clazz,
+                                                                             jfloat f00, jfloat f01, jfloat f02, jfloat f03,
+                                                                             jfloat f04, jfloat f05, jfloat f06, jfloat f07,
+                                                                             jfloat f08, jfloat f09, jfloat f0a, jfloat f0b,
+                                                                             jfloat f0c, jfloat f0d, jfloat f0e, jfloat f0f,
+                                                                             jfloat f10, jfloat f11, jfloat f12, jfloat f13,
+                                                                             jfloat f14, jfloat f15, jfloat f16, jfloat f17,
+                                                                             jfloat f18, jfloat f19, jfloat f1a, jfloat f1b,
+                                                                             jfloat f1c, jfloat f1d, jfloat f1e, jfloat f1f,
+                                                                             jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return F32SDILDS(f00, f01, f02, f03, f04, f05, f06, f07,
+                   f08, f09, f0a, f0b, f0c, f0d, f0e, f0f,
+                   f10, f11, f12, f13, f14, f15, f16, f17,
+                   f18, f19, f1a, f1b, f1c, f1d, f1e, f1f,
+                   a,   b,   c,   d,   e,   f);
+}
+
+
+jfloat JNICALL D32SDILDS(jdouble d00, jdouble d01, jdouble d02, jdouble d03, jdouble d04, jdouble d05, jdouble d06, jdouble d07,
+                         jdouble d08, jdouble d09, jdouble d0a, jdouble d0b, jdouble d0c, jdouble d0d, jdouble d0e, jdouble d0f,
+                         jdouble d10, jdouble d11, jdouble d12, jdouble d13, jdouble d14, jdouble d15, jdouble d16, jdouble d17,
+                         jdouble d18, jdouble d19, jdouble d1a, jdouble d1b, jdouble d1c, jdouble d1d, jdouble d1e, jdouble d1f,
+                         jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return (jfloat)(d00 + d01 + d02 + d03 + d04 + d05 + d06 + d07 +
+                  d08 + d09 + d0a + d0b + d0c + d0d + d0e + d0f +
+                  d10 + d11 + d12 + d13 + d14 + d15 + d16 + d17 +
+                  d18 + d19 + d1a + d1b + d1c + d1d + d1e + d1f +
+                  a +   b +   c +   d +   e + f);
+}
+
+JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getD32SDILDS(JNIEnv *env, jclass clazz) {
+  return (jlong)(intptr_t)D32SDILDS;
+}
+
+JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1D32SDILDS(JNIEnv *env, jclass clazz,
+                                                                             jdouble d00, jdouble d01, jdouble d02, jdouble d03,
+                                                                             jdouble d04, jdouble d05, jdouble d06, jdouble d07,
+                                                                             jdouble d08, jdouble d09, jdouble d0a, jdouble d0b,
+                                                                             jdouble d0c, jdouble d0d, jdouble d0e, jdouble d0f,
+                                                                             jdouble d10, jdouble d11, jdouble d12, jdouble d13,
+                                                                             jdouble d14, jdouble d15, jdouble d16, jdouble d17,
+                                                                             jdouble d18, jdouble d19, jdouble d1a, jdouble d1b,
+                                                                             jdouble d1c, jdouble d1d, jdouble d1e, jdouble d1f,
+                                                                             jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return D32SDILDS(d00, d01, d02, d03, d04, d05, d06, d07,
+                   d08, d09, d0a, d0b, d0c, d0d, d0e, d0f,
+                   d10, d11, d12, d13, d14, d15, d16, d17,
+                   d18, d19, d1a, d1b, d1c, d1d, d1e, d1f,
+                   a,   b,   c,   d,   e,   f);
+}
+
+
+jfloat JNICALL I32SDILDS(jint i00, jint i01, jint i02, jint i03, jint i04, jint i05, jint i06, jint i07,
+                         jint i08, jint i09, jint i0a, jint i0b, jint i0c, jint i0d, jint i0e, jint i0f,
+                         jint i10, jint i11, jint i12, jint i13, jint i14, jint i15, jint i16, jint i17,
+                         jint i18, jint i19, jint i1a, jint i1b, jint i1c, jint i1d, jint i1e, jint i1f,
+                         jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return (jfloat)(i00 + i01 + i02 + i03 + i04 + i05 + i06 + i07 +
+                  i08 + i09 + i0a + i0b + i0c + i0d + i0e + i0f +
+                  i10 + i11 + i12 + i13 + i14 + i15 + i16 + i17 +
+                  i18 + i19 + i1a + i1b + i1c + i1d + i1e + i1f +
+                  a +   b +   c +   d +   e + f);
+}
+
+JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getI32SDILDS(JNIEnv *env, jclass clazz) {
+  return (jlong) (intptr_t) I32SDILDS;
+}
+
+JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1I32SDILDS(JNIEnv *env, jclass clazz,
+                                                                             jint i00, jint i01, jint i02, jint i03,
+                                                                             jint i04, jint i05, jint i06, jint i07,
+                                                                             jint i08, jint i09, jint i0a, jint i0b,
+                                                                             jint i0c, jint i0d, jint i0e, jint i0f,
+                                                                             jint i10, jint i11, jint i12, jint i13,
+                                                                             jint i14, jint i15, jint i16, jint i17,
+                                                                             jint i18, jint i19, jint i1a, jint i1b,
+                                                                             jint i1c, jint i1d, jint i1e, jint i1f,
+                                                                             jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return I32SDILDS(i00, i01, i02, i03, i04, i05, i06, i07,
+                   i08, i09, i0a, i0b, i0c, i0d, i0e, i0f,
+                   i10, i11, i12, i13, i14, i15, i16, i17,
+                   i18, i19, i1a, i1b, i1c, i1d, i1e, i1f,
+                   a,   b,   c,   d,   e,   f);
+}
+
+jfloat JNICALL L32SDILDS(jlong l00, jlong l01, jlong l02, jlong l03, jlong l04, jlong l05, jlong l06, jlong l07,
+                         jlong l08, jlong l09, jlong l0a, jlong l0b, jlong l0c, jlong l0d, jlong l0e, jlong l0f,
+                         jlong l10, jlong l11, jlong l12, jlong l13, jlong l14, jlong l15, jlong l16, jlong l17,
+                         jlong l18, jlong l19, jlong l1a, jlong l1b, jlong l1c, jlong l1d, jlong l1e, jlong l1f,
+                         jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return (jfloat)(l00 + l01 + l02 + l03 + l04 + l05 + l06 + l07 +
+                  l08 + l09 + l0a + l0b + l0c + l0d + l0e + l0f +
+                  l10 + l11 + l12 + l13 + l14 + l15 + l16 + l17 +
+                  l18 + l19 + l1a + l1b + l1c + l1d + l1e + l1f +
+                  a +   b +   c +   d +   e + f);
+}
+
+JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getL32SDILDS(JNIEnv *env, jclass clazz) {
+  return (jlong)(intptr_t)L32SDILDS;
+}
+
+JNIEXPORT jfloat JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1L32SDILDS(JNIEnv *env, jclass clazz,
+                                                                               jlong l00, jlong l01, jlong l02, jlong l03,
+                                                                               jlong l04, jlong l05, jlong l06, jlong l07,
+                                                                               jlong l08, jlong l09, jlong l0a, jlong l0b,
+                                                                               jlong l0c, jlong l0d, jlong l0e, jlong l0f,
+                                                                               jlong l10, jlong l11, jlong l12, jlong l13,
+                                                                               jlong l14, jlong l15, jlong l16, jlong l17,
+                                                                               jlong l18, jlong l19, jlong l1a, jlong l1b,
+                                                                               jlong l1c, jlong l1d, jlong l1e, jlong l1f,
+                                                                               jfloat a, jdouble b, jint c, jlong d, jdouble e, jfloat f) {
+  return L32SDILDS(l00, l01, l02, l03, l04, l05, l06, l07,
+                   l08, l09, l0a, l0b, l0c, l0d, l0e, l0f,
+                   l10, l11, l12, l13, l14, l15, l16, l17,
+                   l18, l19, l1a, l1b, l1c, l1d, l1e, l1f,
+                   a,   b,   c,   d,   e,   f);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInstallationTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInstallationTest.java
index 9ae9d83..62d0e99 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInstallationTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInstallationTest.java
@@ -22,10 +22,6 @@
  */
 package jdk.vm.ci.code.test;
 
-import java.lang.reflect.Method;
-
-import org.junit.Assert;
-
 import jdk.vm.ci.amd64.AMD64;
 import jdk.vm.ci.code.Architecture;
 import jdk.vm.ci.code.CodeCacheProvider;
@@ -41,6 +37,9 @@
 import jdk.vm.ci.runtime.JVMCI;
 import jdk.vm.ci.runtime.JVMCIBackend;
 import jdk.vm.ci.sparc.SPARC;
+import org.junit.Assert;
+
+import java.lang.reflect.Method;
 
 /**
  * Base class for code installation tests.
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java
index bedb1bb..c2e3edf 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java
@@ -38,13 +38,12 @@
 
 package jdk.vm.ci.code.test;
 
-import org.junit.Assume;
-import org.junit.Test;
-
 import jdk.vm.ci.code.Register;
 import jdk.vm.ci.code.site.DataSectionReference;
 import jdk.vm.ci.hotspot.HotSpotConstant;
 import jdk.vm.ci.meta.ResolvedJavaType;
+import org.junit.Assume;
+import org.junit.Test;
 
 /**
  * Test code installation with data patches.
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DebugInfoTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DebugInfoTest.java
index 584249c..424c6be 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DebugInfoTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DebugInfoTest.java
@@ -22,8 +22,6 @@
  */
 package jdk.vm.ci.code.test;
 
-import java.lang.reflect.Method;
-
 import jdk.vm.ci.code.BytecodeFrame;
 import jdk.vm.ci.code.DebugInfo;
 import jdk.vm.ci.code.Location;
@@ -33,6 +31,8 @@
 import jdk.vm.ci.meta.JavaValue;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 
+import java.lang.reflect.Method;
+
 /**
  * Test code installation with debug information.
  */
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java
index 2425cbc..db19e22 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java
@@ -38,14 +38,13 @@
 
 package jdk.vm.ci.code.test;
 
-import org.junit.Assert;
-import org.junit.Test;
-
 import jdk.vm.ci.code.BytecodeFrame;
 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.JavaValue;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
+import org.junit.Assert;
+import org.junit.Test;
 
 public class InterpreterFrameSizeTest extends CodeInstallationTest {
 
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java
index b9e5625..9caed42 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java
@@ -39,13 +39,12 @@
 
 package jdk.vm.ci.code.test;
 
-import org.junit.Test;
-
 import jdk.vm.ci.code.Location;
 import jdk.vm.ci.code.Register;
 import jdk.vm.ci.common.JVMCIError;
 import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.JavaKind;
+import org.junit.Test;
 
 public class MaxOopMapStackOffsetTest extends DebugInfoTest {
 
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java
new file mode 100644
index 0000000..c7bb205
--- /dev/null
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java
@@ -0,0 +1,241 @@
+/*
+ * 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
+ * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64"
+ * @library /test/lib /testlibrary /
+ * @modules jdk.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.vm.ci/jdk.vm.ci.code.site
+ *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.vm.ci/jdk.vm.ci.runtime
+ *          jdk.vm.ci/jdk.vm.ci.common
+ *          jdk.vm.ci/jdk.vm.ci.amd64
+ *          jdk.vm.ci/jdk.vm.ci.sparc
+ * @compile CodeInstallationTest.java TestHotSpotVMConfig.java NativeCallTest.java TestAssembler.java sparc/SPARCTestAssembler.java amd64/AMD64TestAssembler.java
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI  -Xbootclasspath/a:. jdk.vm.ci.code.test.NativeCallTest
+ */
+package jdk.vm.ci.code.test;
+
+import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import jdk.vm.ci.code.CallingConvention;
+import jdk.vm.ci.code.RegisterValue;
+import jdk.vm.ci.meta.JavaType;
+
+public class NativeCallTest extends CodeInstallationTest {
+
+    @BeforeClass
+    public static void beforeClass() {
+        System.loadLibrary("NativeCallTest");
+    }
+
+    @Test
+    public void testFF() {
+        float a = 1.2345678f;
+        float b = 8.7654321f;
+        test("FF", getFF(), float.class, new Class<?>[]{float.class, float.class}, new Object[]{a, b});
+    }
+
+    @Test
+    public void testSDILDS() {
+        float a = 1.2345678f;
+        double b = 3.212434;
+        int c = 43921652;
+        long d = 412435326;
+        double e = .31212333;
+        float f = 8.7654321f;
+        Class<?>[] argClazz = new Class[]{float.class, double.class, int.class, long.class, double.class,
+                        float.class};
+        test("SDILDS", getSDILDS(), float.class, argClazz, new Object[]{a, b, c, d, e, f});
+    }
+
+    @Test
+    public void testF32SDILDS() {
+        int sCount = 32;
+        Object[] remainingArgs = new Object[]{ // Pairs of <Object>, <Class>
+                        1.2345678F, float.class,
+                        3.212434D, double.class,
+                        43921652, int.class,
+                        0xCAFEBABEDEADBEEFL, long.class,
+                        .31212333D, double.class,
+                        8.7654321F, float.class
+        };
+        Class<?>[] argClazz = new Class[sCount + remainingArgs.length / 2];
+        Object[] argValues = new Object[sCount + remainingArgs.length / 2];
+        for (int i = 0; i < sCount; i++) {
+            argValues[i] = (float) i;
+            argClazz[i] = float.class;
+        }
+        for (int i = 0; i < remainingArgs.length; i += 2) {
+            argValues[sCount + i / 2] = remainingArgs[i + 0];
+            argClazz[sCount + i / 2] = (Class<?>) remainingArgs[i + 1];
+        }
+        test("F32SDILDS", getF32SDILDS(), float.class, argClazz, argValues);
+    }
+
+    @Test
+    public void testI32SDILDS() {
+        int sCount = 32;
+        Object[] remainingArgs = new Object[]{ // Pairs of <Object>, <Class>
+                        1.2345678F, float.class,
+                        3.212434D, double.class,
+                        43921652, int.class,
+                        0xCAFEBABEDEADBEEFL, long.class,
+                        .31212333D, double.class,
+                        8.7654321F, float.class
+        };
+        Class<?>[] argClazz = new Class[sCount + remainingArgs.length / 2];
+        Object[] argValues = new Object[sCount + remainingArgs.length / 2];
+        for (int i = 0; i < sCount; i++) {
+            argValues[i] = i;
+            argClazz[i] = int.class;
+        }
+        for (int i = 0; i < remainingArgs.length; i += 2) {
+            argValues[sCount + i / 2] = remainingArgs[i + 0];
+            argClazz[sCount + i / 2] = (Class<?>) remainingArgs[i + 1];
+        }
+        test("I32SDILDS", getI32SDILDS(), float.class, argClazz, argValues);
+    }
+
+    public void test(String name, long addr, Class<?> returnClazz, Class<?>[] types, Object[] values) {
+        try {
+            test(asm -> {
+                JavaType[] argTypes = new JavaType[types.length];
+                int i = 0;
+                for (Class<?> clazz : types) {
+                    argTypes[i++] = metaAccess.lookupJavaType(clazz);
+                }
+                JavaType returnType = metaAccess.lookupJavaType(returnClazz);
+                CallingConvention cc = codeCache.getRegisterConfig().getCallingConvention(NativeCall, returnType, argTypes, asm.valueKindFactory);
+                asm.emitCallPrologue(cc, values);
+                asm.emitCall(addr);
+                asm.emitCallEpilogue(cc);
+                asm.emitFloatRet(((RegisterValue) cc.getReturn()).getRegister());
+            }, getMethod(name, types), values);
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw e;
+        }
+    }
+
+    public static native long getFF();
+
+    public static native float _FF(float a, float b);
+
+    public static float FF(float a, float b) {
+        return _FF(a, b);
+    }
+
+    public static native long getSDILDS();
+
+    public static native float _SDILDS(float a, double b, int c, long d, double e, float f);
+
+    public static float SDILDS(float a, double b, int c, long d, double e, float f) {
+        return _SDILDS(a, b, c, d, e, f);
+    }
+
+    public static native long getF32SDILDS();
+
+    public static native float _F32SDILDS(float f00, float f01, float f02, float f03, float f04, float f05, float f06, float f07,
+                    float f08, float f09, float f0a, float f0b, float f0c, float f0d, float f0e, float f0f,
+                    float f10, float f11, float f12, float f13, float f14, float f15, float f16, float f17,
+                    float f18, float f19, float f1a, float f1b, float f1c, float f1d, float f1e, float f1f,
+                    float a, double b, int c, long d, double e, float f);
+
+    public static float F32SDILDS(float f00, float f01, float f02, float f03, float f04, float f05, float f06, float f07,
+                    float f08, float f09, float f0a, float f0b, float f0c, float f0d, float f0e, float f0f,
+                    float f10, float f11, float f12, float f13, float f14, float f15, float f16, float f17,
+                    float f18, float f19, float f1a, float f1b, float f1c, float f1d, float f1e, float f1f,
+                    float a, double b, int c, long d, double e, float f) {
+        return _F32SDILDS(f00, f01, f02, f03, f04, f05, f06, f07,
+                        f08, f09, f0a, f0b, f0c, f0d, f0e, f0f,
+                        f10, f11, f12, f13, f14, f15, f16, f17,
+                        f18, f19, f1a, f1b, f1c, f1d, f1e, f1f,
+                        a, b, c, d, e, f);
+    }
+
+    public static native long getD32SDILDS();
+
+    public static native float _D32SDILDS(double d00, double d01, double d02, double d03, double d04, double d05, double d06, double d07,
+                    double d08, double d09, double d0a, double d0b, double d0c, double d0d, double d0e, double d0f,
+                    double d10, double d11, double d12, double d13, double d14, double d15, double d16, double d17,
+                    double d18, double d19, double d1a, double d1b, double d1c, double d1d, double d1e, double d1f,
+                    float a, double b, int c, long d, double e, float f);
+
+    public static float D32SDILDS(double d00, double d01, double d02, double d03, double d04, double d05, double d06, double d07,
+                    double d08, double d09, double d0a, double d0b, double d0c, double d0d, double d0e, double d0f,
+                    double d10, double d11, double d12, double d13, double d14, double d15, double d16, double d17,
+                    double d18, double d19, double d1a, double d1b, double d1c, double d1d, double d1e, double d1f,
+                    float a, double b, int c, long d, double e, float f) {
+        return _D32SDILDS(d00, d01, d02, d03, d04, d05, d06, d07,
+                        d08, d09, d0a, d0b, d0c, d0d, d0e, d0d,
+                        d10, d11, d12, d13, d14, d15, d16, d17,
+                        d18, d19, d1a, d1b, d1c, d1d, d1e, d1f,
+                        a, b, c, d, e, f);
+    }
+
+    public static native long getI32SDILDS();
+
+    public static native float _I32SDILDS(int i00, int i01, int i02, int i03, int i04, int i05, int i06, int i07,
+                    int i08, int i09, int i0a, int i0b, int i0c, int i0d, int i0e, int i0f,
+                    int i10, int i11, int i12, int i13, int i14, int i15, int i16, int i17,
+                    int i18, int i19, int i1a, int i1b, int i1c, int i1d, int i1e, int i1f,
+                    float a, double b, int c, long d, double e, float f);
+
+    public static float I32SDILDS(int i00, int i01, int i02, int i03, int i04, int i05, int i06, int i07,
+                    int i08, int i09, int i0a, int i0b, int i0c, int i0d, int i0e, int i0f,
+                    int i10, int i11, int i12, int i13, int i14, int i15, int i16, int i17,
+                    int i18, int i19, int i1a, int i1b, int i1c, int i1d, int i1e, int i1f,
+                    float a, double b, int c, long d, double e, float f) {
+        return _I32SDILDS(i00, i01, i02, i03, i04, i05, i06, i07,
+                        i08, i09, i0a, i0b, i0c, i0d, i0e, i0f,
+                        i10, i11, i12, i13, i14, i15, i16, i17,
+                        i18, i19, i1a, i1b, i1c, i1d, i1e, i1f,
+                        a, b, c, d, e, f);
+    }
+
+    public static native long getL32SDILDS();
+
+    public static native float _L32SDILDS(long l00, long l01, long l02, long l03, long l04, long l05, long l06, long l07,
+                    long l08, long l09, long l0a, long l0b, long l0c, long l0d, long l0e, long l0f,
+                    long l10, long l11, long l12, long l13, long l14, long l15, long l16, long l17,
+                    long l18, long l19, long l1a, long l1b, long l1c, long l1d, long l1e, long l1f,
+                    float a, double b, int c, long d, double e, float f);
+
+    public static float L32SDILDS(long l00, long l01, long l02, long l03, long l04, long l05, long l06, long l07,
+                    long l08, long l09, long l0a, long l0b, long l0c, long l0d, long l0e, long l0f,
+                    long l10, long l11, long l12, long l13, long l14, long l15, long l16, long l17,
+                    long l18, long l19, long l1a, long l1b, long l1c, long l1d, long l1e, long l1f,
+                    float a, double b, int c, long d, double e, float f) {
+        return _L32SDILDS(l00, l01, l02, l03, l04, l05, l06, l07,
+                        l08, l09, l0a, l0b, l0c, l0d, l0e, l0f,
+                        l10, l11, l12, l13, l14, l15, l16, l17,
+                        l18, l19, l1a, l1b, l1c, l1d, l1e, l1f,
+                        a, b, c, d, e, f);
+    }
+}
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
index 57496ed..1f69fc8 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
@@ -38,9 +38,8 @@
 
 package jdk.vm.ci.code.test;
 
-import org.junit.Test;
-
 import jdk.vm.ci.code.Register;
+import org.junit.Test;
 
 /**
  * Test simple code installation.
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java
index f44c480..85c7b45 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java
@@ -38,15 +38,14 @@
 
 package jdk.vm.ci.code.test;
 
-import org.junit.Assume;
-import org.junit.Test;
-
 import jdk.vm.ci.code.Register;
 import jdk.vm.ci.hotspot.HotSpotConstant;
 import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.ResolvedJavaType;
 import jdk.vm.ci.meta.Value;
+import org.junit.Assume;
+import org.junit.Test;
 
 public class SimpleDebugInfoTest extends DebugInfoTest {
 
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java
index 44b1d4b..016b2ee 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java
@@ -23,15 +23,12 @@
 
 package jdk.vm.ci.code.test;
 
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.ArrayList;
-import java.util.Arrays;
-
+import jdk.vm.ci.code.CallingConvention;
 import jdk.vm.ci.code.CodeCacheProvider;
 import jdk.vm.ci.code.DebugInfo;
 import jdk.vm.ci.code.Register;
 import jdk.vm.ci.code.StackSlot;
+import jdk.vm.ci.code.ValueKindFactory;
 import jdk.vm.ci.code.site.Call;
 import jdk.vm.ci.code.site.ConstantReference;
 import jdk.vm.ci.code.site.DataPatch;
@@ -46,13 +43,19 @@
 import jdk.vm.ci.hotspot.HotSpotCompiledNmethod;
 import jdk.vm.ci.hotspot.HotSpotConstant;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.meta.AllocatableValue;
 import jdk.vm.ci.meta.Assumptions.Assumption;
 import jdk.vm.ci.meta.InvokeTarget;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.PlatformKind;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ValueKind;
 import jdk.vm.ci.meta.VMConstant;
+import jdk.vm.ci.meta.ValueKind;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.ArrayList;
+import java.util.Arrays;
 
 /**
  * Simple assembler used by the code installation tests.
@@ -145,6 +148,11 @@
     public abstract StackSlot emitFloatToStack(Register a);
 
     /**
+     * Emit code to store a double-precision float from a register to a new stack slot.
+     */
+    public abstract StackSlot emitDoubleToStack(Register a);
+
+    /**
      * Emit code to store a wide pointer from a register to a new stack slot.
      */
     public abstract StackSlot emitPointerToStack(Register a);
@@ -165,6 +173,11 @@
     public abstract void emitIntRet(Register a);
 
     /**
+     * Emit code to return from a function, returning a single precision float.
+     */
+    public abstract void emitFloatRet(Register a);
+
+    /**
      * Emit code to return from a function, returning a wide oop pointer.
      */
     public abstract void emitPointerRet(Register a);
@@ -193,7 +206,13 @@
 
     private StackSlot deoptRescue;
 
-    private static class TestValueKind extends ValueKind<TestValueKind> {
+    public ValueKindFactory<TestValueKind> valueKindFactory = new ValueKindFactory<TestAssembler.TestValueKind>() {
+        public TestValueKind getValueKind(JavaKind javaKind) {
+            return (TestValueKind) TestAssembler.this.getValueKind(javaKind);
+        }
+    };
+
+    static class TestValueKind extends ValueKind<TestValueKind> {
 
         TestValueKind(PlatformKind kind) {
             super(kind);
@@ -340,6 +359,11 @@
             data.putFloat(f);
         }
 
+        public void emitDouble(double f) {
+            ensureSize(data.position() + 8);
+            data.putDouble(f);
+        }
+
         public void align(int alignment) {
             int pos = data.position();
             int misaligned = pos % alignment;
@@ -353,4 +377,27 @@
             return Arrays.copyOf(data.array(), data.position());
         }
     }
+
+    /**
+     * Loads a primitive into the Allocatable <code>av</code>. Implementors may only implement
+     * primitive types.
+     */
+    public abstract void emitLoad(AllocatableValue av, Object prim);
+
+    /**
+     * Emit a call to a fixed address <code>addr</code>
+     */
+    public abstract void emitCall(long addr);
+
+    /**
+     * Emit code which is necessary to call a method with {@link CallingConvention} <code>cc</code>
+     * and arguments <coe>prim</code>.
+     */
+    public abstract void emitCallPrologue(CallingConvention cc, Object... prim);
+
+    /**
+     * Emit code which is necessary after calling a method with CallingConvention <code>cc</code>.
+     */
+    public abstract void emitCallEpilogue(CallingConvention cc);
+
 }
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java
index d08f612..bee4f8d 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java
@@ -38,12 +38,6 @@
 
 package jdk.vm.ci.code.test;
 
-import java.util.ArrayList;
-import java.util.Objects;
-
-import org.junit.Assert;
-import org.junit.Test;
-
 import jdk.vm.ci.code.Register;
 import jdk.vm.ci.code.VirtualObject;
 import jdk.vm.ci.hotspot.HotSpotConstant;
@@ -52,6 +46,11 @@
 import jdk.vm.ci.meta.JavaValue;
 import jdk.vm.ci.meta.ResolvedJavaField;
 import jdk.vm.ci.meta.ResolvedJavaType;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.Objects;
 
 public class VirtualObjectDebugInfoTest extends DebugInfoTest {
 
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java
index 078af12..fd1eff6 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java
@@ -23,11 +23,15 @@
 
 package jdk.vm.ci.code.test.amd64;
 
+import static jdk.vm.ci.amd64.AMD64.xmm0;
+
 import jdk.vm.ci.amd64.AMD64;
 import jdk.vm.ci.amd64.AMD64Kind;
+import jdk.vm.ci.code.CallingConvention;
 import jdk.vm.ci.code.CodeCacheProvider;
 import jdk.vm.ci.code.DebugInfo;
 import jdk.vm.ci.code.Register;
+import jdk.vm.ci.code.RegisterValue;
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.code.site.ConstantReference;
 import jdk.vm.ci.code.site.DataSectionReference;
@@ -36,11 +40,15 @@
 import jdk.vm.ci.hotspot.HotSpotCallingConventionType;
 import jdk.vm.ci.hotspot.HotSpotConstant;
 import jdk.vm.ci.hotspot.HotSpotForeignCallTarget;
+import jdk.vm.ci.meta.AllocatableValue;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.VMConstant;
 
 public class AMD64TestAssembler extends TestAssembler {
 
+    private static final Register scratchRegister = AMD64.r12;
+    private static final Register doubleScratch = AMD64.xmm15;
+
     public AMD64TestAssembler(CodeCacheProvider codeCache, TestHotSpotVMConfig config) {
         super(codeCache, config, 16, 16, AMD64Kind.DWORD, AMD64.rax, AMD64.rcx, AMD64.rdi, AMD64.r8, AMD64.r9, AMD64.r10);
     }
@@ -116,6 +124,10 @@
     @Override
     public Register emitLoadInt(int c) {
         Register ret = newRegister();
+        return emitLoadInt(ret, c);
+    }
+
+    public Register emitLoadInt(Register ret, int c) {
         emitREX(false, 0, 0, ret.encoding);
         code.emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32
         code.emitInt(c);
@@ -125,6 +137,10 @@
     @Override
     public Register emitLoadLong(long c) {
         Register ret = newRegister();
+        return emitLoadLong(ret, c);
+    }
+
+    public Register emitLoadLong(Register ret, long c) {
         emitREX(true, 0, 0, ret.encoding);
         code.emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r64, imm64
         code.emitLong(c);
@@ -133,12 +149,16 @@
 
     @Override
     public Register emitLoadFloat(float c) {
+        Register ret = AMD64.xmm0;
+        return emitLoadFloat(ret, c);
+    }
+
+    public Register emitLoadFloat(Register ret, float c) {
         DataSectionReference ref = new DataSectionReference();
         ref.setOffset(data.position());
         data.emitFloat(c);
 
         recordDataPatchInCode(ref);
-        Register ret = AMD64.xmm0;
         emitREX(false, ret.encoding, 0, 0);
         code.emitByte(0xF3);
         code.emitByte(0x0F);
@@ -148,6 +168,26 @@
         return ret;
     }
 
+    public Register emitLoadDouble(double c) {
+        Register ret = AMD64.xmm0;
+        return emitLoadDouble(ret, c);
+    }
+
+    public Register emitLoadDouble(Register ret, double c) {
+        DataSectionReference ref = new DataSectionReference();
+        ref.setOffset(data.position());
+        data.emitDouble(c);
+
+        recordDataPatchInCode(ref);
+        emitREX(false, ret.encoding, 0, 0);
+        code.emitByte(0xF2);
+        code.emitByte(0x0F);
+        code.emitByte(0x10);                               // MOVSD xmm1, xmm2/m32
+        code.emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // xmm, [rip+offset]
+        code.emitInt(0xDEADDEAD);
+        return ret;
+    }
+
     @Override
     public Register emitLoadPointer(HotSpotConstant c) {
         recordDataPatchInCode(new ConstantReference((VMConstant) c));
@@ -189,31 +229,67 @@
         return ret;
     }
 
+    private int getAdjustedOffset(StackSlot ret) {
+        if (ret.getRawOffset() < 0) {
+            return ret.getRawOffset() + 16;
+        } else {
+            return -(frameSize - ret.getRawOffset()) + 16;
+        }
+    }
+
     @Override
     public StackSlot emitIntToStack(Register a) {
         StackSlot ret = newStackSlot(AMD64Kind.DWORD);
+        return emitIntToStack(ret, a);
+    }
+
+    public StackSlot emitIntToStack(StackSlot ret, Register a) {
         // MOV r/m32,r32
-        emitModRMMemory(false, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16);
+        emitModRMMemory(false, 0x89, a.encoding, AMD64.rbp.encoding, getAdjustedOffset(ret));
         return ret;
     }
 
     @Override
     public StackSlot emitLongToStack(Register a) {
         StackSlot ret = newStackSlot(AMD64Kind.QWORD);
+        return emitLongToStack(ret, a);
+    }
+
+    public StackSlot emitLongToStack(StackSlot ret, Register a) {
         // MOV r/m64,r64
-        emitModRMMemory(true, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16);
+        emitModRMMemory(true, 0x89, a.encoding, AMD64.rbp.encoding, getAdjustedOffset(ret));
         return ret;
     }
 
     @Override
     public StackSlot emitFloatToStack(Register a) {
         StackSlot ret = newStackSlot(AMD64Kind.SINGLE);
+        return emitFloatToStack(ret, a);
+    }
+
+    public StackSlot emitFloatToStack(StackSlot ret, Register a) {
         emitREX(false, a.encoding, 0, 0);
         code.emitByte(0xF3);
         code.emitByte(0x0F);
         code.emitByte(0x11);                               // MOVSS xmm2/m32, xmm1
         code.emitByte(0x85 | ((a.encoding & 0x7) << 3));   // [rbp+offset]
-        code.emitInt(ret.getRawOffset() + 16);
+        code.emitInt(getAdjustedOffset(ret));
+        return ret;
+    }
+
+    @Override
+    public StackSlot emitDoubleToStack(Register a) {
+        StackSlot ret = newStackSlot(AMD64Kind.DOUBLE);
+        return emitDoubleToStack(ret, a);
+    }
+
+    public StackSlot emitDoubleToStack(StackSlot ret, Register a) {
+        emitREX(false, a.encoding, 0, 0);
+        code.emitByte(0xF2);
+        code.emitByte(0x0F);
+        code.emitByte(0x11);                               // MOVSD xmm2/m32, xmm1
+        code.emitByte(0x85 | ((a.encoding & 0x7) << 3));   // [rbp+offset]
+        code.emitInt(getAdjustedOffset(ret));
         return ret;
     }
 
@@ -269,6 +345,14 @@
     }
 
     @Override
+    public void emitFloatRet(Register a) {
+        assert a == xmm0 : "Unimplemented move " + a;
+        emitMove(true, AMD64.rsp, AMD64.rbp);      // MOV rsp, rbp
+        code.emitByte(0x58 | AMD64.rbp.encoding);  // POP rbp
+        code.emitByte(0xC3);                       // RET
+    }
+
+    @Override
     public void emitPointerRet(Register a) {
         emitMove(true, AMD64.rax, a);              // MOV rax, ...
         emitMove(true, AMD64.rsp, AMD64.rbp);      // MOV rsp, rbp
@@ -285,4 +369,65 @@
         code.emitByte(0x25);
         code.emitInt(0);
     }
+
+    @Override
+    public void emitLoad(AllocatableValue av, Object prim) {
+        if (av instanceof RegisterValue) {
+            Register reg = ((RegisterValue) av).getRegister();
+            if (prim instanceof Float) {
+                emitLoadFloat(reg, (Float) prim);
+            } else if (prim instanceof Double) {
+                emitLoadDouble(reg, (Double) prim);
+            } else if (prim instanceof Integer) {
+                emitLoadInt(reg, (Integer) prim);
+            } else if (prim instanceof Long) {
+                emitLoadLong(reg, (Long) prim);
+            }
+        } else if (av instanceof StackSlot) {
+            StackSlot slot = (StackSlot) av;
+            if (prim instanceof Float) {
+                emitFloatToStack(slot, emitLoadFloat(doubleScratch, (Float) prim));
+            } else if (prim instanceof Double) {
+                emitDoubleToStack(slot, emitLoadDouble(doubleScratch, (Double) prim));
+            } else if (prim instanceof Integer) {
+                emitIntToStack(slot, emitLoadInt(scratchRegister, (Integer) prim));
+            } else if (prim instanceof Long) {
+                emitLongToStack(slot, emitLoadLong(scratchRegister, (Long) prim));
+            } else {
+                assert false : "Unimplemented";
+            }
+        } else {
+            throw new IllegalArgumentException("Unknown value " + av);
+        }
+    }
+
+    @Override
+    public void emitCallPrologue(CallingConvention cc, Object... prim) {
+        emitGrowStack(cc.getStackSize());
+        frameSize += cc.getStackSize();
+        AllocatableValue[] args = cc.getArguments();
+        // Do the emission in reverse, this avoids register collisons of xmm0 - which is used a
+        // scratch register when putting arguments on the stack.
+        for (int i = args.length - 1; i >= 0; i--) {
+            emitLoad(args[i], prim[i]);
+        }
+    }
+
+    @Override
+    public void emitCall(long addr) {
+        Register target = emitLoadLong(addr);
+        code.emitByte(0xFF); // CALL r/m64
+        int enc = target.encoding;
+        if (enc >= 8) {
+            code.emitByte(0x41);
+            enc -= 8;
+        }
+        code.emitByte(0xD0 | enc);
+    }
+
+    @Override
+    public void emitCallEpilogue(CallingConvention cc) {
+        emitGrowStack(-cc.getStackSize());
+        frameSize -= cc.getStackSize();
+    }
 }
diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/sparc/SPARCTestAssembler.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/sparc/SPARCTestAssembler.java
index 26826fa..0ac920a 100644
--- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/sparc/SPARCTestAssembler.java
+++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/sparc/SPARCTestAssembler.java
@@ -23,9 +23,12 @@
 
 package jdk.vm.ci.code.test.sparc;
 
+import jdk.vm.ci.code.CallingConvention;
 import jdk.vm.ci.code.CodeCacheProvider;
 import jdk.vm.ci.code.DebugInfo;
 import jdk.vm.ci.code.Register;
+import jdk.vm.ci.code.Register.RegisterCategory;
+import jdk.vm.ci.code.RegisterValue;
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.code.site.ConstantReference;
 import jdk.vm.ci.code.site.DataSectionReference;
@@ -36,6 +39,7 @@
 import jdk.vm.ci.hotspot.HotSpotConstant;
 import jdk.vm.ci.hotspot.HotSpotForeignCallTarget;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.meta.AllocatableValue;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.VMConstant;
 import jdk.vm.ci.sparc.SPARC;
@@ -44,6 +48,9 @@
 public class SPARCTestAssembler extends TestAssembler {
 
     private static final int MASK13 = (1 << 13) - 1;
+    private static final Register scratchRegister = SPARC.g5;
+    private static final Register floatScratch = SPARC.f30;
+    private static final Register doubleScratch = SPARC.d62;
 
     public SPARCTestAssembler(CodeCacheProvider codeCache, TestHotSpotVMConfig config) {
         super(codeCache, config, 0, 16, SPARCKind.WORD, SPARC.l0, SPARC.l1, SPARC.l2, SPARC.l3, SPARC.l4, SPARC.l5, SPARC.l6, SPARC.l7);
@@ -136,7 +143,7 @@
         return ret;
     }
 
-    private void loadIntToRegister(int c, Register ret) {
+    private Register loadIntToRegister(int c, Register ret) {
         int hi = c >>> 10;
         int lo = c & ((1 << 10) - 1);
         if (hi == 0) {
@@ -147,6 +154,7 @@
                 emitOp3(0b10, ret, 0b000010, ret, lo);  // OR ret, lo, ret
             }
         }
+        return ret;
     }
 
     @Override
@@ -164,12 +172,13 @@
         emitLoadPointerToRegister(ref, ret);
     }
 
-    public void emitLoadLongToRegister(long c, Register r) {
+    public Register emitLoadLongToRegister(long c, Register r) {
         if ((c & 0xFFFF_FFFFL) == c) {
             loadIntToRegister((int) c, r);
         } else {
             loadLongToRegister(c, r);
         }
+        return r;
     }
 
     private void emitPatchableSethi(Register ret, boolean wide) {
@@ -185,16 +194,39 @@
 
     @Override
     public Register emitLoadFloat(float c) {
+        return emitLoadFloat(SPARC.f0, c);
+    }
+
+    public Register emitLoadFloat(Register reg, float c) {
+        return emitLoadFloat(reg, c, newRegister());
+    }
+
+    public Register emitLoadFloat(Register reg, float c, Register scratch) {
         DataSectionReference ref = new DataSectionReference();
         data.align(4);
         ref.setOffset(data.position());
         data.emitFloat(c);
 
-        Register ptr = newRegister();
         recordDataPatchInCode(ref);
-        emitPatchableSethi(ptr, true);
-        emitOp3(0b11, SPARC.f0, 0b100000, ptr, 0); // LDF [ptr+0], f0
-        return SPARC.f0;
+        emitPatchableSethi(scratch, true);
+        emitOp3(0b11, reg, 0b100000, scratch, 0); // LDF [scratch+0], f0
+        return reg;
+    }
+
+    public Register emitLoadDouble(Register reg, double c) {
+        return emitLoadDouble(reg, c, newRegister());
+    }
+
+    public Register emitLoadDouble(Register reg, double c, Register scratch) {
+        DataSectionReference ref = new DataSectionReference();
+        data.align(8);
+        ref.setOffset(data.position());
+        data.emitDouble(c);
+
+        recordDataPatchInCode(ref);
+        emitPatchableSethi(scratch, true);
+        emitOp3(0b11, reg, 0b100011, scratch, 0); // LDDF [ptr+0], f0
+        return reg;
     }
 
     @Override
@@ -240,24 +272,48 @@
     @Override
     public StackSlot emitIntToStack(Register a) {
         StackSlot ret = newStackSlot(SPARCKind.WORD);
-        // STW a, [fp+offset]
-        emitStore(0b000100, a, ret);
+        intToStack(a, ret);
         return ret;
     }
 
+    public void intToStack(Register a, StackSlot ret) {
+        // STW a, [(s|f)p+offset]
+        emitStore(0b000100, a, ret);
+    }
+
     @Override
     public StackSlot emitLongToStack(Register a) {
         StackSlot ret = newStackSlot(SPARCKind.XWORD);
-        // STX a, [sp+offset]
-        emitStore(0b001110, a, ret);
+        longToStack(a, ret);
         return ret;
     }
 
+    public void longToStack(Register a, StackSlot ret) {
+        // STX a, [(f|s)p+offset]
+        emitStore(0b001110, a, ret);
+    }
+
     @Override
     public StackSlot emitFloatToStack(Register a) {
         StackSlot ret = newStackSlot(SPARCKind.SINGLE);
+        floatToStack(a, ret);
+        return ret;
+    }
+
+    public void floatToStack(Register a, StackSlot ret) {
         // STF a, [fp+offset]
         emitStore(0b100100, a, ret);
+    }
+
+    @Override
+    public StackSlot emitDoubleToStack(Register a) {
+        StackSlot ret = newStackSlot(SPARCKind.DOUBLE);
+        return doubleToStack(a, ret);
+    }
+
+    public StackSlot doubleToStack(Register a, StackSlot ret) {
+        // STD a, [(s|f)p+offset]
+        emitStore(0b100111, a, ret);
         return ret;
     }
 
@@ -278,16 +334,22 @@
     }
 
     private void emitStore(int op3, Register a, StackSlot ret) {
+        Register base;
+        if (ret.getRawOffset() < 0) {
+            base = SPARC.fp;
+        } else {
+            base = SPARC.sp;
+        }
         int offset = ret.getRawOffset() + SPARC.STACK_BIAS;
         if (isSimm(offset, 13)) {
             // op3 a, [sp+offset]
-            emitOp3(0b11, a, op3, SPARC.fp, offset);
+            emitOp3(0b11, a, op3, base, offset);
         } else {
             assert a != SPARC.g3;
             Register r = SPARC.g3;
             loadLongToRegister(offset, r);
             // op3 a, [sp+g3]
-            emitOp3(0b11, a, op3, SPARC.fp, r);
+            emitOp3(0b11, a, op3, base, r);
         }
     }
 
@@ -328,6 +390,13 @@
     }
 
     @Override
+    public void emitFloatRet(Register a) {
+        assert a == SPARC.f0 : "Unimplemented";
+        emitOp3(0b10, SPARC.g0, 0b111000, SPARC.i7, 8);        // JMPL [i7+8], g0
+        emitOp3(0b10, SPARC.g0, 0b111101, SPARC.g0, SPARC.g0); // RESTORE g0, g0, g0
+    }
+
+    @Override
     public void emitPointerRet(Register a) {
         emitMove(SPARC.i0, a);
         emitOp3(0b10, SPARC.g0, 0b111000, SPARC.i7, 8);        // JMPL [i7+8], g0
@@ -349,4 +418,57 @@
         }
         return super.emitDataItem(c);
     }
+
+    @Override
+    public void emitCall(long addr) {
+        Register dst = emitLoadLong(addr);
+        emitOp3(0b10, SPARC.o7, 0b111000, dst, 0);        // JMPL [dst+0], o7
+        emitNop();
+    }
+
+    @Override
+    public void emitLoad(AllocatableValue av, Object prim) {
+        if (av instanceof RegisterValue) {
+            Register reg = ((RegisterValue) av).getRegister();
+            RegisterCategory cat = reg.getRegisterCategory();
+            if (cat.equals(SPARC.FPUs)) {
+                emitLoadFloat(reg, (Float) prim, scratchRegister);
+            } else if (cat.equals(SPARC.FPUd)) {
+                emitLoadDouble(reg, (Double) prim, scratchRegister);
+            } else if (prim instanceof Integer) {
+                loadIntToRegister((Integer) prim, reg);
+            } else if (prim instanceof Long) {
+                loadLongToRegister((Long) prim, reg);
+            }
+        } else if (av instanceof StackSlot) {
+            StackSlot slot = (StackSlot) av;
+            if (prim instanceof Float) {
+                floatToStack(emitLoadFloat(floatScratch, (Float) prim, scratchRegister), slot);
+            } else if (prim instanceof Double) {
+                doubleToStack(emitLoadDouble(doubleScratch, (Double) prim, scratchRegister), slot);
+            } else if (prim instanceof Integer) {
+                intToStack(loadIntToRegister((Integer) prim, scratchRegister), slot);
+            } else if (prim instanceof Long) {
+                longToStack(emitLoadLongToRegister((Long) prim, scratchRegister), slot);
+            }
+        } else {
+            throw new IllegalArgumentException("Unknown value " + av);
+        }
+    }
+
+    @Override
+    public void emitCallEpilogue(CallingConvention cc) {
+        // Nothing to do here.
+    }
+
+    @Override
+    public void emitCallPrologue(CallingConvention cc, Object... prim) {
+        emitGrowStack(cc.getStackSize());
+        frameSize += cc.getStackSize();
+        AllocatableValue[] args = cc.getArguments();
+        for (int i = 0; i < args.length; i++) {
+            emitLoad(args[i], prim[i]);
+        }
+    }
+
 }
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/AsJavaTypeDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/AsJavaTypeDataProvider.java
index 2278a18..88dd983 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/AsJavaTypeDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/AsJavaTypeDataProvider.java
@@ -23,12 +23,12 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
-import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
-
 import jdk.vm.ci.meta.JavaConstant;
 import org.testng.annotations.DataProvider;
 
+import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
+import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
+
 public class AsJavaTypeDataProvider {
 
     @DataProvider(name = "asJavaTypeDataProvider")
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/BoxPrimitiveDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/BoxPrimitiveDataProvider.java
index cb57b45..af0ce73 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/BoxPrimitiveDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/BoxPrimitiveDataProvider.java
@@ -23,13 +23,14 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
-import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
-
-import java.util.LinkedList;
 import jdk.vm.ci.meta.JavaConstant;
 import org.testng.annotations.DataProvider;
 
+import java.util.LinkedList;
+
+import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
+import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
+
 public class BoxPrimitiveDataProvider {
 
     @DataProvider(name = "boxPrimitiveDataProvider")
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ConstantEqualsDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ConstantEqualsDataProvider.java
index dff8c48..494f86f 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ConstantEqualsDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ConstantEqualsDataProvider.java
@@ -23,15 +23,16 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
-import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
+import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.JavaConstant;
+import org.testng.annotations.DataProvider;
 
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.Objects;
-import jdk.vm.ci.meta.Constant;
-import jdk.vm.ci.meta.JavaConstant;
-import org.testng.annotations.DataProvider;
+
+import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
+import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
 
 public class ConstantEqualsDataProvider {
     @DataProvider(name = "constantEqualsDataProvider")
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ForStringDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ForStringDataProvider.java
index 8db7185..9aa6651 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ForStringDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ForStringDataProvider.java
@@ -23,10 +23,10 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
-
 import org.testng.annotations.DataProvider;
 
+import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
+
 public class ForStringDataProvider {
     @DataProvider(name = "forStringDataProvider")
     public static Object[][] forStringDataProvider() {
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java
index 1cc6215..5c9c7c6 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java
@@ -39,12 +39,8 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
-
-import java.lang.reflect.Method;
-import jdk.vm.ci.hotspot.HotSpotResolvedJavaField;
-import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.MemoryAccessProvider;
 import jdk.vm.ci.meta.MethodHandleAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaField;
@@ -52,6 +48,8 @@
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
+
 public class HotSpotConstantReflectionProviderTest {
 
     @Test(dataProvider = "forObjectDataProvider", dataProviderClass = ForObjectDataProvider.class)
@@ -120,12 +118,6 @@
         Assert.assertEquals(actual, expected, "Unexpected result:");
     }
 
-    @Test(dataProvider = "isEmbeddableDataProvider", dataProviderClass = IsEmbeddableDataProvider.class)
-    public void testIsEmbeddable(JavaConstant constant, boolean expected) {
-        boolean actual = CONSTANT_REFLECTION_PROVIDER.isEmbeddable(constant);
-        Assert.assertEquals(actual, expected, "Unexpected result:");
-    }
-
     @Test
     public void testGetMemoryAccessProvider() {
         MemoryAccessProvider actual = CONSTANT_REFLECTION_PROVIDER.getMemoryAccessProvider();
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/IsEmbeddableDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/IsEmbeddableDataProvider.java
index 62c64a4..004f32c 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/IsEmbeddableDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/IsEmbeddableDataProvider.java
@@ -23,12 +23,12 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
-import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
-
 import jdk.vm.ci.meta.JavaConstant;
 import org.testng.annotations.DataProvider;
 
+import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
+import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
+
 public class IsEmbeddableDataProvider {
     @DataProvider(name = "isEmbeddableDataProvider")
     public static Object[][] isEmbeddableDataProvider() {
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java
index a880dc4..549cc7b 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java
@@ -23,10 +23,6 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import java.lang.reflect.Field;
-
-import org.testng.annotations.DataProvider;
-
 import jdk.internal.misc.Unsafe;
 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider;
@@ -36,6 +32,9 @@
 import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.runtime.JVMCI;
+import org.testng.annotations.DataProvider;
+
+import java.lang.reflect.Field;
 
 public class MemoryAccessProviderData {
     private static final Unsafe UNSAFE = getUnsafe();
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java
index 466e4e3..03e7f68 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java
@@ -38,12 +38,11 @@
 package jdk.vm.ci.hotspot.test;
 
 import jdk.vm.ci.meta.Constant;
-import org.testng.annotations.Test;
-import org.testng.Assert;
-import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.MemoryAccessProvider;
 import jdk.vm.ci.runtime.JVMCI;
+import org.testng.Assert;
+import org.testng.annotations.Test;
 
 public class MemoryAccessProviderTest {
     private static final MemoryAccessProvider PROVIDER = JVMCI.getRuntime().getHostJVMCIBackend().getConstantReflection().getMemoryAccessProvider();
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderData.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderData.java
index 7cc4822..49f19a4 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderData.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderData.java
@@ -23,6 +23,13 @@
 
 package jdk.vm.ci.hotspot.test;
 
+import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.MetaAccessProvider;
+import jdk.vm.ci.meta.MethodHandleAccessProvider;
+import jdk.vm.ci.runtime.JVMCI;
+import org.testng.annotations.DataProvider;
+
 import java.io.File;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
@@ -31,12 +38,6 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.nio.file.Paths;
-import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.MetaAccessProvider;
-import jdk.vm.ci.meta.MethodHandleAccessProvider;
-import jdk.vm.ci.runtime.JVMCI;
-import org.testng.annotations.DataProvider;
 
 public class MethodHandleAccessProviderData implements TestInterface {
     private static final MetaAccessProvider META_ACCESS = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess();
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java
index 110615d..c94d47a 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java
@@ -24,30 +24,31 @@
 /*
  * @test
  * @bug 8152343
+ * @bug 8161068
  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  * @library /testlibrary /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src
  * @modules jdk.vm.ci/jdk.vm.ci.meta
  *          jdk.vm.ci/jdk.vm.ci.runtime
  *          jdk.vm.ci/jdk.vm.ci.hotspot
- * @ignore 8161068
  * @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *      jdk.vm.ci.hotspot.test.MethodHandleAccessProviderTest
  */
 
 package jdk.vm.ci.hotspot.test;
 
+import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.MetaAccessProvider;
+import jdk.vm.ci.meta.MethodHandleAccessProvider;
+import jdk.vm.ci.meta.MethodHandleAccessProvider.IntrinsicMethod;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.runtime.JVMCI;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Method;
-import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
-import jdk.vm.ci.meta.MethodHandleAccessProvider;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.runtime.JVMCI;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.MetaAccessProvider;
-import jdk.vm.ci.meta.MethodHandleAccessProvider.IntrinsicMethod;
-import org.testng.annotations.Test;
-import org.testng.Assert;
 
 public class MethodHandleAccessProviderTest {
     private static final HotSpotConstantReflectionProvider CONSTANT_REFLECTION = (HotSpotConstantReflectionProvider) JVMCI.getRuntime().getHostJVMCIBackend().getConstantReflection();
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayElementDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayElementDataProvider.java
index fbaea6e..e10f711 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayElementDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayElementDataProvider.java
@@ -23,18 +23,18 @@
 
 package jdk.vm.ci.hotspot.test;
 
+import jdk.vm.ci.meta.JavaConstant;
+import org.testng.annotations.DataProvider;
+
+import java.util.LinkedList;
+import java.util.stream.Stream;
+
 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAYS_MAP;
 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAY_ARRAYS_MAP;
 import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
 
-import java.util.LinkedList;
-import java.util.stream.Stream;
-
-import jdk.vm.ci.meta.JavaConstant;
-import org.testng.annotations.DataProvider;
-
 public class ReadArrayElementDataProvider {
 
     @DataProvider(name = "readArrayElementDataProvider")
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayLengthDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayLengthDataProvider.java
index ad877ac..110c2a2 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayLengthDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayLengthDataProvider.java
@@ -23,13 +23,14 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
-import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
+import jdk.vm.ci.meta.JavaConstant;
+import org.testng.annotations.DataProvider;
 
 import java.util.LinkedList;
 import java.util.List;
-import jdk.vm.ci.meta.JavaConstant;
-import org.testng.annotations.DataProvider;
+
+import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
+import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
 
 public class ReadArrayLengthDataProvider {
 
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadFieldValueDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadFieldValueDataProvider.java
index a46f25c..f3758b2 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadFieldValueDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadFieldValueDataProvider.java
@@ -23,22 +23,23 @@
 
 package jdk.vm.ci.hotspot.test;
 
+import jdk.vm.ci.meta.JavaConstant;
+import org.testng.annotations.DataProvider;
+
+import java.util.LinkedList;
+
 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAYS_MAP;
 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAY_ARRAYS_MAP;
 import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_CONSTANT;
 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
+import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
+import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_FIELDS_MAP;
 import static jdk.vm.ci.hotspot.test.TestHelper.STABLE_ARRAYS_MAP;
 import static jdk.vm.ci.hotspot.test.TestHelper.STABLE_ARRAY_ARRAYS_MAP;
-import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_FIELDS_MAP;
-import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_FIELDS_MAP;
 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_STABLE_FIELDS_MAP;
 
-import java.util.LinkedList;
-import jdk.vm.ci.meta.JavaConstant;
-import org.testng.annotations.DataProvider;
-
 public class ReadFieldValueDataProvider {
 
     @DataProvider(name = "readFieldValueDataProvider")
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHelper.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHelper.java
index 96f05da..53ed106 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHelper.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHelper.java
@@ -23,15 +23,16 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
 import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaField;
 import jdk.vm.ci.runtime.JVMCI;
 
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+
 public class TestHelper {
 
     public static final DummyClass DUMMY_CLASS_INSTANCE = new DummyClass();
diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/UnboxPrimitiveDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/UnboxPrimitiveDataProvider.java
index ed8ad67..de40dbf 100644
--- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/UnboxPrimitiveDataProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/UnboxPrimitiveDataProvider.java
@@ -23,13 +23,13 @@
 
 package jdk.vm.ci.hotspot.test;
 
-import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
-import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
+import jdk.vm.ci.meta.JavaConstant;
+import org.testng.annotations.DataProvider;
 
 import java.util.LinkedList;
 
-import jdk.vm.ci.meta.JavaConstant;
-import org.testng.annotations.DataProvider;
+import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
+import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
 
 public class UnboxPrimitiveDataProvider {
 
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java
index 7857845..f345bad 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java
@@ -33,11 +33,10 @@
  */
 package jdk.vm.ci.runtime.test;
 
+import jdk.vm.ci.meta.JavaConstant;
 import org.junit.Assert;
 import org.junit.Test;
 
-import jdk.vm.ci.meta.JavaConstant;
-
 public class ConstantTest extends FieldUniverse {
 
     @Test
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/FieldUniverse.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/FieldUniverse.java
index e8d3250..dcc380d 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/FieldUniverse.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/FieldUniverse.java
@@ -22,12 +22,12 @@
  */
 package jdk.vm.ci.runtime.test;
 
+import jdk.vm.ci.meta.ResolvedJavaField;
+
 import java.lang.reflect.Field;
 import java.util.HashMap;
 import java.util.Map;
 
-import jdk.vm.ci.meta.ResolvedJavaField;
-
 /**
  * Context for field related tests.
  */
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/MethodUniverse.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/MethodUniverse.java
index 35368eb..9236658 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/MethodUniverse.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/MethodUniverse.java
@@ -22,13 +22,13 @@
  */
 package jdk.vm.ci.runtime.test;
 
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
 
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-
 /**
  * Context for method related tests.
  */
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/NameAndSignature.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/NameAndSignature.java
index 055ded6..3bd14c7 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/NameAndSignature.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/NameAndSignature.java
@@ -22,15 +22,15 @@
  */
 package jdk.vm.ci.runtime.test;
 
-import java.lang.reflect.Method;
-import java.util.Arrays;
-
 import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.ResolvedJavaType;
 import jdk.vm.ci.meta.Signature;
 import jdk.vm.ci.runtime.JVMCI;
 
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
 class NameAndSignature {
 
     public static final MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess();
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java
index 0cc7a30..a93f934 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java
@@ -34,8 +34,11 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static org.junit.Assume.assumeTrue;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import org.junit.Assert;
+import org.junit.Test;
 
+import javax.tools.ToolProvider;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -53,12 +56,7 @@
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
 
-import javax.tools.ToolProvider;
-
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-
-import org.junit.Assert;
-import org.junit.Test;
+import static org.junit.Assume.assumeTrue;
 
 /**
  * Tests that {@link ResolvedJavaMethod}s are safe in the context of class redefinition being used
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java
index 213b7c2..21cdc85 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java
@@ -31,15 +31,15 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
 import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.ResolvedJavaType;
 import jdk.vm.ci.runtime.JVMCI;
-
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 public class ResolvedJavaTypeResolveConcreteMethodTest {
     public final MetaAccessProvider metaAccess;
 
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java
index 0d65a36..a32395c 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java
@@ -31,15 +31,15 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
 import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.ResolvedJavaType;
 import jdk.vm.ci.runtime.JVMCI;
-
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 public class ResolvedJavaTypeResolveMethodTest {
     public final MetaAccessProvider metaAccess;
 
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java
index ab6325e..ab66c98 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java
@@ -34,21 +34,20 @@
 
 package jdk.vm.ci.runtime.test;
 
+import jdk.vm.ci.meta.ConstantReflectionProvider;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.JavaKind;
+import org.junit.Test;
+
+import java.lang.reflect.Array;
+import java.util.List;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.lang.reflect.Array;
-import java.util.List;
-
-import jdk.vm.ci.meta.ConstantReflectionProvider;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.JavaKind;
-
-import org.junit.Test;
-
 /**
  * Tests for {@link ConstantReflectionProvider}. It assumes an implementation of the interface that
  * actually returns non-null results for access operations that are possible, i.e., the tests will
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java
index 8359fb0..15e4959 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java
@@ -34,20 +34,19 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Field;
-import java.util.Map;
-
 import jdk.vm.ci.meta.JavaField;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.JavaType;
 import jdk.vm.ci.meta.ResolvedJavaField;
 import jdk.vm.ci.meta.ResolvedJavaType;
-
 import org.junit.Test;
 
+import java.lang.reflect.Field;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests for {@link JavaField}.
  */
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java
index b143206..a7a2e74 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java
@@ -34,17 +34,16 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import jdk.vm.ci.meta.JavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import org.junit.Test;
 
 import java.lang.reflect.Method;
 import java.util.Map;
 
-import jdk.vm.ci.meta.JavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for {@link JavaMethod}.
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java
index ffcd3b4..4b38875 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java
@@ -34,12 +34,12 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static org.junit.Assert.assertEquals;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.JavaType;
-
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * Tests for {@link JavaType}.
  */
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java
index 16ca94e..cae386e 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java
@@ -34,17 +34,8 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static jdk.vm.ci.meta.MetaUtil.toInternalName;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
 import jdk.vm.ci.meta.DeoptimizationAction;
 import jdk.vm.ci.meta.DeoptimizationReason;
-
 import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.MetaAccessProvider;
@@ -52,9 +43,17 @@
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.ResolvedJavaType;
 import jdk.vm.ci.meta.Signature;
-
 import org.junit.Test;
 
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import static jdk.vm.ci.meta.MetaUtil.toInternalName;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests for {@link MetaAccessProvider}.
  */
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java
index 2c3a677..5085748 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java
@@ -34,10 +34,9 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import jdk.vm.ci.meta.ResolvedJavaField;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import org.junit.Test;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
@@ -47,10 +46,10 @@
 import java.util.Map;
 import java.util.Set;
 
-import jdk.vm.ci.meta.ResolvedJavaField;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-
-import org.junit.Test;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for {@link ResolvedJavaField}.
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java
index 0a58b4b..3333734 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java
@@ -34,10 +34,12 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import jdk.vm.ci.meta.ConstantPool;
+import jdk.vm.ci.meta.ExceptionHandler;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import org.junit.Assert;
+import org.junit.Test;
 
 import java.lang.annotation.Annotation;
 import java.lang.annotation.ElementType;
@@ -56,13 +58,10 @@
 import java.util.Map;
 import java.util.Set;
 
-import jdk.vm.ci.meta.ConstantPool;
-import jdk.vm.ci.meta.ExceptionHandler;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-import org.junit.Assert;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for {@link ResolvedJavaMethod}.
@@ -423,6 +422,25 @@
         assertFalse(ResolvedJavaMethod.isSignaturePolymorphic(metaAccess.lookupJavaType(Object.class), "toString", metaAccess));
     }
 
+    /**
+     * All public non-final methods should be available in the vtable.
+     */
+    @Test
+    public void testVirtualMethodTableAccess() {
+        for (Class<?> c : classes) {
+            if (c.isPrimitive() || c.isInterface()) {
+                continue;
+            }
+            ResolvedJavaType receiverType = metaAccess.lookupJavaType(c);
+            for (Method m : c.getMethods()) {
+                ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
+                if (!method.isStatic() && !method.isFinal() && !method.getDeclaringClass().isLeaf() && !method.getDeclaringClass().isInterface()) {
+                    assertTrue(method + " not available in " + receiverType, method.isInVirtualMethodTable(receiverType));
+                }
+            }
+        }
+    }
+
     private Method findTestMethod(Method apiMethod) {
         String testName = apiMethod.getName() + "Test";
         for (Method m : getClass().getDeclaredMethods()) {
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java
index ab9e0b7..42d340f 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java
@@ -37,18 +37,16 @@
 
 package jdk.vm.ci.runtime.test;
 
-import static java.lang.reflect.Modifier.isAbstract;
-import static java.lang.reflect.Modifier.isFinal;
-import static java.lang.reflect.Modifier.isPrivate;
-import static java.lang.reflect.Modifier.isProtected;
-import static java.lang.reflect.Modifier.isPublic;
-import static java.lang.reflect.Modifier.isStatic;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import jdk.internal.reflect.ConstantPool;
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.meta.Assumptions.AssumptionResult;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.ModifiersProvider;
+import jdk.vm.ci.meta.ResolvedJavaField;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import org.junit.Test;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
@@ -61,18 +59,18 @@
 import java.util.Map;
 import java.util.Set;
 
-import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.meta.Assumptions.AssumptionResult;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.ModifiersProvider;
-import jdk.vm.ci.meta.ResolvedJavaField;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-import org.junit.Test;
-
-import jdk.internal.reflect.ConstantPool;
+import static java.lang.reflect.Modifier.isAbstract;
+import static java.lang.reflect.Modifier.isFinal;
+import static java.lang.reflect.Modifier.isPrivate;
+import static java.lang.reflect.Modifier.isProtected;
+import static java.lang.reflect.Modifier.isPublic;
+import static java.lang.reflect.Modifier.isStatic;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for {@link ResolvedJavaType}.
diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java
index 2aae14c..87a16d2 100644
--- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java
+++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java
@@ -22,8 +22,14 @@
  */
 package jdk.vm.ci.runtime.test;
 
-import static java.lang.reflect.Modifier.isFinal;
-import static java.lang.reflect.Modifier.isStatic;
+import jdk.internal.misc.Unsafe;
+import jdk.vm.ci.meta.ConstantReflectionProvider;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.MetaAccessProvider;
+import jdk.vm.ci.meta.ResolvedJavaField;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import jdk.vm.ci.runtime.JVMCI;
+import org.junit.Test;
 
 import java.io.Serializable;
 import java.lang.reflect.Array;
@@ -47,16 +53,8 @@
 import java.util.TreeMap;
 import java.util.stream.Collectors;
 
-import jdk.vm.ci.meta.ConstantReflectionProvider;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.MetaAccessProvider;
-import jdk.vm.ci.meta.ResolvedJavaField;
-import jdk.vm.ci.meta.ResolvedJavaType;
-import jdk.vm.ci.runtime.JVMCI;
-
-import org.junit.Test;
-
-import jdk.internal.misc.Unsafe;
+import static java.lang.reflect.Modifier.isFinal;
+import static java.lang.reflect.Modifier.isStatic;
 
 /**
  * Context for type related tests.
diff --git a/test/compiler/jvmci/meta/StableFieldTest.java b/test/compiler/jvmci/meta/StableFieldTest.java
index c2087a5..d06278e 100644
--- a/test/compiler/jvmci/meta/StableFieldTest.java
+++ b/test/compiler/jvmci/meta/StableFieldTest.java
@@ -31,18 +31,17 @@
  *          jdk.vm.ci/jdk.vm.ci.hotspot
  *          jdk.vm.ci/jdk.vm.ci.meta
  *          jdk.vm.ci/jdk.vm.ci.runtime
+ *
  * @compile StableFieldTest.java
- * @run main ClassFileInstaller compiler.jvmci.meta.StableFieldTest
+ * @run driver ClassFileInstaller compiler.jvmci.meta.StableFieldTest
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbootclasspath/a:. compiler.jvmci.meta.StableFieldTest
  */
 
 package compiler.jvmci.meta;
 
-import java.lang.reflect.Field;
 import jdk.internal.vm.annotation.Stable;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaField;
 import jdk.vm.ci.meta.MetaAccessProvider;
-import jdk.vm.ci.meta.ResolvedJavaField;
 import jdk.vm.ci.runtime.JVMCI;
 
 public class StableFieldTest {
diff --git a/test/compiler/linkage/CallSites.jasm b/test/compiler/linkage/CallSites.jasm
index 813a9df..8bd63d1 100644
--- a/test/compiler/linkage/CallSites.jasm
+++ b/test/compiler/linkage/CallSites.jasm
@@ -21,34 +21,34 @@
  * questions.
  *
  */
-super class I
+super class compiler/linkage/I
 version 52:0
 {
 
 }
 
 
-super class CallSites
+super class compiler/linkage/CallSites
 version 52:0
 {
 
     // Non-existent methods.
 
     // I.m1()V vs I.m1(I)V
-    public static Method testI1:"(LI;)V"
+    public static Method testI1:"(Lcompiler/linkage/I;)V"
         stack 1 locals 1
     {
         aload_0;
-        invokeinterface InterfaceMethod I."m1":"()V", 1; // throws NSME
+        invokeinterface InterfaceMethod compiler/linkage/I."m1":"()V", 1; // throws NSME
         return;
     }
 
     // X.m1()V vs X.m1(I)V
-    public static Method testX1:"(LX;)V"
+    public static Method testX1:"(Lcompiler/linkage/X;)V"
         stack 1 locals 1
     {
         aload_0;
-        invokevirtual Method X."m1":"()V"; // throws NSME
+        invokevirtual Method compiler/linkage/X."m1":"()V"; // throws NSME
         return;
     }
 
@@ -58,7 +58,7 @@
         stack 1 locals 0
     {
         iconst_0;
-        invokestatic InterfaceMethod I."m1":"(I)V"; // throws ICCE
+        invokestatic InterfaceMethod compiler/linkage/I."m1":"(I)V"; // throws ICCE
         return;
     }
 
@@ -66,25 +66,25 @@
         stack 1 locals 0
     {
         iconst_0;
-        invokestatic Method X."m1":"(I)V"; // throws ICCE
+        invokestatic Method compiler/linkage/X."m1":"(I)V"; // throws ICCE
         return;
     }
 
     // Virtual invocation of static methods.
 
-    public static Method testI3:"(LI;)V"
+    public static Method testI3:"(Lcompiler/linkage/I;)V"
         stack 1 locals 1
     {
         aload_0;
-        invokeinterface InterfaceMethod I."s1":"()V", 1; // throws ICCE
+        invokeinterface InterfaceMethod compiler/linkage/I."s1":"()V", 1; // throws ICCE
         return;
     }
 
-    public static Method testX3:"(LX;)V"
+    public static Method testX3:"(Lcompiler/linkage/X;)V"
         stack 1 locals 1
     {
         aload_0;
-        invokevirtual Method X."s1":"()V";  // throws ICCE
+        invokevirtual Method compiler/linkage/X."s1":"()V";  // throws ICCE
         return;
     }
 
diff --git a/test/compiler/linkage/LinkageErrors.java b/test/compiler/linkage/LinkageErrors.java
index 0a1b2a8..0334604 100644
--- a/test/compiler/linkage/LinkageErrors.java
+++ b/test/compiler/linkage/LinkageErrors.java
@@ -25,10 +25,16 @@
  * @test
  * @bug 8132879
  * @compile CallSites.jasm
- * @run main/othervm -Xverify:all -Xbatch -XX:CompileCommand=dontinline,Test::test* LinkageErrors
+ * @run main/othervm -Xverify:all -Xbatch
+ *                   -XX:CompileCommand=dontinline,compiler.linkage.LinkageErrors::test*
+ *                   compiler.linkage.LinkageErrors
  */
 
-import java.lang.invoke.*;
+package compiler.linkage;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
 
 interface I {
     void m1(int i);
@@ -62,7 +68,7 @@
     }
 
     public static void main(String args[]) throws Throwable {
-        Class<?> test = Class.forName("CallSites");
+        Class<?> test = Class.forName("compiler.linkage.CallSites");
 
         // Non-existent method lookups.
         MethodHandle testI1 = L.findStatic(test, "testI1", MethodType.methodType(void.class, I.class));
diff --git a/test/compiler/loopopts/6860469/Test.java b/test/compiler/loopopts/6860469/Test.java
deleted file mode 100644
index 2a736d3..0000000
--- a/test/compiler/loopopts/6860469/Test.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2009 Google Inc.  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 6860469
- * @summary remix_address_expressions reshapes address expression with bad control
- *
- * @run main/othervm -Xcomp -XX:CompileOnly=Test.C Test
- */
-
-public class Test {
-
-  private static final int H = 16;
-  private static final int F = 9;
-
-  static int[] fl = new int[1 << F];
-
-  static int C(int ll, int f) {
-    int max = -1;
-    int min = H + 1;
-
-    if (ll != 0) {
-      if (ll < min) {
-        min = ll;
-      }
-      if (ll > max) {
-        max = ll;
-      }
-    }
-
-    if (f > max) {
-      f = max;
-    }
-    if (min > f) {
-      min = f;
-    }
-
-    for (int mc = 1 >> max - f; mc <= 0; mc++) {
-      int i = mc << (32 - f);
-      fl[i] = max;
-    }
-
-    return min;
-  }
-
-  public static void main(String argv[]) {
-    C(0, 10);
-  }
-}
diff --git a/test/compiler/loopopts/7044738/Test7044738.java b/test/compiler/loopopts/7044738/Test7044738.java
deleted file mode 100644
index 6b2a8d1..0000000
--- a/test/compiler/loopopts/7044738/Test7044738.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2011, 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 7044738
- * @summary Loop unroll optimization causes incorrect result
- *
- * @run main/othervm -Xbatch Test7044738
- */
-
-public class Test7044738 {
-
-  private static final int INITSIZE = 10000;
-  public int d[] = { 1, 2, 3, 4 };
-  public int i, size;
-
-  private static int iter = 5;
-
-  boolean done() { return (--iter > 0); }
-
-  public static void main(String args[]) {
-    Test7044738 t = new Test7044738();
-    t.test();
-  }
-
-  int test() {
-
-    while (done()) {
-      size = INITSIZE;
-
-      for (i = 0; i < size; i++) {
-        d[0] = d[1]; // 2
-        d[1] = d[2]; // 3
-        d[2] = d[3]; // 4
-        d[3] = d[0]; // 2
-
-        d[0] = d[1]; // 3
-        d[1] = d[2]; // 4
-        d[2] = d[3]; // 2
-        d[3] = d[0]; // 3
-
-        d[0] = d[1]; // 4
-        d[1] = d[2]; // 2
-        d[2] = d[3]; // 3
-        d[3] = d[0]; // 4
-
-        d[0] = d[1]; // 2
-        d[1] = d[2]; // 3
-        d[2] = d[3]; // 4
-        d[3] = d[0]; // 2
-
-        d[0] = d[1]; // 3
-        d[1] = d[2]; // 4
-        d[2] = d[3]; // 2
-        d[3] = d[0]; // 3
-
-        d[0] = d[1]; // 4
-        d[1] = d[2]; // 2
-        d[2] = d[3]; // 3
-        d[3] = d[0]; // 4
-
-        d[0] = d[1]; // 2
-        d[1] = d[2]; // 3
-        d[2] = d[3]; // 4
-        d[3] = d[0]; // 2
-
-        d[0] = d[1]; // 3
-        d[1] = d[2]; // 4
-        d[2] = d[3]; // 2
-        d[3] = d[0]; // 3
-      }
-
-      // try to defeat dead code elimination
-      if (d[0] == d[1]) {
-        System.out.println("test failed: iter=" + iter + "  i=" + i + " d[] = { " + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + " } ");
-        System.exit(97);
-      }
-    }
-    return d[3];
-  }
-
-}
diff --git a/test/compiler/loopopts/7052494/Test7052494.java b/test/compiler/loopopts/7052494/Test7052494.java
deleted file mode 100644
index 62aa12f..0000000
--- a/test/compiler/loopopts/7052494/Test7052494.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2011, 2014, 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 7052494
- * @summary Eclipse test fails on JDK 7 b142
- *
- * @run main/othervm -Xbatch Test7052494
- */
-
-
-public class Test7052494 {
-
-  static int test1(int i, int limit) {
-    int result = 0;
-    while (i++ != 0) {
-      if (result >= limit)
-        break;
-      result = i*2;
-    }
-    return result;
-  }
-
-  static int test2(int i, int limit) {
-    int result = 0;
-    while (i-- != 0) {
-      if (result <= limit)
-        break;
-      result = i*2;
-    }
-    return result;
-  }
-
-  static void test3(int i, int limit, int arr[]) {
-    while (i++ != 0) {
-      if (arr[i-1] >= limit)
-        break;
-      arr[i] = i*2;
-    }
-  }
-
-  static void test4(int i, int limit, int arr[]) {
-    while (i-- != 0) {
-      if (arr[arr.length + i + 1] <= limit)
-        break;
-      arr[arr.length + i] = i*2;
-    }
-  }
-
-  // Empty loop rolls through MAXINT if i > 0
-
-  static final int limit5 = Integer.MIN_VALUE + 10000;
-
-  static int test5(int i) {
-    int result = 0;
-    while (i++ != limit5) {
-      result = i*2;
-    }
-    return result;
-  }
-
-  // Empty loop rolls through MININT if i < 0
-
-  static final int limit6 = Integer.MAX_VALUE - 10000;
-
-  static int test6(int i) {
-    int result = 0;
-    while (i-- != limit6) {
-      result = i*2;
-    }
-    return result;
-  }
-
-  public static void main(String [] args) {
-    boolean failed = false;
-    int[] arr = new int[8];
-    int[] ar3 = { 0, 0, 4, 6, 8, 10, 0, 0 };
-    int[] ar4 = { 0, 0, 0, -10, -8, -6, -4, 0 };
-    System.out.println("test1");
-    for (int i = 0; i < 11000; i++) {
-      int k = test1(1, 10);
-      if (k != 10) {
-        System.out.println("FAILED: " + k + " != 10");
-        failed = true;
-        break;
-      }
-    }
-    System.out.println("test2");
-    for (int i = 0; i < 11000; i++) {
-      int k = test2(-1, -10);
-      if (k != -10) {
-        System.out.println("FAILED: " + k + " != -10");
-        failed = true;
-        break;
-      }
-    }
-    System.out.println("test3");
-    for (int i = 0; i < 11000; i++) {
-      java.util.Arrays.fill(arr, 0);
-      test3(1, 10, arr);
-      if (!java.util.Arrays.equals(arr,ar3)) {
-        System.out.println("FAILED: arr = { " + arr[0] + ", "
-                                              + arr[1] + ", "
-                                              + arr[2] + ", "
-                                              + arr[3] + ", "
-                                              + arr[4] + ", "
-                                              + arr[5] + ", "
-                                              + arr[6] + ", "
-                                              + arr[7] + " }");
-        failed = true;
-        break;
-      }
-    }
-    System.out.println("test4");
-    for (int i = 0; i < 11000; i++) {
-      java.util.Arrays.fill(arr, 0);
-      test4(-1, -10, arr);
-      if (!java.util.Arrays.equals(arr,ar4)) {
-        System.out.println("FAILED: arr = { " + arr[0] + ", "
-                                              + arr[1] + ", "
-                                              + arr[2] + ", "
-                                              + arr[3] + ", "
-                                              + arr[4] + ", "
-                                              + arr[5] + ", "
-                                              + arr[6] + ", "
-                                              + arr[7] + " }");
-        failed = true;
-        break;
-      }
-    }
-    System.out.println("test5");
-    for (int i = 0; i < 11000; i++) {
-      int k = test5(limit6);
-      if (k != limit5*2) {
-        System.out.println("FAILED: " + k + " != " + limit5*2);
-        failed = true;
-        break;
-      }
-    }
-    System.out.println("test6");
-    for (int i = 0; i < 11000; i++) {
-      int k = test6(limit5);
-      if (k != limit6*2) {
-        System.out.println("FAILED: " + k + " != " + limit6*2);
-        failed = true;
-        break;
-      }
-    }
-    System.out.println("finish");
-    if (failed)
-      System.exit(97);
-  }
-}
diff --git a/test/compiler/loopopts/BadPredicateAfterPartialPeel.java b/test/compiler/loopopts/BadPredicateAfterPartialPeel.java
index 186f1cc..36c13ec 100644
--- a/test/compiler/loopopts/BadPredicateAfterPartialPeel.java
+++ b/test/compiler/loopopts/BadPredicateAfterPartialPeel.java
@@ -26,10 +26,16 @@
  * @test
  * @bug 8146792
  * @summary Predicate moved after partial peel may lead to broken graph
- * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileOnly=BadPredicateAfterPartialPeel::m -XX:CompileCommand=dontinline,BadPredicateAfterPartialPeel::not_inlined* -XX:CompileCommand=quiet BadPredicateAfterPartialPeel
- *
+ * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation
+ *      -XX:-UseOnStackReplacement
+ *      -XX:CompileCommand=compileonly,compiler.loopopts.BadPredicateAfterPartialPeel::m
+ *      -XX:CompileCommand=dontinline,compiler.loopopts.BadPredicateAfterPartialPeel::not_inlined*
+ *      -XX:CompileCommand=quiet
+ *      compiler.loopopts.BadPredicateAfterPartialPeel
  */
 
+package compiler.loopopts;
+
 public class BadPredicateAfterPartialPeel {
 
     static void not_inlined1() {}
diff --git a/test/compiler/loopopts/ConstFPVectorization.java b/test/compiler/loopopts/ConstFPVectorization.java
index 50cb0e6..dfb10c7 100644
--- a/test/compiler/loopopts/ConstFPVectorization.java
+++ b/test/compiler/loopopts/ConstFPVectorization.java
@@ -26,11 +26,12 @@
  * @test
  * @bug 8074869
  * @summary C2 code generator can replace -0.0f with +0.0f on Linux
- * @run main ConstFPVectorization 8
+ * @run main compiler.loopopts.ConstFPVectorization 8
  * @author volker.simonis@gmail.com
- *
  */
 
+package compiler.loopopts;
+
 public class ConstFPVectorization {
 
     static float[] f = new float[16];
diff --git a/test/compiler/loopopts/CountedLoopProblem.java b/test/compiler/loopopts/CountedLoopProblem.java
index 23cc0bb..be23ae8 100644
--- a/test/compiler/loopopts/CountedLoopProblem.java
+++ b/test/compiler/loopopts/CountedLoopProblem.java
@@ -26,11 +26,13 @@
  * @test
  * @bug 8072753
  * @summary Inner loop induction variable increment occurs before compare which causes integer overflow
- * @run main/othervm CountedLoopProblem
+ * @run main/othervm compiler.loopopts.CountedLoopProblem
  *
  */
 
-import java.util.*;
+package compiler.loopopts;
+
+import java.util.Random;
 
 public class CountedLoopProblem {
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/loopopts/6659207/Test.java b/test/compiler/loopopts/Test6659207.java
similarity index 94%
rename from test/compiler/loopopts/6659207/Test.java
rename to test/compiler/loopopts/Test6659207.java
index a35b1c7..1ad8576 100644
--- a/test/compiler/loopopts/6659207/Test.java
+++ b/test/compiler/loopopts/Test6659207.java
@@ -26,9 +26,13 @@
  * @test
  * @bug 6659207
  * @summary access violation in CompilerThread0
+ *
+ * @run main compiler.loopopts.Test6659207
  */
 
-public class Test {
+package compiler.loopopts;
+
+public class Test6659207 {
     static int[] array = new int[12];
 
     static int index(int i) {
diff --git a/test/compiler/loopopts/6855164/Test.java b/test/compiler/loopopts/Test6855164.java
similarity index 93%
rename from test/compiler/loopopts/6855164/Test.java
rename to test/compiler/loopopts/Test6855164.java
index 3743d87..7d4b54c 100644
--- a/test/compiler/loopopts/6855164/Test.java
+++ b/test/compiler/loopopts/Test6855164.java
@@ -25,10 +25,13 @@
  * @test
  * @bug 6855164
  * @summary SIGSEGV during compilation of method involving loop over CharSequence
- * @run main/othervm -Xbatch Test
+ *
+ * @run main/othervm -Xbatch compiler.loopopts.Test6855164
  */
 
-public class Test{
+package compiler.loopopts;
+
+public class Test6855164 {
     public static void main(String[] args) throws Exception {
         StringBuffer builder = new StringBuffer();
 
diff --git a/test/compiler/loopopts/Test6860469.java b/test/compiler/loopopts/Test6860469.java
new file mode 100644
index 0000000..a3b6a2d
--- /dev/null
+++ b/test/compiler/loopopts/Test6860469.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2009 Google Inc.  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 6860469
+ * @summary remix_address_expressions reshapes address expression with bad control
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.loopopts.Test6860469::C
+ *      compiler.loopopts.Test6860469
+ */
+
+package compiler.loopopts;
+
+public class Test6860469 {
+
+    private static final int H = 16;
+    private static final int F = 9;
+
+    static int[] fl = new int[1 << F];
+
+    static int C(int ll, int f) {
+        int max = -1;
+        int min = H + 1;
+
+        if (ll != 0) {
+            if (ll < min) {
+                min = ll;
+            }
+            if (ll > max) {
+                max = ll;
+            }
+        }
+
+        if (f > max) {
+            f = max;
+        }
+        if (min > f) {
+            min = f;
+        }
+
+        for (int mc = 1 >> max - f; mc <= 0; mc++) {
+            int i = mc << (32 - f);
+            fl[i] = max;
+        }
+
+        return min;
+    }
+
+    public static void main(String argv[]) {
+        C(0, 10);
+    }
+}
diff --git a/test/compiler/loopopts/Test7044738.java b/test/compiler/loopopts/Test7044738.java
new file mode 100644
index 0000000..b7e64d3
--- /dev/null
+++ b/test/compiler/loopopts/Test7044738.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2011, 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 7044738
+ * @summary Loop unroll optimization causes incorrect result
+ *
+ * @run main/othervm -Xbatch compiler.loopopts.Test7044738
+ */
+
+package compiler.loopopts;
+
+public class Test7044738 {
+
+    private static final int INITSIZE = 10000;
+    public int d[] = {1, 2, 3, 4};
+    public int i, size;
+
+    private static int iter = 5;
+
+    boolean done() {
+        return (--iter > 0);
+    }
+
+    public static void main(String args[]) {
+        Test7044738 t = new Test7044738();
+        t.test();
+    }
+
+    int test() {
+
+        while (done()) {
+            size = INITSIZE;
+
+            for (i = 0; i < size; i++) {
+                d[0] = d[1]; // 2
+                d[1] = d[2]; // 3
+                d[2] = d[3]; // 4
+                d[3] = d[0]; // 2
+
+                d[0] = d[1]; // 3
+                d[1] = d[2]; // 4
+                d[2] = d[3]; // 2
+                d[3] = d[0]; // 3
+
+                d[0] = d[1]; // 4
+                d[1] = d[2]; // 2
+                d[2] = d[3]; // 3
+                d[3] = d[0]; // 4
+
+                d[0] = d[1]; // 2
+                d[1] = d[2]; // 3
+                d[2] = d[3]; // 4
+                d[3] = d[0]; // 2
+
+                d[0] = d[1]; // 3
+                d[1] = d[2]; // 4
+                d[2] = d[3]; // 2
+                d[3] = d[0]; // 3
+
+                d[0] = d[1]; // 4
+                d[1] = d[2]; // 2
+                d[2] = d[3]; // 3
+                d[3] = d[0]; // 4
+
+                d[0] = d[1]; // 2
+                d[1] = d[2]; // 3
+                d[2] = d[3]; // 4
+                d[3] = d[0]; // 2
+
+                d[0] = d[1]; // 3
+                d[1] = d[2]; // 4
+                d[2] = d[3]; // 2
+                d[3] = d[0]; // 3
+            }
+
+            // try to defeat dead code elimination
+            if (d[0] == d[1]) {
+                System.out.println("test failed: iter=" + iter + "  i=" + i + " d[] = { " + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + " } ");
+                System.exit(97);
+            }
+        }
+        return d[3];
+    }
+}
diff --git a/test/compiler/loopopts/Test7052494.java b/test/compiler/loopopts/Test7052494.java
new file mode 100644
index 0000000..1729a16
--- /dev/null
+++ b/test/compiler/loopopts/Test7052494.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2011, 2014, 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 7052494
+ * @summary Eclipse test fails on JDK 7 b142
+ *
+ * @run main/othervm -Xbatch compiler.loopopts.Test7052494
+ */
+
+package compiler.loopopts;
+
+public class Test7052494 {
+
+    static int test1(int i, int limit) {
+        int result = 0;
+        while (i++ != 0) {
+            if (result >= limit)
+                break;
+            result = i * 2;
+        }
+        return result;
+    }
+
+    static int test2(int i, int limit) {
+        int result = 0;
+        while (i-- != 0) {
+            if (result <= limit)
+                break;
+            result = i * 2;
+        }
+        return result;
+    }
+
+    static void test3(int i, int limit, int arr[]) {
+        while (i++ != 0) {
+            if (arr[i - 1] >= limit)
+                break;
+            arr[i] = i * 2;
+        }
+    }
+
+    static void test4(int i, int limit, int arr[]) {
+        while (i-- != 0) {
+            if (arr[arr.length + i + 1] <= limit)
+                break;
+            arr[arr.length + i] = i * 2;
+        }
+    }
+
+    // Empty loop rolls through MAXINT if i > 0
+
+    static final int limit5 = Integer.MIN_VALUE + 10000;
+
+    static int test5(int i) {
+        int result = 0;
+        while (i++ != limit5) {
+            result = i * 2;
+        }
+        return result;
+    }
+
+    // Empty loop rolls through MININT if i < 0
+
+    static final int limit6 = Integer.MAX_VALUE - 10000;
+
+    static int test6(int i) {
+        int result = 0;
+        while (i-- != limit6) {
+            result = i * 2;
+        }
+        return result;
+    }
+
+    public static void main(String[] args) {
+        boolean failed = false;
+        int[] arr = new int[8];
+        int[] ar3 = {0, 0, 4, 6, 8, 10, 0, 0};
+        int[] ar4 = {0, 0, 0, -10, -8, -6, -4, 0};
+        System.out.println("test1");
+        for (int i = 0; i < 11000; i++) {
+            int k = test1(1, 10);
+            if (k != 10) {
+                System.out.println("FAILED: " + k + " != 10");
+                failed = true;
+                break;
+            }
+        }
+        System.out.println("test2");
+        for (int i = 0; i < 11000; i++) {
+            int k = test2(-1, -10);
+            if (k != -10) {
+                System.out.println("FAILED: " + k + " != -10");
+                failed = true;
+                break;
+            }
+        }
+        System.out.println("test3");
+        for (int i = 0; i < 11000; i++) {
+            java.util.Arrays.fill(arr, 0);
+            test3(1, 10, arr);
+            if (!java.util.Arrays.equals(arr, ar3)) {
+                System.out.println("FAILED: arr = { " + arr[0] + ", "
+                        + arr[1] + ", "
+                        + arr[2] + ", "
+                        + arr[3] + ", "
+                        + arr[4] + ", "
+                        + arr[5] + ", "
+                        + arr[6] + ", "
+                        + arr[7] + " }");
+                failed = true;
+                break;
+            }
+        }
+        System.out.println("test4");
+        for (int i = 0; i < 11000; i++) {
+            java.util.Arrays.fill(arr, 0);
+            test4(-1, -10, arr);
+            if (!java.util.Arrays.equals(arr, ar4)) {
+                System.out.println("FAILED: arr = { " + arr[0] + ", "
+                        + arr[1] + ", "
+                        + arr[2] + ", "
+                        + arr[3] + ", "
+                        + arr[4] + ", "
+                        + arr[5] + ", "
+                        + arr[6] + ", "
+                        + arr[7] + " }");
+                failed = true;
+                break;
+            }
+        }
+        System.out.println("test5");
+        for (int i = 0; i < 11000; i++) {
+            int k = test5(limit6);
+            if (k != limit5 * 2) {
+                System.out.println("FAILED: " + k + " != " + limit5 * 2);
+                failed = true;
+                break;
+            }
+        }
+        System.out.println("test6");
+        for (int i = 0; i < 11000; i++) {
+            int k = test6(limit5);
+            if (k != limit6 * 2) {
+                System.out.println("FAILED: " + k + " != " + limit6 * 2);
+                failed = true;
+                break;
+            }
+        }
+        System.out.println("finish");
+        if (failed) {
+            System.exit(97);
+        }
+    }
+}
diff --git a/test/compiler/loopopts/TestArraysFillDeadControl.java b/test/compiler/loopopts/TestArraysFillDeadControl.java
index 540ba42..1f9ce25 100644
--- a/test/compiler/loopopts/TestArraysFillDeadControl.java
+++ b/test/compiler/loopopts/TestArraysFillDeadControl.java
@@ -26,10 +26,14 @@
  * @test
  * @bug 8147645
  * @summary Array.fill intrinsification code doesn't mark replaced control as dead
- * @run main/othervm  -XX:-TieredCompilation -XX:CompileCommand=dontinline,TestArraysFillDeadControl::dont_inline TestArraysFillDeadControl
  *
+ * @run main/othervm -XX:-TieredCompilation
+ *      -XX:CompileCommand=dontinline,compiler.loopopts.TestArraysFillDeadControl::dont_inline
+ *      compiler.loopopts.TestArraysFillDeadControl
  */
 
+package compiler.loopopts;
+
 import java.util.Arrays;
 
 public class TestArraysFillDeadControl {
diff --git a/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java b/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java
index 9dc2e14..bb0c35a 100644
--- a/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java
+++ b/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java
@@ -26,10 +26,13 @@
  * @test
  * @bug 8073184
  * @summary CastII that guards counted loops confuses range check elimination with LoopLimitCheck off
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileOnly=TestCastIINoLoopLimitCheck.m -Xcomp  TestCastIINoLoopLimitCheck
  *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.loopopts.TestCastIINoLoopLimitCheck::m
+ *      compiler.loopopts.TestCastIINoLoopLimitCheck
  */
 
+package compiler.loopopts;
 /*
  * The test was originally run with
  *
diff --git a/test/compiler/c2/8007722/Test8007722.java b/test/compiler/loopopts/TestCountedLoopSafepointBackedge.java
similarity index 60%
copy from test/compiler/c2/8007722/Test8007722.java
copy to test/compiler/loopopts/TestCountedLoopSafepointBackedge.java
index 2e197a4..31c32f2 100644
--- a/test/compiler/c2/8007722/Test8007722.java
+++ b/test/compiler/loopopts/TestCountedLoopSafepointBackedge.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, Red Hat, Inc. 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
@@ -21,36 +21,33 @@
  * questions.
  */
 
-/*
+/**
  * @test
- * @bug 8007722
- * @summary GetAndSetP's MachNode should capture bottom type
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8007722
+ * @bug 8161147
+ * @requires vm.flavor == "server"
+ * @summary Safepoint on backedge breaks UseCountedLoopSafepoints
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+UseCountedLoopSafepoints TestCountedLoopSafepointBackedge
  *
  */
 
-import java.util.concurrent.atomic.*;
-
-public class Test8007722 {
-
-    int i;
-    static AtomicReference<Test8007722> ref;
-
-    static int test(Test8007722 new_obj) {
-        Test8007722 o = ref.getAndSet(new_obj);
-        int ret = o.i;
-        o.i = 5;
-        return ret;
+public class TestCountedLoopSafepointBackedge {
+    static void test(int[] arr, int inc) {
+        int i = 0;
+        for (;;) {
+            for (int j = 0; j < 10; j++);
+            arr[i] = i;
+            i++;
+            if (i >= 100) {
+                break;
+            }
+            for (int j = 0; j < 10; j++);
+        }
     }
 
     static public void main(String[] args) {
-        Test8007722 obj = new Test8007722();
-        ref = new AtomicReference<Test8007722>(obj);
-
+        int[] arr = new int[100];
         for (int i = 0; i < 20000; i++) {
-            test(obj);
+             test(arr, 1);
         }
-
-        System.out.println("PASSED");
     }
 }
diff --git a/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java b/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java
index f278238..e3deae8 100644
--- a/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java
+++ b/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java
@@ -26,10 +26,14 @@
  * @test
  * @bug 8054478
  * @summary dead backbranch in main loop results in erroneous array access
- * @run main/othervm -XX:CompileOnly=TestDeadBackbranchArrayAccess -Xcomp TestDeadBackbranchArrayAccess
  *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.loopopts.TestDeadBackbranchArrayAccess::*
+ *      compiler.loopopts.TestDeadBackbranchArrayAccess
  */
 
+package compiler.loopopts;
+
 public class TestDeadBackbranchArrayAccess {
     static char[] pattern0 = {0};
     static char[] pattern1 = {1};
diff --git a/test/compiler/loopopts/TestLogSum.java b/test/compiler/loopopts/TestLogSum.java
index a32963d..cbd13fd 100644
--- a/test/compiler/loopopts/TestLogSum.java
+++ b/test/compiler/loopopts/TestLogSum.java
@@ -25,14 +25,18 @@
  * @test
  * @bug 8046516
  * @summary Segmentation fault in JVM (easily reproducible)
- * @run main/othervm -XX:-TieredCompilation -Xbatch TestLogSum
+ *
+ * @run main/othervm -XX:-TieredCompilation -Xbatch compiler.loopopts.TestLogSum
  * @author jackkamm@gmail.com
  */
 
+package compiler.loopopts;
+
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+
 public class TestLogSum {
   public static void main(String[] args) {
     double sum;
diff --git a/test/compiler/loopopts/TestLoopPeeling.java b/test/compiler/loopopts/TestLoopPeeling.java
index d2d2e3d..3627ff5 100644
--- a/test/compiler/loopopts/TestLoopPeeling.java
+++ b/test/compiler/loopopts/TestLoopPeeling.java
@@ -25,8 +25,14 @@
  * @test
  * @bug 8078262
  * @summary Tests correct dominator information after loop peeling.
- * @run main/othervm -Xcomp -XX:CompileCommand=compileonly,TestLoopPeeling::test* TestLoopPeeling
+ *
+ * @run main/othervm -Xcomp
+ *      -XX:CompileCommand=compileonly,compiler.loopopts.TestLoopPeeling::test*
+ *      compiler.loopopts.TestLoopPeeling
  */
+
+package compiler.loopopts;
+
 public class TestLoopPeeling {
 
     public int[] array = new int[100];
diff --git a/test/compiler/loopopts/TestMoveStoresOutOfLoops.java b/test/compiler/loopopts/TestMoveStoresOutOfLoops.java
index af99d6b..ea70d70 100644
--- a/test/compiler/loopopts/TestMoveStoresOutOfLoops.java
+++ b/test/compiler/loopopts/TestMoveStoresOutOfLoops.java
@@ -26,13 +26,18 @@
  * @test
  * @bug 8080289
  * @summary Move stores out of loops if possible
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestMoveStoresOutOfLoops::test*  TestMoveStoresOutOfLoops
  *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      -XX:CompileCommand=dontinline,compiler.loopopts.TestMoveStoresOutOfLoops::test*
+ *      compiler.loopopts.TestMoveStoresOutOfLoops
  */
 
-import java.lang.reflect.*;
-import java.util.*;
-import java.util.function.*;
+package compiler.loopopts;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+import java.util.function.Function;
 
 public class TestMoveStoresOutOfLoops {
 
diff --git a/test/compiler/loopopts/TestMoveStoresOutOfLoopsStoreNoCtrl.java b/test/compiler/loopopts/TestMoveStoresOutOfLoopsStoreNoCtrl.java
index ec9dcd5..8419ae1 100644
--- a/test/compiler/loopopts/TestMoveStoresOutOfLoopsStoreNoCtrl.java
+++ b/test/compiler/loopopts/TestMoveStoresOutOfLoopsStoreNoCtrl.java
@@ -25,10 +25,14 @@
  * @test
  * @bug 8134288
  * @summary Store nodes may not have a control if used to update profiling
- * @run main/othervm -XX:-ProfileInterpreter -XX:-TieredCompilation -XX:-BackgroundCompilation TestMoveStoresOutOfLoopsStoreNoCtrl
  *
+ * @run main/othervm -XX:-ProfileInterpreter -XX:-TieredCompilation
+ *                   -XX:-BackgroundCompilation
+ *                   compiler.loopopts.TestMoveStoresOutOfLoopsStoreNoCtrl
  */
 
+package compiler.loopopts;
+
 public class TestMoveStoresOutOfLoopsStoreNoCtrl {
 
     static void test(boolean flag) {
diff --git a/test/compiler/loopopts/TestOverunrolling.java b/test/compiler/loopopts/TestOverunrolling.java
new file mode 100644
index 0000000..0223048
--- /dev/null
+++ b/test/compiler/loopopts/TestOverunrolling.java
@@ -0,0 +1,62 @@
+/*
+ * 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 8159016
+ * @summary Tests correct dominator information after over-unrolling a loop.
+ * @requires vm.gc == "Parallel" | vm.gc == "null"
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-TieredCompilation
+ *                   -XX:-UseG1GC -XX:+UseParallelGC
+ *                   compiler.loopopts.TestOverunrolling
+ */
+
+package compiler.loopopts;
+
+public class TestOverunrolling {
+
+    public static Object test(int arg) {
+        Object arr[] = new Object[3];
+        int lim = (arg & 3);
+        // The pre loop is executed for one iteration, initializing p[0].
+        // The main loop is unrolled twice, initializing p[1], p[2], p[3] and p[4].
+        // The p[3] and p[4] stores are always out of bounds and removed. However,
+        // C2 is unable to remove the "over-unrolled", dead main loop. As a result,
+        // there is a control path from the main loop to the post loop without a
+        // memory path (because the last store was replaced by TOP). We crash
+        // because we use a memory edge from a non-dominating region.
+        for (int i = 0; i < lim; ++i) {
+            arr[i] = new Object();
+        }
+        // Avoid EA
+        return arr;
+    }
+
+    public static void main(String args[]) {
+        for (int i = 0; i < 42; ++i) {
+            test(i);
+        }
+    }
+}
+
diff --git a/test/compiler/loopopts/TestPredicateLostDependency.java b/test/compiler/loopopts/TestPredicateLostDependency.java
index a9986c2..666bc37 100644
--- a/test/compiler/loopopts/TestPredicateLostDependency.java
+++ b/test/compiler/loopopts/TestPredicateLostDependency.java
@@ -26,10 +26,15 @@
  * @test
  * @bug 8069191
  * @summary predicate moved out of loops and CastPP removal causes dependency to be lost
- * @run main/othervm -Xcomp -XX:CompileOnly=TestPredicateLostDependency.m1 -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM TestPredicateLostDependency
+ *
+ * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM
+ *                   -XX:CompileCommand=compileonly,compiler.loopopts.TestPredicateLostDependency::m1
+ *                   compiler.loopopts.TestPredicateLostDependency
  *
  */
 
+package compiler.loopopts;
+
 public class TestPredicateLostDependency {
     static class A {
         int i;
diff --git a/test/compiler/loopopts/TestSplitIfBlocksDisabled.java b/test/compiler/loopopts/TestSplitIfBlocksDisabled.java
index 63745f7..38979a3 100644
--- a/test/compiler/loopopts/TestSplitIfBlocksDisabled.java
+++ b/test/compiler/loopopts/TestSplitIfBlocksDisabled.java
@@ -26,8 +26,13 @@
  * @test TestSplitIfBlocksDisabled
  * @bug 8086057
  * @summary Verifies that loop optimizations work if SplitIfBlocks is disabled.
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-SplitIfBlocks TestSplitIfBlocksDisabled
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-SplitIfBlocks
+ *                   compiler.loopopts.TestSplitIfBlocksDisabled
  */
+
+package compiler.loopopts;
+
 public class TestSplitIfBlocksDisabled {
 
     public static void main(String[] args) {
diff --git a/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java b/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java
index 78cda88..b278943 100644
--- a/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java
+++ b/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java
@@ -26,10 +26,13 @@
  * @test
  * @bug 8078426
  * @summary split if finds predicates on several incoming paths when unswitched's loops are optimized out
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-UseCompressedOops TestSplitIfUnswitchedLoopsEliminated
  *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement
+ *                   -XX:-BackgroundCompilation -XX:-UseCompressedOops
+ *                   compiler.loopopts.TestSplitIfUnswitchedLoopsEliminated
  */
 
+package compiler.loopopts;
 
 public class TestSplitIfUnswitchedLoopsEliminated {
 
diff --git a/test/compiler/loopopts/UseCountedLoopSafepoints.java b/test/compiler/loopopts/UseCountedLoopSafepoints.java
index 67cd3c9..77a9445 100644
--- a/test/compiler/loopopts/UseCountedLoopSafepoints.java
+++ b/test/compiler/loopopts/UseCountedLoopSafepoints.java
@@ -28,14 +28,16 @@
  * @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
- * @modules java.base
  * @ignore 8146096
- * @run main UseCountedLoopSafepoints
+ * @run driver compiler.loopopts.UseCountedLoopSafepoints
  */
 
-import java.util.concurrent.atomic.AtomicLong;
-import jdk.test.lib.ProcessTools;
+package compiler.loopopts;
+
 import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
+import java.util.concurrent.atomic.AtomicLong;
 
 public class UseCountedLoopSafepoints {
     private static final AtomicLong _num = new AtomicLong(0);
@@ -59,7 +61,7 @@
                     "-XX:+SafepointTimeout",
                     "-XX:SafepointTimeoutDelay=2000",
                     "-XX:+UseCountedLoopSafepoints",
-                    "UseCountedLoopSafepoints",
+                    UseCountedLoopSafepoints.class.getName(),
                     "2000000000"
                     );
             OutputAnalyzer output = new OutputAnalyzer(pb.start());
diff --git a/test/compiler/loopopts/superword/ProdRed_Double.java b/test/compiler/loopopts/superword/ProdRed_Double.java
index 37e9fca..d225ecc 100644
--- a/test/compiler/loopopts/superword/ProdRed_Double.java
+++ b/test/compiler/loopopts/superword/ProdRed_Double.java
@@ -28,56 +28,85 @@
  * @summary Add C2 x86 Superword support for scalar product reduction optimizations : float test
  * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.ProdRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.ProdRed_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.ProdRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.ProdRed_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.ProdRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.ProdRed_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.ProdRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.ProdRed_Double
  */
 
-public class ProdRed_Double
-{
-  public static void main(String[] args) throws Exception {
-    double[] a = new double[256*1024];
-    double[] b = new double[256*1024];
-    prodReductionInit(a,b);
-    double valid = 2000;
-    double total = 0;
-    for(int j = 0; j < 2000; j++) {
-      total = j + 1;
-      total = prodReductionImplement(a,b, total);
-    }
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
-    }
-  }
+package compiler.loopopts.superword;
 
-  public static void prodReductionInit(double[] a, double[] b)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      a[i] = i + 2;
-      b[i] = i + 1;
+public class ProdRed_Double {
+    public static void main(String[] args) throws Exception {
+        double[] a = new double[256 * 1024];
+        double[] b = new double[256 * 1024];
+        prodReductionInit(a, b);
+        double valid = 2000;
+        double total = 0;
+        for (int j = 0; j < 2000; j++) {
+            total = j + 1;
+            total = prodReductionImplement(a, b, total);
+        }
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
-  }
 
-  public static double prodReductionImplement(double[] a, double[] b, double total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      total *= a[i] - b[i];
+    public static void prodReductionInit(double[] a, double[] b) {
+        for (int i = 0; i < a.length; i++) {
+            a[i] = i + 2;
+            b[i] = i + 1;
+        }
     }
-    return total;
-  }
+
+    public static double prodReductionImplement(double[] a, double[] b, double total) {
+        for (int i = 0; i < a.length; i++) {
+            total *= a[i] - b[i];
+        }
+        return total;
+    }
 
 }
diff --git a/test/compiler/loopopts/superword/ProdRed_Float.java b/test/compiler/loopopts/superword/ProdRed_Float.java
index b31cf10..d6702ec 100644
--- a/test/compiler/loopopts/superword/ProdRed_Float.java
+++ b/test/compiler/loopopts/superword/ProdRed_Float.java
@@ -28,56 +28,85 @@
  * @summary Add C2 x86 Superword support for scalar product reduction optimizations : float test
  * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.ProdRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.ProdRed_Float
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.ProdRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.ProdRed_Float
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.ProdRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.ProdRed_Float
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.ProdRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.ProdRed_Float
  */
 
-public class ProdRed_Float
-{
-  public static void main(String[] args) throws Exception {
-    float[] a = new float[256*1024];
-    float[] b = new float[256*1024];
-    prodReductionInit(a,b);
-    float valid = 2000;
-    float total = 0;
-    for(int j = 0; j < 2000; j++) {
-      total = j + 1;
-      total = prodReductionImplement(a,b, total);
-    }
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
-    }
-  }
+package compiler.loopopts.superword;
 
-  public static void prodReductionInit(float[] a, float[] b)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      a[i] = i + 2;
-      b[i] = i + 1;
+public class ProdRed_Float {
+    public static void main(String[] args) throws Exception {
+        float[] a = new float[256 * 1024];
+        float[] b = new float[256 * 1024];
+        prodReductionInit(a, b);
+        float valid = 2000;
+        float total = 0;
+        for (int j = 0; j < 2000; j++) {
+            total = j + 1;
+            total = prodReductionImplement(a, b, total);
+        }
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
-  }
 
-  public static float prodReductionImplement(float[] a, float[] b, float total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      total *= a[i] - b[i];
+    public static void prodReductionInit(float[] a, float[] b) {
+        for (int i = 0; i < a.length; i++) {
+            a[i] = i + 2;
+            b[i] = i + 1;
+        }
     }
-    return total;
-  }
+
+    public static float prodReductionImplement(float[] a, float[] b, float total) {
+        for (int i = 0; i < a.length; i++) {
+            total *= a[i] - b[i];
+        }
+        return total;
+    }
 
 }
diff --git a/test/compiler/loopopts/superword/ProdRed_Int.java b/test/compiler/loopopts/superword/ProdRed_Int.java
index a1e8356..423cdfa 100644
--- a/test/compiler/loopopts/superword/ProdRed_Int.java
+++ b/test/compiler/loopopts/superword/ProdRed_Int.java
@@ -28,55 +28,84 @@
  * @summary Add C2 x86 Superword support for scalar product reduction optimizations : int test
  * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Int
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.ProdRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.ProdRed_Int
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Int
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.ProdRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.ProdRed_Int
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Int
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.ProdRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.ProdRed_Int
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Int
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.ProdRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.ProdRed_Int
  */
 
-public class ProdRed_Int
-{
-  public static void main(String[] args) throws Exception {
-    int[] a = new int[256*1024];
-    int[] b = new int[256*1024];
-    prodReductionInit(a,b);
-    int valid = 419430401;
-    int total = 1;
-    for(int j = 0; j < 2000; j++) {
-      total = prodReductionImplement(a,b,total);
-    }
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
-    }
-  }
+package compiler.loopopts.superword;
 
-  public static void prodReductionInit(int[] a, int[] b)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      a[i] = i + 2;
-      b[i] = i + 1;
+public class ProdRed_Int {
+    public static void main(String[] args) throws Exception {
+        int[] a = new int[256 * 1024];
+        int[] b = new int[256 * 1024];
+        prodReductionInit(a, b);
+        int valid = 419430401;
+        int total = 1;
+        for (int j = 0; j < 2000; j++) {
+            total = prodReductionImplement(a, b, total);
+        }
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
-  }
 
-  public static int prodReductionImplement(int[] a, int[] b, int total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      total *= a[i] + b[i];
+    public static void prodReductionInit(int[] a, int[] b) {
+        for (int i = 0; i < a.length; i++) {
+            a[i] = i + 2;
+            b[i] = i + 1;
+        }
     }
-    return total;
-  }
+
+    public static int prodReductionImplement(int[] a, int[] b, int total) {
+        for (int i = 0; i < a.length; i++) {
+            total *= a[i] + b[i];
+        }
+        return total;
+    }
 
 }
diff --git a/test/compiler/loopopts/superword/ReductionPerf.java b/test/compiler/loopopts/superword/ReductionPerf.java
index a91f70f..0496b9a 100644
--- a/test/compiler/loopopts/superword/ReductionPerf.java
+++ b/test/compiler/loopopts/superword/ReductionPerf.java
@@ -28,226 +28,236 @@
  * @summary Add C2 x86 Superword support for scalar product reduction optimizations : int test
  * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:CompileThresholdScaling=0.1 -XX:CompileCommand=exclude,ReductionPerf::main ReductionPerf
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:CompileThresholdScaling=0.1 -XX:CompileCommand=exclude,ReductionPerf::main ReductionPerf
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions
+ *      -XX:LoopUnrollLimit=250 -XX:CompileThresholdScaling=0.1
+ *      -XX:CompileCommand=exclude,compiler.loopopts.superword.ReductionPerf::main
+ *      -XX:+SuperWordReductions
+ *      compiler.loopopts.superword.ReductionPerf
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions
+ *      -XX:LoopUnrollLimit=250 -XX:CompileThresholdScaling=0.1
+ *      -XX:CompileCommand=exclude,compiler.loopopts.superword.ReductionPerf::main
+ *      -XX:-SuperWordReductions
+ *      compiler.loopopts.superword.ReductionPerf
  */
 
+package compiler.loopopts.superword;
+
 public class ReductionPerf {
-  public static void main(String[] args) throws Exception {
-    int[] a1 = new int[8*1024];
-    int[] a2 = new int[8*1024];
-    int[] a3 = new int[8*1024];
-    long[] b1 = new long[8*1024];
-    long[] b2 = new long[8*1024];
-    long[] b3 = new long[8*1024];
-    float[] c1 = new float[8*1024];
-    float[] c2 = new float[8*1024];
-    float[] c3 = new float[8*1024];
-    double[] d1 = new double[8*1024];
-    double[] d2 = new double[8*1024];
-    double[] d3 = new double[8*1024];
+    public static void main(String[] args) throws Exception {
+        int[] a1 = new int[8 * 1024];
+        int[] a2 = new int[8 * 1024];
+        int[] a3 = new int[8 * 1024];
+        long[] b1 = new long[8 * 1024];
+        long[] b2 = new long[8 * 1024];
+        long[] b3 = new long[8 * 1024];
+        float[] c1 = new float[8 * 1024];
+        float[] c2 = new float[8 * 1024];
+        float[] c3 = new float[8 * 1024];
+        double[] d1 = new double[8 * 1024];
+        double[] d2 = new double[8 * 1024];
+        double[] d3 = new double[8 * 1024];
 
-    ReductionInit(a1,a2,a3,b1,b2,b3,c1,c2,c3,d1,d2,d3);
+        ReductionInit(a1, a2, a3, b1, b2, b3, c1, c2, c3, d1, d2, d3);
 
-    int    sumIv = sumInt(a1,a2,a3);
-    long   sumLv = sumLong(b1,b2,b3);
-    float  sumFv = sumFloat(c1,c2,c3);
-    double sumDv = sumDouble(d1,d2,d3);
-    int    mulIv = prodInt(a1,a2,a3);
-    long   mulLv = prodLong(b1,b2,b3);
-    float  mulFv = prodFloat(c1,c2,c3);
-    double mulDv = prodDouble(d1,d2,d3);
+        int sumIv = sumInt(a1, a2, a3);
+        long sumLv = sumLong(b1, b2, b3);
+        float sumFv = sumFloat(c1, c2, c3);
+        double sumDv = sumDouble(d1, d2, d3);
+        int mulIv = prodInt(a1, a2, a3);
+        long mulLv = prodLong(b1, b2, b3);
+        float mulFv = prodFloat(c1, c2, c3);
+        double mulDv = prodDouble(d1, d2, d3);
 
-    int    sumI = 0;
-    long   sumL = 0;
-    float  sumF = 0.f;
-    double sumD = 0.;
-    int    mulI = 0;
-    long   mulL = 0;
-    float  mulF = 0.f;
-    double mulD = 0.;
+        int sumI = 0;
+        long sumL = 0;
+        float sumF = 0.f;
+        double sumD = 0.;
+        int mulI = 0;
+        long mulL = 0;
+        float mulF = 0.f;
+        double mulD = 0.;
 
-    System.out.println("Warmup ...");
-    long  start = System.currentTimeMillis();
+        System.out.println("Warmup ...");
+        long start = System.currentTimeMillis();
 
-    for(int j = 0; j < 2000; j++) {
-      sumI = sumInt(a1,a2,a3);
-      sumL = sumLong(b1,b2,b3);
-      sumF = sumFloat(c1,c2,c3);
-      sumD = sumDouble(d1,d2,d3);
-      mulI = prodInt(a1,a2,a3);
-      mulL = prodLong(b1,b2,b3);
-      mulF = prodFloat(c1,c2,c3);
-      mulD = prodDouble(d1,d2,d3);
+        for (int j = 0; j < 2000; j++) {
+            sumI = sumInt(a1, a2, a3);
+            sumL = sumLong(b1, b2, b3);
+            sumF = sumFloat(c1, c2, c3);
+            sumD = sumDouble(d1, d2, d3);
+            mulI = prodInt(a1, a2, a3);
+            mulL = prodLong(b1, b2, b3);
+            mulF = prodFloat(c1, c2, c3);
+            mulD = prodDouble(d1, d2, d3);
+        }
+
+        long stop = System.currentTimeMillis();
+        System.out.println(" Warmup is done in " + (stop - start) + " msec");
+
+        if (sumIv != sumI) {
+            System.out.println("sum int:    " + sumIv + " != " + sumI);
+        }
+        if (sumLv != sumL) {
+            System.out.println("sum long:   " + sumLv + " != " + sumL);
+        }
+        if (sumFv != sumF) {
+            System.out.println("sum float:  " + sumFv + " != " + sumF);
+        }
+        if (sumDv != sumD) {
+            System.out.println("sum double: " + sumDv + " != " + sumD);
+        }
+        if (mulIv != mulI) {
+            System.out.println("prod int:    " + mulIv + " != " + mulI);
+        }
+        if (mulLv != mulL) {
+            System.out.println("prod long:   " + mulLv + " != " + mulL);
+        }
+        if (mulFv != mulF) {
+            System.out.println("prod float:  " + mulFv + " != " + mulF);
+        }
+        if (mulDv != mulD) {
+            System.out.println("prod double: " + mulDv + " != " + mulD);
+        }
+
+        start = System.currentTimeMillis();
+        for (int j = 0; j < 5000; j++) {
+            sumI = sumInt(a1, a2, a3);
+        }
+        stop = System.currentTimeMillis();
+        System.out.println("sum int:    " + (stop - start));
+
+        start = System.currentTimeMillis();
+        for (int j = 0; j < 5000; j++) {
+            sumL = sumLong(b1, b2, b3);
+        }
+        stop = System.currentTimeMillis();
+        System.out.println("sum long:   " + (stop - start));
+
+        start = System.currentTimeMillis();
+        for (int j = 0; j < 5000; j++) {
+            sumF = sumFloat(c1, c2, c3);
+        }
+        stop = System.currentTimeMillis();
+        System.out.println("sum float:  " + (stop - start));
+
+        start = System.currentTimeMillis();
+        for (int j = 0; j < 5000; j++) {
+            sumD = sumDouble(d1, d2, d3);
+        }
+        stop = System.currentTimeMillis();
+        System.out.println("sum double: " + (stop - start));
+
+        start = System.currentTimeMillis();
+        for (int j = 0; j < 5000; j++) {
+            mulI = prodInt(a1, a2, a3);
+        }
+        stop = System.currentTimeMillis();
+        System.out.println("prod int:    " + (stop - start));
+
+        start = System.currentTimeMillis();
+        for (int j = 0; j < 5000; j++) {
+            mulL = prodLong(b1, b2, b3);
+        }
+        stop = System.currentTimeMillis();
+        System.out.println("prod long:   " + (stop - start));
+
+        start = System.currentTimeMillis();
+        for (int j = 0; j < 5000; j++) {
+            mulF = prodFloat(c1, c2, c3);
+        }
+        stop = System.currentTimeMillis();
+        System.out.println("prod float:  " + (stop - start));
+
+        start = System.currentTimeMillis();
+        for (int j = 0; j < 5000; j++) {
+            mulD = prodDouble(d1, d2, d3);
+        }
+        stop = System.currentTimeMillis();
+        System.out.println("prod double: " + (stop - start));
+
     }
 
-    long stop = System.currentTimeMillis();
-    System.out.println(" Warmup is done in " + (stop - start) + " msec");
-
-    if (sumIv != sumI) {
-      System.out.println("sum int:    " + sumIv + " != " + sumI);
-    }
-    if (sumLv != sumL) {
-      System.out.println("sum long:   " + sumLv + " != " + sumL);
-    }
-    if (sumFv != sumF) {
-      System.out.println("sum float:  " + sumFv + " != " + sumF);
-    }
-    if (sumDv != sumD) {
-      System.out.println("sum double: " + sumDv + " != " + sumD);
-    }
-    if (mulIv != mulI) {
-      System.out.println("prod int:    " + mulIv + " != " + mulI);
-    }
-    if (mulLv != mulL) {
-      System.out.println("prod long:   " + mulLv + " != " + mulL);
-    }
-    if (mulFv != mulF) {
-      System.out.println("prod float:  " + mulFv + " != " + mulF);
-    }
-    if (mulDv != mulD) {
-      System.out.println("prod double: " + mulDv + " != " + mulD);
+    public static void ReductionInit(int[] a1, int[] a2, int[] a3,
+                                     long[] b1, long[] b2, long[] b3,
+                                     float[] c1, float[] c2, float[] c3,
+                                     double[] d1, double[] d2, double[] d3) {
+        for(int i = 0; i < a1.length; i++) {
+            a1[i] =          (i + 0);
+            a2[i] =          (i + 1);
+            a3[i] =          (i + 2);
+            b1[i] =   (long) (i + 0);
+            b2[i] =   (long) (i + 1);
+            b3[i] =   (long) (i + 2);
+            c1[i] =  (float) (i + 0);
+            c2[i] =  (float) (i + 1);
+            c3[i] =  (float) (i + 2);
+            d1[i] = (double) (i + 0);
+            d2[i] = (double) (i + 1);
+            d3[i] = (double) (i + 2);
+        }
     }
 
-    start = System.currentTimeMillis();
-    for (int j = 0; j < 5000; j++) {
-      sumI = sumInt(a1, a2 ,a3);
+    public static int sumInt(int[] a1, int[] a2, int[] a3) {
+        int total = 0;
+        for (int i = 0; i < a1.length; i++) {
+            total += (a1[i] * a2[i]) + (a1[i] * a3[i]) + (a2[i] * a3[i]);
+        }
+        return total;
     }
-    stop = System.currentTimeMillis();
-    System.out.println("sum int:    " + (stop - start));
 
-    start = System.currentTimeMillis();
-    for (int j = 0; j < 5000; j++) {
-      sumL = sumLong(b1, b2, b3);
+    public static long sumLong(long[] b1, long[] b2, long[] b3) {
+        long total = 0;
+        for (int i = 0; i < b1.length; i++) {
+            total += (b1[i] * b2[i]) + (b1[i] * b3[i]) + (b2[i] * b3[i]);
+        }
+        return total;
     }
-    stop = System.currentTimeMillis();
-    System.out.println("sum long:   " + (stop - start));
 
-    start = System.currentTimeMillis();
-    for (int j = 0; j < 5000; j++) {
-      sumF = sumFloat(c1, c2, c3);
+    public static float sumFloat(float[] c1, float[] c2, float[] c3) {
+        float total = 0;
+        for (int i = 0; i < c1.length; i++) {
+            total += (c1[i] * c2[i]) + (c1[i] * c3[i]) + (c2[i] * c3[i]);
+        }
+        return total;
     }
-    stop = System.currentTimeMillis();
-    System.out.println("sum float:  " + (stop - start));
 
-    start = System.currentTimeMillis();
-    for (int j = 0; j < 5000; j++) {
-      sumD = sumDouble(d1, d2, d3);
+    public static double sumDouble(double[] d1, double[] d2, double[] d3) {
+        double total = 0;
+        for (int i = 0; i < d1.length; i++) {
+            total += (d1[i] * d2[i]) + (d1[i] * d3[i]) + (d2[i] * d3[i]);
+        }
+        return total;
     }
-    stop = System.currentTimeMillis();
-    System.out.println("sum double: " + (stop - start));
 
-    start = System.currentTimeMillis();
-    for (int j = 0; j < 5000; j++) {
-      mulI = prodInt(a1, a2, a3);
+    public static int prodInt(int[] a1, int[] a2, int[] a3) {
+        int total = 1;
+        for (int i = 0; i < a1.length; i++) {
+            total *= (a1[i] * a2[i]) + (a1[i] * a3[i]) + (a2[i] * a3[i]);
+        }
+        return total;
     }
-    stop = System.currentTimeMillis();
-    System.out.println("prod int:    " + (stop - start));
 
-    start = System.currentTimeMillis();
-    for (int j = 0; j < 5000; j++) {
-      mulL = prodLong(b1, b2 ,b3);
+    public static long prodLong(long[] b1, long[] b2, long[] b3) {
+        long total = 1;
+        for (int i = 0; i < b1.length; i++) {
+            total *= (b1[i] * b2[i]) + (b1[i] * b3[i]) + (b2[i] * b3[i]);
+        }
+        return total;
     }
-    stop = System.currentTimeMillis();
-    System.out.println("prod long:   " + (stop - start));
 
-    start = System.currentTimeMillis();
-    for (int j = 0; j < 5000; j++) {
-      mulF = prodFloat(c1, c2, c3);
+    public static float prodFloat(float[] c1, float[] c2, float[] c3) {
+        float total = 1;
+        for (int i = 0; i < c1.length; i++) {
+            total *= (c1[i] * c2[i]) + (c1[i] * c3[i]) + (c2[i] * c3[i]);
+        }
+        return total;
     }
-    stop = System.currentTimeMillis();
-    System.out.println("prod float:  " + (stop - start));
 
-    start = System.currentTimeMillis();
-    for (int j = 0; j < 5000; j++) {
-      mulD = prodDouble(d1, d2, d3);
+    public static double prodDouble(double[] d1, double[] d2, double[] d3) {
+        double total = 1;
+        for (int i = 0; i < d1.length; i++) {
+            total *= (d1[i] * d2[i]) + (d1[i] * d3[i]) + (d2[i] * d3[i]);
+        }
+        return total;
     }
-    stop = System.currentTimeMillis();
-    System.out.println("prod double: " + (stop - start));
-
-  }
-
-  public static void ReductionInit(int[]    a1, int[]    a2, int[]    a3,
-                                   long[]   b1, long[]   b2, long[]   b3,
-                                   float[]  c1, float[]  c2, float[]  c3,
-                                   double[] d1, double[] d2, double[] d3 ) {
-    for(int i = 0; i < a1.length; i++) {
-      a1[i] =          (i + 0);
-      a2[i] =          (i + 1);
-      a3[i] =          (i + 2);
-      b1[i] =   (long) (i + 0);
-      b2[i] =   (long) (i + 1);
-      b3[i] =   (long) (i + 2);
-      c1[i] =  (float) (i + 0);
-      c2[i] =  (float) (i + 1);
-      c3[i] =  (float) (i + 2);
-      d1[i] = (double) (i + 0);
-      d2[i] = (double) (i + 1);
-      d3[i] = (double) (i + 2);
-    }
-  }
-
-  public static int sumInt(int[] a1, int[] a2, int[] a3) {
-    int total = 0;
-    for(int i = 0; i < a1.length; i++) {
-      total += (a1[i] * a2[i]) + (a1[i] * a3[i]) + (a2[i] * a3[i]);
-    }
-    return total;
-  }
-
-  public static long sumLong(long[] b1, long[] b2, long[] b3) {
-    long total = 0;
-    for(int i = 0; i < b1.length; i++) {
-      total += (b1[i] * b2[i]) + (b1[i] * b3[i]) + (b2[i] * b3[i]);
-    }
-    return total;
-  }
-
-  public static float sumFloat(float[] c1, float[] c2, float[] c3) {
-    float total = 0;
-    for(int i = 0; i < c1.length; i++) {
-      total += (c1[i] * c2[i]) + (c1[i] * c3[i]) + (c2[i] * c3[i]);
-    }
-    return total;
-  }
-
-  public static double sumDouble(double[] d1, double[] d2, double[] d3) {
-    double total = 0;
-    for(int i = 0; i < d1.length; i++) {
-      total += (d1[i] * d2[i]) + (d1[i] * d3[i]) + (d2[i] * d3[i]);
-    }
-    return total;
-  }
-
-  public static int prodInt(int[] a1, int[] a2, int[] a3) {
-    int total = 1;
-    for(int i = 0; i < a1.length; i++) {
-      total *= (a1[i] * a2[i]) + (a1[i] * a3[i]) + (a2[i] * a3[i]);
-    }
-    return total;
-  }
-
-  public static long prodLong(long[] b1, long[] b2, long[] b3) {
-    long total = 1;
-    for(int i = 0; i < b1.length; i++) {
-      total *= (b1[i] * b2[i]) + (b1[i] * b3[i]) + (b2[i] * b3[i]);
-    }
-    return total;
-  }
-
-  public static float prodFloat(float[] c1, float[] c2, float[] c3) {
-    float total = 1;
-    for(int i = 0; i < c1.length; i++) {
-      total *= (c1[i] * c2[i]) + (c1[i] * c3[i]) + (c2[i] * c3[i]);
-    }
-    return total;
-  }
-
-  public static double prodDouble(double[] d1, double[] d2, double[] d3) {
-    double total = 1;
-    for(int i = 0; i < d1.length; i++) {
-      total *= (d1[i] * d2[i]) + (d1[i] * d3[i]) + (d2[i] * d3[i]);
-    }
-    return total;
-  }
 }
diff --git a/test/compiler/loopopts/superword/SumRedAbsNeg_Double.java b/test/compiler/loopopts/superword/SumRedAbsNeg_Double.java
index 98e8f0f..807be10 100644
--- a/test/compiler/loopopts/superword/SumRedAbsNeg_Double.java
+++ b/test/compiler/loopopts/superword/SumRedAbsNeg_Double.java
@@ -28,72 +28,100 @@
  * @summary Add C2 AArch64 Superword support for scalar sum reduction optimizations : double abs & neg test
  * @requires os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
  */
 
-public class SumRedAbsNeg_Double
-{
-  public static void main(String[] args) throws Exception {
-    double[] a = new double[256*1024];
-    double[] b = new double[256*1024];
-    double[] c = new double[256*1024];
-    double[] d = new double[256*1024];
-    sumReductionInit(a,b,c);
-    double total = 0;
-    double valid = 3.6028590866691944E19;
+package compiler.loopopts.superword;
 
-    for(int j = 0; j < 2000; j++) {
-      total = sumReductionImplement(a,b,c,d,total);
+public class SumRedAbsNeg_Double {
+    public static void main(String[] args) throws Exception {
+        double[] a = new double[256 * 1024];
+        double[] b = new double[256 * 1024];
+        double[] c = new double[256 * 1024];
+        double[] d = new double[256 * 1024];
+        sumReductionInit(a, b, c);
+        double total = 0;
+        double valid = 3.6028590866691944E19;
+
+        for (int j = 0; j < 2000; j++) {
+            total = sumReductionImplement(a, b, c, d, total);
+        }
+
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
 
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
+    public static void sumReductionInit(
+            double[] a,
+            double[] b,
+            double[] c) {
+        for (int j = 0; j < 1; j++) {
+            for (int i = 0; i < a.length; i++) {
+                a[i] = i * 1 + j;
+                b[i] = i * 1 - j;
+                c[i] = i + j;
+            }
+        }
     }
-  }
 
-  public static void sumReductionInit(
-    double[] a,
-    double[] b,
-    double[] c)
-  {
-    for(int j = 0; j < 1; j++)
-    {
-      for(int i = 0; i < a.length; i++)
-      {
-        a[i] = i * 1 + j;
-        b[i] = i * 1 - j;
-        c[i] = i + j;
-      }
+    public static double sumReductionImplement(
+            double[] a,
+            double[] b,
+            double[] c,
+            double[] d,
+            double total) {
+        for (int i = 0; i < a.length; i++) {
+            d[i] = Math.abs(-a[i] * -b[i]) + Math.abs(-a[i] * -c[i]) + Math.abs(-b[i] * -c[i]);
+            total += d[i];
+        }
+        return total;
     }
-  }
-
-  public static double sumReductionImplement(
-    double[] a,
-    double[] b,
-    double[] c,
-    double[] d,
-    double total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      d[i] = Math.abs(-a[i] * -b[i]) + Math.abs(-a[i] * -c[i]) + Math.abs(-b[i] * -c[i]);
-      total += d[i];
-    }
-    return total;
-  }
 
 }
diff --git a/test/compiler/loopopts/superword/SumRedAbsNeg_Float.java b/test/compiler/loopopts/superword/SumRedAbsNeg_Float.java
index bbf7494..d108e10 100644
--- a/test/compiler/loopopts/superword/SumRedAbsNeg_Float.java
+++ b/test/compiler/loopopts/superword/SumRedAbsNeg_Float.java
@@ -28,72 +28,100 @@
  * @summary Add C2 AArch64 Superword support for scalar sum reduction optimizations : float abs & neg test
  * @requires os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRedAbsNeg_Double
  */
 
-public class SumRedAbsNeg_Float
-{
-  public static void main(String[] args) throws Exception {
-    float[] a = new float[256*1024];
-    float[] b = new float[256*1024];
-    float[] c = new float[256*1024];
-    float[] d = new float[256*1024];
-    sumReductionInit(a,b,c);
-    float total = 0;
-    float valid = (float)4.611686E18;
+package compiler.loopopts.superword;
 
-    for(int j = 0; j < 2000; j++) {
-      total = sumReductionImplement(a,b,c,d,total);
+public class SumRedAbsNeg_Float {
+    public static void main(String[] args) throws Exception {
+        float[] a = new float[256 * 1024];
+        float[] b = new float[256 * 1024];
+        float[] c = new float[256 * 1024];
+        float[] d = new float[256 * 1024];
+        sumReductionInit(a, b, c);
+        float total = 0;
+        float valid = (float) 4.611686E18;
+
+        for (int j = 0; j < 2000; j++) {
+            total = sumReductionImplement(a, b, c, d, total);
+        }
+
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
 
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
+    public static void sumReductionInit(
+            float[] a,
+            float[] b,
+            float[] c) {
+        for (int j = 0; j < 1; j++) {
+            for (int i = 0; i < a.length; i++) {
+                a[i] = i * 1 + j;
+                b[i] = i * 1 - j;
+                c[i] = i + j;
+            }
+        }
     }
-  }
 
-  public static void sumReductionInit(
-    float[] a,
-    float[] b,
-    float[] c)
-  {
-    for(int j = 0; j < 1; j++)
-    {
-      for(int i = 0; i < a.length; i++)
-      {
-        a[i] = i * 1 + j;
-        b[i] = i * 1 - j;
-        c[i] = i + j;
-      }
+    public static float sumReductionImplement(
+            float[] a,
+            float[] b,
+            float[] c,
+            float[] d,
+            float total) {
+        for (int i = 0; i < a.length; i++) {
+            d[i] = Math.abs(-a[i] * -b[i]) + Math.abs(-a[i] * -c[i]) + Math.abs(-b[i] * -c[i]);
+            total += d[i];
+        }
+        return total;
     }
-  }
-
-  public static float sumReductionImplement(
-    float[] a,
-    float[] b,
-    float[] c,
-    float[] d,
-    float total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      d[i] = Math.abs(-a[i] * -b[i]) + Math.abs(-a[i] * -c[i]) + Math.abs(-b[i] * -c[i]);
-      total += d[i];
-    }
-    return total;
-  }
 
 }
diff --git a/test/compiler/loopopts/superword/SumRedSqrt_Double.java b/test/compiler/loopopts/superword/SumRedSqrt_Double.java
index ac9edd5..b13efa8 100644
--- a/test/compiler/loopopts/superword/SumRedSqrt_Double.java
+++ b/test/compiler/loopopts/superword/SumRedSqrt_Double.java
@@ -23,75 +23,104 @@
  */
 
 /**
-* @test
-* @bug 8135028
-* @summary Add C2 x86 Superword support for scalar sum reduction optimizations : double sqrt test
-* @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
-*
-* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double
-* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double
-*
-* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double
-* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double
-*
-* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double
-* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double
-*
-* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double
-* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double
-*/
+ * @test
+ * @bug 8135028
+ * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : double sqrt test
+ * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRedSqrt_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRedSqrt_Double
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRedSqrt_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRedSqrt_Double
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRedSqrt_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRedSqrt_Double
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRedSqrt_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRedSqrt_Double
+ */
 
-public class SumRedSqrt_Double
-{
-  public static void main(String[] args) throws Exception {
-    double[] a = new double[256*1024];
-    double[] b = new double[256*1024];
-    double[] c = new double[256*1024];
-    double[] d = new double[256*1024];
-    sumReductionInit(a,b,c);
-    double total = 0;
-    double valid = 2.06157643776E14;
-    for(int j = 0; j < 2000; j++) {
-      total = sumReductionImplement(a,b,c,d,total);
-    }
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
-    }
-  }
 
-  public static void sumReductionInit(
-    double[] a,
-    double[] b,
-    double[] c)
-  {
-    for(int j = 0; j < 1; j++)
-    {
-      for(int i = 0; i < a.length; i++)
-      {
-        a[i] = i * 1 + j;
-        b[i] = i * 1 - j;
-        c[i] = i + j;
-      }
-    }
-  }
+package compiler.loopopts.superword;
 
-  public static double sumReductionImplement(
-    double[] a,
-    double[] b,
-    double[] c,
-    double[] d,
-    double total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      d[i]= Math.sqrt(a[i] * b[i]) + Math.sqrt(a[i] * c[i]) + Math.sqrt(b[i] * c[i]);
-      total += d[i];
+public class SumRedSqrt_Double {
+    public static void main(String[] args) throws Exception {
+        double[] a = new double[256 * 1024];
+        double[] b = new double[256 * 1024];
+        double[] c = new double[256 * 1024];
+        double[] d = new double[256 * 1024];
+        sumReductionInit(a, b, c);
+        double total = 0;
+        double valid = 2.06157643776E14;
+        for (int j = 0; j < 2000; j++) {
+            total = sumReductionImplement(a, b, c, d, total);
+        }
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
-    return total;
-  }
+
+    public static void sumReductionInit(
+            double[] a,
+            double[] b,
+            double[] c) {
+        for (int j = 0; j < 1; j++) {
+            for (int i = 0; i < a.length; i++) {
+                a[i] = i * 1 + j;
+                b[i] = i * 1 - j;
+                c[i] = i + j;
+            }
+        }
+    }
+
+    public static double sumReductionImplement(
+            double[] a,
+            double[] b,
+            double[] c,
+            double[] d,
+            double total) {
+        for (int i = 0; i < a.length; i++) {
+            d[i] = Math.sqrt(a[i] * b[i]) + Math.sqrt(a[i] * c[i]) + Math.sqrt(b[i] * c[i]);
+            total += d[i];
+        }
+        return total;
+    }
 
 }
diff --git a/test/compiler/loopopts/superword/SumRed_Double.java b/test/compiler/loopopts/superword/SumRed_Double.java
index b33ef59..f9e6f9e 100644
--- a/test/compiler/loopopts/superword/SumRed_Double.java
+++ b/test/compiler/loopopts/superword/SumRed_Double.java
@@ -28,70 +28,98 @@
  * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : double test
  * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRed_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRed_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRed_Double
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Double
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRed_Double
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRed_Double
  */
 
-public class SumRed_Double
-{
-  public static void main(String[] args) throws Exception {
-    double[] a = new double[256*1024];
-    double[] b = new double[256*1024];
-    double[] c = new double[256*1024];
-    double[] d = new double[256*1024];
-    sumReductionInit(a,b,c);
-    double total = 0;
-    double valid = 3.6028590866691944E19;
-    for(int j = 0; j < 2000; j++) {
-      total = sumReductionImplement(a,b,c,d,total);
-    }
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
-    }
-  }
+package compiler.loopopts.superword;
 
-  public static void sumReductionInit(
-    double[] a,
-    double[] b,
-    double[] c)
-  {
-    for(int j = 0; j < 1; j++)
-    {
-      for(int i = 0; i < a.length; i++)
-      {
-        a[i] = i * 1 + j;
-        b[i] = i * 1 - j;
-        c[i] = i + j;
-      }
+public class SumRed_Double {
+    public static void main(String[] args) throws Exception {
+        double[] a = new double[256 * 1024];
+        double[] b = new double[256 * 1024];
+        double[] c = new double[256 * 1024];
+        double[] d = new double[256 * 1024];
+        sumReductionInit(a, b, c);
+        double total = 0;
+        double valid = 3.6028590866691944E19;
+        for (int j = 0; j < 2000; j++) {
+            total = sumReductionImplement(a, b, c, d, total);
+        }
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
-  }
 
-  public static double sumReductionImplement(
-    double[] a,
-    double[] b,
-    double[] c,
-    double[] d,
-    double total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
-      total += d[i];
+    public static void sumReductionInit(
+            double[] a,
+            double[] b,
+            double[] c) {
+        for (int j = 0; j < 1; j++) {
+            for (int i = 0; i < a.length; i++) {
+                a[i] = i * 1 + j;
+                b[i] = i * 1 - j;
+                c[i] = i + j;
+            }
+        }
     }
-    return total;
-  }
+
+    public static double sumReductionImplement(
+            double[] a,
+            double[] b,
+            double[] c,
+            double[] d,
+            double total) {
+        for (int i = 0; i < a.length; i++) {
+            d[i] = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
+            total += d[i];
+        }
+        return total;
+    }
 
 }
diff --git a/test/compiler/loopopts/superword/SumRed_Float.java b/test/compiler/loopopts/superword/SumRed_Float.java
index 2f02f36..22afdba 100644
--- a/test/compiler/loopopts/superword/SumRed_Float.java
+++ b/test/compiler/loopopts/superword/SumRed_Float.java
@@ -28,70 +28,98 @@
  * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : float test
  * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRed_Float
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRed_Float
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRed_Float
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Float
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRed_Float
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRed_Float
  */
 
-public class SumRed_Float
-{
-  public static void main(String[] args) throws Exception {
-    float[] a = new float[256*1024];
-    float[] b = new float[256*1024];
-    float[] c = new float[256*1024];
-    float[] d = new float[256*1024];
-    sumReductionInit(a,b,c);
-    float total = 0;
-    float valid = (float)4.611686E18;
-    for(int j = 0; j < 2000; j++) {
-      total = sumReductionImplement(a,b,c,d,total);
-    }
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
-    }
-  }
+package compiler.loopopts.superword;
 
-  public static void sumReductionInit(
-    float[] a,
-    float[] b,
-    float[] c)
-  {
-    for(int j = 0; j < 1; j++)
-    {
-      for(int i = 0; i < a.length; i++)
-      {
-        a[i] = i * 1 + j;
-        b[i] = i * 1 - j;
-        c[i] = i + j;
-      }
+public class SumRed_Float {
+    public static void main(String[] args) throws Exception {
+        float[] a = new float[256 * 1024];
+        float[] b = new float[256 * 1024];
+        float[] c = new float[256 * 1024];
+        float[] d = new float[256 * 1024];
+        sumReductionInit(a, b, c);
+        float total = 0;
+        float valid = (float) 4.611686E18;
+        for (int j = 0; j < 2000; j++) {
+            total = sumReductionImplement(a, b, c, d, total);
+        }
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
-  }
 
-  public static float sumReductionImplement(
-    float[] a,
-    float[] b,
-    float[] c,
-    float[] d,
-    float total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
-      total += d[i];
+    public static void sumReductionInit(
+            float[] a,
+            float[] b,
+            float[] c) {
+        for (int j = 0; j < 1; j++) {
+            for (int i = 0; i < a.length; i++) {
+                a[i] = i * 1 + j;
+                b[i] = i * 1 - j;
+                c[i] = i + j;
+            }
+        }
     }
-    return total;
-  }
+
+    public static float sumReductionImplement(
+            float[] a,
+            float[] b,
+            float[] c,
+            float[] d,
+            float total) {
+        for (int i = 0; i < a.length; i++) {
+            d[i] = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
+            total += d[i];
+        }
+        return total;
+    }
 
 }
diff --git a/test/compiler/loopopts/superword/SumRed_Int.java b/test/compiler/loopopts/superword/SumRed_Int.java
index c6c4b0b..a567665 100644
--- a/test/compiler/loopopts/superword/SumRed_Int.java
+++ b/test/compiler/loopopts/superword/SumRed_Int.java
@@ -28,70 +28,98 @@
  * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : int test
  * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Int
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=2
+ *      compiler.loopopts.superword.SumRed_Int
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Int
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRed_Int
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Int
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRed_Int
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Int
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRed_Int
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=16
+ *      compiler.loopopts.superword.SumRed_Int
  */
 
-public class SumRed_Int
-{
-  public static void main(String[] args) throws Exception {
-    int[] a = new int[256*1024];
-    int[] b = new int[256*1024];
-    int[] c = new int[256*1024];
-    int[] d = new int[256*1024];
-    sumReductionInit(a,b,c);
-    int total = 0;
-    int valid = 262144000;
-    for(int j = 0; j < 2000; j++) {
-      total = sumReductionImplement(a,b,c,d,total);
-    }
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
-    }
-  }
+package compiler.loopopts.superword;
 
-  public static void sumReductionInit(
-    int[] a,
-    int[] b,
-    int[] c)
-  {
-    for(int j = 0; j < 1; j++)
-    {
-      for(int i = 0; i < a.length; i++)
-      {
-        a[i] = i * 1 + j;
-        b[i] = i * 1 - j;
-        c[i] = i + j;
-      }
+public class SumRed_Int {
+    public static void main(String[] args) throws Exception {
+        int[] a = new int[256 * 1024];
+        int[] b = new int[256 * 1024];
+        int[] c = new int[256 * 1024];
+        int[] d = new int[256 * 1024];
+        sumReductionInit(a, b, c);
+        int total = 0;
+        int valid = 262144000;
+        for (int j = 0; j < 2000; j++) {
+            total = sumReductionImplement(a, b, c, d, total);
+        }
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
-  }
 
-  public static int sumReductionImplement(
-    int[] a,
-    int[] b,
-    int[] c,
-    int[] d,
-    int total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
-      total += d[i];
+    public static void sumReductionInit(
+            int[] a,
+            int[] b,
+            int[] c) {
+        for (int j = 0; j < 1; j++) {
+            for (int i = 0; i < a.length; i++) {
+                a[i] = i * 1 + j;
+                b[i] = i * 1 - j;
+                c[i] = i + j;
+            }
+        }
     }
-    return total;
-  }
+
+    public static int sumReductionImplement(
+            int[] a,
+            int[] b,
+            int[] c,
+            int[] d,
+            int total) {
+        for (int i = 0; i < a.length; i++) {
+            d[i] = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
+            total += d[i];
+        }
+        return total;
+    }
 
 }
diff --git a/test/compiler/loopopts/superword/SumRed_Long.java b/test/compiler/loopopts/superword/SumRed_Long.java
index 503a11d..b841d7f 100644
--- a/test/compiler/loopopts/superword/SumRed_Long.java
+++ b/test/compiler/loopopts/superword/SumRed_Long.java
@@ -28,66 +28,77 @@
  * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : long test
  * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64"
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Long
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Long
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRed_Long
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=4
+ *      compiler.loopopts.superword.SumRed_Long
  *
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Long
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Long
- *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:+SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRed_Long
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250
+ *      -XX:CompileThresholdScaling=0.1
+ *      -XX:-SuperWordReductions
+ *      -XX:LoopMaxUnroll=8
+ *      compiler.loopopts.superword.SumRed_Long
  */
 
-public class SumRed_Long
-{
-  public static void main(String[] args) throws Exception {
-    long[] a = new long[256*1024];
-    long[] b = new long[256*1024];
-    long[] c = new long[256*1024];
-    long[] d = new long[256*1024];
-    sumReductionInit(a,b,c);
-    long total = 0;
-    long valid = 262144000;
-    for(int j = 0; j < 2000; j++) {
-      total = sumReductionImplement(a,b,c,d,total);
-    }
-    total = (int)total;
-    if(total == valid) {
-      System.out.println("Success");
-    } else {
-      System.out.println("Invalid sum of elements variable in total: " + total);
-      System.out.println("Expected value = " + valid);
-      throw new Exception("Failed");
-    }
-  }
+package compiler.loopopts.superword;
 
-  public static void sumReductionInit(
-    long[] a,
-    long[] b,
-    long[] c)
-  {
-    for(int j = 0; j < 1; j++)
-    {
-      for(int i = 0; i < a.length; i++)
-      {
-        a[i] = i * 1 + j;
-        b[i] = i * 1 - j;
-        c[i] = i + j;
-      }
+public class SumRed_Long {
+    public static void main(String[] args) throws Exception {
+        long[] a = new long[256 * 1024];
+        long[] b = new long[256 * 1024];
+        long[] c = new long[256 * 1024];
+        long[] d = new long[256 * 1024];
+        sumReductionInit(a, b, c);
+        long total = 0;
+        long valid = 262144000;
+        for (int j = 0; j < 2000; j++) {
+            total = sumReductionImplement(a, b, c, d, total);
+        }
+        total = (int) total;
+        if (total == valid) {
+            System.out.println("Success");
+        } else {
+            System.out.println("Invalid sum of elements variable in total: " + total);
+            System.out.println("Expected value = " + valid);
+            throw new Exception("Failed");
+        }
     }
-  }
 
-  public static long sumReductionImplement(
-    long[] a,
-    long[] b,
-    long[] c,
-    long[] d,
-    long total)
-  {
-    for(int i = 0; i < a.length; i++)
-    {
-      d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
-      total += d[i];
+    public static void sumReductionInit(
+            long[] a,
+            long[] b,
+            long[] c) {
+        for (int j = 0; j < 1; j++) {
+            for (int i = 0; i < a.length; i++) {
+                a[i] = i * 1 + j;
+                b[i] = i * 1 - j;
+                c[i] = i + j;
+            }
+        }
     }
-    return total;
-  }
+
+    public static long sumReductionImplement(
+            long[] a,
+            long[] b,
+            long[] c,
+            long[] d,
+            long total) {
+        for (int i = 0; i < a.length; i++) {
+            d[i] = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
+            total += d[i];
+        }
+        return total;
+    }
 
 }
diff --git a/test/compiler/loopopts/superword/TestBestAlign.java b/test/compiler/loopopts/superword/TestBestAlign.java
index 9609859..87fa90c 100644
--- a/test/compiler/loopopts/superword/TestBestAlign.java
+++ b/test/compiler/loopopts/superword/TestBestAlign.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8141624
  * @summary Limit calculation of pre loop during super word optimization is wrong
- * @run main/othervm TestBestAlign
+ * @run main/othervm compiler.loopopts.superword.TestBestAlign
  * @author gunter.haug@sap.com
  */
 
+package compiler.loopopts.superword;
+
 public class TestBestAlign {
 
     static final int initVal = -1;
diff --git a/test/compiler/loopopts/superword/TestReductionWithLoopVariantUse.java b/test/compiler/loopopts/superword/TestReductionWithLoopVariantUse.java
index b8e1d72..df471d5 100644
--- a/test/compiler/loopopts/superword/TestReductionWithLoopVariantUse.java
+++ b/test/compiler/loopopts/superword/TestReductionWithLoopVariantUse.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8080976
  * @summary Loop variant use in reduction should prevent vectorization
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestReductionWithLoopVariantUse
- *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *      compiler.loopopts.superword.TestReductionWithLoopVariantUse
  */
 
+package compiler.loopopts.superword;
+
 public class TestReductionWithLoopVariantUse {
     static int m(int[] array) {
         int c = 0;
diff --git a/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java b/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java
index 41e7769..8ef4cde 100644
--- a/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java
+++ b/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java
@@ -22,17 +22,20 @@
  *
  */
 
-import jdk.test.lib.*;
-import jdk.internal.misc.Unsafe;
-
 /**
  * @test
  * @bug 8078497
  * @summary Tests correct alignment of vectors with loop invariant offset.
  * @modules java.base/jdk.internal.misc
  * @library /testlibrary
- * @run main TestVectorizationWithInvariant
+ * @run main compiler.loopopts.superword.TestVectorizationWithInvariant
  */
+
+package compiler.loopopts.superword;
+
+import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Utils;
+
 public class TestVectorizationWithInvariant {
 
     private static Unsafe unsafe;
diff --git a/test/compiler/macronodes/TestEliminateAllocationPhi.java b/test/compiler/macronodes/TestEliminateAllocationPhi.java
index e9a5154..b57dcde 100644
--- a/test/compiler/macronodes/TestEliminateAllocationPhi.java
+++ b/test/compiler/macronodes/TestEliminateAllocationPhi.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8046698
  * @summary PhiNode inserted between AllocateNode and Initialization node confuses allocation elimination
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestEliminateAllocationPhi
- *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.macronodes.TestEliminateAllocationPhi
  */
 
+package compiler.macronodes;
+
 public class TestEliminateAllocationPhi {
 
     // This will return I when called from m(0 and once optimized will
diff --git a/test/compiler/membars/DekkerTest.java b/test/compiler/membars/DekkerTest.java
index 83eb923..8fdb33c 100644
--- a/test/compiler/membars/DekkerTest.java
+++ b/test/compiler/membars/DekkerTest.java
@@ -25,14 +25,22 @@
  * @test
  * @bug 8007898
  * @summary Incorrect optimization of Memory Barriers in Matcher::post_store_load_barrier().
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
+ * @run main/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions
+ *      -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM
+ *      compiler.membars.DekkerTest
+ * @run main/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions
+ *      -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM
+ *      compiler.membars.DekkerTest
+ * @run main/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions
+ *      -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM
+ *      compiler.membars.DekkerTest
  * @author Martin Doerr martin DOT doerr AT sap DOT com
  *
  * Run 3 times since the failure is intermittent.
  */
 
+package compiler.membars;
+
 public class DekkerTest {
 
     /*
diff --git a/test/compiler/membars/TestMemBarAcquire.java b/test/compiler/membars/TestMemBarAcquire.java
index e255cc1..d8de1b4 100644
--- a/test/compiler/membars/TestMemBarAcquire.java
+++ b/test/compiler/membars/TestMemBarAcquire.java
@@ -24,30 +24,34 @@
 /*
  * @test TestMemBarAcquire
  * @bug 8048879
- * @summary "Tests optimization of MemBarAcquireNodes"
- * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation TestMemBarAcquire
+ * @summary Tests optimization of MemBarAcquireNodes
+ * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation
+ *                   compiler.membars.TestMemBarAcquire
  */
+
+package compiler.membars;
+
 public class TestMemBarAcquire {
-  private volatile static Object defaultObj = new Object();
-  private Object obj;
+    private volatile static Object defaultObj = new Object();
+    private Object obj;
 
-  public TestMemBarAcquire(Object param) {
-    // Volatile load. MemBarAcquireNode is added after the
-    // load to prevent following loads from floating up past.
-    // StoreNode is added to store result of load in 'obj'.
-    this.obj = defaultObj;
-    // Overrides 'obj' and therefore makes previous StoreNode
-    // and the corresponding LoadNode useless. However, the
-    // LoadNode is still connected to the MemBarAcquireNode
-    // that should now release the reference.
-    this.obj = param;
-  }
-
-  public static void main(String[] args) throws Exception {
-    // Make sure TestMemBarAcquire::<init> is compiled
-    for (int i = 0; i < 100000; ++i) {
-      TestMemBarAcquire p = new TestMemBarAcquire(new Object());
+    public TestMemBarAcquire(Object param) {
+        // Volatile load. MemBarAcquireNode is added after the
+        // load to prevent following loads from floating up past.
+        // StoreNode is added to store result of load in 'obj'.
+        this.obj = defaultObj;
+        // Overrides 'obj' and therefore makes previous StoreNode
+        // and the corresponding LoadNode useless. However, the
+        // LoadNode is still connected to the MemBarAcquireNode
+        // that should now release the reference.
+        this.obj = param;
     }
-  }
+
+    public static void main(String[] args) throws Exception {
+        // Make sure TestMemBarAcquire::<init> is compiled
+        for (int i = 0; i < 100000; ++i) {
+            TestMemBarAcquire p = new TestMemBarAcquire(new Object());
+        }
+    }
 }
 
diff --git a/test/compiler/memoryinitialization/ZeroTLABTest.java b/test/compiler/memoryinitialization/ZeroTLABTest.java
index 9be412a..09057c2 100644
--- a/test/compiler/memoryinitialization/ZeroTLABTest.java
+++ b/test/compiler/memoryinitialization/ZeroTLABTest.java
@@ -25,11 +25,15 @@
 /*
  * @test
  * @bug 8086053
- * @run main/othervm -Xcomp -XX:+UseTLAB -XX:+ZeroTLAB ZeroTLABTest
- * @run main/othervm -Xcomp -XX:+UseTLAB -XX:-ZeroTLAB ZeroTLABTest
- * @run main/othervm -Xcomp -XX:-UseTLAB -XX:+ZeroTLAB ZeroTLABTest
- * @run main/othervm -Xcomp -XX:-UseTLAB -XX:-ZeroTLAB ZeroTLABTest
+ *
+ * @run main/othervm -Xcomp -XX:+UseTLAB -XX:+ZeroTLAB compiler.memoryinitialization.ZeroTLABTest
+ * @run main/othervm -Xcomp -XX:+UseTLAB -XX:-ZeroTLAB compiler.memoryinitialization.ZeroTLABTest
+ * @run main/othervm -Xcomp -XX:-UseTLAB -XX:+ZeroTLAB compiler.memoryinitialization.ZeroTLABTest
+ * @run main/othervm -Xcomp -XX:-UseTLAB -XX:-ZeroTLAB compiler.memoryinitialization.ZeroTLABTest
  */
+
+package compiler.memoryinitialization;
+
 public class ZeroTLABTest {
     public static void main(String args[]) {
         System.out.println("Test PASSED");
diff --git a/test/compiler/onSpinWait/TestOnSpinWait.java b/test/compiler/onSpinWait/TestOnSpinWait.java
index 6a3fa0d..97c3ab6 100644
--- a/test/compiler/onSpinWait/TestOnSpinWait.java
+++ b/test/compiler/onSpinWait/TestOnSpinWait.java
@@ -26,15 +26,16 @@
  * @test TestOnSpinWait
  * @summary (x86 only) checks that java.lang.Thread.onSpinWait is intrinsified
  * @bug 8147844
- * @modules java.base/jdk.internal.misc
  * @library /testlibrary
+ * @modules java.base/jdk.internal.misc
  * @requires os.arch=="x86" | os.arch=="amd64" | os.arch=="x86_64"
- * @run main TestOnSpinWait
+ * @run driver compiler.onSpinWait.TestOnSpinWait
  */
 
-import java.lang.invoke.*;
-import jdk.test.lib.*;
-import static jdk.test.lib.Asserts.*;
+package compiler.onSpinWait;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
 
 public class TestOnSpinWait {
 
@@ -45,7 +46,7 @@
           "-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
           "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch",
           "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions",
-          "-XX:+PrintInlining", "TestOnSpinWait$Launcher");
+          "-XX:+PrintInlining", Launcher.class.getName());
 
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
 
@@ -59,7 +60,7 @@
           "-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
           "-XX:-TieredCompilation", "-Xbatch",
           "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions",
-          "-XX:+PrintInlining", "TestOnSpinWait$Launcher");
+          "-XX:+PrintInlining", Launcher.class.getName());
 
         analyzer = new OutputAnalyzer(pb.start());
 
diff --git a/test/compiler/onSpinWait/TestOnSpinWaitEnableDisable.java b/test/compiler/onSpinWait/TestOnSpinWaitEnableDisable.java
index 97a7dd7..dd0c9c8 100644
--- a/test/compiler/onSpinWait/TestOnSpinWaitEnableDisable.java
+++ b/test/compiler/onSpinWait/TestOnSpinWaitEnableDisable.java
@@ -26,10 +26,14 @@
  * @test TestOnSpinWaitEnableDisable
  * @summary Test to ensure basic functioning of java.lang.Thread.onSpinWait
  * @bug 8157683
- * @run main TestOnSpinWaitEnableDisable
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_onSpinWait TestOnSpinWaitEnableDisable
+ *
+ * @run main compiler.onSpinWait.TestOnSpinWaitEnableDisable
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_onSpinWait
+ *                   compiler.onSpinWait.TestOnSpinWaitEnableDisable
  */
 
+package compiler.onSpinWait;
+
 public class TestOnSpinWaitEnableDisable {
     public static void main(String[] args) {
         for (int i = 0; i < 50_000; i++) {
diff --git a/test/compiler/oracle/CheckCompileCommandOption.java b/test/compiler/oracle/CheckCompileCommandOption.java
index 6489df5..10e71b4 100644
--- a/test/compiler/oracle/CheckCompileCommandOption.java
+++ b/test/compiler/oracle/CheckCompileCommandOption.java
@@ -21,21 +21,23 @@
  * questions.
  */
 
-import java.io.PrintWriter;
-import java.io.File;
-
-import jdk.test.lib.*;
-
 /*
  * @test CheckCompileCommandOption
+ * @summary Checks parsing of -XX:CompileCommand=option
  * @bug 8055286 8056964 8059847 8069035
- * @summary "Checks parsing of -XX:CompileCommand=option"
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main CheckCompileCommandOption
+ * @run driver compiler.oracle.CheckCompileCommandOption
  */
 
+package compiler.oracle;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
+import java.io.File;
+
 public class CheckCompileCommandOption {
 
     // Currently, two types of trailing options can be used with
diff --git a/test/compiler/oracle/GetMethodOptionTest.java b/test/compiler/oracle/GetMethodOptionTest.java
index ed295f4..2da784c 100644
--- a/test/compiler/oracle/GetMethodOptionTest.java
+++ b/test/compiler/oracle/GetMethodOptionTest.java
@@ -21,32 +21,34 @@
  * questions.
  */
 
-import java.lang.reflect.Executable;
-import java.util.function.BiFunction;
+/*
+ * @test
+ * @bug 8074980
+ * @library /testlibrary /test/lib
+ * @modules java.base/jdk.internal.misc
+ * @build sun.hotspot.WhiteBox jdk.test.lib.Asserts compiler.oracle.GetMethodOptionTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,ccstrlist,MyListOption,_foo,_bar
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,ccstr,MyStrOption,_foo
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,bool,MyBoolOption,false
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,intx,MyIntxOption,-1
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,uintx,MyUintxOption,1
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,MyFlag
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,double,MyDoubleOption1,1.123
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,double,MyDoubleOption2,1.123
+ *                   -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,bool,MyBoolOptionX,false,intx,MyIntxOptionX,-1,uintx,MyUintxOptionX,1,MyFlagX,double,MyDoubleOptionX,1.123
+ *                   compiler.oracle.GetMethodOptionTest
+ */
+
+package compiler.oracle;
 
 import jdk.test.lib.Asserts;
 import sun.hotspot.WhiteBox;
 
-/*
- * @test
- * @bug 8074980
- * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib
- * @build sun.hotspot.WhiteBox jdk.test.lib.Asserts GetMethodOptionTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:CompileCommand=option,GetMethodOptionTest::test,ccstrlist,MyListOption,_foo,_bar
- *                   -XX:CompileCommand=option,GetMethodOptionTest::test,ccstr,MyStrOption,_foo
- *                   -XX:CompileCommand=option,GetMethodOptionTest::test,bool,MyBoolOption,false
- *                   -XX:CompileCommand=option,GetMethodOptionTest::test,intx,MyIntxOption,-1
- *                   -XX:CompileCommand=option,GetMethodOptionTest::test,uintx,MyUintxOption,1
- *                   -XX:CompileCommand=option,GetMethodOptionTest::test,MyFlag
- *                   -XX:CompileCommand=option,GetMethodOptionTest::test,double,MyDoubleOption1,1.123
- *                   -XX:CompileCommand=option,GetMethodOptionTest.test,double,MyDoubleOption2,1.123
- *                   -XX:CompileCommand=option,GetMethodOptionTest::test,bool,MyBoolOptionX,false,intx,MyIntxOptionX,-1,uintx,MyUintxOptionX,1,MyFlagX,double,MyDoubleOptionX,1.123
- *                   GetMethodOptionTest
- */
+import java.lang.reflect.Executable;
+import java.util.function.BiFunction;
 
 public class GetMethodOptionTest {
     private static final  WhiteBox WB = WhiteBox.getWhiteBox();
diff --git a/test/compiler/oracle/MethodMatcherTest.java b/test/compiler/oracle/MethodMatcherTest.java
index 1f15827..3e7f1a0 100644
--- a/test/compiler/oracle/MethodMatcherTest.java
+++ b/test/compiler/oracle/MethodMatcherTest.java
@@ -23,21 +23,24 @@
 
 /*
  * @test MethodMatcherTest
- * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib
- * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MethodMatcherTest
  * @summary Testing of compiler/MethodMatcher
  * @bug 8135068
+ * @library /testlibrary /test/lib
+ * @modules java.base/jdk.internal.misc
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   compiler.oracle.MethodMatcherTest
  */
 
+package compiler.oracle;
+
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 
-import sun.hotspot.WhiteBox;
-
 public class MethodMatcherTest {
 
     /** Instance of WhiteBox */
@@ -83,14 +86,14 @@
         testCases.add(helper, "_pool,sub,Klass*,met@%hod,(0)V", PARSING_FAILURE);
 
         testCases.add(helper, "*.*", MATCH);
-        testCases.add(helper, "MethodMatcherTest.*", MATCH);
-        testCases.add(helper, "MethodMatcherTest.helper", MATCH);
-        testCases.add(helper, "MethodMatcherTest.helper()", MATCH);
-        testCases.add(helper, "MethodMatcherTest.helper()V", MATCH);
-        testCases.add(helper, "MethodMatcherTest.helper()V;", NO_MATCH);
-        testCases.add(helper, "MethodMatcherTest.helper()I", NO_MATCH);
-        testCases.add(helper, "MethodMatcherTest.helperX", NO_MATCH);
-        testCases.add(helper, "MethodMatcherTestX.helper;", NO_MATCH);
+        testCases.add(helper, "compiler/oracle/MethodMatcherTest.*", MATCH);
+        testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper", MATCH);
+        testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()", MATCH);
+        testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()V", MATCH);
+        testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()V;", NO_MATCH);
+        testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()I", NO_MATCH);
+        testCases.add(helper, "compiler/oracle/MethodMatcherTest.helperX", NO_MATCH);
+        testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper;", NO_MATCH);
         testCases.add(helper, "abc.*", NO_MATCH);
         testCases.add(helper, "*.abc", NO_MATCH);
 
@@ -100,13 +103,13 @@
         testCases.add(getDate, "java/util/Date.*", MATCH);
 
         testCases.add(inner, "*.*", MATCH);
-        testCases.add(inner, "MethodMatcherTest$TestCases.innerHelper", MATCH);
-        testCases.add(inner, "MethodMatcherTest*.innerHelper", MATCH);
-        testCases.add(inner, "MethodMatcherTest$*.innerHelper", MATCH);
+        testCases.add(inner, "compiler/oracle/MethodMatcherTest$TestCases.innerHelper", MATCH);
+        testCases.add(inner, "compiler/oracle/MethodMatcherTest*.innerHelper", MATCH);
+        testCases.add(inner, "compiler/oracle/MethodMatcherTest$*.innerHelper", MATCH);
         testCases.add(inner, "*$TestCases.innerHelper", MATCH);
         testCases.add(inner, "*TestCases.innerHelper", MATCH);
         testCases.add(inner, "TestCases.innerHelper", NO_MATCH);
-        testCases.add(inner, "MethodMatcherTest.innerHelper", NO_MATCH);
+        testCases.add(inner, "compiler/oracle/MethodMatcherTest.innerHelper", NO_MATCH);
 
         testCases.add(toString, "*.*", MATCH);
         testCases.add(toString, "java/lang/String.toString", MATCH);
diff --git a/test/compiler/oracle/TestCompileCommand.java b/test/compiler/oracle/TestCompileCommand.java
index 6ec02ac..d8ba4aa 100644
--- a/test/compiler/oracle/TestCompileCommand.java
+++ b/test/compiler/oracle/TestCompileCommand.java
@@ -21,21 +21,21 @@
  * questions.
  */
 
-import java.io.PrintWriter;
-import java.io.File;
-
-import jdk.test.lib.*;
-
 /*
  * @test TestCompileCommand
  * @bug 8069389
- * @summary "Regression tests of -XX:CompileCommand"
+ * @summary Regression tests of -XX:CompileCommand
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main TestCompileCommand
+ * @run driver compiler.oracle.TestCompileCommand
  */
 
+package compiler.oracle;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
 public class TestCompileCommand {
 
     private static final String[][] ARGUMENTS = {
diff --git a/test/compiler/osr/TestOSRWithNonEmptyStack.java b/test/compiler/osr/TestOSRWithNonEmptyStack.java
index 516d485..3cbcbb0 100644
--- a/test/compiler/osr/TestOSRWithNonEmptyStack.java
+++ b/test/compiler/osr/TestOSRWithNonEmptyStack.java
@@ -21,22 +21,37 @@
  * questions.
  */
 
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import static jdk.internal.org.objectweb.asm.Opcodes.*;
-
 /**
  * @test
  * @bug 8051344
  * @summary Force OSR compilation with non-empty stack at the OSR entry point.
  * @modules java.base/jdk.internal.org.objectweb.asm
- * @compile -XDignore.symbol.file TestOSRWithNonEmptyStack.java
- * @run main/othervm -XX:CompileOnly=TestCase.test TestOSRWithNonEmptyStack
+ * @run main/othervm -XX:CompileCommand=compileonly,TestCase::test
+ *                   compiler.osr.TestOSRWithNonEmptyStack
  */
+
+package compiler.osr;
+
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.DUP;
+import static jdk.internal.org.objectweb.asm.Opcodes.IADD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
+import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_1;
+import static jdk.internal.org.objectweb.asm.Opcodes.IF_ICMPLT;
+import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.ISTORE;
+import static jdk.internal.org.objectweb.asm.Opcodes.POP;
+import static jdk.internal.org.objectweb.asm.Opcodes.RETURN;
+
 public class TestOSRWithNonEmptyStack extends ClassLoader {
     private static final int CLASS_FILE_VERSION = 52;
     private static final String CLASS_NAME = "TestCase";
diff --git a/test/compiler/osr/TestRangeCheck.java b/test/compiler/osr/TestRangeCheck.java
index 6079cb9..829a07d 100644
--- a/test/compiler/osr/TestRangeCheck.java
+++ b/test/compiler/osr/TestRangeCheck.java
@@ -25,8 +25,11 @@
  * @test TestRangeCheck
  * @bug 8054883
  * @summary Tests that range check is not skipped
+ * @run main compiler.osr.TestRangeCheck
  */
 
+package compiler.osr;
+
 public class TestRangeCheck {
     public static void main(String args[]) {
         try {
diff --git a/test/compiler/print/PrintInlining.java b/test/compiler/print/PrintInlining.java
index 6aa9033..deb1ae0 100644
--- a/test/compiler/print/PrintInlining.java
+++ b/test/compiler/print/PrintInlining.java
@@ -25,12 +25,15 @@
  * @test
  * @bug 8022585
  * @summary VM crashes when ran with -XX:+PrintInlining
- * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining PrintInlining
+ * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining
+ *                   compiler.print.PrintInlining
  *
  */
 
+package compiler.print;
+
 public class PrintInlining {
-  public static void main(String[] args) {
-    System.out.println("Passed");
-  }
+    public static void main(String[] args) {
+        System.out.println("Passed");
+    }
 }
diff --git a/test/compiler/print/TestProfileReturnTypePrinting.java b/test/compiler/print/TestProfileReturnTypePrinting.java
index ca57139..a09d9d3 100644
--- a/test/compiler/print/TestProfileReturnTypePrinting.java
+++ b/test/compiler/print/TestProfileReturnTypePrinting.java
@@ -24,14 +24,17 @@
 /**
  * @test
  * @bug 8073154
- * @build TestProfileReturnTypePrinting
+ * @build compiler.print.TestProfileReturnTypePrinting
  * @run main/othervm -XX:TypeProfileLevel=020
- *                   -XX:CompileOnly=TestProfileReturnTypePrinting.testMethod
+ *                   -XX:CompileCommand=compileonly,compiler.print.TestProfileReturnTypePrinting::testMethod
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintLIR
- *                   TestProfileReturnTypePrinting
+ *                   compiler.print.TestProfileReturnTypePrinting
  * @summary Verify that c1's LIR that contains ProfileType node could be dumped
  *          without a crash disregard to an exact class knowledge.
  */
+
+package compiler.print;
+
 public class TestProfileReturnTypePrinting {
     private static final int ITERATIONS = 1_000_000;
 
diff --git a/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java b/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java
index d882cc3..9ca1c13 100644
--- a/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java
+++ b/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java
@@ -25,11 +25,18 @@
  * @test
  * @bug 8041458
  * @summary profiling of arguments in C1 at MethodHandle invoke of intrinsic tries to profile popped argument.
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TieredStopAtLevel=3 TestMethodHandleInvokesIntrinsic
+ *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:TieredStopAtLevel=3
+ *                   compiler.profiling.TestMethodHandleInvokesIntrinsic
  *
  */
 
-import java.lang.invoke.*;
+package compiler.profiling;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
 
 public class TestMethodHandleInvokesIntrinsic {
 
diff --git a/test/compiler/profiling/TestSpecTrapClassUnloading.java b/test/compiler/profiling/TestSpecTrapClassUnloading.java
index ae70098..acb891f 100644
--- a/test/compiler/profiling/TestSpecTrapClassUnloading.java
+++ b/test/compiler/profiling/TestSpecTrapClassUnloading.java
@@ -25,10 +25,18 @@
  * @test
  * @bug 8031752
  * @summary speculative traps need to be cleaned up at GC
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:+UseTypeSpeculation -XX:TypeProfileLevel=222 -XX:CompileCommand=exclude,java.lang.reflect.Method::invoke -XX:CompileCommand=exclude,sun.reflect.DelegatingMethodAccessorImpl::invoke -Xmx512M TestSpecTrapClassUnloading
  *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
+ *                   -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *                   -XX:+UseTypeSpeculation -XX:TypeProfileLevel=222
+ *                   -XX:CompileCommand=exclude,java.lang.reflect.Method::invoke
+ *                   -XX:CompileCommand=exclude,sun.reflect.DelegatingMethodAccessorImpl::invoke
+ *                   -Xmx512M
+ *                   compiler.profiling.TestSpecTrapClassUnloading
  */
 
+package compiler.profiling;
+
 import java.lang.reflect.Method;
 
 public class TestSpecTrapClassUnloading {
diff --git a/test/compiler/profiling/TestUnexpectedProfilingMismatch.java b/test/compiler/profiling/TestUnexpectedProfilingMismatch.java
index b118027..c0df67a 100644
--- a/test/compiler/profiling/TestUnexpectedProfilingMismatch.java
+++ b/test/compiler/profiling/TestUnexpectedProfilingMismatch.java
@@ -25,11 +25,17 @@
  * @test
  * @bug 8027631
  * @summary profiling of arguments at calls cannot rely on signature of callee for types
- * @run main/othervm -XX:-BackgroundCompilation -XX:TieredStopAtLevel=3 -XX:TypeProfileLevel=111 -XX:Tier3InvocationThreshold=200 -XX:Tier0InvokeNotifyFreqLog=7 TestUnexpectedProfilingMismatch
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:TieredStopAtLevel=3 -XX:TypeProfileLevel=111
+ *                   -XX:Tier3InvocationThreshold=200 -XX:Tier0InvokeNotifyFreqLog=7
+ *                   compiler.profiling.TestUnexpectedProfilingMismatch
  */
 
-import java.lang.invoke.*;
+package compiler.profiling;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
 
 public class TestUnexpectedProfilingMismatch {
 
diff --git a/test/compiler/profiling/UnsafeAccess.java b/test/compiler/profiling/UnsafeAccess.java
index 28abc34..5118101 100644
--- a/test/compiler/profiling/UnsafeAccess.java
+++ b/test/compiler/profiling/UnsafeAccess.java
@@ -24,10 +24,14 @@
  * @test
  * @bug 8134918
  * @modules java.base/jdk.internal.misc
+ *
  * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation -Xbatch
- *                                 -XX:CompileCommand=dontinline,UnsafeAccess::test*
- *                                 UnsafeAccess
+ *                                 -XX:CompileCommand=dontinline,compiler.profiling.UnsafeAccess::test*
+ *                                 compiler.profiling.UnsafeAccess
  */
+
+package compiler.profiling;
+
 import jdk.internal.misc.Unsafe;
 
 public class UnsafeAccess {
diff --git a/test/compiler/profiling/spectrapredefineclass/Agent.java b/test/compiler/profiling/spectrapredefineclass/Agent.java
index d6dd571..f0a30c6 100644
--- a/test/compiler/profiling/spectrapredefineclass/Agent.java
+++ b/test/compiler/profiling/spectrapredefineclass/Agent.java
@@ -21,12 +21,15 @@
  * questions.
  */
 
-import java.security.*;
-import java.lang.instrument.*;
-import java.lang.reflect.*;
-import java.lang.management.ManagementFactory;
+package compiler.profiling.spectrapredefineclass;
+
 import com.sun.tools.attach.VirtualMachine;
 
+import java.lang.instrument.ClassFileTransformer;
+import java.lang.instrument.Instrumentation;
+import java.lang.management.ManagementFactory;
+import java.security.ProtectionDomain;
+
 class A {
     void m() {
     }
diff --git a/test/compiler/profiling/spectrapredefineclass/Launcher.java b/test/compiler/profiling/spectrapredefineclass/Launcher.java
index 312734e..9559389 100644
--- a/test/compiler/profiling/spectrapredefineclass/Launcher.java
+++ b/test/compiler/profiling/spectrapredefineclass/Launcher.java
@@ -20,8 +20,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-import java.io.PrintWriter;
-import jdk.test.lib.*;
 
 /*
  * @test
@@ -30,21 +28,34 @@
  * @modules java.base/jdk.internal.misc
  *          java.instrument
  *          java.management
- * @build Agent
- * @run main ClassFileInstaller Agent
- * @run main Launcher
- * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent
+ * @build compiler.profiling.spectrapredefineclass_classloaders.Agent
+ * @run driver ClassFileInstaller compiler.profiling.spectrapredefineclass.Agent
+ * @run driver compiler.profiling.spectrapredefineclass.Launcher
+ * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation
+ *                   -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222
+ *                   -XX:ReservedCodeCacheSize=3M
+ *                   compiler.profiling.spectrapredefineclass.Agent
  */
+
+package compiler.profiling.spectrapredefineclass;
+
+import jdk.test.lib.JDKToolFinder;
+
+import java.io.File;
+import java.io.PrintWriter;
+
 public class Launcher {
     public static void main(String[] args) throws Exception  {
 
       PrintWriter pw = new PrintWriter("MANIFEST.MF");
-      pw.println("Agent-Class: Agent");
+      pw.println("Agent-Class: " + Launcher.class.getPackage().getName() +".Agent");
       pw.println("Can-Retransform-Classes: true");
       pw.close();
 
       ProcessBuilder pb = new ProcessBuilder();
-      pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", System.getProperty("test.classes",".") + "/agent.jar", "Agent.class"});
+      pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF",
+              System.getProperty("test.classes",".") + "/agent.jar",
+              "compiler/profiling/spectrapredefineclass/Agent.class".replace('/', File.separatorChar)});
       pb.start().waitFor();
     }
 }
diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/A.java b/test/compiler/profiling/spectrapredefineclass_classloaders/A.java
index cae091e..07b3622 100644
--- a/test/compiler/profiling/spectrapredefineclass_classloaders/A.java
+++ b/test/compiler/profiling/spectrapredefineclass_classloaders/A.java
@@ -1,3 +1,5 @@
+package compiler.profiling.spectrapredefineclass_classloaders;
+
 public class A {
     void m() {
     }
diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java b/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java
index d03f7de..35f8523 100644
--- a/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java
+++ b/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java
@@ -21,16 +21,19 @@
  * questions.
  */
 
-import java.security.*;
-import java.lang.instrument.*;
-import java.lang.reflect.*;
-import java.lang.management.ManagementFactory;
+package compiler.profiling.spectrapredefineclass_classloaders;
+
 import com.sun.tools.attach.VirtualMachine;
-import java.lang.reflect.*;
+
+import java.lang.instrument.ClassFileTransformer;
+import java.lang.instrument.Instrumentation;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.nio.file.Paths;
+import java.security.ProtectionDomain;
 
 public class Agent implements ClassFileTransformer {
     public static ClassLoader newClassLoader() {
@@ -49,11 +52,12 @@
 
         // loader2 must be first on the list so loader 1 must be used first
         ClassLoader loader1 = newClassLoader();
-        Class dummy = loader1.loadClass("Test");
+        String packageName = Agent.class.getPackage().getName();
+        Class dummy = loader1.loadClass(packageName + ".Test");
 
         ClassLoader loader2 = newClassLoader();
 
-        Test_class = loader2.loadClass("Test");
+        Test_class = loader2.loadClass(packageName + ".Test");
         Method m3 = Test_class.getMethod("m3", ClassLoader.class);
         // Add speculative trap in m2() (loaded by loader1) that
         // references m4() (loaded by loader2).
diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/B.java b/test/compiler/profiling/spectrapredefineclass_classloaders/B.java
index 1b71f43..55a2851 100644
--- a/test/compiler/profiling/spectrapredefineclass_classloaders/B.java
+++ b/test/compiler/profiling/spectrapredefineclass_classloaders/B.java
@@ -1,3 +1,5 @@
+package compiler.profiling.spectrapredefineclass_classloaders;
+
 public class B extends A {
     void m() {
     }
diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java b/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java
index 66f155d..328c5bc 100644
--- a/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java
+++ b/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java
@@ -20,8 +20,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-import java.io.PrintWriter;
-import jdk.test.lib.*;
 
 /*
  * @test
@@ -30,21 +28,37 @@
  * @modules java.base/jdk.internal.misc
  *          java.instrument
  *          java.management
- * @build Agent Test A B
- * @run main ClassFileInstaller Agent
- * @run main Launcher
- * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent
+ * @build compiler.profiling.spectrapredefineclass_classloaders.Agent
+ *        compiler.profiling.spectrapredefineclass_classloaders.Test
+ *        compiler.profiling.spectrapredefineclass_classloaders.A
+ *        compiler.profiling.spectrapredefineclass_classloaders.B
+ * @run driver ClassFileInstaller compiler.profiling.spectrapredefineclass_classloaders.Agent
+ * @run driver compiler.profiling.spectrapredefineclass_classloaders.Launcher
+ * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation
+ *                   -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222
+ *                   -XX:ReservedCodeCacheSize=3M
+ *                   compiler.profiling.spectrapredefineclass_classloaders.Agent
  */
+package compiler.profiling.spectrapredefineclass_classloaders;
+
+import jdk.test.lib.JDKToolFinder;
+
+import java.io.File;
+import java.io.PrintWriter;
+
 public class Launcher {
-    public static void main(String[] args) throws Exception  {
+    public static void main(String[] args) throws Exception {
 
-      PrintWriter pw = new PrintWriter("MANIFEST.MF");
-      pw.println("Agent-Class: Agent");
-      pw.println("Can-Retransform-Classes: true");
-      pw.close();
+        PrintWriter pw = new PrintWriter("MANIFEST.MF");
 
-      ProcessBuilder pb = new ProcessBuilder();
-      pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", System.getProperty("test.classes",".") + "/agent.jar", "Agent.class"});
-      pb.start().waitFor();
+        pw.println("Agent-Class: " + Launcher.class.getPackage().getName() + ".Agent");
+        pw.println("Can-Retransform-Classes: true");
+        pw.close();
+
+        ProcessBuilder pb = new ProcessBuilder();
+        pb.command(new String[]{JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF",
+                System.getProperty("test.classes", ".") + "/agent.jar",
+                "compiler/profiling/spectrapredefineclass/Agent.class".replace('/', File.separatorChar)});
+        pb.start().waitFor();
     }
 }
diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/Test.java b/test/compiler/profiling/spectrapredefineclass_classloaders/Test.java
index 189d39a..662fe00 100644
--- a/test/compiler/profiling/spectrapredefineclass_classloaders/Test.java
+++ b/test/compiler/profiling/spectrapredefineclass_classloaders/Test.java
@@ -1,4 +1,6 @@
-import java.lang.reflect.*;
+package compiler.profiling.spectrapredefineclass_classloaders;
+
+import java.lang.reflect.Method;
 
 public class Test {
 
@@ -19,11 +21,12 @@
     }
 
     public void m3(ClassLoader loader) throws Exception {
-        Class Test_class = loader.loadClass("Test");
+        String packageName = Test.class.getPackage().getName();
+        Class Test_class = loader.loadClass(packageName + ".Test");
         Object test = Test_class.newInstance();
-        Class A_class = loader.loadClass("A");
+        Class A_class = loader.loadClass(packageName + ".A");
         Object a = A_class.newInstance();
-        Class B_class = loader.loadClass("B");
+        Class B_class = loader.loadClass(packageName + ".B");
         Object b = B_class.newInstance();
         Method m1 = Test_class.getMethod("m1", A_class, Boolean.class);
 
diff --git a/test/compiler/profiling/unloadingconflict/B.java b/test/compiler/profiling/unloadingconflict/B.java
index c37eb86..7464d51 100644
--- a/test/compiler/profiling/unloadingconflict/B.java
+++ b/test/compiler/profiling/unloadingconflict/B.java
@@ -21,5 +21,7 @@
  * questions.
  */
 
+package compiler.profiling.unloadingconflict;
+
 public class B {
 }
diff --git a/test/compiler/profiling/unloadingconflict/TestProfileConflictClassUnloading.java b/test/compiler/profiling/unloadingconflict/TestProfileConflictClassUnloading.java
index c074e18..d68f5c0 100644
--- a/test/compiler/profiling/unloadingconflict/TestProfileConflictClassUnloading.java
+++ b/test/compiler/profiling/unloadingconflict/TestProfileConflictClassUnloading.java
@@ -24,12 +24,17 @@
 /*
  * @test
  * @bug 8027572
- * @summary class unloading resets profile, method compiled after the profile is first set and before class loading sets unknown bit with not recorded class
- * @build B
- * @run main/othervm -XX:TypeProfileLevel=222 -XX:-BackgroundCompilation TestProfileConflictClassUnloading
+ * @summary class unloading resets profile, method compiled after the profile is
+ * first set and before class loading sets unknown bit with not recorded class
+ * @library /
+ * @build compiler.profiling.unloadingconflict.B
+ * @run main/othervm -XX:TypeProfileLevel=222 -XX:-BackgroundCompilation
+ *                   compiler.profiling.unloadingconflict.TestProfileConflictClassUnloading
  *
  */
 
+package compiler.profiling.unloadingconflict;
+
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
@@ -66,7 +71,7 @@
 
     public static void main(String[] args) throws Exception {
         ClassLoader loader = newClassLoader();
-        Object o = loader.loadClass("B").newInstance();
+        Object o = loader.loadClass("compiler.profiling.unloadingconflict.B").newInstance();
         // collect conflicting profiles
         for (int i = 0; i < 5000; i++) {
             m2(o);
diff --git a/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java b/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java
index dad068d..531a075 100644
--- a/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java
+++ b/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java
@@ -26,11 +26,16 @@
  * @test
  * @bug 8003585
  * @summary strength reduce or eliminate range checks for power-of-two sized arrays
- * @run main/othervm -XX:CompileCommand=compileonly,PowerOf2SizedArraysChecks::test* -XX:-BackgroundCompilation PowerOf2SizedArraysChecks
  *
+ * @run main/othervm -XX:CompileCommand=compileonly,compiler.rangechecks.PowerOf2SizedArraysChecks::test*
+ *                   -XX:-BackgroundCompilation
+ *                   compiler.rangechecks.PowerOf2SizedArraysChecks
  */
 
-import java.util.function.*;
+package compiler.rangechecks;
+
+import java.util.function.BiFunction;
+import java.util.function.Function;
 
 public class PowerOf2SizedArraysChecks {
 
diff --git a/test/compiler/rangechecks/TestBadFoldCompare.java b/test/compiler/rangechecks/TestBadFoldCompare.java
index 74e53a0..4f15bf9 100644
--- a/test/compiler/rangechecks/TestBadFoldCompare.java
+++ b/test/compiler/rangechecks/TestBadFoldCompare.java
@@ -26,9 +26,13 @@
  * @bug 8085832
  * @bug 8135069
  * @summary x <= 0 || x > 0 wrongly folded as (x-1) >u -1 and x < 0 || x > -1 wrongly folded as x >u -1
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestBadFoldCompare
+ *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.rangechecks.TestBadFoldCompare
  */
 
+package compiler.rangechecks;
+
 public class TestBadFoldCompare {
 
     static boolean test1_taken;
diff --git a/test/compiler/rangechecks/TestExplicitRangeChecks.java b/test/compiler/rangechecks/TestExplicitRangeChecks.java
index a023d5a..d712535 100644
--- a/test/compiler/rangechecks/TestExplicitRangeChecks.java
+++ b/test/compiler/rangechecks/TestExplicitRangeChecks.java
@@ -25,24 +25,31 @@
  * @test
  * @bug 8073480
  * @summary explicit range checks should be recognized by C2
- * @modules java.base/jdk.internal.misc
  * @library /testlibrary /test/lib /
- * @build TestExplicitRangeChecks
+ * @modules java.base/jdk.internal.misc
+ * @build compiler.rangechecks.TestExplicitRangeChecks
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                jdk.test.lib.Platform
  * @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=compileonly,TestExplicitRangeChecks.test* TestExplicitRangeChecks
+ *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:CompileCommand=compileonly,compiler.rangechecks.TestExplicitRangeChecks::test*
+ *                   compiler.rangechecks.TestExplicitRangeChecks
  *
  */
 
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
-import sun.hotspot.WhiteBox;
-import sun.hotspot.code.NMethod;
-import jdk.test.lib.Platform;
-import jdk.internal.misc.Unsafe;
+package compiler.rangechecks;
+
 import compiler.whitebox.CompilerWhiteBoxTest;
+import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Platform;
+import sun.hotspot.WhiteBox;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
 
 public class TestExplicitRangeChecks {
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
diff --git a/test/compiler/rangechecks/TestRangeCheckEliminationDisabled.java b/test/compiler/rangechecks/TestRangeCheckEliminationDisabled.java
index 288af4d..d5b3be7 100644
--- a/test/compiler/rangechecks/TestRangeCheckEliminationDisabled.java
+++ b/test/compiler/rangechecks/TestRangeCheckEliminationDisabled.java
@@ -26,8 +26,13 @@
  * @test TestRangeCheckEliminationDisabled
  * @bug 8154763
  * @summary Tests PostLoopMultiversioning with RangeCheckElimination disabled.
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+PostLoopMultiversioning -XX:-RangeCheckElimination TestRangeCheckEliminationDisabled
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+PostLoopMultiversioning -XX:-RangeCheckElimination
+ *                   compiler.rangechecks.TestRangeCheckEliminationDisabled
  */
+
+package compiler.rangechecks;
+
 public class TestRangeCheckEliminationDisabled {
 
     public static void main(String[] args) {
diff --git a/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm b/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm
index 2befe6d..30eed33 100644
--- a/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm
+++ b/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm
@@ -22,7 +22,7 @@
  *
  */
 
-super public class TestRangeCheckExceptionHandlerLoop
+super public class compiler/rangechecks/TestRangeCheckExceptionHandlerLoop
 	version 51:0
 {
 
diff --git a/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java b/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
index 3eac323..fe2636d 100644
--- a/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
+++ b/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
@@ -26,10 +26,14 @@
  * @test
  * @bug 8134883
  * @summary C1's range check elimination breaks with a non-natural loop that an exception handler as one entry
+ *
  * @compile TestRangeCheckExceptionHandlerLoop.jasm
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckExceptionHandlerLoopMain
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                  compiler.rangechecks.TestRangeCheckExceptionHandlerLoopMain
  */
 
+package compiler.rangechecks;
+
 public class TestRangeCheckExceptionHandlerLoopMain {
     public static void main(String[] args) throws Exception {
         Exception exception = new Exception();
diff --git a/test/compiler/rangechecks/TestRangeCheckSmearing.java b/test/compiler/rangechecks/TestRangeCheckSmearing.java
index 0ed34a4..17c4327 100644
--- a/test/compiler/rangechecks/TestRangeCheckSmearing.java
+++ b/test/compiler/rangechecks/TestRangeCheckSmearing.java
@@ -28,22 +28,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @ignore 8157984
- * @build TestRangeCheckSmearing
+ * @build compiler.rangechecks.TestRangeCheckSmearing
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                jdk.test.lib.Platform
  * @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckSmearing
+ *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.rangechecks.TestRangeCheckSmearing
  *
  */
 
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
-import sun.hotspot.WhiteBox;
-import sun.hotspot.code.NMethod;
-import jdk.test.lib.Platform;
+package compiler.rangechecks;
+
 import compiler.whitebox.CompilerWhiteBoxTest;
+import compiler.testlibrary.CompilerUtils;
+import jdk.test.lib.Platform;
+import sun.hotspot.WhiteBox;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.HashMap;
 
 public class TestRangeCheckSmearing {
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
@@ -396,7 +402,7 @@
             System.out.println("ArrayIndexOutOfBoundsException was not thrown in "+name);
         }
 
-        if (Platform.isServer()) {
+        if (CompilerUtils.getMaxCompilationLevel() == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) {
             if (exceptionRequired == WHITE_BOX.isMethodCompiled(m)) {
                 System.out.println((exceptionRequired?"Didn't deoptimized":"deoptimized") + " in "+name);
                 test_success = false;
diff --git a/test/compiler/rangechecks/TestRangeCheckSmearingLoopOpts.java b/test/compiler/rangechecks/TestRangeCheckSmearingLoopOpts.java
index 699754a..63f4f89 100644
--- a/test/compiler/rangechecks/TestRangeCheckSmearingLoopOpts.java
+++ b/test/compiler/rangechecks/TestRangeCheckSmearingLoopOpts.java
@@ -25,9 +25,13 @@
  * @test
  * @bug 8048170
  * @summary Following range check smearing, range check cannot be replaced by dominating identical test.
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckSmearingLoopOpts
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.rangechecks.TestRangeCheckSmearingLoopOpts
  */
+
+package compiler.rangechecks;
+
 public class TestRangeCheckSmearingLoopOpts {
 
     static int dummy;
diff --git a/test/compiler/rangechecks/TestUncommonTrapMerging.java b/test/compiler/rangechecks/TestUncommonTrapMerging.java
index bbdda63..b6ae41e 100644
--- a/test/compiler/rangechecks/TestUncommonTrapMerging.java
+++ b/test/compiler/rangechecks/TestUncommonTrapMerging.java
@@ -25,9 +25,16 @@
  * @test
  * @bug 8140574
  * @summary Verify proper re-execution of checks after merging of uncommon traps
- * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileCommand=compileonly,TestUncommonTrapMerging::test* TestUncommonTrapMerging Test1
- * @run main/othervm -XX:CompileCommand=compileonly,TestUncommonTrapMerging::test* TestUncommonTrapMerging Test2
+ *
+ * @run main/othervm -Xcomp -XX:-TieredCompilation
+ *                   -XX:CompileCommand=compileonly,compiler.rangechecks.TestUncommonTrapMerging::test*
+ *                   compiler.rangechecks.TestUncommonTrapMerging Test1
+ * @run main/othervm -XX:CompileCommand=compileonly,compiler.rangechecks.TestUncommonTrapMerging::test*
+ *                   compiler.rangechecks.TestUncommonTrapMerging Test2
  */
+
+package compiler.rangechecks;
+
 public class TestUncommonTrapMerging {
 
     public static void main(String[] args) throws Throwable {
diff --git a/test/compiler/reflection/ArrayNewInstanceOfVoid.java b/test/compiler/reflection/ArrayNewInstanceOfVoid.java
index 6f8a273..928749e 100644
--- a/test/compiler/reflection/ArrayNewInstanceOfVoid.java
+++ b/test/compiler/reflection/ArrayNewInstanceOfVoid.java
@@ -25,8 +25,12 @@
  * @test
  * @bug 8029366
  * @summary ShouldNotReachHere error when creating an array with component type of void
+ *
+ * @run main compiler.reflection.ArrayNewInstanceOfVoid
  */
 
+package compiler.reflection;
+
 public class ArrayNewInstanceOfVoid {
     public static void main(String[] args) {
         for (int i = 0; i < 100_000; i++) {
diff --git a/test/compiler/regalloc/C1ObjectSpillInLogicOp.java b/test/compiler/regalloc/C1ObjectSpillInLogicOp.java
index cf7b65b..82316a8 100644
--- a/test/compiler/regalloc/C1ObjectSpillInLogicOp.java
+++ b/test/compiler/regalloc/C1ObjectSpillInLogicOp.java
@@ -24,24 +24,28 @@
 /*
  * @test
  * @bug 8027751
- * @requires vm.gc.G1
  * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill
- * @run main/othervm -XX:+UseG1GC C1ObjectSpillInLogicOp
+ * @requires vm.gc.G1
  *
+ * @run main/othervm -XX:+UseG1GC compiler.regalloc.C1ObjectSpillInLogicOp
+ */
+
+package compiler.regalloc;
+
+import java.util.concurrent.atomic.AtomicReferenceArray;
+
+/*
  * G1 barriers use logical operators (xor) on T_OBJECT mixed with T_LONG or T_INT.
  * The current implementation of logical operations on x86 in C1 doesn't allow for long operands to be on stack.
  * There is a special code in the register allocator that forces long arguments in registers on x86. However T_OBJECT
  * can be spilled just fine, and in that case the xor emission will fail.
  */
-
-import java.util.concurrent.atomic.*;
-
 public class C1ObjectSpillInLogicOp {
-  public static void main(String[] args) {
-    AtomicReferenceArray<Integer> x = new AtomicReferenceArray(128);
-    Integer y = new Integer(0);
-    for (int i = 0; i < 50000; i++) {
-      x.getAndSet(i % x.length(), y);
+    public static void main(String[] args) {
+        AtomicReferenceArray<Integer> x = new AtomicReferenceArray(128);
+        Integer y = new Integer(0);
+        for (int i = 0; i < 50000; i++) {
+            x.getAndSet(i % x.length(), y);
+        }
     }
-  }
 }
diff --git a/test/compiler/regalloc/TestVectorRegAlloc.java b/test/compiler/regalloc/TestVectorRegAlloc.java
index 0e95544..c737e39 100644
--- a/test/compiler/regalloc/TestVectorRegAlloc.java
+++ b/test/compiler/regalloc/TestVectorRegAlloc.java
@@ -25,11 +25,14 @@
 /**
  * @test
  * @bug 8131969
- * @summary assert in register allocation code when vector Phi for a loop is processed because code assumes all inputs already processed
- * @run main/othervm -Xbatch TestVectorRegAlloc
+ * @summary assert in register allocation code when vector Phi for a loop is
+ * processed because code assumes all inputs already processed
  *
+ * @run main/othervm -Xbatch compiler.regalloc.TestVectorRegAlloc
  */
 
+package compiler.regalloc;
+
 public class TestVectorRegAlloc {
 
     static int test_helper_i;
diff --git a/test/compiler/relocations/TestPrintRelocations.java b/test/compiler/relocations/TestPrintRelocations.java
index 2cfb038..88ed109 100644
--- a/test/compiler/relocations/TestPrintRelocations.java
+++ b/test/compiler/relocations/TestPrintRelocations.java
@@ -25,14 +25,19 @@
  * @test
  * @bug 8044538
  * @summary assert hit while printing relocations for jump table entries
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+PrintRelocations TestPrintRelocations
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+PrintRelocations
+ *                   compiler.relocations.TestPrintRelocations
  */
-
 /**
  * The test compiles all methods (-Xcomp) and prints their relocation
  * entries (-XX:+PrintRelocations) to make sure the printing works.
  */
+
+package compiler.relocations;
+
 public class TestPrintRelocations {
 
-   static public void main(String[] args) { }
+    static public void main(String[] args) {
+    }
 }
diff --git a/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java b/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java
index cc2ad98..50784c5 100644
--- a/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java
+++ b/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java
@@ -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
@@ -22,8 +22,11 @@
  *
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
+package compiler.rtm.cli;
+
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
 
 import java.util.function.BooleanSupplier;
 
@@ -89,7 +92,7 @@
     @Override
     public void runTestCases() throws Throwable {
         if (Platform.isX86() || Platform.isX64() || Platform.isPPC()) {
-            if (Platform.isServer() && !Platform.isEmbedded()) {
+            if (Platform.isServer()) {
                 runX86SupportedVMTestCases();
             } else {
                 runX86UnsupportedVMTestCases();
diff --git a/test/compiler/rtm/cli/RTMLockingAwareTest.java b/test/compiler/rtm/cli/RTMLockingAwareTest.java
index 654040a..aad6397 100644
--- a/test/compiler/rtm/cli/RTMLockingAwareTest.java
+++ b/test/compiler/rtm/cli/RTMLockingAwareTest.java
@@ -22,14 +22,16 @@
  *
  */
 
-import java.util.List;
-import java.util.LinkedList;
+package compiler.rtm.cli;
 
-import jdk.test.lib.ExitCode;
-import jdk.test.lib.cli.*;
-import jdk.test.lib.cli.predicate.AndPredicate;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.LinkedList;
+import java.util.List;
 
 /**
  * Base for all RTM-related CLI tests on options whose processing depends
diff --git a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java
index 769b0e2..e8c9d17 100644
--- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java
+++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java
@@ -22,8 +22,11 @@
  *
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
+package compiler.rtm.cli;
+
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
 
 import java.util.function.BooleanSupplier;
 
diff --git a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
index e8e9fdb..e48cfec 100644
--- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
+++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
@@ -30,18 +30,21 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
+ *
+ * @build compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
+ *                   compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
  */
 
-import jdk.test.lib.cli.*;
-import jdk.test.lib.cli.predicate.AndPredicate;
+package compiler.rtm.cli;
+
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
 
 public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
         extends TestPrintPreciseRTMLockingStatisticsBase {
diff --git a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
index ec2b431..aeec526 100644
--- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
+++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
@@ -30,18 +30,21 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
+ *
+ * @build compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                 TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
+ *                   compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
  */
 
-import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.NotPredicate;
+package compiler.rtm.cli;
+
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
 
 public class TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
         extends TestPrintPreciseRTMLockingStatisticsBase {
diff --git a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java
index b1a761d..2d16a62 100644
--- a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java
+++ b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java
@@ -30,13 +30,17 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMAbortRatioOptionOnSupportedConfig
+ *
+ * @build compiler.rtm.cli.TestRTMAbortRatioOptionOnSupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnSupportedConfig
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.cli.TestRTMAbortRatioOptionOnSupportedConfig
  */
 
+package compiler.rtm.cli;
+
 public class TestRTMAbortRatioOptionOnSupportedConfig
         extends RTMLockingAwareTest {
     private static final String DEFAULT_VALUE = "50";
diff --git a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
index 0104b8f..5921ae7 100644
--- a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
+++ b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
@@ -30,17 +30,21 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMAbortRatioOptionOnUnsupportedConfig
+ *
+ * @build compiler.rtm.cli.TestRTMAbortRatioOptionOnUnsupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnUnsupportedConfig
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.cli.TestRTMAbortRatioOptionOnUnsupportedConfig
  */
 
-import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.NotPredicate;
+package compiler.rtm.cli;
+
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
 
 public class TestRTMAbortRatioOptionOnUnsupportedConfig
         extends RTMGenericCommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java b/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java
index 3edec23..7444280 100644
--- a/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java
+++ b/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java
@@ -26,13 +26,16 @@
  * @test
  * @bug 8031320
  * @summary Verify processing of RTMAbortThreshold option.
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMAbortThresholdOption
- * @run main/othervm TestRTMAbortThresholdOption
+ *
+ * @build compiler.rtm.cli.TestRTMAbortThresholdOption
+ * @run main/othervm compiler.rtm.cli.TestRTMAbortThresholdOption
  */
 
+package compiler.rtm.cli;
+
 public class TestRTMAbortThresholdOption
         extends RTMGenericCommandLineOptionTest {
     private static final String DEFAULT_VALUE = "1000";
diff --git a/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java b/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java
index 9a70f7c..35213b4 100644
--- a/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java
+++ b/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java
@@ -26,13 +26,16 @@
  * @test
  * @bug 8031320
  * @summary Verify processing of RTMLockingCalculationDelay option.
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMLockingCalculationDelayOption
- * @run main/othervm TestRTMLockingCalculationDelayOption
+ *
+ * @build compiler.rtm.cli.TestRTMLockingCalculationDelayOption
+ * @run main/othervm compiler.rtm.cli.TestRTMLockingCalculationDelayOption
  */
 
+package compiler.rtm.cli;
+
 public class TestRTMLockingCalculationDelayOption
         extends RTMGenericCommandLineOptionTest {
     private static final String DEFAULT_VALUE = "0";
diff --git a/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java b/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java
index f9c202a..91a5bff 100644
--- a/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java
+++ b/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java
@@ -26,13 +26,16 @@
  * @test
  * @bug 8031320
  * @summary Verify processing of RTMLockingThreshold option.
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMLockingThresholdOption
- * @run main/othervm TestRTMLockingThresholdOption
+ *
+ * @build compiler.rtm.cli.TestRTMLockingThresholdOption
+ * @run main/othervm compiler.rtm.cli.TestRTMLockingThresholdOption
  */
 
+package compiler.rtm.cli;
+
 public class TestRTMLockingThresholdOption
         extends RTMGenericCommandLineOptionTest {
     private static final String DEFAULT_VALUE = "10000";
diff --git a/test/compiler/rtm/cli/TestRTMRetryCountOption.java b/test/compiler/rtm/cli/TestRTMRetryCountOption.java
index baaf4a7..d77c001 100644
--- a/test/compiler/rtm/cli/TestRTMRetryCountOption.java
+++ b/test/compiler/rtm/cli/TestRTMRetryCountOption.java
@@ -26,13 +26,16 @@
  * @test
  * @bug 8031320
  * @summary Verify processing of RTMRetryCount option.
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMRetryCountOption
- * @run main/othervm TestRTMRetryCountOption
+ *
+ * @build compiler.rtm.cli.TestRTMRetryCountOption
+ * @run main/othervm compiler.rtm.cli.TestRTMRetryCountOption
  */
 
+package compiler.rtm.cli;
+
 public class TestRTMRetryCountOption extends RTMGenericCommandLineOptionTest {
     private static final String DEFAULT_VALUE = "5";
 
diff --git a/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java b/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java
index 23d0f05..dc9ebf7 100644
--- a/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java
+++ b/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java
@@ -26,13 +26,16 @@
  * @test
  * @bug 8031320
  * @summary Verify processing of RTMSpinLoopCount option.
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMSpinLoopCountOption
- * @run main/othervm TestRTMSpinLoopCountOption
+ *
+ * @build compiler.rtm.cli.TestRTMSpinLoopCountOption
+ * @run main/othervm compiler.rtm.cli.TestRTMSpinLoopCountOption
  */
 
+package compiler.rtm.cli;
+
 public class TestRTMSpinLoopCountOption
         extends RTMGenericCommandLineOptionTest {
     private static final String DEFAULT_VALUE = "100";
diff --git a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java
index 1e93004..b21aac4 100644
--- a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java
+++ b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java
@@ -30,14 +30,17 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMTotalCountIncrRateOptionOnSupportedConfig
+ *
+ * @build compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnSupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestRTMTotalCountIncrRateOptionOnSupportedConfig
+ *                   compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnSupportedConfig
  */
 
+package compiler.rtm.cli;
+
 public class TestRTMTotalCountIncrRateOptionOnSupportedConfig
         extends RTMLockingAwareTest {
     private static final String DEFAULT_VALUE = "64";
diff --git a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
index c855876..886d0c3 100644
--- a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
+++ b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
@@ -22,11 +22,6 @@
  *
  */
 
-import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.NotPredicate;
-import compiler.testlibrary.rtm.predicate.SupportedCPU;
-import compiler.testlibrary.rtm.predicate.SupportedVM;
-
 /**
  * @test
  * @bug 8031320
@@ -35,14 +30,22 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
+ *
+ * @build compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
+ *                   compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
  */
 
+package compiler.rtm.cli;
+
+import compiler.testlibrary.rtm.predicate.SupportedCPU;
+import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
+
 public class TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
         extends RTMGenericCommandLineOptionTest {
     private static final String DEFAULT_VALUE = "64";
diff --git a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
index 5ac9c26..001a826 100644
--- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
+++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
@@ -30,18 +30,22 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMDeoptOptionOnSupportedConfig
+ *
+ * @build compiler.rtm.cli.TestUseRTMDeoptOptionOnSupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnSupportedConfig
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.cli.TestUseRTMDeoptOptionOnSupportedConfig
  */
 
+package compiler.rtm.cli;
+
+import compiler.testlibrary.rtm.predicate.SupportedCPU;
+import compiler.testlibrary.rtm.predicate.SupportedVM;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.predicate.SupportedCPU;
-import compiler.testlibrary.rtm.predicate.SupportedVM;
 
 public class TestUseRTMDeoptOptionOnSupportedConfig
         extends CommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
index fd6ef44..385a7c7 100644
--- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
+++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
@@ -30,19 +30,22 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMDeoptOptionOnUnsupportedConfig
+ *
+ * @build compiler.rtm.cli.TestUseRTMDeoptOptionOnUnsupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnUnsupportedConfig
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.cli.TestUseRTMDeoptOptionOnUnsupportedConfig
  */
 
-import jdk.test.lib.cli.CommandLineOptionTest;
+package compiler.rtm.cli;
 
-import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.NotPredicate;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
 
 public class TestUseRTMDeoptOptionOnUnsupportedConfig
         extends RTMGenericCommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
index 49c9ebd..532e68d 100644
--- a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
+++ b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
@@ -30,19 +30,22 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMForStackLocksOptionOnSupportedConfig
+ *
+ * @build compiler.rtm.cli.TestUseRTMForStackLocksOptionOnSupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                   TestUseRTMForStackLocksOptionOnSupportedConfig
+ *                   compiler.rtm.cli.TestUseRTMForStackLocksOptionOnSupportedConfig
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
-import jdk.test.lib.cli.predicate.AndPredicate;
+package compiler.rtm.cli;
+
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
 
 public class TestUseRTMForStackLocksOptionOnSupportedConfig
         extends CommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
index ea1555a..563fec1 100644
--- a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
+++ b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
@@ -30,20 +30,23 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMForStackLocksOptionOnUnsupportedConfig
+ *
+ * @build compiler.rtm.cli.TestUseRTMForStackLocksOptionOnUnsupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI
- *                    TestUseRTMForStackLocksOptionOnUnsupportedConfig
+ *                   compiler.rtm.cli.TestUseRTMForStackLocksOptionOnUnsupportedConfig
  */
 
+package compiler.rtm.cli;
+
+import compiler.testlibrary.rtm.predicate.SupportedCPU;
+import compiler.testlibrary.rtm.predicate.SupportedVM;
 import jdk.test.lib.ExitCode;
 import jdk.test.lib.cli.CommandLineOptionTest;
 import jdk.test.lib.cli.predicate.AndPredicate;
 import jdk.test.lib.cli.predicate.NotPredicate;
-import compiler.testlibrary.rtm.predicate.SupportedCPU;
-import compiler.testlibrary.rtm.predicate.SupportedVM;
 
 public class TestUseRTMForStackLocksOptionOnUnsupportedConfig
         extends RTMGenericCommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
index ed8e386..b82badc 100644
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
@@ -30,18 +30,22 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMLockingOptionOnSupportedConfig
+ *
+ * @build compiler.rtm.cli.TestUseRTMLockingOptionOnSupportedConfig
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnSupportedConfig
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.cli.TestUseRTMLockingOptionOnSupportedConfig
  */
 
-import jdk.test.lib.ExitCode;
-import jdk.test.lib.cli.*;
-import jdk.test.lib.cli.predicate.AndPredicate;
+package compiler.rtm.cli;
+
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
 
 public class TestUseRTMLockingOptionOnSupportedConfig
         extends CommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
index e5d2406..25e173e 100644
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
@@ -30,19 +30,24 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMLockingOptionOnUnsupportedCPU
+ *
+ * @build compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedCPU
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedCPU
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedCPU
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.NotPredicate;
+package compiler.rtm.cli;
+
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
 
 public class TestUseRTMLockingOptionOnUnsupportedCPU
         extends CommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
index 6b9c50d..f042a9d 100644
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
@@ -30,19 +30,23 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMLockingOptionOnUnsupportedVM
+ *
+ * @build compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedVM
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedVM
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedVM
  */
 
-import jdk.test.lib.ExitCode;
-import jdk.test.lib.cli.*;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import jdk.test.lib.cli.predicate.NotPredicate;
+package compiler.rtm.cli;
+
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
 
 public class TestUseRTMLockingOptionOnUnsupportedVM
         extends CommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
index d43c25b..cc004bd 100644
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
@@ -30,18 +30,22 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMLockingOptionWithBiasedLocking
+ *
+ * @build compiler.rtm.cli.TestUseRTMLockingOptionWithBiasedLocking
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMLockingOptionWithBiasedLocking
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.cli.TestUseRTMLockingOptionWithBiasedLocking
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.*;
-import jdk.test.lib.cli.predicate.AndPredicate;
+package compiler.rtm.cli;
+
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
 
 public class TestUseRTMLockingOptionWithBiasedLocking
         extends CommandLineOptionTest {
diff --git a/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java b/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java
index 9683da3..5d365b7 100644
--- a/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java
+++ b/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java
@@ -26,13 +26,16 @@
  * @test
  * @bug 8031320
  * @summary Verify processing of UseRTMXendForLockBusy option.
- * @library /testlibrary
+ * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMXendForLockBusyOption
- * @run main/othervm TestUseRTMXendForLockBusyOption
+ *
+ * @build compiler.rtm.cli.TestUseRTMXendForLockBusyOption
+ * @run main/othervm compiler.rtm.cli.TestUseRTMXendForLockBusyOption
  */
 
+package compiler.rtm.cli;
+
 public class TestUseRTMXendForLockBusyOption
         extends RTMGenericCommandLineOptionTest {
     private static final String DEFAULT_VALUE = "true";
diff --git a/test/compiler/rtm/locking/TestRTMAbortRatio.java b/test/compiler/rtm/locking/TestRTMAbortRatio.java
index c9b6012..893fbc8 100644
--- a/test/compiler/rtm/locking/TestRTMAbortRatio.java
+++ b/test/compiler/rtm/locking/TestRTMAbortRatio.java
@@ -30,21 +30,30 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMAbortRatio
+ * @build compiler.rtm.locking.TestRTMAbortRatio
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMAbortRatio
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMAbortRatio
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.CompilableTest;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that method will be deoptimized on high abort ratio
diff --git a/test/compiler/rtm/locking/TestRTMAbortThreshold.java b/test/compiler/rtm/locking/TestRTMAbortThreshold.java
index c3a4f39..2d8492e 100644
--- a/test/compiler/rtm/locking/TestRTMAbortThreshold.java
+++ b/test/compiler/rtm/locking/TestRTMAbortThreshold.java
@@ -30,20 +30,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMAbortThreshold
+ * @build compiler.rtm.locking.TestRTMAbortThreshold
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMAbortThreshold
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMAbortThreshold
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that on RTMAbortThreshold option actually affects how soon
diff --git a/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java b/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
index cbb3da2..606ed8c 100644
--- a/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
+++ b/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
@@ -32,21 +32,30 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMAfterNonRTMDeopt
+ * @build compiler.rtm.locking.TestRTMAfterNonRTMDeopt
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMAfterNonRTMDeopt
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMAfterNonRTMDeopt
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.CompilableTest;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * To verify that with +UseRTMDeopt method's RTM state will be
diff --git a/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java b/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
index 25e24e4..f53a32c 100644
--- a/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
+++ b/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
@@ -30,20 +30,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMDeoptOnHighAbortRatio
+ * @build compiler.rtm.locking.TestRTMDeoptOnHighAbortRatio
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMDeoptOnHighAbortRatio
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMDeoptOnHighAbortRatio
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that on high abort ratio method wil be deoptimized with
diff --git a/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java b/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
index ded7148..567ec62 100644
--- a/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
+++ b/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
@@ -29,21 +29,30 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMDeoptOnLowAbortRatio
+ * @build compiler.rtm.locking.TestRTMDeoptOnLowAbortRatio
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMDeoptOnLowAbortRatio
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMDeoptOnLowAbortRatio
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.CompilableTest;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that low abort ratio method will be deoptimized with
diff --git a/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java b/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
index 8124d41..7c6ee46 100644
--- a/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
+++ b/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
@@ -30,19 +30,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMLockingCalculationDelay
+ * @build compiler.rtm.locking.TestRTMLockingCalculationDelay
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMLockingCalculationDelay
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMLockingCalculationDelay
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
 
 /**
  * Test verifies that abort ratio calculation could be delayed using
diff --git a/test/compiler/rtm/locking/TestRTMLockingThreshold.java b/test/compiler/rtm/locking/TestRTMLockingThreshold.java
index 415f872..d3ce56c 100644
--- a/test/compiler/rtm/locking/TestRTMLockingThreshold.java
+++ b/test/compiler/rtm/locking/TestRTMLockingThreshold.java
@@ -30,21 +30,30 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMLockingThreshold
+ * @build compiler.rtm.locking.TestRTMLockingThreshold
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMLockingThreshold
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMLockingThreshold
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.CompilableTest;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that RTMLockingThreshold option actually affects how soon
diff --git a/test/compiler/rtm/locking/TestRTMRetryCount.java b/test/compiler/rtm/locking/TestRTMRetryCount.java
index 82c884b..2a1fc7d 100644
--- a/test/compiler/rtm/locking/TestRTMRetryCount.java
+++ b/test/compiler/rtm/locking/TestRTMRetryCount.java
@@ -29,21 +29,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMRetryCount
+ * @build compiler.rtm.locking.TestRTMRetryCount
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMRetryCount
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMRetryCount
  */
 
-import java.util.List;
+package compiler.rtm.locking;
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+import compiler.testlibrary.rtm.BusyLock;
+import compiler.testlibrary.rtm.CompilableTest;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that RTMRetryCount option actually affects amount of
diff --git a/test/compiler/rtm/locking/TestRTMSpinLoopCount.java b/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
index 47e89b0..f6e849e 100644
--- a/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
+++ b/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
@@ -30,20 +30,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMSpinLoopCount
+ * @build compiler.rtm.locking.TestRTMSpinLoopCount
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMSpinLoopCount
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMSpinLoopCount
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.BusyLock;
+import compiler.testlibrary.rtm.CompilableTest;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that RTMSpinLoopCount increase time spent between retries
diff --git a/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java b/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
index 41aeddb..6ae82df 100644
--- a/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
+++ b/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
@@ -30,22 +30,30 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestRTMTotalCountIncrRate
+ * @build compiler.rtm.locking.TestRTMTotalCountIncrRate
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestRTMTotalCountIncrRate
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestRTMTotalCountIncrRate
  */
 
-import jdk.internal.misc.Unsafe;
-import java.util.List;
+package compiler.rtm.locking;
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.CompilableTest;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that with RTMTotalCountIncrRate=1 RTM locking statistics
diff --git a/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java b/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
index 9bc68b4..be13c80 100644
--- a/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
+++ b/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
@@ -30,21 +30,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMAfterLockInflation
+ * @build compiler.rtm.locking.TestUseRTMAfterLockInflation
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMAfterLockInflation
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestUseRTMAfterLockInflation
  */
 
-import java.util.List;
+package compiler.rtm.locking;
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that RTM is used after lock inflation by executing compiled
diff --git a/test/compiler/rtm/locking/TestUseRTMDeopt.java b/test/compiler/rtm/locking/TestUseRTMDeopt.java
index 054d2f7..05578b6 100644
--- a/test/compiler/rtm/locking/TestUseRTMDeopt.java
+++ b/test/compiler/rtm/locking/TestUseRTMDeopt.java
@@ -30,19 +30,25 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMDeopt
+ * @build compiler.rtm.locking.TestUseRTMDeopt
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMDeopt
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestUseRTMDeopt
  */
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.locking;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
 
 /**
  * Test verifies that usage of UseRTMDeopt option affects uncommon traps usage
diff --git a/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java b/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
index b9c23a4..94c4978 100644
--- a/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
+++ b/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
@@ -29,21 +29,27 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMForInflatedLocks
+ * @build compiler.rtm.locking.TestUseRTMForInflatedLocks
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMForInflatedLocks
+ *                   -XX:+WhiteBoxAPI compiler.rtm.locking.TestUseRTMForInflatedLocks
  */
 
-import java.util.List;
+package compiler.rtm.locking;
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that RTM-based lock elision could be used for inflated locks
diff --git a/test/compiler/rtm/locking/TestUseRTMForStackLocks.java b/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
index afede71..6bb2646 100644
--- a/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
+++ b/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
@@ -29,21 +29,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMForStackLocks
+ * @build compiler.rtm.locking.TestUseRTMForStackLocks
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMForStackLocks
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestUseRTMForStackLocks
  */
 
-import java.util.List;
+package compiler.rtm.locking;
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that RTM-based lock elision could be used for stack locks
diff --git a/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java b/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
index c61e6bc..d8dc7ca 100644
--- a/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
+++ b/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
@@ -30,21 +30,29 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMXendForLockBusy
+ * @build compiler.rtm.locking.TestUseRTMXendForLockBusy
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMXendForLockBusy
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.locking.TestUseRTMXendForLockBusy
  */
 
-import java.util.List;
+package compiler.rtm.locking;
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.BusyLock;
+import compiler.testlibrary.rtm.CompilableTest;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that with +UseRTMXendForLockBusy there will be no aborts
diff --git a/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java b/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
index 567ddd5..30d747e 100644
--- a/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
+++ b/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
@@ -30,20 +30,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestNoRTMLockElidingOption
+ * @build compiler.rtm.method_options.TestNoRTMLockElidingOption
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestNoRTMLockElidingOption
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.method_options.TestNoRTMLockElidingOption
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.method_options;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that method tagged with option <i>NoRTMLockElidingOption</i>
diff --git a/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java b/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
index acb8bdd..5080834 100644
--- a/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
+++ b/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
@@ -31,20 +31,28 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestUseRTMLockElidingOption
+ * @build compiler.rtm.method_options.TestUseRTMLockElidingOption
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestUseRTMLockElidingOption
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.method_options.TestUseRTMLockElidingOption
  */
 
-import java.util.List;
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.method_options;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.List;
 
 /**
  * Test verifies that method tagged with option <i>UseRTMLockElidingOption</i>
diff --git a/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java b/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
index 40aa1a3..adeed6d 100644
--- a/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
+++ b/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
@@ -32,21 +32,31 @@
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TestPrintPreciseRTMLockingStatistics
+ * @build compiler.rtm.print.TestPrintPreciseRTMLockingStatistics
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI TestPrintPreciseRTMLockingStatistics
+ *                   -XX:+WhiteBoxAPI
+ *                   compiler.rtm.print.TestPrintPreciseRTMLockingStatistics
  */
 
-import java.util.*;
 
-import jdk.test.lib.*;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
-import compiler.testlibrary.rtm.*;
+package compiler.rtm.print;
+
+import compiler.testlibrary.rtm.AbortProvoker;
+import compiler.testlibrary.rtm.AbortType;
+import compiler.testlibrary.rtm.RTMLockingStatistics;
+import compiler.testlibrary.rtm.RTMTestBase;
 import compiler.testlibrary.rtm.predicate.SupportedCPU;
 import compiler.testlibrary.rtm.predicate.SupportedVM;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
 
 /**
  * Test verifies that VM output does not contain RTM locking statistics when it
diff --git a/test/compiler/runtime/6778657/Test.java b/test/compiler/runtime/6778657/Test.java
deleted file mode 100644
index 116693a..0000000
--- a/test/compiler/runtime/6778657/Test.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 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 6778657
- * @summary Casts in SharedRuntime::f2i, f2l, d2i and d2l rely on undefined C++ behaviour
- */
-
-public class Test {
-  public static void check_f2i(int expect) {
-    float check = expect;
-    check *= 2;
-    int actual = (int) check;
-    if (actual != expect)
-      throw new RuntimeException("expecting " + expect + ", got " + actual);
-  }
-
-  public static void check_f2l(long expect) {
-    float check = expect;
-    check *= 2;
-    long actual = (long) check;
-    if (actual != expect)
-      throw new RuntimeException("expecting " + expect + ", got " + actual);
-  }
-
-  public static void check_d2i(int expect) {
-    double check = expect;
-    check *= 2;
-    int actual = (int) check;
-    if (actual != expect)
-      throw new RuntimeException("expecting " + expect + ", got " + actual);
-  }
-
-  public static void check_d2l(long expect) {
-    double check = expect;
-    check *= 2;
-    long actual = (long) check;
-    if (actual != expect)
-      throw new RuntimeException("expecting " + expect + ", got " + actual);
-  }
-
-  public static void main(String[] args) {
-    check_f2i(Integer.MAX_VALUE);
-    check_f2i(Integer.MIN_VALUE);
-    check_f2l(Long.MAX_VALUE);
-    check_f2l(Long.MIN_VALUE);
-    check_d2i(Integer.MAX_VALUE);
-    check_d2i(Integer.MIN_VALUE);
-    check_d2l(Long.MAX_VALUE);
-    check_d2l(Long.MIN_VALUE);
-  }
-}
-
diff --git a/test/compiler/runtime/6865265/StackOverflowBug.java b/test/compiler/runtime/6865265/StackOverflowBug.java
deleted file mode 100644
index c5d0f3b..0000000
--- a/test/compiler/runtime/6865265/StackOverflowBug.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2011, 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 6865265
- * @summary JVM crashes with "missing exception handler" error
- * @author volker.simonis@sap.com
- *
- * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss512k StackOverflowBug
- */
-
-
-public class StackOverflowBug {
-
-  public static int run() {
-    try {
-      try {
-        return run();
-      } catch (Throwable e) {
-        // Notice that the class 'Throwable' is NOT resolved by the verifier,
-        // because the verifier only checks if 'Throwable' is assignable to
-        // 'java.lang.Throwable' and this check succeeds immediately if the two
-        // types have equal names (see 'VerificationType::is_assignable_from' which
-        // is called from 'ClassVerifier::verify_exception_handler_table').
-        // This is strange, because if the two classes have different names,
-        // 'is_assignable_from()' calls 'is_reference_assignable_from()' which resolves
-        // both classes by calling 'SystemDictionary::resolve_or_fail()'. This call
-        // also takes into account the current class loader (i.e. the one which was used
-        // to load this class) and would place a corresponding
-        // "java.lang.Throwable / current-Classloader" entry into the system dictionary.
-        // This would in turn allow C2 to see 'java.lang.Throwable' as "loaded"
-        // (see 'Parse::catch_inline_exceptions()') when this method is compiled.
-        return 42;
-      }
-    }
-    finally {
-    }
-  }
-
-  public static void main(String argv[]) {
-    run();
-  }
-}
-
-/*
-  public static int run();
-    Code:
-       0: invokestatic  #2                  // Method run:()I
-       3: istore_0
-       4: iload_0
-       5: ireturn
-       6: astore_0
-       7: bipush        42
-       9: istore_1
-      10: iload_1
-      11: ireturn
-      12: astore_2
-      13: aload_2
-      14: athrow
-    Exception table:
-       from    to  target type
-           0     4     6   Class java/lang/Throwable
-           0     4    12   any
-           6    10    12   any
-          12    13    12   any
-
- */
diff --git a/test/compiler/runtime/6892265/Test.java b/test/compiler/runtime/6892265/Test.java
deleted file mode 100644
index fd51193..0000000
--- a/test/compiler/runtime/6892265/Test.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2009, 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 6892265
- * @summary System.arraycopy unable to reference elements beyond Integer.MAX_VALUE bytes
- *
- * @run main/othervm Test
- */
-
-public class Test {
-  static  final int NCOPY = 1;
-  static  final int OVERFLOW = 1;
-  static  int[] src2 = new int[NCOPY];
-  static  int[] dst2;
-
-  static void test() {
-    int N;
-    int SIZE;
-
-    N = Integer.MAX_VALUE/4 + OVERFLOW;
-    System.arraycopy(src2, 0, dst2, N, NCOPY);
-    System.arraycopy(dst2, N, src2, 0, NCOPY);
-  }
-
-  public static void main(String[] args) {
-    try {
-      dst2 = new int[NCOPY + Integer.MAX_VALUE/4 + OVERFLOW];
-    } catch (OutOfMemoryError e) {
-       System.exit(95); // Not enough memory
-    }
-    System.out.println("warmup");
-    for (int i=0; i <11000; i++) {
-      test();
-    }
-    System.out.println("start");
-    for (int i=0; i <1000; i++) {
-      test();
-    }
-    System.out.println("finish");
-  }
-
-}
diff --git a/test/compiler/runtime/7196199/Test7196199.java b/test/compiler/runtime/7196199/Test7196199.java
deleted file mode 100644
index 8f0c520..0000000
--- a/test/compiler/runtime/7196199/Test7196199.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2012, 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 7196199
- * @summary java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
- *
- * @run main/othervm/timeout=400 -Xmx32m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:CompileCommand=exclude,Test7196199.test -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 Test7196199
- */
-
-
-public class Test7196199 {
-  private static final int ARRLEN = 97;
-  private static final int ITERS  = 5000;
-  private static final int INI_ITERS  = 1000;
-  private static final int SFP_ITERS  = 10000;
-  private static final float SFP_ITERS_F  = 10000.f;
-  private static final float VALUE = 15.f;
-  public static void main(String args[]) {
-    int errn = test();
-    if (errn > 0) {
-      System.err.println("FAILED: " + errn + " errors");
-      System.exit(97);
-    }
-    System.out.println("PASSED");
-  }
-
-  static int test() {
-    float[] a0 = new float[ARRLEN];
-    float[] a1 = new float[ARRLEN];
-    // Initialize
-    for (int i=0; i<ARRLEN; i++) {
-      a0[i] = 0.f;
-      a1[i] = (float)i;
-    }
-    System.out.println("Warmup");
-    for (int i=0; i<INI_ITERS; i++) {
-      test_incrc(a0);
-      test_incrv(a0, VALUE);
-      test_addc(a0, a1);
-      test_addv(a0, a1, VALUE);
-    }
-    // Test and verify results
-    System.out.println("Verification");
-    int errn = 0;
-    for (int i=0; i<ARRLEN; i++)
-      a0[i] = 0.f;
-
-    System.out.println("  test_incrc");
-    for (int j=0; j<ITERS; j++) {
-      test_incrc(a0);
-      for (int i=0; i<ARRLEN; i++) {
-        errn += verify("test_incrc: ", i, a0[i], VALUE*SFP_ITERS_F);
-        a0[i] = 0.f; // Reset
-      }
-    }
-
-    System.out.println("  test_incrv");
-    for (int j=0; j<ITERS; j++) {
-      test_incrv(a0, VALUE);
-      for (int i=0; i<ARRLEN; i++) {
-        errn += verify("test_incrv: ", i, a0[i], VALUE*SFP_ITERS_F);
-        a0[i] = 0.f; // Reset
-      }
-    }
-
-    System.out.println("  test_addc");
-    for (int j=0; j<ITERS; j++) {
-      test_addc(a0, a1);
-      for (int i=0; i<ARRLEN; i++) {
-        errn += verify("test_addc: ", i, a0[i], ((float)i + VALUE)*SFP_ITERS_F);
-        a0[i] = 0.f; // Reset
-      }
-    }
-
-    System.out.println("  test_addv");
-    for (int j=0; j<ITERS; j++) {
-      test_addv(a0, a1, VALUE);
-      for (int i=0; i<ARRLEN; i++) {
-        errn += verify("test_addv: ", i, a0[i], ((float)i + VALUE)*SFP_ITERS_F);
-        a0[i] = 0.f; // Reset
-      }
-    }
-
-    if (errn > 0)
-      return errn;
-
-    System.out.println("Time");
-    long start, end;
-
-    start = System.currentTimeMillis();
-    for (int i=0; i<INI_ITERS; i++) {
-      test_incrc(a0);
-    }
-    end = System.currentTimeMillis();
-    System.out.println("test_incrc: " + (end - start));
-
-    start = System.currentTimeMillis();
-    for (int i=0; i<INI_ITERS; i++) {
-      test_incrv(a0, VALUE);
-    }
-    end = System.currentTimeMillis();
-    System.out.println("test_incrv: " + (end - start));
-
-    start = System.currentTimeMillis();
-    for (int i=0; i<INI_ITERS; i++) {
-      test_addc(a0, a1);
-    }
-    end = System.currentTimeMillis();
-    System.out.println("test_addc: " + (end - start));
-
-    start = System.currentTimeMillis();
-    for (int i=0; i<INI_ITERS; i++) {
-      test_addv(a0, a1, VALUE);
-    }
-    end = System.currentTimeMillis();
-    System.out.println("test_addv: " + (end - start));
-
-    return errn;
-  }
-
-  static void test_incrc(float[] a0) {
-    // Non-counted loop with safepoint.
-    for (long l = 0; l < SFP_ITERS; l++) {
-      // Counted and vectorized loop.
-      for (int i = 0; i < a0.length; i+=1) {
-        a0[i] += VALUE;
-      }
-    }
-  }
-  static void test_incrv(float[] a0, float b) {
-    // Non-counted loop with safepoint.
-    for (long l = 0; l < SFP_ITERS; l++) {
-      // Counted and vectorized loop.
-      for (int i = 0; i < a0.length; i+=1) {
-        a0[i] += b;
-      }
-    }
-  }
-  static void test_addc(float[] a0, float[] a1) {
-    // Non-counted loop with safepoint.
-    for (long l = 0; l < SFP_ITERS; l++) {
-      // Counted and vectorized loop.
-      for (int i = 0; i < a0.length; i+=1) {
-        a0[i] += a1[i]+VALUE;
-      }
-    }
-  }
-  static void test_addv(float[] a0, float[] a1, float b) {
-    // Non-counted loop with safepoint.
-    for (long l = 0; l < SFP_ITERS; l++) {
-      // Counted and vectorized loop.
-      for (int i = 0; i < a0.length; i+=1) {
-        a0[i] += a1[i]+b;
-      }
-    }
-  }
-
-  static int verify(String text, int i, float elem, float val) {
-    if (elem != val) {
-      System.err.println(text + "[" + i + "] = " + elem + " != " + val);
-      return 1;
-    }
-    return 0;
-  }
-}
-
diff --git a/test/compiler/runtime/8010927/Test8010927.java b/test/compiler/runtime/8010927/Test8010927.java
deleted file mode 100644
index 9453878..0000000
--- a/test/compiler/runtime/8010927/Test8010927.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2013, 2015, 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 8010927
- * @summary Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy
- * @library /test/lib /testlibrary
- * @modules java.base/jdk.internal.misc
- * @build Test8010927
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xmx64m -XX:NewSize=20971520 -XX:MaxNewSize=32m -XX:-UseTLAB -XX:-UseAdaptiveSizePolicy Test8010927
- */
-
-import sun.hotspot.WhiteBox;
-import java.lang.reflect.Field;
-import jdk.internal.misc.Unsafe;
-
-/**
- * The test creates uncommitted space between oldgen and young gen
- * by specifying MaxNewSize bigger than NewSize.
- * NewSize = 20971520 = (512*4K) * 10 for 4k pages
- * Then it tries to execute arraycopy() with elements type check
- * to the array at the end of survive space near unused space.
- */
-
-public class Test8010927 {
-
-  private static final Unsafe U;
-
-  static {
-    try {
-      Field unsafe = Unsafe.class.getDeclaredField("theUnsafe");
-      unsafe.setAccessible(true);
-      U = (Unsafe) unsafe.get(null);
-    } catch (Exception e) {
-      throw new Error(e);
-    }
-  }
-
-  public static Object[] o;
-
-  public static final boolean debug = Boolean.getBoolean("debug");
-
-  // 2 different obect arrays but same element types
-  static Test8010927[] masterA;
-  static Object[] masterB;
-  static final Test8010927 elem = new Test8010927();
-  static final WhiteBox wb = WhiteBox.getWhiteBox();
-
-  static final int obj_header_size = U.ARRAY_OBJECT_BASE_OFFSET;
-  static final int heap_oop_size = wb.getHeapOopSize();
-  static final int card_size = 512;
-  static final int one_card = (card_size - obj_header_size)/heap_oop_size;
-
-  static final int surv_size = 2112 * 1024;
-
-  // The size is big to not fit into survive space.
-  static final Object[] cache = new Object[(surv_size / card_size)];
-
-  public static void main(String[] args) {
-    masterA = new Test8010927[one_card];
-    masterB = new Object[one_card];
-    for (int i = 0; i < one_card; ++i) {
-      masterA[i] = elem;
-      masterB[i] = elem;
-    }
-
-    // Move cache[] to the old gen.
-    long low_limit = wb.getObjectAddress(cache);
-    System.gc();
-    // Move 'cache' to oldgen.
-    long upper_limit = wb.getObjectAddress(cache);
-    if ((low_limit - upper_limit) > 0) { // substaction works with unsigned values
-      // OldGen is placed before youngger for ParallelOldGC.
-      upper_limit = low_limit + 21000000l; // +20971520
-    }
-    // Each A[one_card] size is 512 bytes,
-    // it will take about 40000 allocations to trigger GC.
-    // cache[] has 8192 elements so GC should happen
-    // each 5th iteration.
-    for(long l = 0; l < 20; l++) {
-      fill_heap();
-      if (debug) {
-        System.out.println("test oop_disjoint_arraycopy");
-      }
-      testA_arraycopy();
-      if (debug) {
-        System.out.println("test checkcast_arraycopy");
-      }
-      testB_arraycopy();
-      // Execute arraycopy to the topmost array in young gen
-      if (debug) {
-        int top_index = get_top_address(low_limit, upper_limit);
-        if (top_index >= 0) {
-          long addr = wb.getObjectAddress(cache[top_index]);
-          System.out.println("top_addr: 0x" + Long.toHexString(addr) + ", 0x" + Long.toHexString(addr + 512));
-        }
-      }
-    }
-  }
-  static void fill_heap() {
-    for (int i = 0; i < cache.length; ++i) {
-      o = new Test8010927[one_card];
-      System.arraycopy(masterA, 0, o, 0, masterA.length);
-      cache[i] = o;
-    }
-    for (long j = 0; j < 256; ++j) {
-      o = new Long[10000]; // to trigger GC
-    }
-  }
-  static void testA_arraycopy() {
-    for (int i = 0; i < cache.length; ++i) {
-      System.arraycopy(masterA, 0, cache[i], 0, masterA.length);
-    }
-  }
-  static void testB_arraycopy() {
-    for (int i = 0; i < cache.length; ++i) {
-      System.arraycopy(masterB, 0, cache[i], 0, masterB.length);
-    }
-  }
-  static int get_top_address(long min, long max) {
-    int index = -1;
-    long addr = min;
-    for (int i = 0; i < cache.length; ++i) {
-      long test = wb.getObjectAddress(cache[i]);
-      if (((test - addr) > 0) && ((max - test) > 0)) { // substaction works with unsigned values
-        addr = test;
-        index = i;
-      }
-    }
-    return index;
-  }
-}
diff --git a/test/compiler/runtime/7141637/SpreadNullArg.java b/test/compiler/runtime/SpreadNullArg.java
similarity index 85%
rename from test/compiler/runtime/7141637/SpreadNullArg.java
rename to test/compiler/runtime/SpreadNullArg.java
index fac5d47..826058e 100644
--- a/test/compiler/runtime/7141637/SpreadNullArg.java
+++ b/test/compiler/runtime/SpreadNullArg.java
@@ -24,11 +24,14 @@
 /*
  * @test SpreadNullArg
  * @bug 7141637
- * @summary  verifies that the MethodHandle spread adapter can gracefully handle null arguments.
- * @run main SpreadNullArg
+ * @summary verifies that the MethodHandle spread adapter can gracefully handle null arguments.
+ *
+ * @run main compiler.runtime.SpreadNullArg
  * @author volker.simonis@gmail.com
  */
 
+package compiler.runtime;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
@@ -44,7 +47,7 @@
 
     try {
       mh_spread_target =
-        MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg);
+          MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg);
       result = (int) mh_spreadInvoker.invokeExact(mh_spread_target, (Object[]) null);
       throw new Error("Expected IllegalArgumentException was not thrown");
     } catch (IllegalArgumentException e) {
@@ -55,7 +58,7 @@
 
     if (result != 42) {
       throw new Error("result [" + result
-        + "] != 42 : Expected IllegalArgumentException was not thrown?");
+          + "] != 42 : Expected IllegalArgumentException was not thrown?");
     }
   }
 
diff --git a/test/compiler/runtime/StackOverflowBug.java b/test/compiler/runtime/StackOverflowBug.java
new file mode 100644
index 0000000..a4ee267
--- /dev/null
+++ b/test/compiler/runtime/StackOverflowBug.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2011, 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 6865265
+ * @summary JVM crashes with "missing exception handler" error
+ * @author volker.simonis@sap.com
+ *
+ * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss512k
+ *      compiler.runtime.StackOverflowBug
+ */
+
+package compiler.runtime;
+
+public class StackOverflowBug {
+
+    public static int run() {
+        try {
+            try {
+                return run();
+            } catch (Throwable e) {
+                // Notice that the class 'Throwable' is NOT resolved by the verifier,
+                // because the verifier only checks if 'Throwable' is assignable to
+                // 'java.lang.Throwable' and this check succeeds immediately if the two
+                // types have equal names (see 'VerificationType::is_assignable_from' which
+                // is called from 'ClassVerifier::verify_exception_handler_table').
+                // This is strange, because if the two classes have different names,
+                // 'is_assignable_from()' calls 'is_reference_assignable_from()' which resolves
+                // both classes by calling 'SystemDictionary::resolve_or_fail()'. This call
+                // also takes into account the current class loader (i.e. the one which was used
+                // to load this class) and would place a corresponding
+                // "java.lang.Throwable / current-Classloader" entry into the system dictionary.
+                // This would in turn allow C2 to see 'java.lang.Throwable' as "loaded"
+                // (see 'Parse::catch_inline_exceptions()') when this method is compiled.
+                return 42;
+            }
+        } finally {
+        }
+    }
+
+    public static void main(String argv[]) {
+        run();
+    }
+}
+
+/*
+  public static int run();
+    Code:
+       0: invokestatic  #2                  // Method run:()I
+       3: istore_0
+       4: iload_0
+       5: ireturn
+       6: astore_0
+       7: bipush        42
+       9: istore_1
+      10: iload_1
+      11: ireturn
+      12: astore_2
+      13: aload_2
+      14: athrow
+    Exception table:
+       from    to  target type
+           0     4     6   Class java/lang/Throwable
+           0     4    12   any
+           6    10    12   any
+          12    13    12   any
+
+ */
diff --git a/test/compiler/runtime/Test6778657.java b/test/compiler/runtime/Test6778657.java
new file mode 100644
index 0000000..37787d2
--- /dev/null
+++ b/test/compiler/runtime/Test6778657.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2008, 2009, 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 6778657
+ * @summary Casts in SharedRuntime::f2i, f2l, d2i and d2l rely on undefined C++ behaviour
+ *
+ * @run main compiler.runtime.Test6778657
+ */
+
+package compiler.runtime;
+
+public class Test6778657 {
+    public static void check_f2i(int expect) {
+        float check = expect;
+        check *= 2;
+        int actual = (int) check;
+        if (actual != expect) {
+            throw new RuntimeException("expecting " + expect + ", got " + actual);
+        }
+    }
+
+    public static void check_f2l(long expect) {
+        float check = expect;
+        check *= 2;
+        long actual = (long) check;
+        if (actual != expect) {
+            throw new RuntimeException("expecting " + expect + ", got " + actual);
+        }
+    }
+
+    public static void check_d2i(int expect) {
+        double check = expect;
+        check *= 2;
+        int actual = (int) check;
+        if (actual != expect) {
+            throw new RuntimeException("expecting " + expect + ", got " + actual);
+        }
+    }
+
+    public static void check_d2l(long expect) {
+        double check = expect;
+        check *= 2;
+        long actual = (long) check;
+        if (actual != expect) {
+            throw new RuntimeException("expecting " + expect + ", got " + actual);
+        }
+    }
+
+    public static void main(String[] args) {
+        check_f2i(Integer.MAX_VALUE);
+        check_f2i(Integer.MIN_VALUE);
+        check_f2l(Long.MAX_VALUE);
+        check_f2l(Long.MIN_VALUE);
+        check_d2i(Integer.MAX_VALUE);
+        check_d2i(Integer.MIN_VALUE);
+        check_d2l(Long.MAX_VALUE);
+        check_d2l(Long.MIN_VALUE);
+    }
+}
+
diff --git a/test/compiler/runtime/6826736/Test.java b/test/compiler/runtime/Test6826736.java
similarity index 84%
rename from test/compiler/runtime/6826736/Test.java
rename to test/compiler/runtime/Test6826736.java
index e1e1e8d..1fb8dd6 100644
--- a/test/compiler/runtime/6826736/Test.java
+++ b/test/compiler/runtime/Test6826736.java
@@ -27,10 +27,17 @@
  * @bug 6826736
  * @summary CMS: core dump with -XX:+UseCompressedOops
  *
- * @run main/othervm/timeout=600 -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+ScavengeALot -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g -XX:CompileThreshold=100 -XX:CompileOnly=Test.test -XX:-BlockLayoutRotateLoops -XX:LoopUnrollLimit=0 -Xmx256m -XX:ParallelGCThreads=4 Test
+ * @run main/othervm/timeout=600 -XX:+IgnoreUnrecognizedVMOptions -Xbatch
+ *      -XX:+ScavengeALot -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g
+ *      -XX:CompileThreshold=100 -XX:-BlockLayoutRotateLoops
+ *      -XX:LoopUnrollLimit=0 -Xmx256m -XX:ParallelGCThreads=4
+ *      -XX:CompileCommand=compileonly,compiler.runtime.Test6826736::test
+ *      compiler.runtime.Test6826736
  */
 
-public class Test {
+package compiler.runtime;
+
+public class Test6826736 {
     int[] arr;
     int[] arr2;
     int test(int r) {
@@ -50,7 +57,7 @@
 
     public static void main(String[] args) {
         int r = 0;
-        Test t = new Test();
+        Test6826736 t = new Test6826736();
         for (int i = 0; i < 100; i++) {
             t.arr = new int[100];
             r = t.test(r);
diff --git a/test/compiler/runtime/6859338/Test6859338.java b/test/compiler/runtime/Test6859338.java
similarity index 92%
rename from test/compiler/runtime/6859338/Test6859338.java
rename to test/compiler/runtime/Test6859338.java
index 7357684..b7db714 100644
--- a/test/compiler/runtime/6859338/Test6859338.java
+++ b/test/compiler/runtime/Test6859338.java
@@ -27,9 +27,13 @@
  * @bug 6859338
  * @summary Assertion failure in sharedRuntime.cpp
  *
- * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-InlineObjectHash -Xbatch -XX:-ProfileInterpreter Test6859338
+ * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *      -XX:-InlineObjectHash -Xbatch -XX:-ProfileInterpreter
+ *      compiler.runtime.Test6859338
  */
 
+package compiler.runtime;
+
 public class Test6859338 {
     static Object[] o = new Object[] { new Object(), null };
     public static void main(String[] args) {
diff --git a/test/compiler/runtime/6863420/Test.java b/test/compiler/runtime/Test6863420.java
similarity index 94%
rename from test/compiler/runtime/6863420/Test.java
rename to test/compiler/runtime/Test6863420.java
index 11d91d3..e18035c 100644
--- a/test/compiler/runtime/6863420/Test.java
+++ b/test/compiler/runtime/Test6863420.java
@@ -27,11 +27,15 @@
  * @bug 6863420
  * @summary os::javaTimeNanos() go backward on Solaris x86
  *
- * Notice the internal timeout in timeout thread Test.TOT.
- * @run main/othervm/timeout=300 Test
+ * @run main/othervm/timeout=300 compiler.runtime.Test6863420
+ */
+/*
+ * Notice the internal timeout in timeout thread Test6863420.TOT.
  */
 
-public class Test {
+package compiler.runtime;
+
+public class Test6863420 {
 
     static final int INTERNAL_TIMEOUT=240;
     static class TOT extends Thread {
diff --git a/test/compiler/runtime/Test6892265.java b/test/compiler/runtime/Test6892265.java
new file mode 100644
index 0000000..2f6df91
--- /dev/null
+++ b/test/compiler/runtime/Test6892265.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2009, 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 6892265
+ * @summary System.arraycopy unable to reference elements beyond Integer.MAX_VALUE bytes
+ *
+ * @run main/othervm compiler.runtime.Test6892265
+ */
+
+package compiler.runtime;
+
+public class Test6892265 {
+    static final int NCOPY = 1;
+    static final int OVERFLOW = 1;
+    static int[] src2 = new int[NCOPY];
+    static int[] dst2;
+
+    static void test() {
+        int N;
+        int SIZE;
+
+        N = Integer.MAX_VALUE / 4 + OVERFLOW;
+        System.arraycopy(src2, 0, dst2, N, NCOPY);
+        System.arraycopy(dst2, N, src2, 0, NCOPY);
+    }
+
+    public static void main(String[] args) {
+        try {
+            dst2 = new int[NCOPY + Integer.MAX_VALUE / 4 + OVERFLOW];
+        } catch (OutOfMemoryError e) {
+            System.exit(95); // Not enough memory
+        }
+        System.out.println("warmup");
+        for (int i = 0; i < 11000; i++) {
+            test();
+        }
+        System.out.println("start");
+        for (int i = 0; i < 1000; i++) {
+            test();
+        }
+        System.out.println("finish");
+    }
+
+}
diff --git a/test/compiler/runtime/7088020/Test7088020.java b/test/compiler/runtime/Test7088020.java
similarity index 92%
rename from test/compiler/runtime/7088020/Test7088020.java
rename to test/compiler/runtime/Test7088020.java
index 4ea9913..fa11ec6 100644
--- a/test/compiler/runtime/7088020/Test7088020.java
+++ b/test/compiler/runtime/Test7088020.java
@@ -27,11 +27,15 @@
  * @bug 7088020
  * @summary SEGV in JNIHandleBlock::release_block
  *
- * @run main Test7088020
+ * @run main compiler.runtime.Test7088020
  */
 
-import java.lang.invoke.*;
+package compiler.runtime;
 
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.invoke.WrongMethodTypeException;
 
 public class Test7088020 {
     public static boolean test() {
diff --git a/test/compiler/runtime/Test7196199.java b/test/compiler/runtime/Test7196199.java
new file mode 100644
index 0000000..1a83660
--- /dev/null
+++ b/test/compiler/runtime/Test7196199.java
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2012, 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 7196199
+ * @summary java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
+ *
+ * @run main/othervm/timeout=400 -Xmx32m -Xbatch -XX:+IgnoreUnrecognizedVMOptions
+ *      -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation
+ *      -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100
+ *      -XX:CompileCommand=exclude,compiler.runtime.Test7196199::test
+ *      compiler.runtime.Test7196199
+ */
+
+package compiler.runtime;
+
+public class Test7196199 {
+    private static final int ARRLEN = 97;
+    private static final int ITERS = 5000;
+    private static final int INI_ITERS = 1000;
+    private static final int SFP_ITERS = 10000;
+    private static final float SFP_ITERS_F = 10000.f;
+    private static final float VALUE = 15.f;
+
+    public static void main(String args[]) {
+        int errn = test();
+        if (errn > 0) {
+            System.err.println("FAILED: " + errn + " errors");
+            System.exit(97);
+        }
+        System.out.println("PASSED");
+    }
+
+    static int test() {
+        float[] a0 = new float[ARRLEN];
+        float[] a1 = new float[ARRLEN];
+        // Initialize
+        for (int i = 0; i < ARRLEN; i++) {
+            a0[i] = 0.f;
+            a1[i] = (float) i;
+        }
+        System.out.println("Warmup");
+        for (int i = 0; i < INI_ITERS; i++) {
+            test_incrc(a0);
+            test_incrv(a0, VALUE);
+            test_addc(a0, a1);
+            test_addv(a0, a1, VALUE);
+        }
+        // Test and verify results
+        System.out.println("Verification");
+        int errn = 0;
+        for (int i = 0; i < ARRLEN; i++)
+            a0[i] = 0.f;
+
+        System.out.println("  test_incrc");
+        for (int j = 0; j < ITERS; j++) {
+            test_incrc(a0);
+            for (int i = 0; i < ARRLEN; i++) {
+                errn += verify("test_incrc: ", i, a0[i], VALUE * SFP_ITERS_F);
+                a0[i] = 0.f; // Reset
+            }
+        }
+
+        System.out.println("  test_incrv");
+        for (int j = 0; j < ITERS; j++) {
+            test_incrv(a0, VALUE);
+            for (int i = 0; i < ARRLEN; i++) {
+                errn += verify("test_incrv: ", i, a0[i], VALUE * SFP_ITERS_F);
+                a0[i] = 0.f; // Reset
+            }
+        }
+
+        System.out.println("  test_addc");
+        for (int j = 0; j < ITERS; j++) {
+            test_addc(a0, a1);
+            for (int i = 0; i < ARRLEN; i++) {
+                errn += verify("test_addc: ", i, a0[i], ((float) i + VALUE) * SFP_ITERS_F);
+                a0[i] = 0.f; // Reset
+            }
+        }
+
+        System.out.println("  test_addv");
+        for (int j = 0; j < ITERS; j++) {
+            test_addv(a0, a1, VALUE);
+            for (int i = 0; i < ARRLEN; i++) {
+                errn += verify("test_addv: ", i, a0[i], ((float) i + VALUE) * SFP_ITERS_F);
+                a0[i] = 0.f; // Reset
+            }
+        }
+
+        if (errn > 0)
+            return errn;
+
+        System.out.println("Time");
+        long start, end;
+
+        start = System.currentTimeMillis();
+        for (int i = 0; i < INI_ITERS; i++) {
+            test_incrc(a0);
+        }
+        end = System.currentTimeMillis();
+        System.out.println("test_incrc: " + (end - start));
+
+        start = System.currentTimeMillis();
+        for (int i = 0; i < INI_ITERS; i++) {
+            test_incrv(a0, VALUE);
+        }
+        end = System.currentTimeMillis();
+        System.out.println("test_incrv: " + (end - start));
+
+        start = System.currentTimeMillis();
+        for (int i = 0; i < INI_ITERS; i++) {
+            test_addc(a0, a1);
+        }
+        end = System.currentTimeMillis();
+        System.out.println("test_addc: " + (end - start));
+
+        start = System.currentTimeMillis();
+        for (int i = 0; i < INI_ITERS; i++) {
+            test_addv(a0, a1, VALUE);
+        }
+        end = System.currentTimeMillis();
+        System.out.println("test_addv: " + (end - start));
+
+        return errn;
+    }
+
+    static void test_incrc(float[] a0) {
+        // Non-counted loop with safepoint.
+        for (long l = 0; l < SFP_ITERS; l++) {
+            // Counted and vectorized loop.
+            for (int i = 0; i < a0.length; i += 1) {
+                a0[i] += VALUE;
+            }
+        }
+    }
+
+    static void test_incrv(float[] a0, float b) {
+        // Non-counted loop with safepoint.
+        for (long l = 0; l < SFP_ITERS; l++) {
+            // Counted and vectorized loop.
+            for (int i = 0; i < a0.length; i += 1) {
+                a0[i] += b;
+            }
+        }
+    }
+
+    static void test_addc(float[] a0, float[] a1) {
+        // Non-counted loop with safepoint.
+        for (long l = 0; l < SFP_ITERS; l++) {
+            // Counted and vectorized loop.
+            for (int i = 0; i < a0.length; i += 1) {
+                a0[i] += a1[i] + VALUE;
+            }
+        }
+    }
+
+    static void test_addv(float[] a0, float[] a1, float b) {
+        // Non-counted loop with safepoint.
+        for (long l = 0; l < SFP_ITERS; l++) {
+            // Counted and vectorized loop.
+            for (int i = 0; i < a0.length; i += 1) {
+                a0[i] += a1[i] + b;
+            }
+        }
+    }
+
+    static int verify(String text, int i, float elem, float val) {
+        if (elem != val) {
+            System.err.println(text + "[" + i + "] = " + elem + " != " + val);
+            return 1;
+        }
+        return 0;
+    }
+}
+
diff --git a/test/compiler/runtime/Test8010927.java b/test/compiler/runtime/Test8010927.java
new file mode 100644
index 0000000..64dc5ca
--- /dev/null
+++ b/test/compiler/runtime/Test8010927.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2013, 2015, 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 8010927
+ * @summary Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy
+ * @library /test/lib /testlibrary
+ * @modules java.base/jdk.internal.misc
+ * @build compiler.runtime.Test8010927
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions
+ *                   -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xmx64m -XX:NewSize=20971520
+ *                   -XX:MaxNewSize=32m -XX:-UseTLAB -XX:-UseAdaptiveSizePolicy
+ *                   compiler.runtime.Test8010927
+ */
+
+package compiler.runtime;
+
+import jdk.internal.misc.Unsafe;
+import sun.hotspot.WhiteBox;
+
+import java.lang.reflect.Field;
+
+/**
+ * The test creates uncommitted space between oldgen and young gen
+ * by specifying MaxNewSize bigger than NewSize.
+ * NewSize = 20971520 = (512*4K) * 10 for 4k pages
+ * Then it tries to execute arraycopy() with elements type check
+ * to the array at the end of survive space near unused space.
+ */
+
+public class Test8010927 {
+
+    private static final Unsafe U;
+
+    static {
+        try {
+            Field unsafe = Unsafe.class.getDeclaredField("theUnsafe");
+            unsafe.setAccessible(true);
+            U = (Unsafe) unsafe.get(null);
+        } catch (Exception e) {
+            throw new Error(e);
+        }
+    }
+
+    public static Object[] o;
+
+    public static final boolean debug = Boolean.getBoolean("debug");
+
+    // 2 different obect arrays but same element types
+    static Test8010927[] masterA;
+    static Object[] masterB;
+    static final Test8010927 elem = new Test8010927();
+    static final WhiteBox wb = WhiteBox.getWhiteBox();
+
+    static final int obj_header_size = U.ARRAY_OBJECT_BASE_OFFSET;
+    static final int heap_oop_size = wb.getHeapOopSize();
+    static final int card_size = 512;
+    static final int one_card = (card_size - obj_header_size) / heap_oop_size;
+
+    static final int surv_size = 2112 * 1024;
+
+    // The size is big to not fit into survive space.
+    static final Object[] cache = new Object[(surv_size / card_size)];
+
+    public static void main(String[] args) {
+        masterA = new Test8010927[one_card];
+        masterB = new Object[one_card];
+        for (int i = 0; i < one_card; ++i) {
+            masterA[i] = elem;
+            masterB[i] = elem;
+        }
+
+        // Move cache[] to the old gen.
+        long low_limit = wb.getObjectAddress(cache);
+        System.gc();
+        // Move 'cache' to oldgen.
+        long upper_limit = wb.getObjectAddress(cache);
+        if ((low_limit - upper_limit) > 0) { // substaction works with unsigned values
+            // OldGen is placed before youngger for ParallelOldGC.
+            upper_limit = low_limit + 21000000l; // +20971520
+        }
+        // Each A[one_card] size is 512 bytes,
+        // it will take about 40000 allocations to trigger GC.
+        // cache[] has 8192 elements so GC should happen
+        // each 5th iteration.
+        for (long l = 0; l < 20; l++) {
+            fill_heap();
+            if (debug) {
+                System.out.println("test oop_disjoint_arraycopy");
+            }
+            testA_arraycopy();
+            if (debug) {
+                System.out.println("test checkcast_arraycopy");
+            }
+            testB_arraycopy();
+            // Execute arraycopy to the topmost array in young gen
+            if (debug) {
+                int top_index = get_top_address(low_limit, upper_limit);
+                if (top_index >= 0) {
+                    long addr = wb.getObjectAddress(cache[top_index]);
+                    System.out.println("top_addr: 0x" + Long.toHexString(addr) + ", 0x" + Long.toHexString(addr + 512));
+                }
+            }
+        }
+    }
+
+    static void fill_heap() {
+        for (int i = 0; i < cache.length; ++i) {
+            o = new Test8010927[one_card];
+            System.arraycopy(masterA, 0, o, 0, masterA.length);
+            cache[i] = o;
+        }
+        for (long j = 0; j < 256; ++j) {
+            o = new Long[10000]; // to trigger GC
+        }
+    }
+
+    static void testA_arraycopy() {
+        for (int i = 0; i < cache.length; ++i) {
+            System.arraycopy(masterA, 0, cache[i], 0, masterA.length);
+        }
+    }
+
+    static void testB_arraycopy() {
+        for (int i = 0; i < cache.length; ++i) {
+            System.arraycopy(masterB, 0, cache[i], 0, masterB.length);
+        }
+    }
+
+    static int get_top_address(long min, long max) {
+        int index = -1;
+        long addr = min;
+        for (int i = 0; i < cache.length; ++i) {
+            long test = wb.getObjectAddress(cache[i]);
+            if (((test - addr) > 0) && ((max - test) > 0)) { // substaction works with unsigned values
+                addr = test;
+                index = i;
+            }
+        }
+        return index;
+    }
+}
diff --git a/test/compiler/runtime/6891750/Test6891750.java b/test/compiler/runtime/cr6891750/Test6891750.java
similarity index 96%
rename from test/compiler/runtime/6891750/Test6891750.java
rename to test/compiler/runtime/cr6891750/Test6891750.java
index 05381e8..a375639 100644
--- a/test/compiler/runtime/6891750/Test6891750.java
+++ b/test/compiler/runtime/cr6891750/Test6891750.java
@@ -26,10 +26,11 @@
  * @test
  * @bug 6891750
  * @summary deopt blob kills values in O5
- *
- * @run main Test6891750
+ * @run main compiler.runtime.cr6891750.Test6891750
  */
 
+package compiler.runtime.cr6891750;
+
 abstract class Base6891750 extends Thread {
     abstract public long m();
 }
diff --git a/test/compiler/runtime/8015436/Test8015436.java b/test/compiler/runtime/cr8015436/Test8015436.java
similarity index 92%
rename from test/compiler/runtime/8015436/Test8015436.java
rename to test/compiler/runtime/cr8015436/Test8015436.java
index 268e04a..8c70624 100644
--- a/test/compiler/runtime/8015436/Test8015436.java
+++ b/test/compiler/runtime/cr8015436/Test8015436.java
@@ -25,8 +25,8 @@
  * @test
  * @bug 8015436
  * @summary the IK _initial_method_idnum value must be adjusted if overpass methods are added
- * @run main Test8015436
  *
+ * @run main compiler.runtime.cr8015436.Test8015436
  */
 
 /*
@@ -38,15 +38,11 @@
  * All the invocations of the defaultMethod() must be completed successfully.
  */
 
-import java.lang.invoke.*;
+package compiler.runtime.cr8015436;
 
-interface InterfaceWithDefaultMethod {
-    public void someMethod();
-
-    default public void defaultMethod(String str){
-        System.out.println("defaultMethod() " + str);
-    }
-}
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
 
 public class Test8015436 implements InterfaceWithDefaultMethod {
     @Override
@@ -66,6 +62,13 @@
     }
 }
 
+interface InterfaceWithDefaultMethod {
+    public void someMethod();
+
+    default public void defaultMethod(String str){
+        System.out.println("defaultMethod() " + str);
+    }
+}
 /*
  * A successful execution gives the output:
  *   someMethod() invoked
diff --git a/test/compiler/runtime/safepoints/TestRegisterRestoring.java b/test/compiler/runtime/safepoints/TestRegisterRestoring.java
index 08c2cb7..07b1542 100644
--- a/test/compiler/runtime/safepoints/TestRegisterRestoring.java
+++ b/test/compiler/runtime/safepoints/TestRegisterRestoring.java
@@ -27,36 +27,43 @@
  * @test
  * @bug 8148490
  * @summary Test correct saving and restoring of vector registers at safepoints.
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:-TieredCompilation -XX:CompileCommand=exclude,TestRegisterRestoring::main -XX:+SafepointALot TestRegisterRestoring
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:-TieredCompilation
+ *                   -XX:+SafepointALot
+ *                   -XX:CompileCommand=exclude,compiler.runtime.safepoints.TestRegisterRestoring::main
+ *                   compiler.runtime.safepoints.TestRegisterRestoring
  */
-public class TestRegisterRestoring {
-  public static void main(String args[]) throws Exception {
-    // Initialize
-    float[] array = new float[100];
-    for (int i = 0; i < array.length; ++i) {
-      array[i] = 0;
-    }
-    // Test
-    for (int j = 0; j < 20_000; ++j) {
-      increment(array);
-      // Check result
-      for (int i = 0; i < array.length; i++) {
-        if (array[i] != 10_000) {
-          throw new RuntimeException("Test failed: array[" + i + "] = " + array[i] + " but should be 10.000");
-        }
-        array[i] = 0;
-      }
-    }
-  }
 
-  static void increment(float[] array) {
-    // Loop with safepoint
-    for (long l = 0; l < 10_000; l++) {
-      // Vectorized loop
-      for (int i = 0; i < array.length; ++i) {
-        array[i] += 1;
-      }
+package compiler.runtime.safepoints;
+
+public class TestRegisterRestoring {
+    public static void main(String args[]) throws Exception {
+        // Initialize
+        float[] array = new float[100];
+        for (int i = 0; i < array.length; ++i) {
+            array[i] = 0;
+        }
+        // Test
+        for (int j = 0; j < 20_000; ++j) {
+            increment(array);
+            // Check result
+            for (int i = 0; i < array.length; i++) {
+                if (array[i] != 10_000) {
+                    throw new RuntimeException("Test failed: array[" + i + "] = " + array[i] + " but should be 10.000");
+                }
+                array[i] = 0;
+            }
+        }
     }
-  }
+
+    static void increment(float[] array) {
+        // Loop with safepoint
+        for (long l = 0; l < 10_000; l++) {
+            // Vectorized loop
+            for (int i = 0; i < array.length; ++i) {
+                array[i] += 1;
+            }
+        }
+    }
 }
 
diff --git a/test/compiler/stable/StableConfiguration.java b/test/compiler/stable/StableConfiguration.java
index 6f11dcd..dc608df 100644
--- a/test/compiler/stable/StableConfiguration.java
+++ b/test/compiler/stable/StableConfiguration.java
@@ -27,8 +27,6 @@
 
 import sun.hotspot.WhiteBox;
 
-import java.lang.reflect.Method;
-
 public class StableConfiguration {
     static final WhiteBox WB = WhiteBox.getWhiteBox();
     public static final boolean isStableEnabled;
diff --git a/test/compiler/stable/TestStableBoolean.java b/test/compiler/stable/TestStableBoolean.java
index 0e9f7bc..dbb9705 100644
--- a/test/compiler/stable/TestStableBoolean.java
+++ b/test/compiler/stable/TestStableBoolean.java
@@ -58,6 +58,7 @@
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
+
 import java.lang.reflect.InvocationTargetException;
 
 public class TestStableBoolean {
diff --git a/test/compiler/stable/TestStableByte.java b/test/compiler/stable/TestStableByte.java
index 46f4711..5561b4b 100644
--- a/test/compiler/stable/TestStableByte.java
+++ b/test/compiler/stable/TestStableByte.java
@@ -58,6 +58,7 @@
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
+
 import java.lang.reflect.InvocationTargetException;
 
 public class TestStableByte {
diff --git a/test/compiler/stable/TestStableChar.java b/test/compiler/stable/TestStableChar.java
index 95c95c1..8a1f51e 100644
--- a/test/compiler/stable/TestStableChar.java
+++ b/test/compiler/stable/TestStableChar.java
@@ -57,9 +57,10 @@
 
 package compiler.stable;
 
-import java.lang.reflect.InvocationTargetException;
 import jdk.internal.vm.annotation.Stable;
 
+import java.lang.reflect.InvocationTargetException;
+
 public class TestStableChar {
     static final boolean isStableEnabled    = StableConfiguration.isStableEnabled;
 
diff --git a/test/compiler/stable/TestStableDouble.java b/test/compiler/stable/TestStableDouble.java
index 34a3df6..ff96b2c 100644
--- a/test/compiler/stable/TestStableDouble.java
+++ b/test/compiler/stable/TestStableDouble.java
@@ -57,9 +57,10 @@
 
 package compiler.stable;
 
-import java.lang.reflect.InvocationTargetException;
 import jdk.internal.vm.annotation.Stable;
 
+import java.lang.reflect.InvocationTargetException;
+
 public class TestStableDouble {
     static final boolean isStableEnabled    = StableConfiguration.isStableEnabled;
 
diff --git a/test/compiler/stable/TestStableFloat.java b/test/compiler/stable/TestStableFloat.java
index 0f9fc97..ab879c5 100644
--- a/test/compiler/stable/TestStableFloat.java
+++ b/test/compiler/stable/TestStableFloat.java
@@ -58,6 +58,7 @@
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
+
 import java.lang.reflect.InvocationTargetException;
 
 public class TestStableFloat {
diff --git a/test/compiler/stable/TestStableInt.java b/test/compiler/stable/TestStableInt.java
index 4da1d89..e203a26 100644
--- a/test/compiler/stable/TestStableInt.java
+++ b/test/compiler/stable/TestStableInt.java
@@ -58,6 +58,7 @@
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
+
 import java.lang.reflect.InvocationTargetException;
 
 public class TestStableInt {
diff --git a/test/compiler/stable/TestStableLong.java b/test/compiler/stable/TestStableLong.java
index dfbf93b..11e6a95 100644
--- a/test/compiler/stable/TestStableLong.java
+++ b/test/compiler/stable/TestStableLong.java
@@ -58,6 +58,7 @@
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
+
 import java.lang.reflect.InvocationTargetException;
 
 public class TestStableLong {
diff --git a/test/compiler/stable/TestStableMemoryBarrier.java b/test/compiler/stable/TestStableMemoryBarrier.java
index 4a421c6..7837202 100644
--- a/test/compiler/stable/TestStableMemoryBarrier.java
+++ b/test/compiler/stable/TestStableMemoryBarrier.java
@@ -27,8 +27,6 @@
  * @test TestStableMemoryBarrier
  * @bug 8139758
  * @summary tests memory barrier correctly inserted for stable fields
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.vm.annotation
  *
  * @run main/bootclasspath/othervm -Xcomp -XX:CompileOnly=::testCompile
diff --git a/test/compiler/stable/TestStableMismatched.java b/test/compiler/stable/TestStableMismatched.java
index a71ee78..57578fc 100644
--- a/test/compiler/stable/TestStableMismatched.java
+++ b/test/compiler/stable/TestStableMismatched.java
@@ -26,13 +26,17 @@
  * @test TestStableMismatched
  * @bug 8158228
  * @summary Tests if mismatched char load from stable byte[] returns correct result
+ *
  * @run main/othervm -XX:-CompactStrings -XX:TieredStopAtLevel=1 -Xcomp
- *                   -XX:CompileOnly=TestStableMismatched::test,::charAt
- *                   TestStableMismatched
+ *                   -XX:CompileOnly=compiler.stable.TestStableMismatched::test,::charAt
+ *                   compiler.stable.TestStableMismatched
  * @run main/othervm -XX:-CompactStrings -XX:-TieredCompilation -Xcomp
- *                   -XX:CompileOnly=TestStableMismatched::test,::charAt
- *                   TestStableMismatched
+ *                   -XX:CompileOnly=compiler.stable.TestStableMismatched::test,::charAt
+ *                   compiler.stable.TestStableMismatched
  */
+
+package compiler.stable;
+
 public class TestStableMismatched {
     public static void main(String args[]) {
         test();
diff --git a/test/compiler/stable/TestStableObject.java b/test/compiler/stable/TestStableObject.java
index 1ad6b68..58affb9 100644
--- a/test/compiler/stable/TestStableObject.java
+++ b/test/compiler/stable/TestStableObject.java
@@ -58,6 +58,7 @@
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
+
 import java.lang.reflect.InvocationTargetException;
 
 public class TestStableObject {
diff --git a/test/compiler/stable/TestStableShort.java b/test/compiler/stable/TestStableShort.java
index acd8182..d893f8d 100644
--- a/test/compiler/stable/TestStableShort.java
+++ b/test/compiler/stable/TestStableShort.java
@@ -58,6 +58,7 @@
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
+
 import java.lang.reflect.InvocationTargetException;
 
 public class TestStableShort {
diff --git a/test/compiler/stable/TestStableUByte.java b/test/compiler/stable/TestStableUByte.java
index 788feca..5431345 100644
--- a/test/compiler/stable/TestStableUByte.java
+++ b/test/compiler/stable/TestStableUByte.java
@@ -57,8 +57,8 @@
  *                                 -XX:-FoldStableValues
  *                                 -XX:CompileOnly=::get,::get1
  *                                 compiler.stable.TestStableUByte
- *
  */
+
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
diff --git a/test/compiler/stable/TestStableUShort.java b/test/compiler/stable/TestStableUShort.java
index 43ebf3c..88f5cb4 100644
--- a/test/compiler/stable/TestStableUShort.java
+++ b/test/compiler/stable/TestStableUShort.java
@@ -57,8 +57,8 @@
  *                                 -XX:-FoldStableValues
  *                                 -XX:CompileOnly=::get,::get1
  *                                 compiler.stable.TestStableUShort
- *
  */
+
 package compiler.stable;
 
 import jdk.internal.vm.annotation.Stable;
diff --git a/test/compiler/startup/NumCompilerThreadsCheck.java b/test/compiler/startup/NumCompilerThreadsCheck.java
index 1eebffc..7abfc63 100644
--- a/test/compiler/startup/NumCompilerThreadsCheck.java
+++ b/test/compiler/startup/NumCompilerThreadsCheck.java
@@ -28,8 +28,15 @@
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
+ * @run driver compiler.startup.NumCompilerThreadsCheck
  */
-import jdk.test.lib.*;
+
+package compiler.startup;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
 
 public class NumCompilerThreadsCheck {
 
diff --git a/test/compiler/startup/SmallCodeCacheStartup.java b/test/compiler/startup/SmallCodeCacheStartup.java
index fbab262..2ff6437 100644
--- a/test/compiler/startup/SmallCodeCacheStartup.java
+++ b/test/compiler/startup/SmallCodeCacheStartup.java
@@ -23,7 +23,6 @@
 
 /*
  * @test
- * @ignore 8134286
  * @bug 8023014
  * @summary Test ensures that there is no crash if there is not enough ReservedCodeCacheSize
  *          to initialize all compiler threads. The option -Xcomp gives the VM more time to
@@ -31,8 +30,16 @@
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
+ * @ignore 8134286
+ * @run driver compiler.startup.SmallCodeCacheStartup
  */
-import jdk.test.lib.*;
+
+package compiler.startup;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
 import static jdk.test.lib.Asserts.assertTrue;
 
 public class SmallCodeCacheStartup {
diff --git a/test/compiler/startup/StartupOutput.java b/test/compiler/startup/StartupOutput.java
index 5d15e40..b8cd315 100644
--- a/test/compiler/startup/StartupOutput.java
+++ b/test/compiler/startup/StartupOutput.java
@@ -28,18 +28,24 @@
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
+ * @run driver compiler.startup.StartupOutput
  */
-import jdk.test.lib.*;
+
+package compiler.startup;
+
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
 
 public class StartupOutput {
-  public static void main(String[] args) throws Exception {
-    ProcessBuilder pb;
-    OutputAnalyzer out;
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer out;
 
-    pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version");
-    out = new OutputAnalyzer(pb.start());
-    out.shouldNotContain("no space to run compilers");
+        pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version");
+        out = new OutputAnalyzer(pb.start());
+        out.shouldNotContain("no space to run compilers");
 
-    out.shouldHaveExitValue(0);
-  }
+        out.shouldHaveExitValue(0);
+    }
 }
diff --git a/test/compiler/startup/TieredStopAtLevel0SanityTest.java b/test/compiler/startup/TieredStopAtLevel0SanityTest.java
index a7dbf2b..2dbce93 100644
--- a/test/compiler/startup/TieredStopAtLevel0SanityTest.java
+++ b/test/compiler/startup/TieredStopAtLevel0SanityTest.java
@@ -25,9 +25,13 @@
  * @test
  * @bug 8154151
  * @summary Sanity test flag combo that force compiles on level 0
- * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:TieredStopAtLevel=0 TieredStopAtLevel0SanityTest
+ *
+ * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:TieredStopAtLevel=0
+ *                   compiler.startup.TieredStopAtLevel0SanityTest
  */
 
+package compiler.startup;
+
 public class TieredStopAtLevel0SanityTest {
     public static void main(String[] args) throws Exception {
         System.out.println("Hello world!");
diff --git a/test/compiler/stringopts/TestOptimizeStringConcat.java b/test/compiler/stringopts/TestOptimizeStringConcat.java
index 2f0ec3c..1f14cee 100644
--- a/test/compiler/stringopts/TestOptimizeStringConcat.java
+++ b/test/compiler/stringopts/TestOptimizeStringConcat.java
@@ -26,9 +26,14 @@
  * @bug 8068909
  * @key regression
  * @summary test that string optimizations produce code, that doesn't lead to a crash.
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestOptimizeStringConcat
+ *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.stringopts.TestOptimizeStringConcat
  * @author axel.siebenborn@sap.com
  */
+
+package compiler.stringopts;
+
 public class TestOptimizeStringConcat {
 
     static boolean checkArgumentSyntax(String value, String allowedchars, String notallowedchars, String logmsg) {
diff --git a/test/compiler/stringopts/TestStringObjectInitialization.java b/test/compiler/stringopts/TestStringObjectInitialization.java
index 2d09be1..b25c225 100644
--- a/test/compiler/stringopts/TestStringObjectInitialization.java
+++ b/test/compiler/stringopts/TestStringObjectInitialization.java
@@ -22,19 +22,26 @@
  */
 
 
-import java.util.Arrays;
+
 
 /*
  * @test
  * @bug 8159244
- * @requires vm.gc == "Parallel" | vm.gc == "null"
  * @summary Verifies that no partially initialized String object escapes from
  *          C2's String concat optimization in a highly concurrent setting.
  *          This test triggers the bug in about 1 out of 10 runs.
+ * @requires vm.gc == "Parallel" | vm.gc == "null"
+ *
  * @compile -XDstringConcat=inline TestStringObjectInitialization.java
  * @run main/othervm/timeout=300 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-CompactStrings
- *                               -XX:-UseG1GC -XX:+UseParallelGC TestStringObjectInitialization
+ *                               -XX:-UseG1GC -XX:+UseParallelGC
+ *                               compiler.stringopts.TestStringObjectInitialization
  */
+
+package compiler.stringopts;
+
+import java.util.Arrays;
+
 public class TestStringObjectInitialization {
 
     String myString;
@@ -59,19 +66,19 @@
         // Trigger C2's string concatenation optimization
         add(s + Arrays.toString(sArray) + " const ");
     }
-}
 
-class Runner implements Runnable {
-    private TestStringObjectInitialization test;
+    private static class Runner implements Runnable {
+        private TestStringObjectInitialization test;
 
-    public Runner(TestStringObjectInitialization t) {
-        test = t;
-    }
+        public Runner(TestStringObjectInitialization t) {
+            test = t;
+        }
 
-    public void run(){
-        String[] array = {"a", "b", "c"};
-        for (int i = 0; i < 10000; ++i) {
-            test.run("a", array);
+        public void run() {
+            String[] array = {"a", "b", "c"};
+            for (int i = 0; i < 10000; ++i) {
+                test.run("a", array);
+            }
         }
     }
 }
diff --git a/test/compiler/testlibrary/CompilerUtils.java b/test/compiler/testlibrary/CompilerUtils.java
index 3af7e76..fea72bd 100644
--- a/test/compiler/testlibrary/CompilerUtils.java
+++ b/test/compiler/testlibrary/CompilerUtils.java
@@ -23,11 +23,13 @@
 
 package compiler.testlibrary;
 
+import java.util.Arrays;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Platform;
-import java.util.stream.IntStream;
 import sun.hotspot.WhiteBox;
 
+import java.util.stream.IntStream;
+
 public class CompilerUtils {
 
     private CompilerUtils() {
@@ -60,4 +62,14 @@
         }
         return new int[0];
     }
+
+    /**
+     * Returns maximum compilation level available
+     * @return an int value representing maximum compilation level available
+     */
+    public static int getMaxCompilationLevel() {
+        return Arrays.stream(getAvailableCompilationLevels())
+                .max()
+                .getAsInt();
+    }
 }
diff --git a/test/compiler/testlibrary/rtm/AbortProvoker.java b/test/compiler/testlibrary/rtm/AbortProvoker.java
index c7ae7f4..37b7ff6 100644
--- a/test/compiler/testlibrary/rtm/AbortProvoker.java
+++ b/test/compiler/testlibrary/rtm/AbortProvoker.java
@@ -24,13 +24,13 @@
 
 package compiler.testlibrary.rtm;
 
+import jdk.test.lib.Asserts;
+import sun.hotspot.WhiteBox;
+
 import java.util.Objects;
 import java.util.concurrent.BrokenBarrierException;
 import java.util.concurrent.CyclicBarrier;
 
-import jdk.test.lib.Asserts;
-import sun.hotspot.WhiteBox;
-
 /**
  * Base class for different transactional execution abortion
  * provokers aimed to force abort due to specified reason.
diff --git a/test/compiler/testlibrary/rtm/RTMLockingStatistics.java b/test/compiler/testlibrary/rtm/RTMLockingStatistics.java
index bf8598d..a558492 100644
--- a/test/compiler/testlibrary/rtm/RTMLockingStatistics.java
+++ b/test/compiler/testlibrary/rtm/RTMLockingStatistics.java
@@ -28,8 +28,8 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.regex.Pattern;
 import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * Wrapper for +UsePreciseRTMLockingStatistics output.
diff --git a/test/compiler/testlibrary/rtm/RTMTestBase.java b/test/compiler/testlibrary/rtm/RTMTestBase.java
index f608d00..65cbf0a 100644
--- a/test/compiler/testlibrary/rtm/RTMTestBase.java
+++ b/test/compiler/testlibrary/rtm/RTMTestBase.java
@@ -24,21 +24,21 @@
 
 package compiler.testlibrary.rtm;
 
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 import jdk.test.lib.OutputAnalyzer;
 import jdk.test.lib.ProcessTools;
 import jdk.test.lib.Utils;
 import jdk.test.lib.cli.CommandLineOptionTest;
 
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 /**
  * Auxiliary methods used for RTM testing.
  */
diff --git a/test/compiler/testlibrary/rtm/XAbortProvoker.java b/test/compiler/testlibrary/rtm/XAbortProvoker.java
index 6bab4cd..b7891ee 100644
--- a/test/compiler/testlibrary/rtm/XAbortProvoker.java
+++ b/test/compiler/testlibrary/rtm/XAbortProvoker.java
@@ -24,8 +24,8 @@
 
 package compiler.testlibrary.rtm;
 
-import jdk.test.lib.Utils;
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Utils;
 
 /**
  * Current RTM locking implementation force transaction abort
diff --git a/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java b/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java
index 8796d79..d634727 100644
--- a/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java
+++ b/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java
@@ -24,12 +24,11 @@
 
 package compiler.testlibrary.rtm.predicate;
 
+import jdk.test.lib.Platform;
 import sun.hotspot.cpuinfo.CPUInfo;
 
 import java.util.function.BooleanSupplier;
 
-import jdk.test.lib.Platform;
-
 public class SupportedCPU implements BooleanSupplier {
     @Override
     public boolean getAsBoolean() {
diff --git a/test/compiler/testlibrary/rtm/predicate/SupportedVM.java b/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
index 352b4e9..5f2c002 100644
--- a/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
+++ b/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
@@ -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
@@ -31,6 +31,6 @@
 public class SupportedVM implements BooleanSupplier {
     @Override
     public boolean getAsBoolean() {
-        return Platform.isServer() && !Platform.isEmbedded();
+        return Platform.isServer();
     }
 }
diff --git a/test/compiler/testlibrary/uncommontrap/Verifier.java b/test/compiler/testlibrary/uncommontrap/Verifier.java
index c22db58..31ccc34 100644
--- a/test/compiler/testlibrary/uncommontrap/Verifier.java
+++ b/test/compiler/testlibrary/uncommontrap/Verifier.java
@@ -23,6 +23,8 @@
 
 package compiler.testlibrary.uncommontrap;
 
+import jdk.test.lib.Asserts;
+
 import java.io.FileReader;
 import java.io.IOException;
 import java.nio.file.Files;
@@ -33,8 +35,6 @@
 import java.util.Properties;
 import java.util.regex.Pattern;
 
-import jdk.test.lib.Asserts;
-
 /**
  * Utility tool aimed to verify presence or absence of specified uncommon trap
  * in compilation log.
diff --git a/test/compiler/tiered/CompLevelsTest.java b/test/compiler/tiered/CompLevelsTest.java
index 3aa5ba1..a084110 100644
--- a/test/compiler/tiered/CompLevelsTest.java
+++ b/test/compiler/tiered/CompLevelsTest.java
@@ -27,6 +27,8 @@
  * @author igor.ignatyev@oracle.com
  */
 
+package compiler.tiered;
+
 import compiler.whitebox.CompilerWhiteBoxTest;
 
 public abstract class CompLevelsTest extends CompilerWhiteBoxTest {
diff --git a/test/compiler/tiered/ConstantGettersTransitionsTest.java b/test/compiler/tiered/ConstantGettersTransitionsTest.java
index 4c6e972..6393f5c 100644
--- a/test/compiler/tiered/ConstantGettersTransitionsTest.java
+++ b/test/compiler/tiered/ConstantGettersTransitionsTest.java
@@ -23,21 +23,27 @@
 
 /**
  * @test ConstantGettersTransitionsTest
+ * @summary Test the correctness of compilation level transitions for constant getters methods
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @build TransitionsTestExecutor ConstantGettersTransitionsTest
+ *
+ * @build compiler.tiered.TransitionsTestExecutor
+ *        compiler.tiered.ConstantGettersTransitionsTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI -XX:+TieredCompilation -XX:-UseCounterDecay
- *                   -XX:CompileCommand=compileonly,ConstantGettersTestCase$TrivialMethods::*
- *                   TransitionsTestExecutor ConstantGettersTransitionsTest
- * @summary Test the correctness of compilation level transitions for constant getters methods
+ *      -XX:+WhiteBoxAPI -XX:+TieredCompilation -XX:-UseCounterDecay
+ *      -XX:CompileCommand=compileonly,compiler.tiered.ConstantGettersTransitionsTest$ConstantGettersTestCase$TrivialMethods::*
+ *      compiler.tiered.TransitionsTestExecutor
+ *      compiler.tiered.ConstantGettersTransitionsTest
  */
 
+package compiler.tiered;
+
+import compiler.whitebox.CompilerWhiteBoxTest;
+
 import java.lang.reflect.Executable;
 import java.util.concurrent.Callable;
-import compiler.whitebox.CompilerWhiteBoxTest;
 
 public class ConstantGettersTransitionsTest extends LevelTransitionTest {
     public static void main(String[] args) {
@@ -57,141 +63,141 @@
     private ConstantGettersTransitionsTest(TestCase testCase) {
         super(testCase);
     }
-}
 
-enum ConstantGettersTestCase implements CompilerWhiteBoxTest.TestCase {
-    ICONST_M1,
-    ICONST_0,
-    ICONST_1,
-    ICONST_2,
-    ICONST_3,
-    ICONST_4,
-    ICONST_5,
-    LCONST_0,
-    LCONST_1,
-    FCONST_0,
-    FCONST_1,
-    FCONST_2,
-    DCONST_0,
-    DCONST_1,
-    DCONST_W,
-    BYTE,
-    SHORT,
-    CHAR;
+    private static enum ConstantGettersTestCase implements CompilerWhiteBoxTest.TestCase {
+        ICONST_M1,
+        ICONST_0,
+        ICONST_1,
+        ICONST_2,
+        ICONST_3,
+        ICONST_4,
+        ICONST_5,
+        LCONST_0,
+        LCONST_1,
+        FCONST_0,
+        FCONST_1,
+        FCONST_2,
+        DCONST_0,
+        DCONST_1,
+        DCONST_W,
+        BYTE,
+        SHORT,
+        CHAR;
 
-    private final Executable executable;
-    private final Callable<Integer> callable;
+        private final Executable executable;
+        private final Callable<Integer> callable;
 
-    @Override
-    public Executable getExecutable() {
-        return executable;
-    }
-
-    @Override
-    public Callable<Integer> getCallable() {
-        return callable;
-    }
-
-    @Override
-    public boolean isOsr() {
-        return false;
-    }
-
-    private ConstantGettersTestCase() {
-        String name = "make" + this.name();
-        this.executable = LevelTransitionTest.Helper.getMethod(TrivialMethods.class, name);
-        this.callable = LevelTransitionTest.Helper.getCallable(new TrivialMethods(), name);
-    }
-
-    /**
-     * Contains methods that load constants with certain types of bytecodes
-     * See JVMS 2.11.2. Load and Store Instructions
-     * Note that it doesn't have a method for ldc_w instruction
-     */
-    private static class TrivialMethods {
-        public static int makeICONST_M1() {
-            return -1;
+        @Override
+        public Executable getExecutable() {
+            return executable;
         }
 
-        public static int makeICONST_0() {
-            return 0;
+        @Override
+        public Callable<Integer> getCallable() {
+            return callable;
         }
 
-        public static int makeICONST_1() {
-            return 1;
+        @Override
+        public boolean isOsr() {
+            return false;
         }
 
-        public static int makeICONST_2() {
-            return 2;
+        private ConstantGettersTestCase() {
+            String name = "make" + this.name();
+            this.executable = LevelTransitionTest.Helper.getMethod(TrivialMethods.class, name);
+            this.callable = LevelTransitionTest.Helper.getCallable(new TrivialMethods(), name);
         }
 
-        public static int makeICONST_3() {
-            return 3;
-        }
+        /**
+         * Contains methods that load constants with certain types of bytecodes
+         * See JVMS 2.11.2. Load and Store Instructions
+         * Note that it doesn't have a method for ldc_w instruction
+         */
+        private static class TrivialMethods {
+            public static int makeICONST_M1() {
+                return -1;
+            }
 
-        public static int makeICONST_4() {
-            return 4;
-        }
+            public static int makeICONST_0() {
+                return 0;
+            }
 
-        public static int makeICONST_5() {
-            return 5;
-        }
+            public static int makeICONST_1() {
+                return 1;
+            }
 
-        public static long makeLCONST_0() {
-            return 0L;
-        }
+            public static int makeICONST_2() {
+                return 2;
+            }
 
-        public static long makeLCONST_1() {
-            return 1L;
-        }
+            public static int makeICONST_3() {
+                return 3;
+            }
 
-        public static float makeFCONST_0() {
-            return 0F;
-        }
+            public static int makeICONST_4() {
+                return 4;
+            }
 
-        public static float makeFCONST_1() {
-            return 1F;
-        }
+            public static int makeICONST_5() {
+                return 5;
+            }
 
-        public static float makeFCONST_2() {
-            return 2F;
-        }
+            public static long makeLCONST_0() {
+                return 0L;
+            }
 
-        public static double makeDCONST_0() {
-            return 0D;
-        }
+            public static long makeLCONST_1() {
+                return 1L;
+            }
 
-        public static double makeDCONST_1() {
-            return 1D;
-        }
+            public static float makeFCONST_0() {
+                return 0F;
+            }
 
-        public static double makeDCONST_W() {
-            // ldc2_w
-            return Double.MAX_VALUE;
-        }
+            public static float makeFCONST_1() {
+                return 1F;
+            }
 
-        public static Object makeOBJECT() {
-            // aconst_null
-            return null;
-        }
+            public static float makeFCONST_2() {
+                return 2F;
+            }
 
-        public static byte makeBYTE() {
-            // bipush
-            return (byte) 0x7F;
-        }
+            public static double makeDCONST_0() {
+                return 0D;
+            }
 
-        public static short makeSHORT() {
-            // sipush
-            return (short) 0x7FFF;
-        }
+            public static double makeDCONST_1() {
+                return 1D;
+            }
 
-        public static char makeCHAR() {
-            // ldc
-            return (char) 0xFFFF;
-        }
+            public static double makeDCONST_W() {
+                // ldc2_w
+                return Double.MAX_VALUE;
+            }
 
-        public static boolean makeBOOLEAN() {
-            return true;
+            public static Object makeOBJECT() {
+                // aconst_null
+                return null;
+            }
+
+            public static byte makeBYTE() {
+                // bipush
+                return (byte) 0x7F;
+            }
+
+            public static short makeSHORT() {
+                // sipush
+                return (short) 0x7FFF;
+            }
+
+            public static char makeCHAR() {
+                // ldc
+                return (char) 0xFFFF;
+            }
+
+            public static boolean makeBOOLEAN() {
+                return true;
+            }
         }
     }
-}
+}
\ No newline at end of file
diff --git a/test/compiler/tiered/LevelTransitionTest.java b/test/compiler/tiered/LevelTransitionTest.java
index 01220a2..d49d995 100644
--- a/test/compiler/tiered/LevelTransitionTest.java
+++ b/test/compiler/tiered/LevelTransitionTest.java
@@ -23,29 +23,37 @@
 
 /**
  * @test LevelTransitionTest
+ * @summary Test the correctness of compilation level transitions for different methods
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
  * @ignore 8067651
- * @build TransitionsTestExecutor LevelTransitionTest
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build compiler.tiered.TransitionsTestExecutor compiler.tiered.LevelTransitionTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI -XX:+TieredCompilation
+ *                   -XX:+WhiteBoxAPI -XX:+TieredCompilation -XX:-UseCounterDecay
  *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
- *                   -XX:CompileCommand=compileonly,ExtendedTestCase$CompileMethodHolder::*
- *                   TransitionsTestExecutor LevelTransitionTest
- * @summary Test the correctness of compilation level transitions for different methods
+ *                   -XX:CompileCommand=compileonly,compiler.tiered.LevelTransitionTest$ExtendedTestCase$CompileMethodHolder::*
+ *                   compiler.tiered.TransitionsTestExecutor
+ *                   compiler.tiered.LevelTransitionTest
  */
 
+package compiler.tiered;
+
+import compiler.whitebox.CompilerWhiteBoxTest;
+import compiler.whitebox.SimpleTestCase;
+
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
 import java.util.Objects;
 import java.util.concurrent.Callable;
-import compiler.whitebox.CompilerWhiteBoxTest;
-import compiler.whitebox.SimpleTestCase;
 
 public class LevelTransitionTest extends TieredLevelsTest {
-    /** Shows if method was profiled by being executed on levels 2 or 3 */
+    /**
+     * Shows if method was profiled by being executed on levels 2 or 3
+     */
     protected boolean isMethodProfiled;
     private int transitionCount;
 
@@ -103,7 +111,8 @@
             System.out.printf("Method %s is compiled on level %d. Expected level is %d%n", method, newLevel, expected);
             checkLevel(expected, newLevel);
             printInfo();
-        };
+        }
+        ;
     }
 
     /**
@@ -195,59 +204,66 @@
             };
         }
     }
-}
 
-enum ExtendedTestCase implements CompilerWhiteBoxTest.TestCase {
-    ACCESSOR_TEST("accessor"),
-    NONTRIVIAL_METHOD_TEST("nonTrivialMethod"),
-    TRIVIAL_CODE_TEST("trivialCode");
+    private static enum ExtendedTestCase implements CompilerWhiteBoxTest.TestCase {
+        ACCESSOR_TEST("accessor"),
+        NONTRIVIAL_METHOD_TEST("nonTrivialMethod"),
+        TRIVIAL_CODE_TEST("trivialCode");
 
-    private final Executable executable;
-    private final Callable<Integer> callable;
+        private final Executable executable;
+        private final Callable<Integer> callable;
 
-    @Override
-    public Executable getExecutable() {
-        return executable;
-    }
+        @Override
+        public Executable getExecutable() {
+            return executable;
+        }
 
-    @Override
-    public Callable<Integer> getCallable() {
-        return callable;
-    }
+        @Override
+        public Callable<Integer> getCallable() {
+            return callable;
+        }
 
-    @Override
-    public boolean isOsr() {
-        return false;
-    }
+        @Override
+        public boolean isOsr() {
+            return false;
+        }
 
-    private ExtendedTestCase(String methodName) {
-        this.executable = LevelTransitionTest.Helper.getMethod(CompileMethodHolder.class, methodName);
-        this.callable = LevelTransitionTest.Helper.getCallable(new CompileMethodHolder(), methodName);
-    }
+        private ExtendedTestCase(String methodName) {
+            this.executable = LevelTransitionTest.Helper.getMethod(CompileMethodHolder.class, methodName);
+            this.callable = LevelTransitionTest.Helper.getCallable(new CompileMethodHolder(), methodName);
+        }
 
-    private static class CompileMethodHolder {
-        private final int iter = 10;
-        private int field = 42;
+        private static class CompileMethodHolder {
+            private final int iter = 10;
+            private int field = 42;
 
-        /** Non-trivial method for threshold policy: contains loops */
-        public int nonTrivialMethod() {
-            int acc = 0;
-            for (int i = 0; i < iter; i++) {
-                acc += i;
+            /**
+             * Non-trivial method for threshold policy: contains loops
+             */
+            public int nonTrivialMethod() {
+                int acc = 0;
+                for (int i = 0; i < iter; i++) {
+                    acc += i;
+                }
+                return acc;
             }
-            return acc;
-        }
 
-        /** Field accessor method */
-        public int accessor() {
-            return field;
-        }
+            /**
+             * Field accessor method
+             */
+            public int accessor() {
+                return field;
+            }
 
-        /** Method considered as trivial by amount of code */
-        public int trivialCode() {
-            int var = 0xBAAD_C0DE;
-            var *= field;
-            return var;
+            /**
+             * Method considered as trivial by amount of code
+             */
+            public int trivialCode() {
+                int var = 0xBAAD_C0DE;
+                var *= field;
+                return var;
+            }
         }
     }
-}
+
+}
\ No newline at end of file
diff --git a/test/compiler/tiered/NonTieredLevelsTest.java b/test/compiler/tiered/NonTieredLevelsTest.java
index 9c471c6..3973bdc 100644
--- a/test/compiler/tiered/NonTieredLevelsTest.java
+++ b/test/compiler/tiered/NonTieredLevelsTest.java
@@ -23,39 +23,39 @@
 
 /**
  * @test NonTieredLevelsTest
+ * @summary Verify that only one level can be used
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @ignore 8157984
- * @build NonTieredLevelsTest
+ *          java.management
+ * @requires vm.opt.TieredStopAtLevel==null
+ * @build compiler.tiered.NonTieredLevelsTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay
  *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
- *                   NonTieredLevelsTest
- * @summary Verify that only one level can be used
- * @author igor.ignatyev@oracle.com
+ *                   compiler.tiered.NonTieredLevelsTest
  */
 
+package compiler.tiered;
+
 import java.util.function.IntPredicate;
 import compiler.whitebox.CompilerWhiteBoxTest;
+import jdk.test.lib.Platform;
 
 public class NonTieredLevelsTest extends CompLevelsTest {
     private static final int AVAILABLE_COMP_LEVEL;
     private static final IntPredicate IS_AVAILABLE_COMPLEVEL;
     static {
-        String vmName = System.getProperty("java.vm.name");
-        if (vmName.endsWith(" Server VM")) {
+        if (Platform.isServer()) {
             AVAILABLE_COMP_LEVEL = COMP_LEVEL_FULL_OPTIMIZATION;
             IS_AVAILABLE_COMPLEVEL = x -> x == COMP_LEVEL_FULL_OPTIMIZATION;
-        } else if (vmName.endsWith(" Client VM")
-                || vmName.endsWith(" Minimal VM")) {
+        } else if (Platform.isClient() || Platform.isMinimal()) {
             AVAILABLE_COMP_LEVEL = COMP_LEVEL_SIMPLE;
             IS_AVAILABLE_COMPLEVEL = x -> x >= COMP_LEVEL_SIMPLE
                     && x <= COMP_LEVEL_FULL_PROFILE;
         } else {
-            throw new RuntimeException("Unknown VM: " + vmName);
+            throw new Error("TESTBUG: unknown VM: " + Platform.vmName);
         }
 
     }
diff --git a/test/compiler/tiered/TieredLevelsTest.java b/test/compiler/tiered/TieredLevelsTest.java
index 2f36bd5..768022b 100644
--- a/test/compiler/tiered/TieredLevelsTest.java
+++ b/test/compiler/tiered/TieredLevelsTest.java
@@ -23,24 +23,26 @@
 
 /**
  * @test TieredLevelsTest
+ * @summary Verify that all levels &lt; 'TieredStopAtLevel' can be used
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build TieredLevelsTest
+ *          java.management
+ *
+ * @build compiler.tiered.TieredLevelsTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay
  *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
- *                   TieredLevelsTest
- * @summary Verify that all levels &lt; 'TieredStopAtLevel' can be used
- * @author igor.ignatyev@oracle.com
+ *                   compiler.tiered.TieredLevelsTest
  */
 
+package compiler.tiered;
+
 import compiler.whitebox.CompilerWhiteBoxTest;
 
 public class TieredLevelsTest extends CompLevelsTest {
-    public static void main(String[] args) throws Exception, Throwable {
+    public static void main(String[] args) throws Throwable {
         if (CompilerWhiteBoxTest.skipOnTieredCompilation(false)) {
             return;
         }
diff --git a/test/compiler/tiered/TransitionsTestExecutor.java b/test/compiler/tiered/TransitionsTestExecutor.java
index 630bac2..832678b 100644
--- a/test/compiler/tiered/TransitionsTestExecutor.java
+++ b/test/compiler/tiered/TransitionsTestExecutor.java
@@ -21,6 +21,9 @@
  * questions.
  */
 
+package compiler.tiered;
+
+import compiler.whitebox.CompilerWhiteBoxTest;
 import jdk.test.lib.OutputAnalyzer;
 import jdk.test.lib.ProcessTools;
 
@@ -29,7 +32,6 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import compiler.whitebox.CompilerWhiteBoxTest;
 
 /**
  * Executes given test in a separate VM with enabled Tiered Compilation for
@@ -59,9 +61,6 @@
         Collections.addAll(args, policy, testName);
 
         OutputAnalyzer out = ProcessTools.executeTestJvm(args.toArray(new String[args.size()]));
-        int exitCode = out.getExitValue();
-        if (exitCode != 0) {
-            throw new Error("Test execution failed with exit code " + exitCode);
-        }
+        out.shouldHaveExitValue(0);
     }
 }
diff --git a/test/compiler/types/TestMeetExactConstantArrays.java b/test/compiler/types/TestMeetExactConstantArrays.java
index 951288e..1016d1b 100644
--- a/test/compiler/types/TestMeetExactConstantArrays.java
+++ b/test/compiler/types/TestMeetExactConstantArrays.java
@@ -25,10 +25,12 @@
  * @test
  * @bug 8075587
  * @summary meet of 2 constant arrays result in bottom
- * @run main/othervm TestMeetExactConstantArrays
  *
+ * @run main/othervm compiler.types.TestMeetExactConstantArrays
  */
 
+package compiler.types;
+
 public class TestMeetExactConstantArrays {
     public abstract static class NumbersHolder {
         public Number[] getNumbers() {
diff --git a/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java b/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java
index 9769afc..a5cf25d 100644
--- a/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java
+++ b/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java
@@ -28,9 +28,10 @@
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.misc
  * @library /testlibrary /test/lib
+ *
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm
  *        -Xbootclasspath/a:.
  *        -XX:+UnlockDiagnosticVMOptions
@@ -41,10 +42,10 @@
  *        -XX:CICompilerCount=1
  *        -XX:+PrintCompilation
  *        -XX:+PrintInlining
- *        -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run
- *        -XX:CompileCommand=dontinline,TestMeetIncompatibleInterfaceArrays$Helper.createI2*
+ *        -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
+ *        -XX:CompileCommand=dontinline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
  *        -XX:CompileCommand=quiet
- *        TestMeetIncompatibleInterfaceArrays 0
+ *        compiler.types.TestMeetIncompatibleInterfaceArrays 0
  * @run main/othervm
  *        -Xbootclasspath/a:.
  *        -XX:+UnlockDiagnosticVMOptions
@@ -55,10 +56,10 @@
  *        -XX:CICompilerCount=1
  *        -XX:+PrintCompilation
  *        -XX:+PrintInlining
- *        -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run
- *        -XX:CompileCommand=inline,TestMeetIncompatibleInterfaceArrays$Helper.createI2*
+ *        -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
+ *        -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
  *        -XX:CompileCommand=quiet
- *        TestMeetIncompatibleInterfaceArrays 1
+ *        compiler.types.TestMeetIncompatibleInterfaceArrays 1
  * @run main/othervm
  *        -Xbootclasspath/a:.
  *        -XX:+UnlockDiagnosticVMOptions
@@ -72,22 +73,39 @@
  *        -XX:CICompilerCount=2
  *        -XX:+PrintCompilation
  *        -XX:+PrintInlining
- *        -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run
- *        -XX:CompileCommand=compileonly,TestMeetIncompatibleInterfaceArrays$Helper.createI2*
- *        -XX:CompileCommand=inline,TestMeetIncompatibleInterfaceArrays$Helper.createI2*
+ *        -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
+ *        -XX:CompileCommand=compileonly,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
+ *        -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
  *        -XX:CompileCommand=quiet
- *        TestMeetIncompatibleInterfaceArrays 2
+ *        compiler.types.TestMeetIncompatibleInterfaceArrays 2
  *
  * @author volker.simonis@gmail.com
  */
 
+package compiler.types;
+
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import sun.hotspot.WhiteBox;
+
 import java.io.FileOutputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import static jdk.internal.org.objectweb.asm.Opcodes.*;
-import sun.hotspot.WhiteBox;
+
+import static jdk.internal.org.objectweb.asm.Opcodes.AALOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ARETURN;
+import static jdk.internal.org.objectweb.asm.Opcodes.ASTORE;
+import static jdk.internal.org.objectweb.asm.Opcodes.GETSTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEINTERFACE;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.RETURN;
+import static jdk.internal.org.objectweb.asm.Opcodes.V1_8;
 
 public class TestMeetIncompatibleInterfaceArrays extends ClassLoader {
 
@@ -245,14 +263,14 @@
         constr.visitMaxs(0, 0);
         constr.visitEnd();
         MethodVisitor run = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "run",
-                "()" + a + "LTestMeetIncompatibleInterfaceArrays$I1;", null, null);
+                "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I1;", null, null);
         run.visitCode();
         if (dim == 4) {
-            run.visitMethodInsn(INVOKESTATIC, "TestMeetIncompatibleInterfaceArrays$Helper", createName + 3,
-                    "()" + "[[[" + "LTestMeetIncompatibleInterfaceArrays$I2;", false);
+            run.visitMethodInsn(INVOKESTATIC, "compiler/types/TestMeetIncompatibleInterfaceArrays$Helper", createName + 3,
+                    "()" + "[[[" + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I2;", false);
         } else {
-            run.visitMethodInsn(INVOKESTATIC, "TestMeetIncompatibleInterfaceArrays$Helper", createName + dim,
-                    "()" + a + "LTestMeetIncompatibleInterfaceArrays$I2;", false);
+            run.visitMethodInsn(INVOKESTATIC, "compiler/types/TestMeetIncompatibleInterfaceArrays$Helper", createName + dim,
+                    "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I2;", false);
         }
         run.visitInsn(ARETURN);
         run.visitMaxs(0, 0);
@@ -260,7 +278,7 @@
         MethodVisitor test = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "test", "()V", null, null);
         test.visitCode();
         test.visitMethodInsn(INVOKESTATIC, baseClassName + dim + "ASM", "run",
-                "()" + a + "LTestMeetIncompatibleInterfaceArrays$I1;", false);
+                "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I1;", false);
         test.visitVarInsn(ASTORE, 0);
         if (dim > 0) {
             test.visitVarInsn(ALOAD, 0);
@@ -272,7 +290,7 @@
         }
         test.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
         test.visitVarInsn(ALOAD, dim > 0 ? 1 : 0);
-        test.visitMethodInsn(INVOKEINTERFACE, "TestMeetIncompatibleInterfaceArrays$I1", "getName",
+        test.visitMethodInsn(INVOKEINTERFACE, "compiler/types/TestMeetIncompatibleInterfaceArrays$I1", "getName",
                 "()Ljava/lang/String;", true);
         test.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/Object;)V", false);
         test.visitInsn(RETURN);
@@ -296,9 +314,9 @@
         final int pass = Integer.parseInt(args.length > 0 ? args[0] : "0");
 
         // Load and initialize some classes required for compilation
-        Class.forName("TestMeetIncompatibleInterfaceArrays$I1");
-        Class.forName("TestMeetIncompatibleInterfaceArrays$I2");
-        Class.forName("TestMeetIncompatibleInterfaceArrays$Helper");
+        Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$I1");
+        Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$I2");
+        Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$Helper");
 
         for (int g = 0; g < 2; g++) {
             String baseClassName = "MeetIncompatibleInterfaceArrays";
diff --git a/test/compiler/types/TestMeetTopArrayExactConstantArray.java b/test/compiler/types/TestMeetTopArrayExactConstantArray.java
index 4ec6e7b..73234b4 100644
--- a/test/compiler/types/TestMeetTopArrayExactConstantArray.java
+++ b/test/compiler/types/TestMeetTopArrayExactConstantArray.java
@@ -25,10 +25,15 @@
  * @test
  * @bug 8027571
  * @summary meet of TopPTR exact array with constant array is not symmetric
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation -XX:-BackgroundCompilation TestMeetTopArrayExactConstantArray
  *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement
+ *                   -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation
+ *                   -XX:-BackgroundCompilation
+ *                   compiler.types.TestMeetTopArrayExactConstantArray
  */
 
+package compiler.types;
+
 public class TestMeetTopArrayExactConstantArray {
 
     static class A {
diff --git a/test/compiler/types/TestPhiElimination.java b/test/compiler/types/TestPhiElimination.java
index 5029b99..d6e8958 100644
--- a/test/compiler/types/TestPhiElimination.java
+++ b/test/compiler/types/TestPhiElimination.java
@@ -26,8 +26,13 @@
  * @test
  * @bug 8150804
  * @summary Tests elimination of Phi nodes without losing type information.
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestPhiElimination
+ *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.types.TestPhiElimination
  */
+
+package compiler.types;
+
 public class TestPhiElimination {
     /*
        A::get() is inlined into test(obj) producing the following graph:
@@ -90,23 +95,20 @@
         }
     }
 
-}
+    static class A extends TestPhiElimination {
+        public Object f;
 
-class A extends TestPhiElimination {
-    public Object f;
-
-    public A create() {
-        return new A();
-    }
-
-    public synchronized Object get() {
-        if (f == null) {
-            f = create();
+        public A create() {
+            return new A();
         }
-        return f;
+
+        public synchronized Object get() {
+            if (f == null) {
+                f = create();
+            }
+            return f;
+        }
     }
-}
 
-class B extends A {
-
+    static class B extends A { }
 }
diff --git a/test/compiler/types/TestSpeculationFailedHigherEqual.java b/test/compiler/types/TestSpeculationFailedHigherEqual.java
index 70d5566..323edd9 100644
--- a/test/compiler/types/TestSpeculationFailedHigherEqual.java
+++ b/test/compiler/types/TestSpeculationFailedHigherEqual.java
@@ -25,10 +25,14 @@
  * @test
  * @bug 8027422
  * @summary type methods shouldn't always operate on speculative part
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation -XX:-BackgroundCompilation TestSpeculationFailedHigherEqual
  *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TypeProfileLevel=222
+ *                   -XX:+UseTypeSpeculation -XX:-BackgroundCompilation
+ *                   compiler.types.TestSpeculationFailedHigherEqual
  */
 
+package compiler.types;
+
 public class TestSpeculationFailedHigherEqual {
 
     static class A {
diff --git a/test/compiler/types/TestTypePropagationToCmpU.java b/test/compiler/types/TestTypePropagationToCmpU.java
index 9e08a8b..abc0ab2 100644
--- a/test/compiler/types/TestTypePropagationToCmpU.java
+++ b/test/compiler/types/TestTypePropagationToCmpU.java
@@ -25,8 +25,12 @@
  * @test
  * @bug 8080156 8060036
  * @summary Test correctness of type propagation to CmpUNodes.
- * @run main TestTypePropagationToCmpU
+ *
+ * @run main compiler.types.TestTypePropagationToCmpU
  */
+
+package compiler.types;
+
 public class TestTypePropagationToCmpU {
     public static void main(String[] args) {
         try {
diff --git a/test/compiler/types/TypeSpeculation.java b/test/compiler/types/TypeSpeculation.java
index 6f146b8..4bc53ac 100644
--- a/test/compiler/types/TypeSpeculation.java
+++ b/test/compiler/types/TypeSpeculation.java
@@ -25,10 +25,15 @@
  * @test
  * @bug 8024070
  * @summary Test that type speculation doesn't cause incorrect execution
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation TypeSpeculation
  *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement
+ *                   -XX:-BackgroundCompilation -XX:TypeProfileLevel=222
+ *                   -XX:+UseTypeSpeculation
+ *                   compiler.types.TypeSpeculation
  */
 
+package compiler.types;
+
 public class TypeSpeculation {
 
     interface I {
diff --git a/test/compiler/types/correctness/CorrectnessTest.java b/test/compiler/types/correctness/CorrectnessTest.java
index 7add655..15a5bba 100644
--- a/test/compiler/types/correctness/CorrectnessTest.java
+++ b/test/compiler/types/correctness/CorrectnessTest.java
@@ -24,47 +24,62 @@
 /*
  * @test CorrectnessTest
  * @bug 8038418
- * @library /testlibrary /test/lib
+ * @summary Tests correctness of type usage with type profiling and speculations
+ * @requires vm.flavor == "server"
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
  * @ignore 8066173
- * @compile execution/TypeConflict.java execution/TypeProfile.java
- *          execution/MethodHandleDelegate.java
- * @build CorrectnessTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build compiler.types.correctness.CorrectnessTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation
- *                   -XX:CompileCommand=exclude,execution/*::methodNotToCompile
- *                   -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType
- *                   CorrectnessTest RETURN
+ *                   -XX:CompileCommand=exclude,compiler.types.correctness.execution.*::methodNotToCompile
+ *                   -XX:CompileCommand=dontinline,compiler.types.correctness.scenarios.Scenario::collectReturnType
+ *                   compiler.types.correctness.CorrectnessTest RETURN
  * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation
- *                   -XX:CompileCommand=exclude,execution/*::methodNotToCompile
- *                   -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType
- *                   CorrectnessTest PARAMETERS
+ *                   -XX:CompileCommand=exclude,compiler.types.correctness.execution.*::methodNotToCompile
+ *                   -XX:CompileCommand=dontinline,compiler.types.correctness.scenarios.Scenario::collectReturnType
+ *                   compiler.types.correctness.CorrectnessTest PARAMETERS
  * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation
- *                   -XX:CompileCommand=exclude,execution/*::methodNotToCompile
- *                   -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType
- *                   CorrectnessTest ARGUMENTS
- * @summary Tests correctness of type usage with type profiling and speculations
+ *                   -XX:CompileCommand=exclude,compiler.types.correctness.execution.*::methodNotToCompile
+ *                   -XX:CompileCommand=dontinline,compiler.types.correctness.scenarios.Scenario::collectReturnType
+ *                   compiler.types.correctness.CorrectnessTest ARGUMENTS
  */
 
+package compiler.types.correctness;
+
+import compiler.types.correctness.execution.Execution;
+import compiler.types.correctness.execution.MethodHandleDelegate;
+import compiler.types.correctness.execution.TypeConflict;
+import compiler.types.correctness.execution.TypeProfile;
+import compiler.types.correctness.hierarchies.DefaultMethodInterface;
+import compiler.types.correctness.hierarchies.DefaultMethodInterface2;
+import compiler.types.correctness.hierarchies.Linear;
+import compiler.types.correctness.hierarchies.Linear2;
+import compiler.types.correctness.hierarchies.NullableType;
+import compiler.types.correctness.hierarchies.OneRank;
+import compiler.types.correctness.hierarchies.TypeHierarchy;
+import compiler.types.correctness.scenarios.ArrayCopy;
+import compiler.types.correctness.scenarios.ArrayReferenceStore;
+import compiler.types.correctness.scenarios.CheckCast;
+import compiler.types.correctness.scenarios.ClassIdentity;
+import compiler.types.correctness.scenarios.ClassInstanceOf;
+import compiler.types.correctness.scenarios.ClassIsInstance;
+import compiler.types.correctness.scenarios.ProfilingType;
+import compiler.types.correctness.scenarios.ReceiverAtInvokes;
+import compiler.types.correctness.scenarios.Scenario;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Platform;
-import execution.Execution;
-import execution.MethodHandleDelegate;
-import execution.TypeConflict;
-import execution.TypeProfile;
-import hierarchies.*;
-import scenarios.*;
 import sun.hotspot.WhiteBox;
 
-import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
@@ -75,7 +90,7 @@
 
     public static void main(String[] args) {
         if (!Platform.isServer()) {
-            System.out.println("ALL TESTS SKIPPED");
+            throw new Error("TESTBUG: Not server VM");
         }
         Asserts.assertGTE(args.length, 1);
         ProfilingType profilingType = ProfilingType.valueOf(args[0]);
diff --git a/test/compiler/types/correctness/OffTest.java b/test/compiler/types/correctness/OffTest.java
index ecab6e8..ad623fe 100644
--- a/test/compiler/types/correctness/OffTest.java
+++ b/test/compiler/types/correctness/OffTest.java
@@ -24,24 +24,25 @@
 /*
  * @test CorrectnessTest
  * @bug 8038418
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
  * @ignore 8066173
- * @compile execution/TypeConflict.java execution/TypeProfile.java
- *          execution/MethodHandleDelegate.java
- * @build CorrectnessTest
- * @build OffTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=1200 OffTest
+ * @build compiler.types.correctness.OffTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/timeout=1200 compiler.types.correctness.OffTest
  */
 
+package compiler.types.correctness;
+
+import compiler.types.correctness.scenarios.ProfilingType;
 import jdk.test.lib.OutputAnalyzer;
 import jdk.test.lib.ProcessTools;
 import jdk.test.lib.Utils;
+
 import java.util.Random;
-import scenarios.ProfilingType;
 
 public class OffTest {
     private static final String[] OPTIONS = {
@@ -50,8 +51,8 @@
             "-XX:+UnlockExperimentalVMOptions",
             "-XX:+UnlockDiagnosticVMOptions",
             "-XX:+WhiteBoxAPI",
-            "-XX:CompileCommand=exclude,execution/*::methodNotToCompile",
-            "-XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType",
+            "-XX:CompileCommand=exclude,compiler.types.correctness.execution.*::methodNotToCompile",
+            "-XX:CompileCommand=dontinline,compiler.types.correctness.scenarios.Scenario::collectReturnType",
             "", // -XX:TypeProfileLevel=?
             "", // -XX:?UseTypeSpeculation
             CorrectnessTest.class.getName(),
diff --git a/test/compiler/types/correctness/execution/Execution.java b/test/compiler/types/correctness/execution/Execution.java
index f0b1949..f8b52bb 100644
--- a/test/compiler/types/correctness/execution/Execution.java
+++ b/test/compiler/types/correctness/execution/Execution.java
@@ -20,10 +20,10 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-package execution;
+package compiler.types.correctness.execution;
 
-import hierarchies.TypeHierarchy;
-import scenarios.Scenario;
+import compiler.types.correctness.hierarchies.TypeHierarchy;
+import compiler.types.correctness.scenarios.Scenario;
 
 /**
  * Execution scenario represents test methods execution type.
@@ -33,7 +33,7 @@
 public interface Execution<T extends TypeHierarchy.I, R> {
     /**
      * Executes the test code of the given scenario
-     * See {@link scenarios.Scenario#run(T)}
+     * See {@link Scenario#run(T)}
      *
      * @param scenario test scenario
      */
diff --git a/test/compiler/types/correctness/execution/MethodHandleDelegate.java b/test/compiler/types/correctness/execution/MethodHandleDelegate.java
index d067449..ca61ed1 100644
--- a/test/compiler/types/correctness/execution/MethodHandleDelegate.java
+++ b/test/compiler/types/correctness/execution/MethodHandleDelegate.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package execution;
+package compiler.types.correctness.execution;
 
-import hierarchies.TypeHierarchy;
-import scenarios.Scenario;
+import compiler.types.correctness.hierarchies.TypeHierarchy;
+import compiler.types.correctness.scenarios.Scenario;
 
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
diff --git a/test/compiler/types/correctness/execution/TypeConflict.java b/test/compiler/types/correctness/execution/TypeConflict.java
index a171504..69f779d 100644
--- a/test/compiler/types/correctness/execution/TypeConflict.java
+++ b/test/compiler/types/correctness/execution/TypeConflict.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package execution;
+package compiler.types.correctness.execution;
 
-import hierarchies.TypeHierarchy;
-import scenarios.Scenario;
+import compiler.types.correctness.hierarchies.TypeHierarchy;
+import compiler.types.correctness.scenarios.Scenario;
 
 /**
  *  Type profiling conflict execution scenario. The main goal is
diff --git a/test/compiler/types/correctness/execution/TypeProfile.java b/test/compiler/types/correctness/execution/TypeProfile.java
index 446fdb8..69f75bb 100644
--- a/test/compiler/types/correctness/execution/TypeProfile.java
+++ b/test/compiler/types/correctness/execution/TypeProfile.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package execution;
+package compiler.types.correctness.execution;
 
-import hierarchies.TypeHierarchy;
-import scenarios.Scenario;
+import compiler.types.correctness.hierarchies.TypeHierarchy;
+import compiler.types.correctness.scenarios.Scenario;
 
 /**
  * Profile type execution scenario. Executes tester method
diff --git a/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java b/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java
index bad66a0..f46a0e8 100644
--- a/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java
+++ b/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package hierarchies;
+package compiler.types.correctness.hierarchies;
 
 public class DefaultMethodInterface {
     private DefaultMethodInterface() {
diff --git a/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java b/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java
index 05c0ded..df32685 100644
--- a/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java
+++ b/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package hierarchies;
+package compiler.types.correctness.hierarchies;
 
 public class DefaultMethodInterface2 {
     private DefaultMethodInterface2() {
diff --git a/test/compiler/types/correctness/hierarchies/Linear.java b/test/compiler/types/correctness/hierarchies/Linear.java
index 85927ef..519157a 100644
--- a/test/compiler/types/correctness/hierarchies/Linear.java
+++ b/test/compiler/types/correctness/hierarchies/Linear.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package hierarchies;
+package compiler.types.correctness.hierarchies;
 
 public class Linear {
     private Linear() {
diff --git a/test/compiler/types/correctness/hierarchies/Linear2.java b/test/compiler/types/correctness/hierarchies/Linear2.java
index a5df9b9..10d3195 100644
--- a/test/compiler/types/correctness/hierarchies/Linear2.java
+++ b/test/compiler/types/correctness/hierarchies/Linear2.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package hierarchies;
+package compiler.types.correctness.hierarchies;
 
 public class Linear2 {
     private Linear2() {
diff --git a/test/compiler/types/correctness/hierarchies/NullableType.java b/test/compiler/types/correctness/hierarchies/NullableType.java
index 409a7c8..f338c1e 100644
--- a/test/compiler/types/correctness/hierarchies/NullableType.java
+++ b/test/compiler/types/correctness/hierarchies/NullableType.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package hierarchies;
+package compiler.types.correctness.hierarchies;
 
 public class NullableType<M extends TypeHierarchy.I, N extends TypeHierarchy.I>
         extends TypeHierarchy<M, N> {
diff --git a/test/compiler/types/correctness/hierarchies/OneRank.java b/test/compiler/types/correctness/hierarchies/OneRank.java
index 4dcba0f..c29b9b9 100644
--- a/test/compiler/types/correctness/hierarchies/OneRank.java
+++ b/test/compiler/types/correctness/hierarchies/OneRank.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package hierarchies;
+package compiler.types.correctness.hierarchies;
 
 public class OneRank {
     private OneRank() {
diff --git a/test/compiler/types/correctness/hierarchies/TypeHierarchy.java b/test/compiler/types/correctness/hierarchies/TypeHierarchy.java
index 91e168b..5c9821b 100644
--- a/test/compiler/types/correctness/hierarchies/TypeHierarchy.java
+++ b/test/compiler/types/correctness/hierarchies/TypeHierarchy.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package hierarchies;
+package compiler.types.correctness.hierarchies;
 
 /**
  * Type hierarchy contains classes the type profiling and speculation are tested with
diff --git a/test/compiler/types/correctness/scenarios/ArrayCopy.java b/test/compiler/types/correctness/scenarios/ArrayCopy.java
index 3f51162..1e3f3d7 100644
--- a/test/compiler/types/correctness/scenarios/ArrayCopy.java
+++ b/test/compiler/types/correctness/scenarios/ArrayCopy.java
@@ -21,9 +21,9 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
-import hierarchies.TypeHierarchy;
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 
 import java.util.Arrays;
 
diff --git a/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java b/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java
index f63e47e..868f786 100644
--- a/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java
+++ b/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java
@@ -21,9 +21,9 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
-import hierarchies.TypeHierarchy;
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 
 import java.util.Arrays;
 
diff --git a/test/compiler/types/correctness/scenarios/ArrayScenario.java b/test/compiler/types/correctness/scenarios/ArrayScenario.java
index e93a578..5530bc5 100644
--- a/test/compiler/types/correctness/scenarios/ArrayScenario.java
+++ b/test/compiler/types/correctness/scenarios/ArrayScenario.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 import jdk.test.lib.Asserts;
-import hierarchies.TypeHierarchy;
 
 import java.lang.reflect.Array;
 import java.util.Arrays;
diff --git a/test/compiler/types/correctness/scenarios/CheckCast.java b/test/compiler/types/correctness/scenarios/CheckCast.java
index 97e6de6..2863381 100644
--- a/test/compiler/types/correctness/scenarios/CheckCast.java
+++ b/test/compiler/types/correctness/scenarios/CheckCast.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 import jdk.test.lib.Asserts;
-import hierarchies.TypeHierarchy;
 
 import java.util.Objects;
 
diff --git a/test/compiler/types/correctness/scenarios/ClassIdentity.java b/test/compiler/types/correctness/scenarios/ClassIdentity.java
index 84fe2ed..bc6cc25 100644
--- a/test/compiler/types/correctness/scenarios/ClassIdentity.java
+++ b/test/compiler/types/correctness/scenarios/ClassIdentity.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 import jdk.test.lib.Asserts;
-import hierarchies.TypeHierarchy;
 
 /**
  * Tests pattern: if (a.getClass() == D.class)
diff --git a/test/compiler/types/correctness/scenarios/ClassInstanceOf.java b/test/compiler/types/correctness/scenarios/ClassInstanceOf.java
index 8b39043..2192fe0 100644
--- a/test/compiler/types/correctness/scenarios/ClassInstanceOf.java
+++ b/test/compiler/types/correctness/scenarios/ClassInstanceOf.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 import jdk.test.lib.Asserts;
-import hierarchies.TypeHierarchy;
 
 /**
  * Tests instanceof
diff --git a/test/compiler/types/correctness/scenarios/ClassIsInstance.java b/test/compiler/types/correctness/scenarios/ClassIsInstance.java
index b4cd94d..6c466c4 100644
--- a/test/compiler/types/correctness/scenarios/ClassIsInstance.java
+++ b/test/compiler/types/correctness/scenarios/ClassIsInstance.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 import jdk.test.lib.Asserts;
-import hierarchies.TypeHierarchy;
 
 /**
  * Tests {@link Class#isInstance(Object)}
diff --git a/test/compiler/types/correctness/scenarios/ProfilingType.java b/test/compiler/types/correctness/scenarios/ProfilingType.java
index 449fb16..d94a9e5 100644
--- a/test/compiler/types/correctness/scenarios/ProfilingType.java
+++ b/test/compiler/types/correctness/scenarios/ProfilingType.java
@@ -21,7 +21,7 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
 public enum ProfilingType {
     /** type profiling of return values of reference types from an invoke */
diff --git a/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java b/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java
index f98632d..a6c430e 100644
--- a/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java
+++ b/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java
@@ -21,10 +21,10 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 import jdk.test.lib.Asserts;
-import hierarchies.TypeHierarchy;
 
 /**
  * Receiver at invokes profiling and speculation
diff --git a/test/compiler/types/correctness/scenarios/Scenario.java b/test/compiler/types/correctness/scenarios/Scenario.java
index 4867920..d2aea49 100644
--- a/test/compiler/types/correctness/scenarios/Scenario.java
+++ b/test/compiler/types/correctness/scenarios/Scenario.java
@@ -21,9 +21,9 @@
  * questions.
  */
 
-package scenarios;
+package compiler.types.correctness.scenarios;
 
-import hierarchies.TypeHierarchy;
+import compiler.types.correctness.hierarchies.TypeHierarchy;
 
 /**
  * Test scenario
diff --git a/test/compiler/uncommontrap/DeoptReallocFailure.java b/test/compiler/uncommontrap/DeoptReallocFailure.java
index 1064527..0363689 100644
--- a/test/compiler/uncommontrap/DeoptReallocFailure.java
+++ b/test/compiler/uncommontrap/DeoptReallocFailure.java
@@ -25,30 +25,37 @@
  * @test
  * @bug 8146416
  * @library /test/lib /testlibrary /
+ *
  * @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbatch -XX:CompileCommand=exclude,DeoptReallocFailure::main -Xmx100m DeoptReallocFailure
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *      -XX:+WhiteBoxAPI -Xbatch -Xmx100m
+ *      -XX:CompileCommand=exclude,compiler.uncommontrap.DeoptReallocFailure::main
+ *      compiler.uncommontrap.DeoptReallocFailure
  *
  */
-import java.lang.reflect.Method;
+
+package compiler.uncommontrap;
+
 import sun.hotspot.WhiteBox;
 
-class MemoryChunk {
-    MemoryChunk other;
-    Object[][] array;
-
-    MemoryChunk(MemoryChunk other) {
-        this.other = other;
-        array = new Object[1024 * 256][];
-    }
-}
-
-class NoEscape {
-    long f1;
-}
+import java.lang.reflect.Method;
 
 public class DeoptReallocFailure {
+    static class MemoryChunk {
+        MemoryChunk other;
+        Object[][] array;
+
+        MemoryChunk(MemoryChunk other) {
+            this.other = other;
+            array = new Object[1024 * 256][];
+        }
+    }
+
+    static class NoEscape {
+        long f1;
+    }
 
     static MemoryChunk root;
     private static final WhiteBox WB = WhiteBox.getWhiteBox();
diff --git a/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java b/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java
index 835283c..3d0e84b 100644
--- a/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java
+++ b/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java
@@ -25,10 +25,16 @@
  * @test
  * @bug 8029383
  * @summary stack overflow if callee is marked for deoptimization causes crash
- * @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,StackOverflowGuardPagesOff::m1 -XX:CompileCommand=exclude,StackOverflowGuardPagesOff::m2 -Xss512K -XX:-UseOnStackReplacement StackOverflowGuardPagesOff
  *
+ * @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation
+ *      -XX:CompileCommand=dontinline,compiler.uncommontrap.StackOverflowGuardPagesOff::m1
+ *      -XX:CompileCommand=exclude,compiler.uncommontrap.StackOverflowGuardPagesOff::m2
+ *      -Xss512K -XX:-UseOnStackReplacement
+ *      compiler.uncommontrap.StackOverflowGuardPagesOff
  */
 
+package compiler.uncommontrap;
+
 // This test calls m2 recursively until a stack overflow. Then calls
 // m3 that calls m1. m1 triggers B's class loading, as a result m1 and
 // m3 needs to be deoptimized. Deoptimization of m1 causes a stack
diff --git a/test/compiler/uncommontrap/8009761/Test8009761.java b/test/compiler/uncommontrap/Test8009761.java
similarity index 96%
rename from test/compiler/uncommontrap/8009761/Test8009761.java
rename to test/compiler/uncommontrap/Test8009761.java
index 91b58c6..df9141e 100644
--- a/test/compiler/uncommontrap/8009761/Test8009761.java
+++ b/test/compiler/uncommontrap/Test8009761.java
@@ -21,20 +21,28 @@
  * questions.
  */
 
-import sun.hotspot.WhiteBox;
-import java.lang.reflect.Method;
-
 /*
  * @test
  * @bug 8009761
- * @modules java.base/jdk.internal.misc
- * @library /testlibrary /test/lib
  * @summary Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
- * @build Test8009761
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=exclude,Test8009761::m2 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss512K Test8009761
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *
+ * @build compiler.uncommontrap.Test8009761
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *      -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss512K
+ *      -XX:CompileCommand=exclude,compiler.uncommontrap.Test8009761::m2
+ *      compiler.uncommontrap.Test8009761
  */
+
+package compiler.uncommontrap;
+
+import sun.hotspot.WhiteBox;
+
+import java.lang.reflect.Method;
+
 public class Test8009761 {
 
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
diff --git a/test/compiler/uncommontrap/TestDeoptOOM.java b/test/compiler/uncommontrap/TestDeoptOOM.java
index 5342582..75a00d2 100644
--- a/test/compiler/uncommontrap/TestDeoptOOM.java
+++ b/test/compiler/uncommontrap/TestDeoptOOM.java
@@ -25,10 +25,15 @@
  * @test
  * @bug 6898462
  * @summary failed reallocations of scalar replaced objects during deoptimization causes crash
- * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=exclude,TestDeoptOOM::main -XX:CompileCommand=exclude,TestDeoptOOM::m9_1 -Xmx128M TestDeoptOOM
  *
+ * @run main/othervm -XX:-BackgroundCompilation -Xmx128M
+ *      -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::main
+ *      -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::m9_1
+ *      compiler.uncommontrap.TestDeoptOOM
  */
 
+package compiler.uncommontrap;
+
 public class TestDeoptOOM {
 
     long f1;
diff --git a/test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java b/test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java
index 153b214..6491f8e 100644
--- a/test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java
+++ b/test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java
@@ -25,10 +25,15 @@
  * @test
  * @bug 8032011
  * @summary biased locking's revoke_bias locks monitor in compiled frame with eliminated lock
- * @run main/othervm -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestLockEliminatedAtDeopt$A.m2 -XX:-BackgroundCompilation -XX:BiasedLockingStartupDelay=0 TestLockEliminatedAtDeopt
  *
+ * @run main/othervm -XX:-UseOnStackReplacement
+ *      -XX:CompileCommand=dontinline,compiler.uncommontrap.TestLockEliminatedAtDeopt$A::m2
+ *      -XX:-BackgroundCompilation -XX:BiasedLockingStartupDelay=0
+ *      compiler.uncommontrap.TestLockEliminatedAtDeopt
  */
 
+package compiler.uncommontrap;
+
 public class TestLockEliminatedAtDeopt {
 
     static class A {
diff --git a/test/compiler/uncommontrap/TestStackBangMonitorOwned.java b/test/compiler/uncommontrap/TestStackBangMonitorOwned.java
index c07a995..e1c45a7 100644
--- a/test/compiler/uncommontrap/TestStackBangMonitorOwned.java
+++ b/test/compiler/uncommontrap/TestStackBangMonitorOwned.java
@@ -25,9 +25,15 @@
  * @test
  * @bug 8032410
  * @summary Stack overflow at deoptimization doesn't release owned monitors
- * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangMonitorOwned::m1 -XX:CompileCommand=exclude,TestStackBangMonitorOwned::m2 -Xss512K -XX:-UseOnStackReplacement TestStackBangMonitorOwned
  *
+ * @run main/othervm -XX:-BackgroundCompilation -Xss512K -XX:-UseOnStackReplacement
+ *      -XX:CompileCommand=dontinline,compiler.uncommontrap.TestStackBangMonitorOwned::m1
+ *      -XX:CompileCommand=exclude,compiler.uncommontrap.TestStackBangMonitorOwned::m2
+ *      compiler.uncommontrap.TestStackBangMonitorOwned
  */
+
+package compiler.uncommontrap;
+
 public class TestStackBangMonitorOwned {
 
     static class UnloadedClass1 {
diff --git a/test/compiler/uncommontrap/TestStackBangRbp.java b/test/compiler/uncommontrap/TestStackBangRbp.java
index 9b96951..c2c80ef 100644
--- a/test/compiler/uncommontrap/TestStackBangRbp.java
+++ b/test/compiler/uncommontrap/TestStackBangRbp.java
@@ -25,9 +25,15 @@
  * @test
  * @bug 8028308
  * @summary rbp not restored when stack overflow is thrown from deopt/uncommon trap blobs
- * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangRbp::m1 -XX:CompileCommand=exclude,TestStackBangRbp::m2 -Xss512K -XX:-UseOnStackReplacement TestStackBangRbp
  *
+ * @run main/othervm -XX:-BackgroundCompilation -Xss512K -XX:-UseOnStackReplacement
+ *      -XX:CompileCommand=dontinline,compiler.uncommontrap.TestStackBangRbp::m1
+ *      -XX:CompileCommand=exclude,compiler.uncommontrap.TestStackBangRbp::m2
+ *      compiler.uncommontrap.TestStackBangRbp
  */
+
+package compiler.uncommontrap;
+
 public class TestStackBangRbp {
 
     static class UnloadedClass1 {
diff --git a/test/compiler/uncommontrap/TestUnstableIfTrap.java b/test/compiler/uncommontrap/TestUnstableIfTrap.java
index 3de7157..25e4413 100644
--- a/test/compiler/uncommontrap/TestUnstableIfTrap.java
+++ b/test/compiler/uncommontrap/TestUnstableIfTrap.java
@@ -30,51 +30,67 @@
  *          java.compiler
  *          java.management
  *          jdk.jvmstat/sun.jvmstat.monitor
- * @build TestUnstableIfTrap jdk.test.lib.* compiler.testlibrary.uncommontrap.Verifier
+ *
+ * @build compiler.uncommontrap.TestUnstableIfTrap
+ *        jdk.test.lib.*
+ *        compiler.testlibrary.uncommontrap.Verifier
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  *                   -XX:LogFile=always_taken_not_fired.xml
- *                   TestUnstableIfTrap ALWAYS_TAKEN false
+ *                   compiler.uncommontrap.TestUnstableIfTrap ALWAYS_TAKEN false
  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  *                   -XX:LogFile=always_taken_fired.xml
- *                   TestUnstableIfTrap ALWAYS_TAKEN true
+ *                   compiler.uncommontrap.TestUnstableIfTrap ALWAYS_TAKEN true
  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  *                   -XX:LogFile=never_taken_not_fired.xml
- *                   TestUnstableIfTrap NEVER_TAKEN false
+ *                   compiler.uncommontrap.TestUnstableIfTrap NEVER_TAKEN false
  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  *                   -XX:LogFile=never_taken_fired.xml
- *                   TestUnstableIfTrap NEVER_TAKEN true
+ *                   compiler.uncommontrap.TestUnstableIfTrap NEVER_TAKEN true
  * @run driver compiler.testlibrary.uncommontrap.Verifier always_taken_not_fired.xml
  *                                                        always_taken_fired.xml
  *                                                        never_taken_not_fired.xml
  *                                                        never_taken_fired.xml
  */
 
+package compiler.uncommontrap;
+
+import compiler.testlibrary.uncommontrap.Verifier;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.test.lib.ByteCodeLoader;
+import jdk.test.lib.Platform;
+import sun.hotspot.WhiteBox;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.Properties;
 
-import jdk.test.lib.ByteCodeLoader;
-import jdk.test.lib.Platform;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import static jdk.internal.org.objectweb.asm.Opcodes.*;
-
-import sun.hotspot.WhiteBox;
-import compiler.testlibrary.uncommontrap.Verifier;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_ABSTRACT;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_VOLATILE;
+import static jdk.internal.org.objectweb.asm.Opcodes.GETSTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.GOTO;
+import static jdk.internal.org.objectweb.asm.Opcodes.IADD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_1;
+import static jdk.internal.org.objectweb.asm.Opcodes.IFEQ;
+import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ISUB;
+import static jdk.internal.org.objectweb.asm.Opcodes.RETURN;
 
 public class TestUnstableIfTrap {
     private static final WhiteBox WB = WhiteBox.getWhiteBox();
diff --git a/test/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java b/test/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java
index 563bbbb..4a371a5 100644
--- a/test/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java
+++ b/test/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java
@@ -25,10 +25,14 @@
  * @test
  * @bug 8067144
  * @summary -XX:+TraceDeoptimization tries to print realloc'ed objects even when there are none
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceDeoptimization TraceDeoptimizationNoRealloc
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceDeoptimization
+ *                   compiler.uncommontrap.TraceDeoptimizationNoRealloc
  */
 
+package compiler.uncommontrap;
+
 public class TraceDeoptimizationNoRealloc {
 
     static void m(boolean some_condition) {
diff --git a/test/compiler/uncommontrap/UncommonTrapStackBang.java b/test/compiler/uncommontrap/UncommonTrapStackBang.java
index e0c093b..d286d80 100644
--- a/test/compiler/uncommontrap/UncommonTrapStackBang.java
+++ b/test/compiler/uncommontrap/UncommonTrapStackBang.java
@@ -27,8 +27,10 @@
  * @bug 8026775
  * @summary Uncommon trap blob did not bang all the stack shadow pages
  *
- * @run main/othervm UncommonTrapStackBang
- *
+ * @run main/othervm compiler.uncommontrap.UncommonTrapStackBang
+ */
+
+/*
  * Note: This test does not reproduce the problem with absolute
  * certainty. Empirically the bug reproduces on Windows some 80+% of
  * the time. Setting everything up to fail in 100% of the cases turns
@@ -55,6 +57,9 @@
  * which raises an exception on Windows when the stack bang in
  * StringBuilder is performed.
  */
+
+package compiler.uncommontrap;
+
 public class UncommonTrapStackBang extends Thread {
     class Foo { }
 
diff --git a/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java b/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
index a6707d5..be07553 100644
--- a/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
+++ b/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
@@ -25,14 +25,18 @@
  * @test
  * @bug 8016474
  * @summary The bug only happens with C1 and G1 using a different ObjectAlignmentInBytes than KlassAlignmentInBytes (which is 8)
+ *
  * @modules java.base/jdk.internal.misc
- * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 GetUnsafeObjectG1PreBarrier
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32
+ *                   compiler.unsafe.GetUnsafeObjectG1PreBarrier
  */
 
-import java.lang.reflect.Field;
+package compiler.unsafe;
 
 import jdk.internal.misc.Unsafe;
 
+import java.lang.reflect.Field;
+
 public class GetUnsafeObjectG1PreBarrier {
     private static final Unsafe unsafe;
     private static final int N = 100_000;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java
index 816977d..e98e8b4 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for boolean
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestBoolean
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestBoolean
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestBoolean
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestBoolean
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestBoolean
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestBoolean
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestBoolean
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestBoolean
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java
index 9ce6f05..7828244 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for byte
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestByte
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestByte
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestByte
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestByte
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestByte
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestByte
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestByte
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestByte
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java
index df81a2f..c774f6b 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for char
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestChar
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestChar
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestChar
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestChar
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestChar
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestChar
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestChar
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestChar
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java
index 83874a5..8a366bf 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for double
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestDouble
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestDouble
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestDouble
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestDouble
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestDouble
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestDouble
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestDouble
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestDouble
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java
index f5191f0..03df5ea 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for float
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestFloat
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestFloat
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestFloat
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestFloat
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestFloat
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestFloat
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestFloat
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestFloat
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java
index 6428c0d..61498e6 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for int
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestInt
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestInt
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestInt
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestInt
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestInt
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestInt
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestInt
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestInt
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java
index 505681a..3a07e8e 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for long
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestLong
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestLong
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestLong
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestLong
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestLong
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestLong
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestLong
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestLong
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java
index 7fc59cd..1c5c2d0 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for Object
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestObject
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestObject
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestObject
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestObject
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestObject
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestObject
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestObject
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestObject
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java
index 12ab68c..30deaa8 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for short
+ *
  * @modules java.base/jdk.internal.misc
- * @run testng/othervm -Diters=100   -Xint                   JdkInternalMiscUnsafeAccessTestShort
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestShort
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  JdkInternalMiscUnsafeAccessTestShort
- * @run testng/othervm -Diters=20000                         JdkInternalMiscUnsafeAccessTestShort
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.JdkInternalMiscUnsafeAccessTestShort
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestShort
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.JdkInternalMiscUnsafeAccessTestShort
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.JdkInternalMiscUnsafeAccessTestShort
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java b/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java
index 45959f0..f5b7681 100644
--- a/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java
+++ b/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java
@@ -26,13 +26,18 @@
  * @bug 8158260
  * @summary Test unaligned Unsafe accesses
  * @modules java.base/jdk.internal.misc
- * @run main/othervm -Diters=20000 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation JdkInternalMiscUnsafeUnalignedAccess
+ *
+ * @run main/othervm -Diters=20000 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *      compiler.unsafe.JdkInternalMiscUnsafeUnalignedAccess
  * @author volker.simonis@gmail.com
  */
 
+package compiler.unsafe;
+
+import jdk.internal.misc.Unsafe;
+
 import java.lang.reflect.Field;
 import java.nio.ByteOrder;
-import jdk.internal.misc.Unsafe;
 
 public class JdkInternalMiscUnsafeUnalignedAccess {
     static final int ITERS = Integer.getInteger("iters", 20_000);
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java
index c5349ff..7200bf7 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for boolean
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestBoolean
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestBoolean
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestBoolean
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestBoolean
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestBoolean
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestBoolean
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestBoolean
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestBoolean
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java
index e15bd64..a30c01f 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for byte
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestByte
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestByte
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestByte
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestByte
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestByte
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestByte
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestByte
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestByte
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java
index 3c34908..12dbb25 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for char
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestChar
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestChar
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestChar
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestChar
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestChar
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestChar
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestChar
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestChar
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java
index 9300fc0..5fedde7 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for double
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestDouble
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestDouble
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestDouble
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestDouble
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestDouble
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestDouble
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestDouble
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestDouble
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java
index 39a3f51..621e4ae 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for float
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestFloat
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestFloat
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestFloat
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestFloat
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestFloat
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestFloat
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestFloat
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestFloat
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java
index 5b505ad..1e49aac 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for int
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestInt
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestInt
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestInt
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestInt
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestInt
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestInt
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestInt
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestInt
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java
index 2864b04..e484bce 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for long
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestLong
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestLong
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestLong
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestLong
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestLong
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestLong
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestLong
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestLong
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java
index b56cc41..1241f0f 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for Object
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestObject
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestObject
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestObject
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestObject
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestObject
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestObject
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestObject
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestObject
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java
index 4d43464..d1d7b63 100644
--- a/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java
+++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for short
+ *
  * @modules jdk.unsupported/sun.misc
- * @run testng/othervm -Diters=100   -Xint                   SunMiscUnsafeAccessTestShort
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestShort
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  SunMiscUnsafeAccessTestShort
- * @run testng/othervm -Diters=20000                         SunMiscUnsafeAccessTestShort
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.SunMiscUnsafeAccessTestShort
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestShort
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.SunMiscUnsafeAccessTestShort
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.SunMiscUnsafeAccessTestShort
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/unsafe/TestUnsafeLoadControl.java b/test/compiler/unsafe/TestUnsafeLoadControl.java
index 3fc0e82..fde5d53 100644
--- a/test/compiler/unsafe/TestUnsafeLoadControl.java
+++ b/test/compiler/unsafe/TestUnsafeLoadControl.java
@@ -26,13 +26,17 @@
  * @bug 8077504
  * @summary Unsafe load can loose control dependency and cause crash
  * @modules java.base/jdk.internal.misc
- * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestUnsafeLoadControl
  *
+ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+ *                   compiler.unsafe.TestUnsafeLoadControl
  */
 
-import java.lang.reflect.Field;
+package compiler.unsafe;
+
 import jdk.internal.misc.Unsafe;
 
+import java.lang.reflect.Field;
+
 public class TestUnsafeLoadControl {
 
     private static final Unsafe UNSAFE;
diff --git a/test/compiler/unsafe/UnsafeGetConstantField.java b/test/compiler/unsafe/UnsafeGetConstantField.java
index 7701443..d897ba9 100644
--- a/test/compiler/unsafe/UnsafeGetConstantField.java
+++ b/test/compiler/unsafe/UnsafeGetConstantField.java
@@ -28,7 +28,7 @@
  * @summary tests on constant folding of unsafe get operations
  * @library /testlibrary
  *
- * @requires vm.flavor != "client"
+ * @requires vm.flavor == "server"
  *
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.vm.annotation
@@ -37,24 +37,26 @@
  * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions
  *                                 -Xbatch -XX:-TieredCompilation
  *                                 -XX:+FoldStableValues
- *                                 -XX:CompileCommand=dontinline,UnsafeGetConstantField.checkGetAddress()
- *                                 -XX:CompileCommand=dontinline,*.test*
+ *                                 -XX:CompileCommand=dontinline,compiler.unsafe.UnsafeGetConstantField::checkGetAddress
+ *                                 -XX:CompileCommand=dontinline,*::test*
  *                                 -XX:+UseUnalignedAccesses
- *                         -XaddReads:java.base=ALL-UNNAMED
+ *                                 -XaddReads:java.base=ALL-UNNAMED
  *                                 compiler.unsafe.UnsafeGetConstantField
  *
  * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions
  *                                 -Xbatch -XX:-TieredCompilation
  *                                 -XX:+FoldStableValues
- *                                 -XX:CompileCommand=dontinline,UnsafeGetConstantField.checkGetAddress()
- *                                 -XX:CompileCommand=dontinline,*.test*
- *                                 -XX:CompileCommand=inline,*Unsafe.get*
+ *                                 -XX:CompileCommand=dontinline,compiler.unsafe.UnsafeGetConstantField::checkGetAddress
+ *                                 -XX:CompileCommand=dontinline,*::test*
+ *                                 -XX:CompileCommand=inline,*Unsafe::get*
  *                                 -XX:-UseUnalignedAccesses
- *                         -XaddReads:java.base=ALL-UNNAMED
+ *                                 -XaddReads:java.base=ALL-UNNAMED
  *                                 compiler.unsafe.UnsafeGetConstantField
  */
+
 package compiler.unsafe;
 
+import jdk.internal.misc.Unsafe;
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.internal.org.objectweb.asm.FieldVisitor;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
@@ -63,25 +65,40 @@
 import jdk.internal.vm.annotation.Stable;
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Platform;
-import jdk.internal.misc.Unsafe;
 
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
-import static jdk.internal.org.objectweb.asm.Opcodes.*;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_FINAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACONST_NULL;
+import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ARETURN;
+import static jdk.internal.org.objectweb.asm.Opcodes.DUP;
+import static jdk.internal.org.objectweb.asm.Opcodes.GETFIELD;
+import static jdk.internal.org.objectweb.asm.Opcodes.GETSTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.NEW;
+import static jdk.internal.org.objectweb.asm.Opcodes.PUTFIELD;
+import static jdk.internal.org.objectweb.asm.Opcodes.PUTSTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.RETURN;
 
 public class UnsafeGetConstantField {
     static final Class<?> THIS_CLASS = UnsafeGetConstantField.class;
     static final Unsafe U = Unsafe.getUnsafe();
 
     public static void main(String[] args) {
-        if (Platform.isServer()) {
-            testUnsafeGetAddress();
-            testUnsafeGetField();
-            testUnsafeGetFieldUnaligned();
+        if (!Platform.isServer()) {
+            throw new Error("TESTBUG: Not server VM");
         }
+        testUnsafeGetAddress();
+        testUnsafeGetField();
+        testUnsafeGetFieldUnaligned();
         System.out.println("TEST PASSED");
     }
 
diff --git a/test/compiler/unsafe/UnsafeGetStableArrayElement.java b/test/compiler/unsafe/UnsafeGetStableArrayElement.java
index c4d5672..956e993 100644
--- a/test/compiler/unsafe/UnsafeGetStableArrayElement.java
+++ b/test/compiler/unsafe/UnsafeGetStableArrayElement.java
@@ -28,7 +28,7 @@
  * @summary tests on constant folding of unsafe get operations from stable arrays
  * @library /testlibrary
  *
- * @requires vm.flavor != "client"
+ * @requires vm.flavor == "server"
  *
  * @modules java.base/jdk.internal.vm.annotation
  *          java.base/jdk.internal.misc
@@ -39,15 +39,18 @@
  *                   -XX:CompileCommand=dontinline,*Test::test*
  *                   compiler.unsafe.UnsafeGetStableArrayElement
  */
+
 package compiler.unsafe;
 
 import jdk.internal.misc.Unsafe;
 import jdk.internal.vm.annotation.Stable;
-import java.util.concurrent.Callable;
 import jdk.test.lib.Platform;
 
+import java.util.concurrent.Callable;
+
 import static jdk.internal.misc.Unsafe.*;
-import static jdk.test.lib.Asserts.*;
+import static jdk.test.lib.Asserts.assertEQ;
+import static jdk.test.lib.Asserts.assertNE;
 
 public class UnsafeGetStableArrayElement {
     @Stable static final boolean[] STABLE_BOOLEAN_ARRAY = new boolean[16];
@@ -329,9 +332,10 @@
     }
 
     public static void main(String[] args) throws Exception {
-        if (Platform.isServer()) {
-            testUnsafeAccess();
+        if (!Platform.isServer()) {
+            throw new Error("TESTBUG: Not server VM");
         }
+        testUnsafeAccess();
         System.out.println("TEST PASSED");
     }
 }
diff --git a/test/compiler/unsafe/UnsafeRaw.java b/test/compiler/unsafe/UnsafeRaw.java
index bb2e9a1..af1a1cd 100644
--- a/test/compiler/unsafe/UnsafeRaw.java
+++ b/test/compiler/unsafe/UnsafeRaw.java
@@ -28,12 +28,15 @@
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main/othervm -Xbatch UnsafeRaw
+ * @run main/othervm -Xbatch compiler.unsafe.UnsafeRaw
  */
 
-import jdk.test.lib.Utils;
-import java.util.Random;
+package compiler.unsafe;
+
 import jdk.internal.misc.Unsafe;
+import jdk.test.lib.Utils;
+
+import java.util.Random;
 
 public class UnsafeRaw {
   public static class Tests {
diff --git a/test/compiler/unsafe/X-UnsafeAccessTest.java.template b/test/compiler/unsafe/X-UnsafeAccessTest.java.template
index 2d1743e..55ed81f 100644
--- a/test/compiler/unsafe/X-UnsafeAccessTest.java.template
+++ b/test/compiler/unsafe/X-UnsafeAccessTest.java.template
@@ -25,13 +25,16 @@
  * @test
  * @bug 8143628
  * @summary Test unsafe access for $type$
+ *
  * @modules $module$/$package$
- * @run testng/othervm -Diters=100   -Xint                   $Qualifier$UnsafeAccessTest$Type$
- * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 $Qualifier$UnsafeAccessTest$Type$
- * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  $Qualifier$UnsafeAccessTest$Type$
- * @run testng/othervm -Diters=20000                         $Qualifier$UnsafeAccessTest$Type$
+ * @run testng/othervm -Diters=100   -Xint                   compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$
+ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$
+ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$
+ * @run testng/othervm -Diters=20000                         compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$
  */
 
+package compiler.unsafe;
+
 import org.testng.annotations.Test;
 
 import java.lang.reflect.Field;
diff --git a/test/compiler/vectorization/TestNaNVector.java b/test/compiler/vectorization/TestNaNVector.java
new file mode 100644
index 0000000..d19f42e
--- /dev/null
+++ b/test/compiler/vectorization/TestNaNVector.java
@@ -0,0 +1,89 @@
+/*
+ * 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 8160425
+ * @summary Test vectorization with a signalling NaN.
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-OptimizeFill
+ *      compiler.vectorization.TestNaNVector
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-OptimizeFill
+ *      -XX:MaxVectorSize=4 compiler.vectorization.TestNaNVector
+ */
+
+package compiler.vectorization;
+
+public class TestNaNVector {
+    private char[] array;
+    private static final int LEN = 1024;
+
+    public static void main(String args[]) {
+        TestNaNVector test = new TestNaNVector();
+        // Check double precision NaN
+        for (int i = 0; i < 10_000; ++i) {
+          test.vectorizeNaNDP();
+        }
+        System.out.println("Checking double precision Nan");
+        test.checkResult(0xfff7);
+
+        // Check single precision NaN
+        for (int i = 0; i < 10_000; ++i) {
+          test.vectorizeNaNSP();
+        }
+        System.out.println("Checking single precision Nan");
+        test.checkResult(0xff80);
+    }
+
+    public TestNaNVector() {
+        array = new char[LEN];
+    }
+
+    public void vectorizeNaNDP() {
+        // This loop will be vectorized and the array store will be replaced by
+        // a 64-bit vector store to four subsequent array elements. The vector
+        // should look like this '0xfff7fff7fff7fff7' and is read from the constant
+        // table. However, in floating point arithmetic this is a signalling NaN
+        // which may be converted to a quiet NaN when processed by the x87 FPU.
+        // If the signalling bit is set, the vector ends up in the constant table
+        // as '0xfffffff7fff7fff7' which leads to an incorrect result.
+        for (int i = 0; i < LEN; ++i) {
+            array[i] = 0xfff7;
+        }
+    }
+
+    public void vectorizeNaNSP() {
+        // Same as above but with single precision
+        for (int i = 0; i < LEN; ++i) {
+            array[i] = 0xff80;
+        }
+    }
+
+    public void checkResult(int expected) {
+        for (int i = 0; i < LEN; ++i) {
+            if (array[i] != expected) {
+                throw new RuntimeException("Invalid result: array[" + i + "] = " + (int)array[i] + " != " + expected);
+            }
+        }
+    }
+}
+
diff --git a/test/compiler/vectorization/TestVectorUnalignedOffset.java b/test/compiler/vectorization/TestVectorUnalignedOffset.java
index 081a6d9..c3f80c1 100644
--- a/test/compiler/vectorization/TestVectorUnalignedOffset.java
+++ b/test/compiler/vectorization/TestVectorUnalignedOffset.java
@@ -25,10 +25,11 @@
  * @test
  * @bug 8155612
  * @summary Aarch64: vector nodes need to support misaligned offset
- * @run main/othervm -XX:-BackgroundCompilation TestVectorUnalignedOffset
  *
+ * @run main/othervm -XX:-BackgroundCompilation compiler.vectorization.TestVectorUnalignedOffset
  */
 
+package compiler.vectorization;
 
 public class TestVectorUnalignedOffset {
 
diff --git a/test/compiler/whitebox/AllocationCodeBlobTest.java b/test/compiler/whitebox/AllocationCodeBlobTest.java
index db37118..8f65176 100644
--- a/test/compiler/whitebox/AllocationCodeBlobTest.java
+++ b/test/compiler/whitebox/AllocationCodeBlobTest.java
@@ -22,32 +22,37 @@
  *
  */
 
-import java.lang.management.MemoryPoolMXBean;
-import java.util.EnumSet;
-import java.util.ArrayList;
-
-import sun.hotspot.WhiteBox;
-import sun.hotspot.code.BlobType;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.InfiniteLoop;
-
 /*
  * @test AllocationCodeBlobTest
- * @bug 8059624 8064669
- * @library /testlibrary /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build AllocationCodeBlobTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
- *                   -XX:-SegmentedCodeCache AllocationCodeBlobTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
- *                   -XX:+SegmentedCodeCache AllocationCodeBlobTest
  * @summary testing of WB::allocate/freeCodeBlob()
+ * @bug 8059624 8064669
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @build compiler.whitebox.AllocationCodeBlobTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
+ *                   -XX:-SegmentedCodeCache
+ *                   compiler.whitebox.AllocationCodeBlobTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::*
+ *                   -XX:+SegmentedCodeCache
+ *                   compiler.whitebox.AllocationCodeBlobTest
  */
+
+package compiler.whitebox;
+
+import jdk.test.lib.Asserts;
+import jdk.test.lib.InfiniteLoop;
+import sun.hotspot.WhiteBox;
+import sun.hotspot.code.BlobType;
+
+import java.lang.management.MemoryPoolMXBean;
+import java.util.ArrayList;
+import java.util.EnumSet;
+
 public class AllocationCodeBlobTest {
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
     private static final long CODE_CACHE_SIZE
diff --git a/test/compiler/whitebox/BlockingCompilation.java b/test/compiler/whitebox/BlockingCompilation.java
index 927cfea..a89ab05 100644
--- a/test/compiler/whitebox/BlockingCompilation.java
+++ b/test/compiler/whitebox/BlockingCompilation.java
@@ -31,19 +31,22 @@
  *        compiler.testlibrary.CompilerUtils
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm/timeout=60
+ * @run main/othervm
  *        -Xbootclasspath/a:.
  *        -Xmixed
  *        -XX:+UnlockDiagnosticVMOptions
  *        -XX:+WhiteBoxAPI
  *        -XX:+PrintCompilation
- *        BlockingCompilation
+ *        compiler.whitebox.BlockingCompilation
  */
 
+package compiler.whitebox;
+
 import compiler.testlibrary.CompilerUtils;
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Method;
 import java.util.Random;
-import sun.hotspot.WhiteBox;
 
 public class BlockingCompilation {
     private static final WhiteBox WB = WhiteBox.getWhiteBox();
@@ -94,7 +97,9 @@
 
         // Blocking compilations on all levels, using the default versions of
         // WB.enqueueMethodForCompilation() and manually setting compiler directives.
-        String directive = "[{ match: \"BlockingCompilation.foo\", BackgroundCompilation: false }]";
+        String directive = "[{ match: \""
+                + BlockingCompilation.class.getName().replace('.', '/')
+                + ".foo\", BackgroundCompilation: false }]";
         if (WB.addCompilerDirective(directive) != 1) {
             throw new Exception("Failed to add compiler directive");
         }
diff --git a/test/compiler/whitebox/ClearMethodStateTest.java b/test/compiler/whitebox/ClearMethodStateTest.java
index 38eb99a..d0a06f9 100644
--- a/test/compiler/whitebox/ClearMethodStateTest.java
+++ b/test/compiler/whitebox/ClearMethodStateTest.java
@@ -21,23 +21,23 @@
  * questions.
  */
 
-import java.util.function.Function;
-
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test ClearMethodStateTest
  * @bug 8006683 8007288 8022832
+ * @summary testing of WB::clearMethodState()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build ClearMethodStateTest
+ *          java.management
+ * @build compiler.whitebox.ClearMethodStateTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay ClearMethodStateTest
- * @summary testing of WB::clearMethodState()
- * @author igor.ignatyev@oracle.com
+ * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay
+ *                   compiler.whitebox.ClearMethodStateTest
  */
+
+package compiler.whitebox;
+
 public class ClearMethodStateTest extends CompilerWhiteBoxTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/whitebox/CompilerWhiteBoxTest.java b/test/compiler/whitebox/CompilerWhiteBoxTest.java
index e83cd1e..bc46d9e 100644
--- a/test/compiler/whitebox/CompilerWhiteBoxTest.java
+++ b/test/compiler/whitebox/CompilerWhiteBoxTest.java
@@ -20,8 +20,10 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 package compiler.whitebox;
 
+import jdk.test.lib.Platform;
 import sun.hotspot.WhiteBox;
 import sun.hotspot.code.NMethod;
 
@@ -32,6 +34,7 @@
 
 /**
  * Abstract class for WhiteBox testing of JIT.
+ * Depends on jdk.test.lib.Platform from testlibrary.
  *
  * @author igor.ignatyev@oracle.com
  */
@@ -74,8 +77,6 @@
     public static final int THRESHOLD;
     /** invocation count to trigger OSR compilation */
     protected static final long BACKEDGE_THRESHOLD;
-    /** Value of {@code java.vm.info} (interpreted|mixed|comp mode) */
-    protected static final String MODE = System.getProperty("java.vm.info");
 
     static {
         if (TIERED_COMPILATION) {
@@ -164,10 +165,8 @@
      * @see #test()
      */
     protected final void runTest() {
-        if (CompilerWhiteBoxTest.MODE.startsWith("interpreted ")) {
-            System.err.println(
-                    "Warning: test is not applicable in interpreted mode");
-            return;
+        if (Platform.isInt()) {
+            throw new Error("TESTBUG: test can not be run in interpreter");
         }
         System.out.println("at test's start:");
         printInfo();
@@ -430,11 +429,10 @@
      *          Xcomp, otherwise {@code false}
      */
     protected boolean skipXcompOSR() {
-        boolean result =  testCase.isOsr()
-                && CompilerWhiteBoxTest.MODE.startsWith("compiled ");
+        boolean result = testCase.isOsr() && Platform.isComp();
         if (result && IS_VERBOSE) {
             System.err.printf("Warning: %s is not applicable in %s%n",
-                    testCase.name(), CompilerWhiteBoxTest.MODE);
+                    testCase.name(), Platform.vmInfo);
         }
         return result;
     }
diff --git a/test/compiler/whitebox/DeoptimizeAllTest.java b/test/compiler/whitebox/DeoptimizeAllTest.java
index e479149..2a718fc 100644
--- a/test/compiler/whitebox/DeoptimizeAllTest.java
+++ b/test/compiler/whitebox/DeoptimizeAllTest.java
@@ -21,21 +21,24 @@
  * questions.
  */
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test DeoptimizeAllTest
  * @bug 8006683 8007288 8022832
+ * @summary testing of WB::deoptimizeAll()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build DeoptimizeAllTest
+ *          java.management
+ * @build compiler.whitebox.DeoptimizeAllTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* DeoptimizeAllTest
- * @summary testing of WB::deoptimizeAll()
- * @author igor.ignatyev@oracle.com
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:-UseCounterDecay
+ *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
+ *                   compiler.whitebox.DeoptimizeAllTest
  */
+
+package compiler.whitebox;
+
 public class DeoptimizeAllTest extends CompilerWhiteBoxTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/whitebox/DeoptimizeFramesTest.java b/test/compiler/whitebox/DeoptimizeFramesTest.java
index ce21094..62f4154 100644
--- a/test/compiler/whitebox/DeoptimizeFramesTest.java
+++ b/test/compiler/whitebox/DeoptimizeFramesTest.java
@@ -21,37 +21,37 @@
  * questions.
  */
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test DeoptimizeFramesTest
  * @bug 8028595
+ * @summary testing of WB::deoptimizeFrames()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build DeoptimizeFramesTest
+ *          java.management
+ * @build compiler.whitebox.DeoptimizeFramesTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay
- *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
+ *                   -XX:CompileCommand=compileonly,compiler.whitebox.DeoptimizeFramesTest$TestCaseImpl::method
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot
- *                   DeoptimizeFramesTest true
+ *                   compiler.whitebox.DeoptimizeFramesTest true
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay
- *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
+ *                   -XX:CompileCommand=compileonly,compiler.whitebox.DeoptimizeFramesTest$TestCaseImpl::method
  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot
- *                   DeoptimizeFramesTest false
- * @summary testing of WB::deoptimizeFrames()
+ *                   compiler.whitebox.DeoptimizeFramesTest false
  */
+
+package compiler.whitebox;
+
+import jdk.test.lib.Asserts;
+import sun.hotspot.code.NMethod;
+
 import java.lang.reflect.Executable;
 import java.util.concurrent.Callable;
 import java.util.concurrent.Phaser;
 
-import sun.hotspot.code.NMethod;
-import jdk.test.lib.Asserts;
-import jdk.test.lib.InfiniteLoop;
-
 public class DeoptimizeFramesTest extends CompilerWhiteBoxTest {
     private final boolean makeNotEntrant;
     private final Phaser phaser;
diff --git a/test/compiler/whitebox/DeoptimizeMethodTest.java b/test/compiler/whitebox/DeoptimizeMethodTest.java
index 71ef586..f505bbd 100644
--- a/test/compiler/whitebox/DeoptimizeMethodTest.java
+++ b/test/compiler/whitebox/DeoptimizeMethodTest.java
@@ -21,21 +21,24 @@
  * questions.
  */
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test DeoptimizeMethodTest
  * @bug 8006683 8007288 8022832
+ * @summary testing of WB::deoptimizeMethod()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build DeoptimizeMethodTest
+ *          java.management
+ * @build compiler.whitebox.DeoptimizeMethodTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* DeoptimizeMethodTest
- * @summary testing of WB::deoptimizeMethod()
- * @author igor.ignatyev@oracle.com
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:-UseCounterDecay
+ *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
+ *                   compiler.whitebox.DeoptimizeMethodTest
  */
+
+package compiler.whitebox;
+
 public class DeoptimizeMethodTest extends CompilerWhiteBoxTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java b/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java
index 82397fe..c5ec028 100644
--- a/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java
+++ b/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java
@@ -21,23 +21,28 @@
  * questions.
  */
 
-import sun.hotspot.WhiteBox;
-import java.lang.reflect.Executable;
-import java.lang.reflect.Method;
-import compiler.whitebox.CompilerWhiteBoxTest;
 
 /*
  * @test DeoptimizeMultipleOSRTest
  * @bug 8061817
+ * @summary testing of WB::deoptimizeMethod()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build DeoptimizeMultipleOSRTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,DeoptimizeMultipleOSRTest::triggerOSR DeoptimizeMultipleOSRTest
- * @summary testing of WB::deoptimizeMethod()
+ *          java.management
+ * @build compiler.whitebox.DeoptimizeMultipleOSRTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=compileonly,compiler.whitebox.DeoptimizeMultipleOSRTest::triggerOSR
+ *                   compiler.whitebox.DeoptimizeMultipleOSRTest
  */
+
+package compiler.whitebox;
+
+import sun.hotspot.WhiteBox;
+
+import java.lang.reflect.Method;
+
 public class DeoptimizeMultipleOSRTest {
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
     private static final long BACKEDGE_THRESHOLD = 150000;
diff --git a/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
index 3bf0a1d..ccb8ab0 100644
--- a/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
+++ b/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
@@ -21,21 +21,23 @@
  * questions.
  */
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test EnqueueMethodForCompilationTest
  * @bug 8006683 8007288 8022832
+ * @summary testing of WB::enqueueMethodForCompilation()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build EnqueueMethodForCompilationTest
+ *          java.management
+ * @build compiler.whitebox.EnqueueMethodForCompilationTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay EnqueueMethodForCompilationTest
- * @summary testing of WB::enqueueMethodForCompilation()
- * @author igor.ignatyev@oracle.com
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay
+ *                   compiler.whitebox.EnqueueMethodForCompilationTest
  */
+
+package compiler.whitebox;
+
 public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/whitebox/ForceNMethodSweepTest.java b/test/compiler/whitebox/ForceNMethodSweepTest.java
index ea22e25..f9b7cda 100644
--- a/test/compiler/whitebox/ForceNMethodSweepTest.java
+++ b/test/compiler/whitebox/ForceNMethodSweepTest.java
@@ -22,31 +22,30 @@
  *
  */
 
-import java.lang.reflect.Method;
-import java.util.EnumSet;
-
-import sun.hotspot.WhiteBox;
-import sun.hotspot.code.BlobType;
-
-import jdk.test.lib.Asserts;
-import jdk.test.lib.InfiniteLoop;
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test
  * @bug 8059624 8064669 8153265
+ * @summary testing of WB::forceNMethodSweep
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build ForceNMethodSweepTest
+ *          java.management
+ * @build compiler.whitebox.ForceNMethodSweepTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:-TieredCompilation -XX:+WhiteBoxAPI
  *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
- *                   -XX:-BackgroundCompilation -XX:-UseCounterDecay ForceNMethodSweepTest
- * @summary testing of WB::forceNMethodSweep
+ *                   -XX:-BackgroundCompilation -XX:-UseCounterDecay
+ *                   compiler.whitebox.ForceNMethodSweepTest
  */
+
+package compiler.whitebox;
+
+import jdk.test.lib.Asserts;
+import sun.hotspot.code.BlobType;
+
+import java.util.EnumSet;
+
 public class ForceNMethodSweepTest extends CompilerWhiteBoxTest {
     public static void main(String[] args) throws Exception {
         CompilerWhiteBoxTest.main(ForceNMethodSweepTest::new, args);
diff --git a/test/compiler/whitebox/GetCodeHeapEntriesTest.java b/test/compiler/whitebox/GetCodeHeapEntriesTest.java
index 8b2acf4..c6493c0 100644
--- a/test/compiler/whitebox/GetCodeHeapEntriesTest.java
+++ b/test/compiler/whitebox/GetCodeHeapEntriesTest.java
@@ -22,31 +22,34 @@
  *
  */
 
-import java.util.Arrays;
-import java.util.EnumSet;
-
-import sun.hotspot.WhiteBox;
-import sun.hotspot.code.CodeBlob;
-import sun.hotspot.code.BlobType;
-import jdk.test.lib.Asserts;
-
 /*
  * @test GetCodeHeapEntriesTest
  * @bug 8059624
- * @library /testlibrary /test/lib
+ * @summary testing of WB::getCodeHeapEntries()
+ * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build GetCodeHeapEntriesTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ *          java.management
+ * @build compiler.whitebox.GetCodeHeapEntriesTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache
- *                   GetCodeHeapEntriesTest
+ *                   compiler.whitebox.GetCodeHeapEntriesTest
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache
- *                   GetCodeHeapEntriesTest
- * @summary testing of WB::getCodeHeapEntries()
+ *                   compiler.whitebox.GetCodeHeapEntriesTest
  */
+
+package compiler.whitebox;
+
+import jdk.test.lib.Asserts;
+import sun.hotspot.WhiteBox;
+import sun.hotspot.code.BlobType;
+import sun.hotspot.code.CodeBlob;
+
+import java.util.Arrays;
+import java.util.EnumSet;
+
 public class GetCodeHeapEntriesTest {
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
     private static final int SIZE = 1024;
diff --git a/test/compiler/whitebox/GetNMethodTest.java b/test/compiler/whitebox/GetNMethodTest.java
index bb9f9fc..4b64a6c 100644
--- a/test/compiler/whitebox/GetNMethodTest.java
+++ b/test/compiler/whitebox/GetNMethodTest.java
@@ -22,24 +22,28 @@
  *
  */
 
-import sun.hotspot.code.BlobType;
-import sun.hotspot.code.NMethod;
-import jdk.test.lib.Asserts;
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test GetNMethodTest
  * @bug 8038240
+ * @summary testing of WB::getNMethod()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build GetNMethodTest
+ *          java.management
+ * @build compiler.whitebox.GetNMethodTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* GetNMethodTest
- * @summary testing of WB::getNMethod()
- * @author igor.ignatyev@oracle.com
+ * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:-UseCounterDecay
+ *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
+ *                   compiler.whitebox.GetNMethodTest
  */
+
+package compiler.whitebox;
+
+import jdk.test.lib.Asserts;
+import sun.hotspot.code.BlobType;
+import sun.hotspot.code.NMethod;
+
 public class GetNMethodTest extends CompilerWhiteBoxTest {
     public static void main(String[] args) throws Exception {
         CompilerWhiteBoxTest.main(GetNMethodTest::new, args);
diff --git a/test/compiler/whitebox/IsMethodCompilableTest.java b/test/compiler/whitebox/IsMethodCompilableTest.java
index ff34c2a..6b80657 100644
--- a/test/compiler/whitebox/IsMethodCompilableTest.java
+++ b/test/compiler/whitebox/IsMethodCompilableTest.java
@@ -24,22 +24,28 @@
 /*
  * @test IsMethodCompilableTest
  * @bug 8007270 8006683 8007288 8022832
+ * @summary testing of WB::isMethodCompilable()
+ * @requires vm.flavor == "server"
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
+ *
  * @build jdk.test.lib.*
  *        sun.hotspot.WhiteBox
- * @build IsMethodCompilableTest
+ * @build compiler.whitebox.IsMethodCompilableTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  *                                jdk.test.lib.Platform
- * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -Xmixed -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:PerMethodRecompilationCutoff=3 -XX:-UseCounterDecay -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* IsMethodCompilableTest
- * @summary testing of WB::isMethodCompilable()
- * @author igor.ignatyev@oracle.com
+ * @run main/othervm/timeout=2400 -XX:-TieredCompilation -Xmixed
+ *      -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *      -XX:PerMethodRecompilationCutoff=3 -XX:-UseCounterDecay
+ *      -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
+ *      compiler.whitebox.IsMethodCompilableTest
  */
 
+package compiler.whitebox;
+
 import jdk.test.lib.Platform;
-import compiler.whitebox.CompilerWhiteBoxTest;
 
 public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
     /**
@@ -80,7 +86,7 @@
 
         // Only c2 compilations can be disabled through PerMethodRecompilationCutoff
         if (!Platform.isServer()) {
-            return;
+            throw new Error("TESTBUG: Not server VM");
         }
 
         if (skipXcompOSR()) {
diff --git a/test/compiler/whitebox/LockCompilationTest.java b/test/compiler/whitebox/LockCompilationTest.java
index eb04651..e3b8682 100644
--- a/test/compiler/whitebox/LockCompilationTest.java
+++ b/test/compiler/whitebox/LockCompilationTest.java
@@ -24,22 +24,20 @@
 /*
  * @test LockCompilationTest
  * @bug 8059624 8152169
+ * @summary testing of WB::lock/unlockCompilation()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build LockCompilationTest
+ *          java.management
+ * @build compiler.whitebox.LockCompilationTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay LockCompilationTest
- * @summary testing of WB::lock/unlockCompilation()
+ * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:-UseCounterDecay
+ *                   compiler.whitebox.LockCompilationTest
  */
 
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.concurrent.BrokenBarrierException;
-import java.util.concurrent.CyclicBarrier;
+package compiler.whitebox;
 
-import compiler.whitebox.CompilerWhiteBoxTest;
 import jdk.test.lib.Asserts;
 
 public class LockCompilationTest extends CompilerWhiteBoxTest {
diff --git a/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/test/compiler/whitebox/MakeMethodNotCompilableTest.java
index ba06694..6722ace 100644
--- a/test/compiler/whitebox/MakeMethodNotCompilableTest.java
+++ b/test/compiler/whitebox/MakeMethodNotCompilableTest.java
@@ -21,21 +21,23 @@
  * questions.
  */
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test MakeMethodNotCompilableTest
  * @bug 8012322 8006683 8007288 8022832
+ * @summary testing of WB::makeMethodNotCompilable()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build MakeMethodNotCompilableTest
+ *          java.management
+ * @build compiler.whitebox.MakeMethodNotCompilableTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay MakeMethodNotCompilableTest
- * @summary testing of WB::makeMethodNotCompilable()
- * @author igor.ignatyev@oracle.com
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay
+ *                   compiler.whitebox.MakeMethodNotCompilableTest
  */
+
+package compiler.whitebox;
+
 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
     private int bci;
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/whitebox/SetDontInlineMethodTest.java b/test/compiler/whitebox/SetDontInlineMethodTest.java
index 3ba7b77..5a8c7c3 100644
--- a/test/compiler/whitebox/SetDontInlineMethodTest.java
+++ b/test/compiler/whitebox/SetDontInlineMethodTest.java
@@ -21,21 +21,24 @@
  * questions.
  */
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test SetDontInlineMethodTest
  * @bug 8006683 8007288 8022832
+ * @summary testing of WB::testSetDontInlineMethod()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build SetDontInlineMethodTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* SetDontInlineMethodTest
- * @summary testing of WB::testSetDontInlineMethod()
- * @author igor.ignatyev@oracle.com
+ *          java.management
+ * @build compiler.whitebox.SetDontInlineMethodTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
+ *                   compiler.whitebox.SetDontInlineMethodTest
  */
+
+package compiler.whitebox;
+
 public class SetDontInlineMethodTest extends CompilerWhiteBoxTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/whitebox/SetForceInlineMethodTest.java b/test/compiler/whitebox/SetForceInlineMethodTest.java
index c04f234..f3e27e9 100644
--- a/test/compiler/whitebox/SetForceInlineMethodTest.java
+++ b/test/compiler/whitebox/SetForceInlineMethodTest.java
@@ -21,21 +21,24 @@
  * questions.
  */
 
-import compiler.whitebox.CompilerWhiteBoxTest;
-
 /*
  * @test SetForceInlineMethodTest
  * @bug 8006683 8007288 8022832
+ * @summary testing of WB::testSetForceInlineMethod()
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules java.management
- * @build SetForceInlineMethodTest
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* SetForceInlineMethodTest
- * @summary testing of WB::testSetForceInlineMethod()
- * @author igor.ignatyev@oracle.com
+ *          java.management
+ * @build compiler.whitebox.SetForceInlineMethodTest
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
+ *                   compiler.whitebox.SetForceInlineMethodTest
  */
+
+package compiler.whitebox;
+
 public class SetForceInlineMethodTest extends CompilerWhiteBoxTest {
 
     public static void main(String[] args) throws Exception {
diff --git a/test/compiler/whitebox/SimpleTestCase.java b/test/compiler/whitebox/SimpleTestCase.java
index 2de860e..196c39e 100644
--- a/test/compiler/whitebox/SimpleTestCase.java
+++ b/test/compiler/whitebox/SimpleTestCase.java
@@ -23,11 +23,12 @@
 
 package compiler.whitebox;
 
+import sun.hotspot.WhiteBox;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
 import java.util.concurrent.Callable;
-import sun.hotspot.WhiteBox;
 
 public enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase {
     /** constructor test case */
diff --git a/test/gc/TestSmallHeap.java b/test/gc/TestSmallHeap.java
index 4b3d403..9b791a5 100644
--- a/test/gc/TestSmallHeap.java
+++ b/test/gc/TestSmallHeap.java
@@ -27,7 +27,6 @@
  * @requires vm.gc=="null"
  * @summary Verify that starting the VM with a small heap works
  * @library /testlibrary /test/lib /test/lib/share/classes
- * @ignore 8161552
  * @modules java.base/jdk.internal.misc
  * @modules java.management/sun.management
  * @build TestSmallHeap
@@ -35,7 +34,7 @@
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestSmallHeap
  */
 
-/* Note: It would be nice to verify the minimal supported heap size (2m) here,
+/* Note: It would be nice to verify the minimal supported heap size here,
  * but we align the heap size based on the card table size. And the card table
  * size is aligned based on the minimal pages size provided by the os. This
  * means that on most platforms, where the minimal page size is 4k, we get a
@@ -44,14 +43,18 @@
  * we get a minimal heap size of 32m. We never use large pages for the card table.
  *
  * There is also no check in the VM for verifying that the maximum heap size
- * is larger than the supported minimal heap size. This means that specifying
- * -Xmx1m on the command line is fine but will give a heap of 2m (or 4m or 32m).
+ * is larger than the supported minimal heap size.
  *
- * To work around these rather strange behaviors this test uses -Xmx2m but then
+ * To work around these behaviors this test uses -Xmx4m but then
  * calculates what the expected heap size should be. The calculation is a
  * simplified version of the code in the VM. We assume that the card table will
  * use one page. Each byte in the card table corresponds to 512 bytes on the heap.
  * So, the expected heap size is page_size * 512.
+ *
+ * There is no formal requirement for the minimal value of the maximum heap size
+ * the VM should support. In most cases the VM could start with -Xmx2m.
+ * But with 2m limit GC could be triggered before VM initialization completed.
+ * Therefore we start the VM with 4M heap.
  */
 
 import jdk.test.lib.Asserts;
@@ -80,9 +83,10 @@
     }
 
     private static void verifySmallHeapSize(String gc, long expectedMaxHeap) throws Exception {
+        long minMaxHeap = 4 * 1024 * 1024;
         LinkedList<String> vmOptions = new LinkedList<>();
         vmOptions.add(gc);
-        vmOptions.add("-Xmx2m");
+        vmOptions.add("-Xmx" + minMaxHeap);
         vmOptions.add("-XX:+PrintFlagsFinal");
         vmOptions.add(VerifyHeapSize.class.getName());
 
@@ -90,6 +94,7 @@
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
         analyzer.shouldHaveExitValue(0);
 
+        expectedMaxHeap = Math.max(expectedMaxHeap, minMaxHeap);
         long maxHeapSize = Long.parseLong(analyzer.firstMatch("MaxHeapSize.+=\\s+(\\d+)",1));
         long actualHeapSize = Long.parseLong(analyzer.firstMatch(VerifyHeapSize.actualMsg + "(\\d+)",1));
         Asserts.assertEQ(maxHeapSize, expectedMaxHeap);
diff --git a/test/gc/arguments/TestMaxHeapSizeTools.java b/test/gc/arguments/TestMaxHeapSizeTools.java
index 46bd333..69bb75d 100644
--- a/test/gc/arguments/TestMaxHeapSizeTools.java
+++ b/test/gc/arguments/TestMaxHeapSizeTools.java
@@ -106,7 +106,6 @@
   }
 
   public static void checkGenMaxHeapErgo(String gcflag) throws Exception {
-    TestMaxHeapSizeTools.checkGenMaxHeapSize(gcflag, 3);
     TestMaxHeapSizeTools.checkGenMaxHeapSize(gcflag, 4);
     TestMaxHeapSizeTools.checkGenMaxHeapSize(gcflag, 5);
   }
@@ -132,7 +131,6 @@
   }
 
   private static void checkValidInitialMaxHeapCombinations(String gcflag) throws Exception {
-    expectValid(new String[] { gcflag, "-XX:MaxHeapSize=2048K", "-version" });
     expectValid(new String[] { gcflag, "-XX:InitialHeapSize=4M", "-XX:MaxHeapSize=8M", "-version" });
     expectValid(new String[] { gcflag, "-XX:MaxHeapSize=8M", "-XX:InitialHeapSize=4M", "-version" });
     expectValid(new String[] { gcflag, "-XX:MaxHeapSize=4M", "-XX:InitialHeapSize=4M", "-version" });
diff --git a/test/gc/arguments/TestNewSizeFlags.java b/test/gc/arguments/TestNewSizeFlags.java
index 4762afb..df01656 100644
--- a/test/gc/arguments/TestNewSizeFlags.java
+++ b/test/gc/arguments/TestNewSizeFlags.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -60,13 +60,13 @@
 
         // Test NewSize and MaxNewSize
         testNewSizeFlags(20 * M, 10 * M, 30 * M, 40 * M, options, false);
-        testNewSizeFlags(10 * M, 20 * M, 30 * M, 40 * M, options, false);
+        testNewSizeFlags(10 * M, 20 * M, 30 * M, 80 * M, options, false);
         testNewSizeFlags(-1, 20 * M, 30 * M, 40 * M, options, false);
         testNewSizeFlags(10 * M, -1, 30 * M, 40 * M, options, false);
         testNewSizeFlags(20 * M, 20 * M, 30 * M, 40 * M, options, false);
         testNewSizeFlags(20 * M, 30 * M, 40 * M, 50 * M, options, false);
         testNewSizeFlags(30 * M, 100 * M, 150 * M, 200 * M, options, false);
-        testNewSizeFlags(0, -1, 30 * M, 40 * M, options, false);
+        testNewSizeFlags(20 * M, 30 * M, 128 * M, 128 * M, options, false);
 
         // Test -Xmn
         testXmnFlags(0, 30 * M, 40 * M, options, true);
@@ -88,9 +88,11 @@
             long heapSize, long maxHeapSize,
             LinkedList<String> options,
             boolean failureExpected) throws Exception {
+        long expectedNewSize = newSize;
+        long expectedMaxNewSize = (maxNewSize >= 0 ? Math.max(maxNewSize, newSize) : maxNewSize);
         testVMOptions(newSize, maxNewSize,
                 heapSize, maxHeapSize,
-                newSize, (maxNewSize >= 0 ? Math.max(maxNewSize, newSize) : maxNewSize),
+                expectedNewSize, expectedMaxNewSize,
                 options, failureExpected);
     }
 
@@ -159,7 +161,9 @@
                 "-XX:-UseLargePages",
                 NewSizeVerifier.class.getName(),
                 Long.toString(expectedNewSize),
-                Long.toString(expectedMaxNewSize)
+                Long.toString(expectedMaxNewSize),
+                Long.toString(heapSize),
+                Long.toString(maxHeapSize)
         );
         vmOptions.removeIf(String::isEmpty);
         ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(vmOptions.toArray(new String[vmOptions.size()]));
@@ -177,7 +181,12 @@
      */
     public static class NewSizeVerifier {
 
-        static WhiteBox wb = WhiteBox.getWhiteBox();
+        private static final WhiteBox WB = WhiteBox.getWhiteBox();
+        private static final GCTypes.YoungGCType YOUNG_GC_TYPE = GCTypes.YoungGCType.getYoungGCType();
+        private static final long HEAP_SPACE_ALIGNMENT = WB.getHeapSpaceAlignment();
+        private static final long HEAP_ALIGNMENT = WB.getHeapAlignment();
+        private static final long PS_VIRTUAL_SPACE_ALIGNMENT =
+                (YOUNG_GC_TYPE == GCTypes.YoungGCType.PSNew) ? WB.psVirtualSpaceAlignment() : 0;
 
         public static final int ARRAY_LENGTH = 100;
         public static final int CHUNK_SIZE = 1024;
@@ -185,63 +194,79 @@
         public static byte garbage[][] = new byte[ARRAY_LENGTH][];
 
         public static void main(String args[]) throws Exception {
-            if (args.length != 2) {
-                throw new IllegalArgumentException("Expected 2 args: <expectedNewSize> <expectedMaxNewSize>");
+            if (args.length != 4) {
+                throw new IllegalArgumentException("Expected 4 args: <expectedNewSize> <expectedMaxNewSize> <initialHeapSize> <maxHeapSize>");
             }
             final long newSize = Long.valueOf(args[0]);
             final long maxNewSize = Long.valueOf(args[1]);
+            final long initialHeapSize = Long.valueOf(args[2]);
+            final long maxHeapSize = Long.valueOf(args[3]);
 
             // verify initial size
-            verifyNewSize(newSize, maxNewSize);
+            verifyNewSize(newSize, maxNewSize, initialHeapSize, maxHeapSize);
 
             // force GC and verify that size is still correct
-            AllocationHelper allocator = new AllocationHelper(MAX_ITERATIONS, ARRAY_LENGTH, CHUNK_SIZE, () -> (verifyNewSize(newSize, maxNewSize)));
+            AllocationHelper allocator = new AllocationHelper(MAX_ITERATIONS, ARRAY_LENGTH, CHUNK_SIZE, () -> (verifyNewSize(newSize, maxNewSize, initialHeapSize, maxHeapSize)));
             allocator.allocateMemoryAndVerifyNoOOME();
         }
 
         /**
          * Verify that actual young gen size conforms NewSize and MaxNewSize values.
          */
-        public static Void verifyNewSize(long newSize, long maxNewSize) {
-            long alignedNewSize = alignNewSize(newSize);
-            long alignedMaxNewSize = alignNewSize(maxNewSize);
+        public static Void verifyNewSize(long newSize, long maxNewSize,
+                long initialHeapSize, long maxHeapSize) {
+            long alignedNewSize = alignGenSize(newSize);
+            long alignedMaxNewSize = alignGenSize(maxNewSize);
+            long alignedXms = alignHeapSize(initialHeapSize);
+            long alignedXmx = alignHeapSize(maxHeapSize);
 
             MemoryUsage youngGenUsage = getYoungGenUsage();
+            long initSize = youngGenUsage.getInit();
+            long commitedSize = youngGenUsage.getCommitted();
+            long maxSize = youngGenUsage.getMax();
 
             if (newSize != -1) {
-                if (youngGenUsage.getInit() < alignedNewSize) {
+                if (initSize < alignedNewSize) {
                     throw new RuntimeException("initial new size < NewSize value: "
-                            + youngGenUsage.getInit() + " < " + alignedNewSize);
+                            + initSize + " < " + alignedNewSize);
                 }
 
-                if (youngGenUsage.getCommitted() < alignedNewSize) {
+                if (commitedSize < alignedNewSize) {
                     throw new RuntimeException("actual new size < NewSize value: "
-                            + youngGenUsage.getCommitted() + " < " + alignedNewSize);
+                            + commitedSize + " < " + alignedNewSize);
                 }
 
                 // for G1 max new size == committed new size
-                if (GCTypes.YoungGCType.getYoungGCType() != GCTypes.YoungGCType.G1
-                        && youngGenUsage.getMax() < alignedNewSize) {
+                if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
+                        && maxSize < alignedNewSize) {
                     throw new RuntimeException("max new size < NewSize value: "
-                            + youngGenUsage.getMax() + " < " + alignedNewSize);
+                            + maxSize + " < " + alignedNewSize);
                 }
             }
 
             if (maxNewSize != -1) {
-                if (youngGenUsage.getInit() > alignedMaxNewSize) {
+                if (initSize > alignedMaxNewSize) {
                     throw new RuntimeException("initial new size > MaxNewSize value: "
-                            + youngGenUsage.getInit() + " > " + alignedMaxNewSize);
+                            + initSize + " > " + alignedMaxNewSize);
                 }
 
-                if (youngGenUsage.getCommitted() > alignedMaxNewSize) {
+                if (commitedSize > alignedMaxNewSize) {
                     throw new RuntimeException("actual new size > MaxNewSize value: "
-                            + youngGenUsage.getCommitted() + " > " + alignedMaxNewSize);
+                            + commitedSize + " > " + alignedMaxNewSize);
                 }
 
-                if (GCTypes.YoungGCType.getYoungGCType() != GCTypes.YoungGCType.G1
-                        && youngGenUsage.getMax() != alignedMaxNewSize) {
-                    throw new RuntimeException("max new size != MaxNewSize value: "
-                            + youngGenUsage.getMax() + " != " + alignedMaxNewSize);
+                if (alignedXms != alignedXmx) {
+                    if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
+                            && maxSize != alignedMaxNewSize) {
+                        throw new RuntimeException("max new size != MaxNewSize value: "
+                                + maxSize + " != " + alignedMaxNewSize);
+                    }
+                } else {
+                    if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
+                            && maxSize != alignedNewSize) {
+                        throw new RuntimeException("max new size != NewSize for case InitialHeapSize == MaxHeapSize value: "
+                                + maxSize + " != " + alignedNewSize + " HeapSize == " + alignedXms);
+                    }
                 }
             }
             return null;
@@ -256,41 +281,47 @@
          *  For all GCs used value is 0.
          */
         private static MemoryUsage getYoungGenUsage() {
-            if (GCTypes.YoungGCType.getYoungGCType() == GCTypes.YoungGCType.G1) {
-                return new MemoryUsage(HeapRegionUsageTool.getEdenUsage().getInit()
-                        + HeapRegionUsageTool.getSurvivorUsage().getInit(),
-                        0,
-                        HeapRegionUsageTool.getEdenUsage().getCommitted()
-                        + HeapRegionUsageTool.getSurvivorUsage().getCommitted(),
-                        Long.MAX_VALUE);
+            MemoryUsage edenUsage = HeapRegionUsageTool.getEdenUsage();
+            MemoryUsage survivorUsage = HeapRegionUsageTool.getSurvivorUsage();
+            long edenUsageInit = edenUsage.getInit();
+            long edenUsageCommited = edenUsage.getCommitted();
+            long survivorUsageInit = survivorUsage.getInit();
+            long survivorUsageCommited = survivorUsage.getCommitted();
+
+            if (YOUNG_GC_TYPE == GCTypes.YoungGCType.G1) {
+                return new MemoryUsage(edenUsageInit + survivorUsageInit, 0,
+                        edenUsageCommited + survivorUsageCommited, Long.MAX_VALUE);
             } else {
-                return new MemoryUsage(HeapRegionUsageTool.getEdenUsage().getInit()
-                        + HeapRegionUsageTool.getSurvivorUsage().getInit() * 2,
-                        0,
-                        HeapRegionUsageTool.getEdenUsage().getCommitted()
-                        + HeapRegionUsageTool.getSurvivorUsage().getCommitted() * 2,
-                        HeapRegionUsageTool.getEdenUsage().getMax()
-                        + HeapRegionUsageTool.getSurvivorUsage().getMax() * 2);
+                return new MemoryUsage(edenUsageInit + survivorUsageInit * 2, 0,
+                        edenUsageCommited + survivorUsageCommited * 2,
+                        edenUsage.getMax() + survivorUsage.getMax() * 2);
             }
         }
 
         /**
-         * Align value regardful to used young GC.
+         * Align generation size regardful to used young GC.
          */
-        public static long alignNewSize(long value) {
-            switch (GCTypes.YoungGCType.getYoungGCType()) {
+        public static long alignGenSize(long value) {
+            switch (YOUNG_GC_TYPE) {
                 case DefNew:
                 case ParNew:
-                    return HeapRegionUsageTool.alignDown(value, wb.getHeapSpaceAlignment());
+                    return HeapRegionUsageTool.alignDown(value, HEAP_SPACE_ALIGNMENT);
                 case PSNew:
                     return HeapRegionUsageTool.alignUp(HeapRegionUsageTool.alignDown(value,
-                            wb.getHeapSpaceAlignment()),
-                            wb.psVirtualSpaceAlignment());
+                            HEAP_SPACE_ALIGNMENT),
+                            PS_VIRTUAL_SPACE_ALIGNMENT);
                 case G1:
-                    return HeapRegionUsageTool.alignUp(value, wb.g1RegionSize());
+                    return HeapRegionUsageTool.alignUp(value, WB.g1RegionSize());
                 default:
                     throw new RuntimeException("Unexpected young GC type");
             }
         }
+
+        /**
+         * Align heap size.
+         */
+        public static long alignHeapSize(long value){
+            return HeapRegionUsageTool.alignUp(value,HEAP_ALIGNMENT);
+        }
     }
 }
diff --git a/test/gc/arguments/TestParallelHeapSizeFlags.java b/test/gc/arguments/TestParallelHeapSizeFlags.java
index d393a75..af0b2a7 100644
--- a/test/gc/arguments/TestParallelHeapSizeFlags.java
+++ b/test/gc/arguments/TestParallelHeapSizeFlags.java
@@ -29,7 +29,6 @@
  * parallel collectors.
  * @requires vm.gc=="null"
  * @library /testlibrary /test/lib
- * @ignore 8161552
  * @modules java.base/jdk.internal.misc
  *          java.management
  * @build TestParallelHeapSizeFlags TestMaxHeapSizeTools
diff --git a/test/gc/arguments/TestSelectDefaultGC.java b/test/gc/arguments/TestSelectDefaultGC.java
index 8dc1435..0c39a6b 100644
--- a/test/gc/arguments/TestSelectDefaultGC.java
+++ b/test/gc/arguments/TestSelectDefaultGC.java
@@ -55,14 +55,10 @@
         output.shouldHaveExitValue(0);
 
         final boolean isServer = actAsServer;
-        final boolean isEmbedded = Platform.isEmbedded();
 
         // Verify GC selection
-        // G1 is default for non-embedded server class machines
-        assertVMOption(output, "UseG1GC",            isServer && !isEmbedded);
-        // Parallel is default for embedded server class machines
-        assertVMOption(output, "UseParallelGC",      isServer && isEmbedded);
-        assertVMOption(output, "UseParallelOldGC",   isServer && isEmbedded);
+        // G1 is default for server class machines
+        assertVMOption(output, "UseG1GC",            isServer);
         // Serial is default for non-server class machines
         assertVMOption(output, "UseSerialGC",        !isServer);
         // CMS is never default
diff --git a/test/gc/g1/TestGCLogMessages.java b/test/gc/g1/TestGCLogMessages.java
index 90e4b71..ec9250c 100644
--- a/test/gc/g1/TestGCLogMessages.java
+++ b/test/gc/g1/TestGCLogMessages.java
@@ -95,6 +95,8 @@
         new LogMessageWithLevel("String Dedup Fixup", Level.INFO),
         new LogMessageWithLevel("Expand Heap After Collection", Level.INFO),
         // Free CSet
+        new LogMessageWithLevel("Free Collection Set", Level.INFO),
+        new LogMessageWithLevel("Free Collection Set Serial", Level.DEBUG),
         new LogMessageWithLevel("Young Free Collection Set", Level.DEBUG),
         new LogMessageWithLevel("Non-Young Free Collection Set", Level.DEBUG),
         // Humongous Eager Reclaim
diff --git a/test/gc/g1/TestShrinkAuxiliaryData.java b/test/gc/g1/TestShrinkAuxiliaryData.java
index 1600989..83ef798 100644
--- a/test/gc/g1/TestShrinkAuxiliaryData.java
+++ b/test/gc/g1/TestShrinkAuxiliaryData.java
@@ -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
@@ -44,6 +44,7 @@
     private static final int REGION_SIZE = 1024 * 1024;
 
     private final static String[] initialOpts = new String[]{
+        "-XX:NewSize=16m",
         "-XX:MinHeapFreeRatio=10",
         "-XX:MaxHeapFreeRatio=11",
         "-XX:+UseG1GC",
diff --git a/test/gc/logging/TestUnifiedLoggingSwitchStress.java b/test/gc/logging/TestUnifiedLoggingSwitchStress.java
index 647cd63..37fd5b2 100644
--- a/test/gc/logging/TestUnifiedLoggingSwitchStress.java
+++ b/test/gc/logging/TestUnifiedLoggingSwitchStress.java
@@ -43,6 +43,7 @@
  * @summary Switches gc log level on fly while stressing memory/gc
  * @key gc
  * @key stress
+ * @requires !vm.flightRecorder
  * @library /testlibrary /test/lib /
  * @modules java.management java.base/jdk.internal.misc
  *
diff --git a/test/gc/metaspace/TestMetaspaceSizeFlags.java b/test/gc/metaspace/TestMetaspaceSizeFlags.java
index b56343c..639694c 100644
--- a/test/gc/metaspace/TestMetaspaceSizeFlags.java
+++ b/test/gc/metaspace/TestMetaspaceSizeFlags.java
@@ -74,8 +74,8 @@
     OutputAnalyzer output = run(maxMetaspaceSize, metaspaceSize);
     output.shouldNotMatch("Error occurred during initialization of VM\n.*");
 
-    String stringMaxMetaspaceSize = output.firstMatch(".* MaxMetaspaceSize .* := (\\d+).*", 1);
-    String stringMetaspaceSize = output.firstMatch(".* MetaspaceSize .* := (\\d+).*", 1);
+    String stringMaxMetaspaceSize = output.firstMatch(".* MaxMetaspaceSize .* = (\\d+).*", 1);
+    String stringMetaspaceSize = output.firstMatch(".* MetaspaceSize .* = (\\d+).*", 1);
 
     return new MetaspaceFlags(Long.parseLong(stringMaxMetaspaceSize),
                               Long.parseLong(stringMetaspaceSize));
diff --git a/test/gc/stress/TestGCOld.java b/test/gc/stress/TestGCOld.java
index 23fb60a..3d74aa2 100644
--- a/test/gc/stress/TestGCOld.java
+++ b/test/gc/stress/TestGCOld.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2015, 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
@@ -33,6 +33,7 @@
  * @run main/othervm -Xmx384M -XX:+UseConcMarkSweepGC TestGCOld 50 1 20 10 10000
  * @run main/othervm -Xmx384M -XX:+UseG1GC TestGCOld 50 1 20 10 10000
  * @run main/othervm -Xms64m -Xmx128m -XX:+UseG1GC -XX:+UseDynamicNumberOfGCThreads -Xlog:gc,gc+task=trace TestGCOld 50 5 20 1 5000
+ * @run main/othervm -Xms64m -Xmx128m -XX:+UseG1GC -XX:+UseDynamicNumberOfGCThreads  -XX:+UnlockDiagnosticVMOptions -XX:+InjectGCWorkerCreationFailure -Xlog:gc,gc+task=trace TestGCOld 50 5 20 1 5000
  */
 
 import java.text.*;
diff --git a/test/gc/stress/TestStressG1Humongous.java b/test/gc/stress/TestStressG1Humongous.java
index 6b507e4..501f646 100644
--- a/test/gc/stress/TestStressG1Humongous.java
+++ b/test/gc/stress/TestStressG1Humongous.java
@@ -53,6 +53,7 @@
     private static final int THREAD_COUNT = Integer.getInteger("threads", 2);
     private static final int REGION_SIZE = Integer.getInteger("regionsize", 1) * 1024 * 1024;
     private static final int HUMONGOUS_SIZE = (int) (REGION_SIZE * Double.parseDouble(System.getProperty("humongoussize", "1.5")));
+    private static final int NUMBER_OF_FREE_REGIONS = 2;
 
     private volatile boolean isRunning;
     private final ExecutorService threadExecutor;
@@ -92,8 +93,12 @@
     private int getExpectedAmountOfObjects() {
         long maxMem = Runtime.getRuntime().maxMemory();
         int expectedHObjects = (int) (maxMem / HUMONGOUS_SIZE);
-        // Will allocate 1 region less to give some free space for VM.
-        int checkedAmountOfHObjects = checkHeapCapacity(expectedHObjects) - 1;
+        // Will allocate NUMBER_OF_FREE_REGIONS region less to give some free space for VM.
+        int checkedAmountOfHObjects = checkHeapCapacity(expectedHObjects) - NUMBER_OF_FREE_REGIONS;
+        if (checkedAmountOfHObjects <= 0) {
+            throw new RuntimeException("Cannot start testing because selected maximum heap "
+                    + "is not large enough to contain more than " + NUMBER_OF_FREE_REGIONS + " regions");
+        }
         return checkedAmountOfHObjects;
     }
 
diff --git a/test/runtime/7107135/Test7107135.sh b/test/runtime/7107135/Test7107135.sh
deleted file mode 100644
index 5371b3a..0000000
--- a/test/runtime/7107135/Test7107135.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-#
-#  Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
-#  Copyright (c) 2011 SAP SE. 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 Test7107135.sh
-## @bug 7107135
-## @bug 8021296
-## @bug 8025519
-## @summary Stack guard pages lost after loading library with executable stack.
-## @run shell Test7107135.sh
-##
-
-if [ "${TESTSRC}" = "" ]
-then
-  TESTSRC=${PWD}
-  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
-fi
-echo "TESTSRC=${TESTSRC}"
-## Adding common setup Variables for running shell tests.
-. ${TESTSRC}/../../test_env.sh
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  Linux)
-    echo "Testing on Linux"
-    gcc_cmd=`which gcc`
-    if [ "x$gcc_cmd" == "x" ]; then
-        echo "WARNING: gcc not found. Cannot execute test." 2>&1
-        exit 0;
-    fi
-    ;;
-  *)
-    echo "Test passed; only valid for Linux"
-    exit 0;
-    ;;
-esac
-
-ARCH=`uname -m`
-
-THIS_DIR=.
-
-cp ${TESTSRC}${FS}*.java ${THIS_DIR}
-${COMPILEJAVA}${FS}bin${FS}javac *.java
-
-$gcc_cmd -fPIC -shared -c -o test.o \
-    -I${COMPILEJAVA}${FS}include -I${COMPILEJAVA}${FS}include${FS}linux \
-    ${TESTSRC}${FS}test.c
-
-ld -shared -z   execstack -o libtest-rwx.so test.o
-ld -shared -z noexecstack -o libtest-rw.so  test.o
-
-
-LD_LIBRARY_PATH=${THIS_DIR}
-echo   LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}
-export LD_LIBRARY_PATH
-
-# This should not fail.
-echo Check testprogram. Expected to pass:
-echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw
-${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw
-
-echo
-echo Test changing of stack protection:
-echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx
-${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx
-JAVA_RETVAL=$?
-
-if [ "$JAVA_RETVAL" == "0" ]
-then
-  echo
-  echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx
-  ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx
-  JAVA_RETVAL=$?
-fi
-
-exit $JAVA_RETVAL
diff --git a/test/runtime/StackGuardPages/invoke.c b/test/runtime/StackGuardPages/exeinvoke.c
similarity index 89%
rename from test/runtime/StackGuardPages/invoke.c
rename to test/runtime/StackGuardPages/exeinvoke.c
index 580e128..fa2a06e 100644
--- a/test/runtime/StackGuardPages/invoke.c
+++ b/test/runtime/StackGuardPages/exeinvoke.c
@@ -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
@@ -36,6 +36,7 @@
 #include <jni.h>
 #include <alloca.h>
 #include <signal.h>
+#include <string.h>
 #include <sys/mman.h>
 #include <stdlib.h>
 #include <sys/ucontext.h>
@@ -46,6 +47,8 @@
 
 #include <pthread.h>
 
+#define CLASS_PATH_OPT "-Djava.class.path="
+
 JavaVM* _jvm;
 
 static jmp_buf  context;
@@ -120,6 +123,7 @@
     fprintf(stderr, "Test ERROR. Can't call detach from current thread\n");
     exit(7);
   }
+  return NULL;
 }
 
 void do_overflow(){
@@ -209,24 +213,42 @@
 void usage() {
   fprintf(stderr, "Usage: invoke test_java_overflow\n");
   fprintf(stderr, "       invoke test_native_overflow\n");
-  exit(7);
 }
 
 
 int main (int argc, const char** argv) {
   JavaVMInitArgs vm_args;
-  JavaVMOption options[2];
+  JavaVMOption options[3];
   JNIEnv* env;
+  int optlen;
+  char *javaclasspath = NULL;
+  char javaclasspathopt[4096];
 
   printf("Test started with pid: %ld\n", (long) getpid());
 
+  /* set the java class path so the DoOverflow class can be found */
+  javaclasspath = getenv("CLASSPATH");
+
+  if (javaclasspath == NULL) {
+    fprintf(stderr, "Test ERROR. CLASSPATH is not set\n");
+    exit(7);
+  }
+  optlen = strlen(CLASS_PATH_OPT) + strlen(javaclasspath) + 1;
+  if (optlen > 4096) {
+    fprintf(stderr, "Test ERROR. CLASSPATH is too long\n");
+    exit(7);
+  }
+  snprintf(javaclasspathopt, sizeof(javaclasspathopt), "%s%s",
+      CLASS_PATH_OPT, javaclasspath);
+
   options[0].optionString = "-Xint";
-  options[1].optionString = "-Xss512k";
+  options[1].optionString = "-Xss328k";
+  options[2].optionString = javaclasspathopt;
 
   vm_args.version = JNI_VERSION_1_2;
   vm_args.ignoreUnrecognized = JNI_TRUE;
   vm_args.options = options;
-  vm_args.nOptions = 2;
+  vm_args.nOptions = 3;
 
   if (JNI_CreateJavaVM (&_jvm, (void **)&env, &vm_args) < 0 ) {
     fprintf(stderr, "Test ERROR. Can't create JavaVM\n");
@@ -263,4 +285,5 @@
 
   fprintf(stderr, "Test ERROR. Unknown parameter %s\n", ((argc > 1) ? argv[1] : "none"));
   usage();
+  exit(7);
 }
diff --git a/test/runtime/StackGuardPages/testme.sh b/test/runtime/StackGuardPages/testme.sh
index 7f6a24a..22c5001 100644
--- a/test/runtime/StackGuardPages/testme.sh
+++ b/test/runtime/StackGuardPages/testme.sh
@@ -1,8 +1,29 @@
+# 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
+# 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.
 #!/bin/sh
 
 #
 # @test testme.sh
 # @summary Stack guard pages should be installed correctly and removed when thread is detached
+# @compile DoOverflow.java
 # @run shell testme.sh
 #
 
@@ -21,40 +42,10 @@
   exit 0
 fi
 
-gcc_cmd=`which gcc`
-if [ "x$gcc_cmd" = "x" ]; then
-  echo "WARNING: gcc not found. Cannot execute test." 2>&1
-  exit 0;
-fi
-
-CFLAGS=-m${VM_BITS}
-
 LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:${TESTJAVA}/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 
-echo "Architecture: ${VM_CPU}"
-echo "Compilation flag: ${CFLAGS}"
-echo "VM type: ${VM_TYPE}"
-echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
-
-# Note pthread may not be found thus invoke creation will fail to be created.
-# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
-# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
-
-cp ${TESTSRC}/DoOverflow.java .
-${COMPILEJAVA}/bin/javac DoOverflow.java
-
-$gcc_cmd -DLINUX -g3 ${CFLAGS} -o invoke \
-    -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
-    -L${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
-    -L${TESTJAVA}/lib/${VM_CPU}/${VM_TYPE} \
-     ${TESTSRC}/invoke.c -ljvm -lpthread
-
-if [ $? -ne 0 ] ; then
-    echo "Compile failed, Ignoring failed compilation and forcing the test to pass"
-    exit 0
-fi
-
-./invoke test_java_overflow
-./invoke test_native_overflow
+# Run the test for a java and native overflow
+${TESTNATIVEPATH}/invoke test_java_overflow
+${TESTNATIVEPATH}/invoke test_native_overflow
 exit $?
diff --git a/test/runtime/Unsafe/GetUnsafe.java b/test/runtime/Unsafe/GetUnsafe.java
deleted file mode 100644
index efc85af..0000000
--- a/test/runtime/Unsafe/GetUnsafe.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2015, 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
- * @summary Verifies that getUnsafe() actually throws SecurityException when unsafeAccess is prohibited.
- * @library /testlibrary
- * @modules java.base/jdk.internal.misc
- * @ignore 8161947
- * @run main GetUnsafe
- */
-
-import jdk.internal.misc.Unsafe;
-import static jdk.test.lib.Asserts.*;
-
-public class GetUnsafe {
-    public static void main(String args[]) throws Exception {
-        try {
-            Unsafe unsafe = Unsafe.getUnsafe();
-        } catch (SecurityException e) {
-            // Expected
-            return;
-        }
-        throw new RuntimeException("Did not get expected SecurityException");
-    }
-}
diff --git a/test/runtime/7107135/Test.java b/test/runtime/execstack/Test.java
similarity index 91%
rename from test/runtime/7107135/Test.java
rename to test/runtime/execstack/Test.java
index 9b48934..4fd931e 100644
--- a/test/runtime/7107135/Test.java
+++ b/test/runtime/execstack/Test.java
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 SAP SE. All rights reserved.
+ * Copyright (c) 2002-2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 SAP AG.  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
@@ -42,7 +42,7 @@
     static int Runner() {
         counter = counter * -1;
         int i = counter;
-        if(counter < 2) counter += Runner();
+        if (counter < 2) counter += Runner();
         return i;
     }
 
diff --git a/test/runtime/7107135/TestMT.java b/test/runtime/execstack/TestMT.java
similarity index 93%
rename from test/runtime/7107135/TestMT.java
rename to test/runtime/execstack/TestMT.java
index 4fc297d..c02edd5 100644
--- a/test/runtime/7107135/TestMT.java
+++ b/test/runtime/execstack/TestMT.java
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 SAP SE. All rights reserved.
+ * Copyright (c) 2002-2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 SAP AG.  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
@@ -37,7 +37,7 @@
         return false;
     }
 
-    public static int counter        = 1;
+    public static int counter = 1;
     static int Runner() {
         counter = counter * -1;
         int i = counter;
diff --git a/test/runtime/execstack/Testexecstack.java b/test/runtime/execstack/Testexecstack.java
new file mode 100644
index 0000000..eb0b89f
--- /dev/null
+++ b/test/runtime/execstack/Testexecstack.java
@@ -0,0 +1,74 @@
+/*
+ * 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 Testexecstack.java
+ * @bug 7107135
+ * @bug 8021296
+ * @bug 8025519
+ * @summary Stack guard pages lost after loading library with executable stack.
+ * @requires (os.family == "linux")
+ * @library /testlibrary
+ * @build jdk.test.lib.*
+ * @compile Test.java
+ * @compile TestMT.java
+ * @run driver Testexecstack
+ */
+
+import jdk.test.lib.*;
+
+public class Testexecstack {
+
+    public static void main(String[] args) throws Throwable {
+
+        // Get the library path property
+        String libpath = System.getProperty("java.library.path");
+
+        // Create a new java process for the Test Java/JNI test without
+        // an executeable stack
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+            "-Djava.library.path=" + libpath + ":.", "Test", "test-rw");
+
+        // Start the process and check the output
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+
+        // Create a new java process for the Test Java/JNI test with an
+        // executable stack
+        pb = ProcessTools.createJavaProcessBuilder(
+            "-Djava.library.path=" + libpath + ":.", "Test", "test-rwx");
+
+        // Start the process and check the output
+        output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+
+        // Create a new java process for the TestMT Java/JNI test with an
+        // executable stack
+        pb = ProcessTools.createJavaProcessBuilder(
+            "-Djava.library.path=" + libpath + ":.", "TestMT", "test-rwx");
+
+        // Start the process and check the output
+        output = new OutputAnalyzer(pb.start());
+        output.shouldHaveExitValue(0);
+    }
+}
diff --git a/test/runtime/7107135/test.c b/test/runtime/execstack/libtest-rw.c
similarity index 76%
copy from test/runtime/7107135/test.c
copy to test/runtime/execstack/libtest-rw.c
index 3e39eae..93b11a1 100644
--- a/test/runtime/7107135/test.c
+++ b/test/runtime/execstack/libtest-rw.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 SAP SE. All rights reserved.
+ * Copyright (c) 2002-2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 SAP AG.  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
@@ -22,6 +22,12 @@
  * questions.
  */
 
+/*
+ * This source file is the same as libtest-rwx.c and needs to be a separate
+ * file so it can be built with "-z noexecstack" by the build process.
+ * If any changes are made they probably also need to be made to libtest-rwx.c.
+ */
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/test/runtime/7107135/test.c b/test/runtime/execstack/libtest-rwx.c
similarity index 76%
rename from test/runtime/7107135/test.c
rename to test/runtime/execstack/libtest-rwx.c
index 3e39eae..62b5ac9 100644
--- a/test/runtime/7107135/test.c
+++ b/test/runtime/execstack/libtest-rwx.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 SAP SE. All rights reserved.
+ * Copyright (c) 2002-2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 SAP AG.  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
@@ -22,6 +22,12 @@
  * questions.
  */
 
+/*
+ * This source file is the same as libtest-rw.c and needs to be a separate
+ * file so it can be built with "-z execstack" by the build process.
+ * If any changes are made they probably also need to be made to libtest-rwx.c.
+ */
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/test/runtime/jsig/Test8017498.sh b/test/runtime/jsig/Test8017498.sh
deleted file mode 100644
index 64b019d..0000000
--- a/test/runtime/jsig/Test8017498.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-#
-#  Copyright (c) 2013, 2014, 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 Test8017498.sh
-## @bug 8017498
-## @bug 8020791
-## @bug 8021296
-## @bug 8022301
-## @bug 8025519
-## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX
-## @run shell/timeout=60 Test8017498.sh
-##
-
-if [ -z "${TESTSRC}" ]; then
-  TESTSRC="${PWD}"
-  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
-fi
-
-echo "TESTSRC=${TESTSRC}"
-## Adding common setup Variables for running shell tests.
-. ${TESTSRC}/../../test_env.sh
-
-EXTRA_CFLAG=
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  Linux)
-    echo "Testing on Linux"
-    gcc_cmd=`which gcc`
-    if [ -z "$gcc_cmd" ]; then
-        echo "WARNING: gcc not found. Cannot execute test." 2>&1
-        exit 0;
-    fi
-    MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}${VM_CPU}${FS}libjsig.so
-    if [ "$VM_BITS" = "32" ] && [ "$VM_CPU" != "arm" ] && [ "$VM_CPU" != "ppc" ]; then
-        EXTRA_CFLAG=-m32
-    fi
-    echo MY_LD_PRELOAD = ${MY_LD_PRELOAD}
-    ;;
-  *)
-    echo "Test passed; only valid for Linux"
-    exit 0;
-    ;;
-esac
-
-THIS_DIR=.
-
-cp "${TESTSRC}${FS}"*.java "${THIS_DIR}"
-${COMPILEJAVA}${FS}bin${FS}javac *.java
-
-$gcc_cmd -DLINUX -fPIC -shared \
-    ${EXTRA_CFLAG} -z noexecstack \
-    -o libTestJNI.so \
-    -I${COMPILEJAVA}${FS}include \
-    -I${COMPILEJAVA}${FS}include${FS}linux \
-    ${TESTSRC}${FS}TestJNI.c
-
-if [ $? -ne 0 ] ; then
-    echo "Compile failed, Ignoring failed compilation and forcing the test to pass"
-    exit 0
-fi
-
-# run the java test in the background
-cmd="LD_PRELOAD=$MY_LD_PRELOAD \
-    ${TESTJAVA}${FS}bin${FS}java \
-    -Djava.library.path=. -server TestJNI 100"
-echo "$cmd > test.out"
-eval $cmd > test.out
-
-if grep "old handler" test.out > ${NULL}; then
-    echo "Test Passed"
-    exit 0
-fi
-
-echo "Test Failed"
-exit 1
diff --git a/test/runtime/jsig/TestJNI.c b/test/runtime/jsig/libTestJNI.c
similarity index 100%
rename from test/runtime/jsig/TestJNI.c
rename to test/runtime/jsig/libTestJNI.c
diff --git a/test/runtime/logging/MonitorMismatchTest.java b/test/runtime/logging/MonitorMismatchTest.java
index 82d464c..0d7c76f 100644
--- a/test/runtime/logging/MonitorMismatchTest.java
+++ b/test/runtime/logging/MonitorMismatchTest.java
@@ -39,23 +39,21 @@
 public class MonitorMismatchTest {
 
     public static void main(String... args) throws Exception {
-        if (!Platform.isEmbedded()){
-            // monitormismatch should turn on.
-            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcomp",
-                                                                      "-XX:+TieredCompilation",
-                                                                      "-Xlog:monitormismatch=info",
-                                                                      "MonitorMismatchHelper");
-            OutputAnalyzer o = new OutputAnalyzer(pb.start());
-            o.shouldContain("[monitormismatch] Monitor mismatch in method");
+        // monitormismatch should turn on.
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcomp",
+                                                                  "-XX:+TieredCompilation",
+                                                                  "-Xlog:monitormismatch=info",
+                                                                  "MonitorMismatchHelper");
+        OutputAnalyzer o = new OutputAnalyzer(pb.start());
+        o.shouldContain("[monitormismatch] Monitor mismatch in method");
 
-            // monitormismatch should turn off.
-            pb = ProcessTools.createJavaProcessBuilder("-Xcomp",
-                                                       "-XX:+TieredCompilation",
-                                                       "-Xlog:monitormismatch=off",
-                                                       "MonitorMismatchHelper");
-            o = new OutputAnalyzer(pb.start());
-            o.shouldNotContain("[monitormismatch]");
-        }
+        // monitormismatch should turn off.
+        pb = ProcessTools.createJavaProcessBuilder("-Xcomp",
+                                                   "-XX:+TieredCompilation",
+                                                   "-Xlog:monitormismatch=off",
+                                                   "MonitorMismatchHelper");
+        o = new OutputAnalyzer(pb.start());
+        o.shouldNotContain("[monitormismatch]");
     };
 
 }
diff --git a/test/runtime/modules/JVMDefineModule.java b/test/runtime/modules/JVMDefineModule.java
index 602c5fd..82f5065 100644
--- a/test/runtime/modules/JVMDefineModule.java
+++ b/test/runtime/modules/JVMDefineModule.java
@@ -77,7 +77,7 @@
             ModuleHelper.DefineModule(new Object(),  "9.0", "mymodule/here", new String[] { "mypackage1" });
             throw new RuntimeException("Failed to get expected IAE or NPE for bad module");
         } catch(IllegalArgumentException e) {
-            if (!e.getMessage().contains("module is not a subclass")) {
+            if (!e.getMessage().contains("module is not an instance of type java.lang.reflect.Module")) {
               throw new RuntimeException("Failed to get expected IAE message for bad module: " + e.getMessage());
             }
         }
diff --git a/test/serviceability/dcmd/compiler/CompilerQueueTest.java b/test/serviceability/dcmd/compiler/CompilerQueueTest.java
index 708ee0b..217e9c2 100644
--- a/test/serviceability/dcmd/compiler/CompilerQueueTest.java
+++ b/test/serviceability/dcmd/compiler/CompilerQueueTest.java
@@ -29,6 +29,7 @@
  *          java.compiler
  *          java.management
  *          jdk.jvmstat/sun.jvmstat.monitor
+ * @summary Test of diagnostic command Compiler.queue
  * @build jdk.test.lib.*
  *        jdk.test.lib.dcmd.*
  *        sun.hotspot.WhiteBox
@@ -38,7 +39,6 @@
  * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -Xmixed -XX:+WhiteBoxAPI CompilerQueueTest
  * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -Xmixed -XX:-TieredCompilation -XX:+WhiteBoxAPI CompilerQueueTest
  * @run testng/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -Xint -XX:+WhiteBoxAPI CompilerQueueTest
- * @summary Test of diagnostic command Compiler.queue
  */
 
 import compiler.testlibrary.CompilerUtils;
@@ -107,7 +107,7 @@
             boolean added = WB.enqueueMethodForCompilation(testcase.method, testcase.level);
             // Set results to false for those methods we must to find
             // We will also assert if we find any test method we don't expect
-            Assert.assertTrue(WB.isMethodQueuedForCompilation(testcase.method));
+            Assert.assertEquals(added, WB.isMethodQueuedForCompilation(testcase.method));
             testcase.check = false;
         }
 
diff --git a/test/serviceability/jvmti/ExceptionCaughtOutOfPhase/ExceptionCaughtOutOfPhaseTest.java b/test/serviceability/jvmti/ExceptionCaughtOutOfPhase/ExceptionCaughtOutOfPhaseTest.java
new file mode 100644
index 0000000..2c823d3
--- /dev/null
+++ b/test/serviceability/jvmti/ExceptionCaughtOutOfPhase/ExceptionCaughtOutOfPhaseTest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/*
+ * @test
+ * @bug 8134434
+ * @summary JVM_DoPrivileged() fires assert(_exception_caught == false) failed: _exception_caught is out of phase
+ * @run main/othervm -agentlib:jdwp=transport=dt_socket,address=9000,server=y,suspend=n -Xbatch ExceptionCaughtOutOfPhaseTest
+ */
+
+public class ExceptionCaughtOutOfPhaseTest {
+    public static void main(String[] args) {
+        PrivilegedAction action = new HotThrowingAction();
+        System.out.println("### Warm-up");
+        for(int i=0; i<11000; i++) {
+            try {
+                action.run(); // call run() to get it compiled
+            } catch(Throwable t) {
+                // ignored
+            }
+        }
+
+        System.out.println("### Warm-up done");
+        System.out.println("### Executing privileged action");
+
+        try {
+            AccessController.doPrivileged(action);
+        } catch (Error e) {
+            // ignored
+        }
+    }
+
+    public static class HotThrowingAction implements PrivilegedAction {
+        public Object run() {
+            throw new Error();
+        }
+    }
+}
diff --git a/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java b/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java
new file mode 100644
index 0000000..90855ba
--- /dev/null
+++ b/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java
@@ -0,0 +1,130 @@
+/*
+ * 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
+ * @summary Verifies the JVMTI GetAllModules API
+ * @library /testlibrary
+ * @run main/othervm -agentlib:JvmtiGetAllModulesTest JvmtiGetAllModulesTest
+ *
+ */
+import java.lang.reflect.Layer;
+import java.lang.reflect.Module;
+import java.lang.module.ModuleReference;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReader;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.Configuration;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.Map;
+import java.util.function.Supplier;
+import java.util.Objects;
+import java.util.Optional;
+import java.net.URI;
+import java.util.HashSet;
+import java.util.HashMap;
+import java.util.stream.Collectors;
+import jdk.test.lib.Asserts;
+
+public class JvmtiGetAllModulesTest {
+
+    private static native Module[] getModulesNative();
+
+    private static Set<Module> getModulesJVMTI() {
+
+        Set<Module> modules = Arrays.stream(getModulesNative()).collect(Collectors.toSet());
+
+        // JVMTI reports unnamed modules, Java API does not
+        // remove the unnamed modules here, so the resulting report can be expected
+        // to be equal to what Java reports
+        modules.removeIf(mod -> !mod.isNamed());
+
+        return modules;
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        final String MY_MODULE_NAME = "myModule";
+
+        // Verify that JVMTI reports exactly the same info as Java regarding the named modules
+        Asserts.assertEquals(Layer.boot().modules(), getModulesJVMTI());
+
+        // Load a new named module
+        ModuleDescriptor descriptor
+                = new ModuleDescriptor.Builder(MY_MODULE_NAME)
+                .build();
+        ModuleFinder finder = finderOf(descriptor);
+        ClassLoader loader = new ClassLoader() {};
+        Configuration parent = Layer.boot().configuration();
+        Configuration cf = parent.resolveRequires(finder, ModuleFinder.of(), Set.of(MY_MODULE_NAME));
+        Layer my = Layer.boot().defineModules(cf, m -> loader);
+
+        // Verify that the loaded module is indeed reported by JVMTI
+        Set<Module> jvmtiModules = getModulesJVMTI();
+        for (Module mod : my.modules()) {
+            if (!jvmtiModules.contains(mod)) {
+                throw new RuntimeException("JVMTI did not report the loaded named module: " + mod.getName());
+            }
+        }
+
+    }
+
+    /**
+     * Returns a ModuleFinder that finds modules with the given module
+     * descriptors.
+     */
+    static ModuleFinder finderOf(ModuleDescriptor... descriptors) {
+
+        // Create a ModuleReference for each module
+        Map<String, ModuleReference> namesToReference = new HashMap<>();
+
+        for (ModuleDescriptor descriptor : descriptors) {
+            String name = descriptor.name();
+
+            URI uri = URI.create("module:/" + name);
+
+            Supplier<ModuleReader> supplier = () -> {
+                throw new UnsupportedOperationException();
+            };
+
+            ModuleReference mref = new ModuleReference(descriptor, uri, supplier);
+
+            namesToReference.put(name, mref);
+        }
+
+        return new ModuleFinder() {
+            @Override
+            public Optional<ModuleReference> find(String name) {
+                Objects.requireNonNull(name);
+                return Optional.ofNullable(namesToReference.get(name));
+            }
+
+            @Override
+            public Set<ModuleReference> findAll() {
+                return new HashSet<>(namesToReference.values());
+            }
+        };
+    }
+
+}
diff --git a/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c b/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c
new file mode 100644
index 0000000..ed83d19
--- /dev/null
+++ b/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <jvmti.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    static jvmtiEnv *jvmti = NULL;
+
+    JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
+        int err = (*jvm)->GetEnv(jvm, (void**) &jvmti, JVMTI_VERSION_9);
+        if (err != JNI_OK) {
+            return JNI_ERR;
+        }
+        return JNI_OK;
+    }
+
+    JNIEXPORT jobjectArray JNICALL
+    Java_JvmtiGetAllModulesTest_getModulesNative(JNIEnv *env, jclass cls) {
+
+        jvmtiError err;
+        jint modules_count = -1;
+        jobject* modules_ptr;
+        jobjectArray array = NULL;
+        int i = 0;
+
+        err = (*jvmti)->GetAllModules(jvmti, &modules_count, &modules_ptr);
+        if (err != JVMTI_ERROR_NONE) {
+            return NULL;
+        }
+
+        array = (*env)->NewObjectArray(env, modules_count, (*env)->FindClass(env, "java/lang/reflect/Module"), NULL);
+
+        for (i = 0; i < modules_count; ++i) {
+            (*env)->SetObjectArrayElement(env, array, i, modules_ptr[i]);
+        }
+
+        return array;
+    }
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/test/serviceability/sa/TestClassLoaderStats.java b/test/serviceability/sa/TestClassLoaderStats.java
deleted file mode 100644
index 6cbd9ee..0000000
--- a/test/serviceability/sa/TestClassLoaderStats.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2015, 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.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import jdk.test.lib.Platform;
-import jdk.test.lib.ProcessTools;
-import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.Utils;
-import jdk.test.lib.apps.LingeredApp;
-
-/*
- * @test
- * @summary Started failing on 2016.06.24 due to 8160376 on MacOS X so
- * quarantine it on that platform:
- * @requires os.family != "mac"
- * @modules java.base/jdk.internal.misc
- * @library /test/lib/share/classes
- * @library /testlibrary
- * @build jdk.test.lib.*
- * @build jdk.test.lib.apps.*
- * @run main TestClassLoaderStats
- */
-public class TestClassLoaderStats {
-
-    public static void main(String[] args) throws Exception {
-        if (!Platform.shouldSAAttach()) {
-            System.out.println("SA attach not expected to work - test skipped.");
-            return;
-        }
-
-        LingeredApp app = null;
-        try {
-            List<String> vmArgs = new ArrayList<String>();
-            vmArgs.add("-XX:+UsePerfData");
-            vmArgs.addAll(Utils.getVmOptions());
-            app = LingeredApp.startApp(vmArgs);
-
-            System.out.println("Attaching sun.jvm.hotspot.tools.ClassLoaderStats to " + app.getPid());
-            ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
-                    "-XX:+UsePerfData",
-                    "sun.jvm.hotspot.tools.ClassLoaderStats",
-                    Long.toString(app.getPid()));
-            OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
-            System.out.println(output.getOutput());
-
-            output.shouldHaveExitValue(0);
-            output.shouldContain("Debugger attached successfully.");
-            // The class loader stats header needs to be presented in the output:
-            output.shouldMatch("class_loader\\W+classes\\W+bytes\\W+parent_loader\\W+alive?\\W+type");
-            output.stderrShouldNotMatch("[E|e]xception");
-            output.stderrShouldNotMatch("[E|e]rror");
-        } finally {
-            LingeredApp.stopApp(app);
-        }
-    }
-
-}
diff --git a/test/serviceability/sa/TestInstanceKlassSize.java b/test/serviceability/sa/TestInstanceKlassSize.java
new file mode 100644
index 0000000..5d13df4
--- /dev/null
+++ b/test/serviceability/sa/TestInstanceKlassSize.java
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+import sun.jvm.hotspot.HotSpotAgent;
+import sun.jvm.hotspot.utilities.SystemDictionaryHelper;
+import sun.jvm.hotspot.debugger.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.apps.LingeredApp;
+import jdk.test.lib.Asserts;
+
+import java.io.*;
+import java.util.*;
+
+/*
+ * @test
+ * @library /test/lib/share/classes
+ * @library /testlibrary
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.apps.*
+ * @modules java.base/jdk.internal.misc
+ * @modules jdk.hotspot.agent
+ * @modules jdk.hotspot.agent/sun.jvm.hotspot
+ * @modules jdk.hotspot.agent/sun.jvm.hotspot.utilities
+ * @modules jdk.hotspot.agent/sun.jvm.hotspot.oops
+ * @compile -XDignore.symbol.file=true -Xmodule:jdk.hotspot.agent TestInstanceKlassSize.java
+ * @run main/othervm  TestInstanceKlassSize
+ */
+
+public class TestInstanceKlassSize {
+
+    private static String getJcmdInstanceKlassSize(OutputAnalyzer output,
+                                                   String instanceKlassName) {
+        for (String s : output.asLines()) {
+            if (s.contains(instanceKlassName)) {
+                String tokens[];
+                System.out.println(s);
+                tokens = s.split("\\s+");
+                return tokens[3];
+            }
+        }
+        return null;
+    }
+
+    private static OutputAnalyzer jcmd(Long pid,
+                                       String... toolArgs) throws Exception {
+        ProcessBuilder processBuilder = new ProcessBuilder();
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jcmd");
+        launcher.addToolArg(Long.toString(pid));
+        if (toolArgs != null) {
+            for (String toolArg : toolArgs) {
+                launcher.addToolArg(toolArg);
+            }
+        }
+
+        processBuilder.command(launcher.getCommand());
+        System.out.println(
+            processBuilder.command().stream().collect(Collectors.joining(" ")));
+        return ProcessTools.executeProcess(processBuilder);
+    }
+
+    private static void startMeWithArgs() throws Exception {
+
+        LingeredApp app = null;
+        OutputAnalyzer output = null;
+        try {
+            List<String> vmArgs = new ArrayList<String>();
+            vmArgs.add("-XX:+UnlockDiagnosticVMOptions");
+            vmArgs.add("-XX:+UsePerfData");
+            vmArgs.addAll(Utils.getVmOptions());
+            app = LingeredApp.startApp(vmArgs);
+            System.out.println ("Started LingeredApp with pid " + app.getPid());
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new RuntimeException(ex);
+        }
+        try {
+            String[] instanceKlassNames = new String[] {
+                                              " java.lang.Object",
+                                              " java.util.Vector",
+                                              " sun.util.PreHashedMap",
+                                              " java.lang.String",
+                                              " java.lang.Thread",
+                                              " java.lang.Byte",
+                                          };
+            String[] toolArgs = {
+                "-XX:+UnlockDiagnosticVMOptions",
+                "-XaddExports:jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED",
+                "-XaddExports:jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED",
+                "-XaddExports:jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED",
+                "TestInstanceKlassSize",
+                Long.toString(app.getPid())
+            };
+
+            OutputAnalyzer jcmdOutput = jcmd(
+                           app.getPid(),
+                           "GC.class_stats", "VTab,ITab,OopMap,KlassBytes");
+            ProcessBuilder processBuilder = ProcessTools
+                                            .createJavaProcessBuilder(toolArgs);
+            output = ProcessTools.executeProcess(processBuilder);
+            System.out.println(output.getOutput());
+            output.shouldHaveExitValue(0);
+
+            // Check whether the size matches that which jcmd outputs
+            for (String instanceKlassName : instanceKlassNames) {
+                System.out.println ("Trying to match for" + instanceKlassName);
+                String jcmdInstanceKlassSize = getJcmdInstanceKlassSize(
+                                                      jcmdOutput,
+                                                      instanceKlassName);
+                for (String s : output.asLines()) {
+                    if (s.contains(instanceKlassName)) {
+                       Asserts.assertTrue(
+                          s.contains(jcmdInstanceKlassSize),
+                          "The size computed by SA for" +
+                          instanceKlassName + " does not match.");
+                    }
+                }
+            }
+        } finally {
+            LingeredApp.stopApp(app);
+        }
+    }
+
+    private static void SAInstanceKlassSize(int pid,
+                                            String[] SAInstanceKlassNames) {
+        HotSpotAgent agent = new HotSpotAgent();
+        try {
+            agent.attach(pid);
+        }
+        catch (DebuggerException e) {
+            System.out.println(e.getMessage());
+            System.err.println("Unable to connect to process ID: " + pid);
+
+            agent.detach();
+            e.printStackTrace();
+        }
+
+        for (String SAInstanceKlassName : SAInstanceKlassNames) {
+            Long size = SystemDictionaryHelper.findInstanceKlass(
+                            SAInstanceKlassName).getSize();
+            System.out.println("SA: The size of " + SAInstanceKlassName +
+                               " is " + size);
+        }
+        agent.detach();
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        if (!Platform.shouldSAAttach()) {
+            System.out.println("SA attach not expected to work - test skipped.");
+            return;
+        }
+
+        if (args == null || args.length == 0) {
+            System.out.println ("No args run. Starting with args now.");
+            startMeWithArgs();
+        } else {
+            String[] SAInstanceKlassNames = new String[] {
+                                                "java.lang.Object",
+                                                "java.util.Vector",
+                                                "sun.util.PreHashedMap",
+                                                "java.lang.String",
+                                                "java.lang.Thread",
+                                                "java.lang.Byte"
+                                             };
+            SAInstanceKlassSize(Integer.parseInt(args[0]), SAInstanceKlassNames);
+        }
+    }
+}
+
diff --git a/test/serviceability/sa/TestInstanceKlassSizeForInterface.java b/test/serviceability/sa/TestInstanceKlassSizeForInterface.java
new file mode 100644
index 0000000..085ac24
--- /dev/null
+++ b/test/serviceability/sa/TestInstanceKlassSizeForInterface.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+import sun.jvm.hotspot.HotSpotAgent;
+import sun.jvm.hotspot.utilities.SystemDictionaryHelper;
+import sun.jvm.hotspot.oops.InstanceKlass;
+import sun.jvm.hotspot.debugger.*;
+
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.Asserts;
+
+/*
+ * @test
+ * @library /test/lib/share/classes
+ * @library /testlibrary
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.apps.*
+ * @modules java.base/jdk.internal.misc
+ * @modules jdk.hotspot.agent
+ * @modules jdk.hotspot.agent/sun.jvm.hotspot
+ * @modules jdk.hotspot.agent/sun.jvm.hotspot.utilities
+ * @modules jdk.hotspot.agent/sun.jvm.hotspot.oops
+ * @compile -XDignore.symbol.file=true -Xmodule:jdk.hotspot.agent TestInstanceKlassSizeForInterface.java
+ * @run main/othervm TestInstanceKlassSizeForInterface
+ */
+
+interface Language {
+    static final long nbrOfWords = 99999;
+    public abstract long getNbrOfWords();
+}
+
+class ParselTongue implements Language {
+    public long getNbrOfWords() {
+      return nbrOfWords * 4;
+    }
+}
+
+public class TestInstanceKlassSizeForInterface {
+
+    private static void SAInstanceKlassSize(int pid,
+                                            String[] instanceKlassNames) {
+
+        HotSpotAgent agent = new HotSpotAgent();
+        try {
+            agent.attach((int)pid);
+        }
+        catch (DebuggerException e) {
+            System.out.println(e.getMessage());
+            System.err.println("Unable to connect to process ID: " + pid);
+
+            agent.detach();
+            e.printStackTrace();
+        }
+
+        for (String instanceKlassName : instanceKlassNames) {
+            InstanceKlass iKlass = SystemDictionaryHelper.findInstanceKlass(
+                                       instanceKlassName);
+            System.out.println("SA: The size of " + instanceKlassName +
+                               " is " + iKlass.getSize());
+        }
+        agent.detach();
+    }
+
+    private static String getJcmdInstanceKlassSize(OutputAnalyzer output,
+                                                   String instanceKlassName) {
+        for (String s : output.asLines()) {
+            if (s.contains(instanceKlassName)) {
+                String tokens[];
+                System.out.println(s);
+                tokens = s.split("\\s+");
+                return tokens[3];
+            }
+        }
+        return null;
+    }
+
+    private static void createAnotherToAttach(
+                            String[] instanceKlassNames) throws Exception {
+
+        ProcessBuilder pb = new ProcessBuilder();
+
+        // Grab the pid from the current java process and pass it
+        String[] toolArgs = {
+            "-XX:+UnlockDiagnosticVMOptions",
+            "-XaddExports:jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED",
+            "-XaddExports:jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED",
+            "-XaddExports:jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED",
+            "TestInstanceKlassSizeForInterface",
+            Long.toString(ProcessTools.getProcessId())
+        };
+
+        pb.command(new String[] {
+                          JDKToolFinder.getJDKTool("jcmd"),
+                          Long.toString(ProcessTools.getProcessId()),
+                          "GC.class_stats",
+                          "VTab,ITab,OopMap,KlassBytes"
+                      }
+                  );
+
+        // Start a new process to attach to the current process
+        ProcessBuilder processBuilder = ProcessTools
+                  .createJavaProcessBuilder(toolArgs);
+        OutputAnalyzer SAOutput = ProcessTools.executeProcess(processBuilder);
+        System.out.println(SAOutput.getOutput());
+
+        OutputAnalyzer jcmdOutput = new OutputAnalyzer(pb.start());
+        System.out.println(jcmdOutput.getOutput());
+
+        // Match the sizes from both the output streams
+        for (String instanceKlassName : instanceKlassNames) {
+            System.out.println ("Trying to match for " + instanceKlassName);
+            String jcmdInstanceKlassSize = getJcmdInstanceKlassSize(
+                                                      jcmdOutput,
+                                                      instanceKlassName);
+            for (String s : SAOutput.asLines()) {
+                if (s.contains(instanceKlassName)) {
+                   Asserts.assertTrue(
+                      s.contains(jcmdInstanceKlassSize),
+                      "The size computed by SA for " +
+                      instanceKlassName + " does not match.");
+                }
+            }
+        }
+    }
+
+    public static void main (String... args) throws Exception {
+        String[] instanceKlassNames = new String[] {
+                                          "Language",
+                                          "ParselTongue",
+                                          "TestInstanceKlassSizeForInterface$1"
+                                      };
+
+        if (!Platform.shouldSAAttach()) {
+            System.out.println(
+               "SA attach not expected to work - test skipped.");
+            return;
+        }
+
+        if ( args == null || args.length == 0 ) {
+            ParselTongue lang = new ParselTongue();
+
+            Language ventro = new Language() {
+                public long getNbrOfWords() {
+                    return nbrOfWords * 8;
+                }
+            };
+
+            // Not tested at this point. The test needs to be enhanced
+            // later to test for the sizes of the Lambda MetaFactory
+            // generated anonymous classes too. (After JDK-8160228 gets
+            // fixed.)
+            Runnable r2 = () -> System.out.println("Hello world!");
+            r2.run();
+
+            createAnotherToAttach(instanceKlassNames);
+        } else {
+            SAInstanceKlassSize(Integer.parseInt(args[0]), instanceKlassNames);
+        }
+    }
+}
diff --git a/test/serviceability/sa/TestStackTrace.java b/test/serviceability/sa/TestStackTrace.java
deleted file mode 100644
index de6c970..0000000
--- a/test/serviceability/sa/TestStackTrace.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2015, 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.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import jdk.test.lib.OutputAnalyzer;
-import jdk.test.lib.Platform;
-import jdk.test.lib.ProcessTools;
-import jdk.test.lib.Utils;
-import jdk.test.lib.apps.LingeredApp;
-
-/*
- * @test
- * @summary Started failing on 2016.06.24 due to 8160376 on MacOS X so
- * quarantine it on that platform:
- * @requires os.family != "mac"
- * @modules java.base/jdk.internal.misc
- * @library /test/lib/share/classes
- * @library /testlibrary
- * @build jdk.test.lib.*
- * @build jdk.test.lib.apps.*
- * @run main TestStackTrace
- */
-public class TestStackTrace {
-
-    public static void main(String[] args) throws Exception {
-        if (!Platform.shouldSAAttach()) {
-            System.out.println("SA attach not expected to work - test skipped.");
-            return;
-        }
-
-        LingeredApp app = null;
-        try {
-            List<String> vmArgs = new ArrayList<String>();
-            vmArgs.add("-XX:+UsePerfData");
-            vmArgs.addAll(Utils.getVmOptions());
-            app = LingeredApp.startApp(vmArgs);
-
-            System.out.println("Attaching sun.jvm.hotspot.tools.StackTrace to " + app.getPid());
-            ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
-                    "-XX:+UsePerfData",
-                    "sun.jvm.hotspot.tools.StackTrace",
-                    Long.toString(app.getPid()));
-            OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
-            System.out.println(output.getOutput());
-
-            output.shouldHaveExitValue(0);
-            output.shouldContain("Debugger attached successfully.");
-            output.stderrShouldNotMatch("[E|e]xception");
-            output.stderrShouldNotMatch("[E|e]rror");
-        } finally {
-            LingeredApp.stopApp(app);
-        }
-     }
-
-}
diff --git a/test/testlibrary/ctw/Makefile b/test/testlibrary/ctw/Makefile
index a4fc462..ed63271 100644
--- a/test/testlibrary/ctw/Makefile
+++ b/test/testlibrary/ctw/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 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
@@ -35,12 +35,13 @@
 SRC_DIR = src
 BUILD_DIR = build
 OUTPUT_DIR = $(BUILD_DIR)/classes
-WHITEBOX_DIR = ../whitebox
+TESTLIBRARY_DIR = ../../../../test/lib
 
 JAVAC = $(JDK_HOME)/bin/javac
 JAR = $(JDK_HOME)/bin/jar
 
-SRC_FILES = $(shell find $(SRC_DIR) -name '*.java')
+SRC_FILES = $(shell find $(SRC_DIR) $(TESTLIBRARY_DIR)/share/classes -name '*.java')
+WB_SRC_FILES = $(shell find $(TESTLIBRARY_DIR)/sun/hotspot -name '*.java')
 
 MAIN_CLASS = sun.hotspot.tools.ctw.CompileTheWorld
 
@@ -52,22 +53,29 @@
 	@rm -rf ctw.jar wb.jar
 
 cleantmp:
-	@rm -rf filelist manifest.mf
+	@rm -rf filelist wb_filelist manifest.mf
 	@rm -rf $(BUILD_DIR)
 
-ctw.jar: filelist wb.jar manifest.mf
+ctw.jar: filelist wb.jar
 	@mkdir -p $(OUTPUT_DIR)
-	$(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp wb.jar @filelist
-	$(JAR) cfm ctw.jar manifest.mf -C $(OUTPUT_DIR) .
+	$(JAVAC) -XaddExports:java.base/jdk.internal.jimage=ALL-UNNAMED \
+		-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED \
+		-XaddExports:java.base/jdk.internal.reflect=ALL-UNNAMED \
+		-sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp wb.jar @filelist
+	$(JAR) --create --file=$@ --main-class $(MAIN_CLASS) -C $(OUTPUT_DIR) .
 
-wb.jar: 
-	make -C ${WHITEBOX_DIR} wb.jar
-	cp ${WHITEBOX_DIR}/wb.jar ./
-	make -C ${WHITEBOX_DIR} clean
+wb.jar: wb_filelist
+	@mkdir -p $(OUTPUT_DIR)
+	$(JAVAC)  -sourcepath $(TESTLIBRARY_DIR) \
+		-d $(OUTPUT_DIR) \
+		-cp $(OUTPUT_DIR) \
+		@wb_filelist
+	$(JAR) --create --file=$@ -C $(OUTPUT_DIR) .
+
+wb_filelist: $(WB_SRC_FILES)
+	@rm -f $@
+	@echo $(WB_SRC_FILES) > $@
 
 filelist: $(SRC_FILES)
 	@rm -f $@
 	@echo $(SRC_FILES) > $@
-
-manifest.mf:
-	@echo "Main-Class: ${MAIN_CLASS}" > manifest.mf
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java
index b1e8fe2..bafe2dd 100644
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java
@@ -54,7 +54,7 @@
 
     @Override
     public void process() {
-        System.out.println("# dir: " + root);
+        CompileTheWorld.OUT.println("# dir: " + root);
         if (!Files.exists(root)) {
             return;
         }
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarEntry.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarEntry.java
index a639a63..bf72bc6 100644
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarEntry.java
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarEntry.java
@@ -50,7 +50,7 @@
 
     @Override
     public void process() {
-        System.out.println("# jar: " + root);
+        CompileTheWorld.OUT.println("# jar: " + root);
         if (!Files.exists(root)) {
             return;
         }
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarInDirEntry.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarInDirEntry.java
index a9f7c8a..c9bdcb1 100644
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarInDirEntry.java
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarInDirEntry.java
@@ -40,7 +40,7 @@
 
     @Override
     public void process() {
-        System.out.println("# jar_in_dir: " + root);
+        CompileTheWorld.OUT.println("# jar_in_dir: " + root);
         if (!Files.exists(root)) {
             return;
         }
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJimageEntry.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJimageEntry.java
new file mode 100644
index 0000000..7043e4b
--- /dev/null
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJimageEntry.java
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+package sun.hotspot.tools.ctw;
+
+import jdk.internal.jimage.ImageReader;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.concurrent.Executor;
+
+/**
+ * Handler for jimage-files containing classes to compile.
+ */
+public class ClassPathJimageEntry extends PathHandler {
+    public ClassPathJimageEntry(Path root, Executor executor) {
+        super(root, executor);
+        try {
+            URL url = root.toUri().toURL();
+            setLoader(new URLClassLoader(new URL[]{url}));
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void process() {
+        CompileTheWorld.OUT.println("# jimage: " + root);
+        if (!Files.exists(root)) {
+            return;
+        }
+        try {
+            ImageReader reader = ImageReader.open(root);
+            Arrays.stream(reader.getEntryNames())
+                    .filter(name -> name.endsWith(".class"))
+                    .filter(name -> !name.endsWith("module-info.class"))
+                    .map(Utils::fileNameToClassName)
+                    .forEach(this::processClass);
+        } catch (IOException ioe) {
+            ioe.printStackTrace();
+        }
+    }
+}
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassesListInFile.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassesListInFile.java
index d25364a..7c810dd 100644
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassesListInFile.java
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassesListInFile.java
@@ -40,7 +40,7 @@
 
     @Override
     public void process() {
-        System.out.println("# list: " + root);
+        CompileTheWorld.OUT.println("# list: " + root);
         if (!Files.exists(root)) {
             return;
         }
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
index b398ea1..88a94f6 100644
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
@@ -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
@@ -33,14 +33,20 @@
 import java.util.concurrent.*;
 
 public class CompileTheWorld {
+    // in case when a static constructor changes System::out and System::err
+    // we hold these values of output streams
+    static PrintStream OUT = System.out;
+    static final PrintStream ERR = System.err;
     /**
-     * Entry point. Compiles classes in {@code args}, or all classes in
-     * boot-classpath if args is empty
+     * Entry point. Compiles classes in {@code paths}
      *
-     * @param args paths to jar/zip, dir contains classes, or to .lst file
-     *             contains list of classes to compile
+     * @param paths paths to jar/zip, dir contains classes, or to .lst file
+     *              contains list of classes to compile
      */
-    public static void main(String[] args) {
+    public static void main(String[] paths) {
+        if (paths.length == 0) {
+            throw new IllegalArgumentException("Expect a path to a compile target.");
+        }
         String logfile = Utils.LOG_FILE;
         PrintStream os = null;
         if (logfile != null) {
@@ -50,7 +56,7 @@
             }
         }
         if (os != null) {
-            System.setOut(os);
+            OUT = os;
         }
 
         try {
@@ -62,12 +68,6 @@
             } catch (java.lang.NoClassDefFoundError e) {
                 // compact1, compact2 support
             }
-            String[] paths = args;
-            boolean skipRtJar = false;
-            if (args.length == 0) {
-                paths = getDefaultPaths();
-                skipRtJar = true;
-            }
             ExecutorService executor = createExecutor();
             long start = System.currentTimeMillis();
             try {
@@ -75,17 +75,13 @@
                 for (int i = 0, n = paths.length; i < n
                         && !PathHandler.isFinished(); ++i) {
                     path = paths[i];
-                    if (skipRtJar && i > 0 && isRtJar(path)) {
-                        // rt.jar is not first, so skip it
-                        continue;
-                    }
                     PathHandler.create(path, executor).process();
                 }
             } finally {
                 await(executor);
             }
-            System.out.printf("Done (%d classes, %d methods, %d ms)%n",
-                    Compiler.getClassCount(),
+            CompileTheWorld.OUT.printf("Done (%d classes, %d methods, %d ms)%n",
+                    PathHandler.getClassCount(),
                     Compiler.getMethodCount(),
                     System.currentTimeMillis() - start);
         } finally {
@@ -111,13 +107,6 @@
         return result;
     }
 
-    private static String[] getDefaultPaths() {
-        String property = System.getProperty("sun.boot.class.path");
-        System.out.println(
-                "# use 'sun.boot.class.path' as args: " + property);
-        return Utils.PATH_SEPARATOR.split(property);
-    }
-
     private static void await(ExecutorService executor) {
         executor.shutdown();
         while (!executor.isTerminated()) {
@@ -130,10 +119,6 @@
         }
     }
 
-    private static boolean isRtJar(String path) {
-        return Utils.endsWithIgnoreCase(path, File.separator + "rt.jar");
-    }
-
     private static class CurrentThreadExecutor extends AbstractExecutorService {
         private boolean isShutdown;
 
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java
index 96b627a..e546f2e 100644
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java
@@ -26,7 +26,6 @@
 import sun.hotspot.WhiteBox;
 import jdk.internal.misc.SharedSecrets;
 import jdk.internal.reflect.ConstantPool;
-
 import java.lang.reflect.Executable;
 
 import java.util.Objects;
@@ -38,18 +37,11 @@
  * Also contains compiled methods and classes counters.
  */
 public class Compiler {
-    private Compiler() { }
-    private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
-    private static final AtomicLong CLASS_COUNT = new AtomicLong(0L);
-    private static final AtomicLong METHOD_COUNT = new AtomicLong(0L);
-    private static volatile boolean CLASSES_LIMIT_REACHED = false;
 
-    /**
-     * @return count of processed classes
-     */
-    public static long getClassCount() {
-        return CLASS_COUNT.get();
-    }
+    private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+    private static final AtomicLong METHOD_COUNT = new AtomicLong(0L);
+
+    private Compiler() { }
 
     /**
      * @return count of processed methods
@@ -59,58 +51,46 @@
     }
 
     /**
-     * @return {@code true} if classes limit is reached
-     */
-    public static boolean isLimitReached() {
-        return CLASSES_LIMIT_REACHED;
-    }
-
-    /**
      * Compiles all methods and constructors.
      *
      * @param aClass class to compile
+     * @param id an id of the class
      * @param executor executor used for compile task invocation
      * @throws NullPointerException if {@code class} or {@code executor}
      *                              is {@code null}
      */
-    public static void compileClass(Class aClass, Executor executor) {
+    public static void compileClass(Class<?> aClass, long id, Executor executor) {
         Objects.requireNonNull(aClass);
         Objects.requireNonNull(executor);
-        long id = CLASS_COUNT.incrementAndGet();
-        if (id > Utils.COMPILE_THE_WORLD_STOP_AT) {
-            CLASS_COUNT.decrementAndGet();
-            CLASSES_LIMIT_REACHED = true;
-            return;
-        }
-
-        if (id >= Utils.COMPILE_THE_WORLD_START_AT) {
-            String name = aClass.getName();
-            try {
-                System.out.printf("[%d]\t%s%n", id, name);
-                ConstantPool constantPool = SharedSecrets.getJavaLangAccess().
-                        getConstantPool(aClass);
-                if (Utils.COMPILE_THE_WORLD_PRELOAD_CLASSES) {
-                    preloadClasses(name, id, constantPool);
-                }
-                long methodCount = 0;
-                for (Executable e : aClass.getDeclaredConstructors()) {
-                    ++methodCount;
-                    executor.execute(new CompileMethodCommand(id, name, e));
-                }
-                for (Executable e : aClass.getDeclaredMethods()) {
-                    ++methodCount;
-                    executor.execute(new CompileMethodCommand(id, name, e));
-                }
-                METHOD_COUNT.addAndGet(methodCount);
-
-                if (Utils.DEOPTIMIZE_ALL_CLASSES_RATE > 0
-                        && (id % Utils.DEOPTIMIZE_ALL_CLASSES_RATE == 0)) {
-                    WHITE_BOX.deoptimizeAll();
-                }
-            } catch (Throwable t) {
-                System.out.printf("[%d]\t%s\tskipping %s%n", id, name, t);
-                t.printStackTrace();
+        try {
+            ConstantPool constantPool = SharedSecrets.getJavaLangAccess().
+                    getConstantPool(aClass);
+            if (Utils.COMPILE_THE_WORLD_PRELOAD_CLASSES) {
+                preloadClasses(aClass.getName(), id, constantPool);
             }
+            int startLevel = Utils.INITIAL_COMP_LEVEL;
+            int endLevel = Utils.TIERED_COMPILATION ? Utils.TIERED_STOP_AT_LEVEL : startLevel;
+            for (int i = startLevel; i <= endLevel; ++i) {
+                WHITE_BOX.enqueueInitializerForCompilation(aClass, i);
+            }
+            long methodCount = 0;
+            for (Executable e : aClass.getDeclaredConstructors()) {
+                ++methodCount;
+                executor.execute(new CompileMethodCommand(id, e));
+            }
+            for (Executable e : aClass.getDeclaredMethods()) {
+                ++methodCount;
+                executor.execute(new CompileMethodCommand(id, e));
+            }
+            METHOD_COUNT.addAndGet(methodCount);
+
+            if (Utils.DEOPTIMIZE_ALL_CLASSES_RATE > 0
+                    && (id % Utils.DEOPTIMIZE_ALL_CLASSES_RATE == 0)) {
+                WHITE_BOX.deoptimizeAll();
+            }
+        } catch (Throwable t) {
+            CompileTheWorld.OUT.printf("[%d]\t%s\tskipping %s%n", id, aClass.getName(), t);
+            t.printStackTrace();
         }
     }
 
@@ -124,8 +104,8 @@
                 }
             }
         } catch (Throwable t) {
-            System.out.printf("[%d]\t%s\tpreloading failed : %s%n", id,
-                    className, t);
+            CompileTheWorld.OUT.printf("[%d]\t%s\tpreloading failed : %s%n",
+                    id, className, t);
         }
     }
 
@@ -142,13 +122,11 @@
 
         /**
          * @param classId   id of class
-         * @param className name of class
          * @param method    compiled for compilation
          */
-        public CompileMethodCommand(long classId, String className,
-                Executable method) {
+        public CompileMethodCommand(long classId, Executable method) {
             this.classId = classId;
-            this.className = className;
+            this.className = method.getDeclaringClass().getName();
             this.method = method;
         }
 
@@ -158,10 +136,10 @@
             if (Utils.TIERED_COMPILATION) {
                 for (int i = compLevel; i <= Utils.TIERED_STOP_AT_LEVEL; ++i) {
                     WHITE_BOX.deoptimizeMethod(method);
-                    compileMethod(method, i);
+                    compileAtLevel(i);
                 }
             } else {
-                compileMethod(method, compLevel);
+                compileAtLevel(compLevel);
             }
         }
 
@@ -183,29 +161,29 @@
             }
         }
 
-        private void compileMethod(Executable method, int compLevel) {
+        private void compileAtLevel(int compLevel) {
             if (WHITE_BOX.isMethodCompilable(method, compLevel)) {
                 try {
                     WHITE_BOX.enqueueMethodForCompilation(method, compLevel);
                     waitCompilation();
                     int tmp = WHITE_BOX.getMethodCompilationLevel(method);
                     if (tmp != compLevel) {
-                        logMethod(method, "compilation level = " + tmp
+                        log("compilation level = " + tmp
                                 + ", but not " + compLevel);
                     } else if (Utils.IS_VERBOSE) {
-                        logMethod(method, "compilation level = " + tmp + ". OK");
+                        log("compilation level = " + tmp + ". OK");
                     }
                 } catch (Throwable t) {
-                    logMethod(method, "error on compile at " + compLevel
+                    log("error on compile at " + compLevel
                             + " level");
                     t.printStackTrace();
                 }
             } else if (Utils.IS_VERBOSE) {
-                logMethod(method, "not compilable at " + compLevel);
+                log("not compilable at " + compLevel);
             }
         }
 
-        private void logMethod(Executable method, String message) {
+        private void log(String message) {
             StringBuilder builder = new StringBuilder("[");
             builder.append(classId);
             builder.append("]\t");
@@ -226,7 +204,7 @@
                 builder.append('\t');
                 builder.append(message);
             }
-            System.err.println(builder);
+            CompileTheWorld.ERR.println(builder);
         }
     }
 
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
index 04b23e7..a8e1491 100644
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
@@ -23,21 +23,25 @@
 
 package sun.hotspot.tools.ctw;
 
+import jdk.internal.misc.Unsafe;
+
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.io.File;
-
 import java.util.Objects;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
 import java.util.concurrent.Executor;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * Abstract handler for path.
  * Concrete subclasses should implement method {@link #process()}.
  */
 public abstract class PathHandler {
+    private static final Unsafe UNSAFE = jdk.test.lib.Utils.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
             = Pattern.compile("^(.*[/\\\\])?\\*$");
     protected final Path root;
@@ -81,6 +85,8 @@
                 return new ClassPathJarEntry(p, executor);
             } else if (isListFile(p)) {
                 return new ClassesListInFile(p, executor);
+            } else if (isJimageFile(p)) {
+                return new ClassPathJimageEntry(p, executor);
             } else {
                 return new ClassPathDirEntry(p, executor);
             }
@@ -96,6 +102,13 @@
         return false;
     }
 
+    private static boolean isJimageFile(Path path) {
+        String filename = path.getFileName().toString();
+        return Files.isRegularFile(path)
+                && ("modules".equals(filename)
+                || Utils.endsWithIgnoreCase(filename, ".jimage"));
+    }
+
     private static boolean isListFile(Path path) {
         if (Files.isRegularFile(path)) {
             String name = path.toString();
@@ -122,24 +135,54 @@
     }
 
     /**
-     * Processes specificed class.
+     * Processes specified class.
      * @param name fully qualified name of class to process
      */
     protected final void processClass(String name) {
-        try {
-            Class aClass = Class.forName(name, true, loader);
-            Compiler.compileClass(aClass, executor);
-        } catch (ClassNotFoundException | LinkageError e) {
-            System.out.printf("Class %s loading failed : %s%n", name,
-                e.getMessage());
+        Objects.requireNonNull(name);
+        if (CLASSES_LIMIT_REACHED) {
+            return;
+        }
+        long id = CLASS_COUNT.incrementAndGet();
+        if (id > Utils.COMPILE_THE_WORLD_STOP_AT) {
+            CLASSES_LIMIT_REACHED = true;
+            return;
+        }
+        if (id >= Utils.COMPILE_THE_WORLD_START_AT) {
+            try {
+                Class<?> aClass = loader.loadClass(name);
+                if (name != "sun.reflect.misc.Trampoline"
+                        && name != "sun.tools.jconsole.OutputViewer") { // workaround for JDK-8159155
+                    UNSAFE.ensureClassInitialized(aClass);
+                }
+                CompileTheWorld.OUT.printf("[%d]\t%s%n", id, name);
+                Compiler.compileClass(aClass, id, executor);
+            } catch (ClassNotFoundException e) {
+                CompileTheWorld.OUT.printf("Class %s loading failed : %s%n",
+                        name, e.getMessage());
+            }
         }
     }
 
     /**
-     * @return {@code true} if processing should be stopped
+     * @return count of processed classes
+     */
+    public static long getClassCount() {
+        long id = CLASS_COUNT.get();
+        if (id < Utils.COMPILE_THE_WORLD_START_AT) {
+            return 0;
+        }
+        if (id > Utils.COMPILE_THE_WORLD_STOP_AT) {
+            return Utils.COMPILE_THE_WORLD_STOP_AT - Utils.COMPILE_THE_WORLD_START_AT + 1;
+        }
+        return id - Utils.COMPILE_THE_WORLD_START_AT + 1;
+    }
+
+    /**
+     * @return {@code true} if classes limit is reached and processing should be stopped
      */
     public static boolean isFinished() {
-        return Compiler.isLimitReached();
+        return CLASSES_LIMIT_REACHED;
     }
 
 }
diff --git a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java
index 4e98bd8..4159c48 100644
--- a/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java
+++ b/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java
@@ -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
@@ -207,7 +207,12 @@
      */
     public static String fileNameToClassName(String filename) {
         assert isClassFile(filename);
-        return filename.substring(0, filename.length() - CLASSFILE_EXT.length())
-                       .replace(File.separatorChar, '.');
+        // workaround for the class naming in jimage : /<module>/<class_name>
+        final char nameSeparator = '/';
+        int nameStart = filename.charAt(0) == nameSeparator
+                ? filename.indexOf(nameSeparator, 1) + 1
+                : 0;
+        return filename.substring(nameStart, filename.length() - CLASSFILE_EXT.length())
+                       .replace(nameSeparator, '.');
     }
 }
diff --git a/test/testlibrary/jdk/test/lib/Platform.java b/test/testlibrary/jdk/test/lib/Platform.java
index 6477322..d090663 100644
--- a/test/testlibrary/jdk/test/lib/Platform.java
+++ b/test/testlibrary/jdk/test/lib/Platform.java
@@ -31,12 +31,13 @@
  */
 @Deprecated
 public class Platform {
+    public  static final String vmName      = System.getProperty("java.vm.name");
+    public  static final String vmInfo      = System.getProperty("java.vm.info");
     private static final String osName      = System.getProperty("os.name");
     private static final String dataModel   = System.getProperty("sun.arch.data.model");
     private static final String vmVersion   = System.getProperty("java.vm.version");
     private static final String jdkDebug    = System.getProperty("jdk.debug");
     private static final String osArch      = System.getProperty("os.arch");
-    private static final String vmName      = System.getProperty("java.vm.name");
     private static final String userName    = System.getProperty("user.name");
     private static final String compiler    = System.getProperty("sun.management.compiler");
 
@@ -60,14 +61,22 @@
         return vmName.endsWith(" Minimal VM");
     }
 
-    public static boolean isEmbedded() {
-        return vmName.contains("Embedded");
-    }
-
     public static boolean isTieredSupported() {
         return compiler.contains("Tiered Compilers");
     }
 
+    public static boolean isInt() {
+        return vmInfo.contains("interpreted");
+    }
+
+    public static boolean isMixed() {
+        return vmInfo.contains("mixed");
+    }
+
+    public static boolean isComp() {
+        return vmInfo.contains("compiled");
+    }
+
     public static boolean is32bit() {
         return dataModel.equals("32");
     }
diff --git a/test/testlibrary/jdk/test/lib/Utils.java b/test/testlibrary/jdk/test/lib/Utils.java
index 8ad11fd..6925f73 100644
--- a/test/testlibrary/jdk/test/lib/Utils.java
+++ b/test/testlibrary/jdk/test/lib/Utils.java
@@ -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
@@ -317,8 +317,8 @@
             output = ProcessTools.executeProcess(jcmdLauncher.getCommand());
             output.shouldHaveExitValue(0);
 
-            // Search for a line starting with numbers (pid), follwed by the key.
-            Pattern pattern = Pattern.compile("([0-9]+)\\s.*(" + key + ").*\\r?\\n");
+            // Search for a line starting with numbers (pid), followed by the key.
+            Pattern pattern = Pattern.compile("^([0-9]+)\\s.*(" + key + ")", Pattern.MULTILINE);
             Matcher matcher = pattern.matcher(output.getStdout());
 
             int pid = -1;
diff --git a/test/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java b/test/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java
index ee81bcf..334911c 100644
--- a/test/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java
+++ b/test/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java
@@ -120,16 +120,30 @@
             String name = "Test_" + counter;
             Pair<IRNode, IRNode> irTree = generateIRTree(name);
             System.out.printf(" %8d |", counter);
+            long maxWaitTime = TimeUnit.MINUTES.toMillis(MINUTES_TO_WAIT);
             double generationTime = System.currentTimeMillis() - start;
             System.out.printf(" %8.0f |", generationTime);
             start = System.currentTimeMillis();
-            for (TestsGenerator generator : generators) {
-                generator.accept(irTree.first, irTree.second);
+            Thread generatorThread = new Thread(() -> {
+                for (TestsGenerator generator : generators) {
+                        generator.accept(irTree.first, irTree.second);
+                }
+            });
+            generatorThread.start();
+            try {
+                generatorThread.join(maxWaitTime);
+            } catch (InterruptedException ie) {
+                throw new Error("Test generation interrupted: " + ie, ie);
             }
-            double runningTime = System.currentTimeMillis() - start;
-            System.out.printf(" %8.0f |%n", runningTime);
-            if (runningTime < TimeUnit.MINUTES.toMillis(MINUTES_TO_WAIT)) {
-                ++counter;
+            if (generatorThread.isAlive()) {
+                // maxTime reached, so, proceed to next test generation
+                generatorThread.interrupt();
+            } else {
+                double runningTime = System.currentTimeMillis() - start;
+                System.out.printf(" %8.0f |%n", runningTime);
+                if (runningTime < maxWaitTime) {
+                    ++counter;
+                }
             }
         } while (counter < ProductionParams.numberOfTests.value());
     }
diff --git a/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
index 4f20576..98cf13b 100644
--- a/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
+++ b/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
@@ -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
@@ -49,7 +49,8 @@
         BITNESS("is32bit", "is64bit"),
         OS("isAix", "isLinux", "isOSX", "isSolaris", "isWindows"),
         VM_TYPE("isClient", "isServer", "isGraal", "isMinimal", "isZero"),
-        IGNORED("isEmbedded", "isDebugBuild", "shouldSAAttach",
+        MODE("isInt", "isMixed", "isComp"),
+        IGNORED("isDebugBuild", "shouldSAAttach",
                 "canPtraceAttachLinux", "canAttachOSX", "isTieredSupported");
 
         public final List<String> methodNames;
diff --git a/test/testlibrary_tests/ctw/ClassesDirTest.java b/test/testlibrary_tests/ctw/ClassesDirTest.java
index a114366..eb29c5b 100644
--- a/test/testlibrary_tests/ctw/ClassesDirTest.java
+++ b/test/testlibrary_tests/ctw/ClassesDirTest.java
@@ -25,7 +25,8 @@
  * @test
  * @bug 8012447
  * @library /testlibrary /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.jimage
+ *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.management
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
diff --git a/test/testlibrary_tests/ctw/ClassesListTest.java b/test/testlibrary_tests/ctw/ClassesListTest.java
index f9feeaa..873180c 100644
--- a/test/testlibrary_tests/ctw/ClassesListTest.java
+++ b/test/testlibrary_tests/ctw/ClassesListTest.java
@@ -25,7 +25,8 @@
  * @test
  * @bug 8012447
  * @library /testlibrary /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.jimage
+ *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.management
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
diff --git a/test/testlibrary_tests/ctw/JarDirTest.java b/test/testlibrary_tests/ctw/JarDirTest.java
index 7bc97e6..57f12a6 100644
--- a/test/testlibrary_tests/ctw/JarDirTest.java
+++ b/test/testlibrary_tests/ctw/JarDirTest.java
@@ -25,7 +25,8 @@
  * @test
  * @bug 8012447
  * @library /testlibrary /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.jimage
+ *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.compiler
  *          java.management
diff --git a/test/testlibrary_tests/ctw/JarsTest.java b/test/testlibrary_tests/ctw/JarsTest.java
index e357912..e9bc05c 100644
--- a/test/testlibrary_tests/ctw/JarsTest.java
+++ b/test/testlibrary_tests/ctw/JarsTest.java
@@ -25,7 +25,8 @@
  * @test
  * @bug 8012447
  * @library /testlibrary /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.jimage
+ *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.compiler
  *          java.management