Merge JDK-8200758-branch
authorherrick
Mon, 05 Nov 2018 19:05:15 -0500
branchJDK-8200758-branch
changeset 57019 585939d9f952
parent 57018 9d782e357916 (current diff)
parent 52421 3021c1ad958b (diff)
child 57020 a828547f7e50
Merge
src/hotspot/share/utilities/internalVMTests.cpp
src/hotspot/share/utilities/internalVMTests.hpp
test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java
test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java
--- a/doc/testing.html	Mon Nov 05 19:00:34 2018 -0500
+++ b/doc/testing.html	Mon Nov 05 19:05:15 2018 -0500
@@ -62,9 +62,8 @@
 <p>If you want, you can single out an individual test or a group of tests, for instance <code>gtest:LogDecorations</code> or <code>gtest:LogDecorations.level_test_vm</code>. This can be particularly useful if you want to run a shaky test repeatedly.</p>
 <p>For Gtest, there is a separate test suite for each JVM variant. The JVM variant is defined by adding <code>/&lt;variant&gt;</code> to the test descriptor, e.g. <code>gtest:Log/client</code>. If you specify no variant, gtest will run once for each JVM variant present (e.g. server, client). So if you only have the server JVM present, then <code>gtest:all</code> will be equivalent to <code>gtest:all/server</code>.</p>
 <h3 id="special-tests">Special tests</h3>
-<p>A handful of odd tests that are not covered by any other testing framework are accessible using the <code>special:</code> test descriptor. Currently, this includes <code>hotspot-internal</code>, <code>failure-handler</code> and <code>make</code>.</p>
+<p>A handful of odd tests that are not covered by any other testing framework are accessible using the <code>special:</code> test descriptor. Currently, this includes <code>failure-handler</code> and <code>make</code>.</p>
 <ul>
-<li><p>Hotspot legacy internal testing (run using <code>-XX:+ExecuteInternalVMTests</code>) is run using <code>special:hotspot-internal</code> or just <code>hotspot-internal</code> as test descriptor, and will only work on a debug JVM.</p></li>
 <li><p>Failure handler testing is run using <code>special:failure-handler</code> or just <code>failure-handler</code> as test descriptor.</p></li>
 <li><p>Tests for the build system, including both makefiles and related functionality, is run using <code>special:make</code> or just <code>make</code> as test descriptor. This is equivalent to <code>special:make:all</code>.</p>
 <p>A specific make test can be run by supplying it as argument, e.g. <code>special:make:idea</code>. As a special syntax, this can also be expressed as <code>make-idea</code>, which allows for command lines as <code>make test-make-idea</code>.</p></li>
--- a/doc/testing.md	Mon Nov 05 19:00:34 2018 -0500
+++ b/doc/testing.md	Mon Nov 05 19:05:15 2018 -0500
@@ -108,11 +108,7 @@
 
 A handful of odd tests that are not covered by any other testing framework are
 accessible using the `special:` test descriptor. Currently, this includes
-`hotspot-internal`, `failure-handler` and `make`.
-
-  * Hotspot legacy internal testing (run using `-XX:+ExecuteInternalVMTests`)
-    is run using `special:hotspot-internal` or just `hotspot-internal` as test
-    descriptor, and will only work on a debug JVM.
+`failure-handler` and `make`.
 
   * Failure handler testing is run using `special:failure-handler` or just
     `failure-handler` as test descriptor.
--- a/make/RunTests.gmk	Mon Nov 05 19:00:34 2018 -0500
+++ b/make/RunTests.gmk	Mon Nov 05 19:05:15 2018 -0500
@@ -45,7 +45,7 @@
 endif
 
 $(eval $(call ParseKeywordVariable, TEST_OPTS, \
-    SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR, \
+    SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR AOT_MODULES, \
     STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
 ))
 
@@ -108,6 +108,90 @@
 GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS)))
 
 ################################################################################
+# Optionally create AOT libraries for specified modules before running tests.
+# Note, this could not be done during JDK build time.
+################################################################################
+
+# Note, this could not be done during JDK build time.
+
+# Parameter 1 is the name of the rule.
+#
+# Remaining parameters are named arguments.
+#   MODULE      The module to generate a library for
+#   BIN         Output directory in which to put the library
+#   VM_OPTIONS  List of JVM arguments to use when creating library
+#   OPTIONS_VAR Name of variable to put AOT java options in
+#   PREREQS_VAR Name of variable to put all AOT prerequisite rule targets in
+#               for test rules to depend on
+#
+SetupAotModule = $(NamedParamsMacroTemplate)
+define SetupAotModuleBody
+  $1_AOT_LIB := $$($1_BIN)/$$(call SHARED_LIBRARY,$$($1_MODULE))
+  $1_AOT_CCLIST := $$(wildcard $$(TOPDIR)/test/hotspot/jtreg/compiler/aot/scripts/$$($1_MODULE)-list.txt)
+
+  ifeq ($(OPENJDK_TARGET_OS), windows)
+    $1_LD := $$(addsuffix $$(EXE_SUFFIX), $$(filter-out $$(FIXPATH), $$(LD)))
+  else
+    $1_LD := $$(LD)
+  endif
+
+  $1_JAOTC_OPTS := \
+      -J-Xmx4g --info \
+      $$(addprefix -J, $$($1_VM_OPTIONS)) \
+      $$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \
+      --linker-path $$($1_LD) \
+      #
+
+  ifneq ($$(filter -ea, $$($1_VM_OPTIONS)), )
+    $1_JAOTC_OPTS += --compile-with-assertions
+  endif
+
+  $$($1_AOT_LIB): $$(JDK_IMAGE_DIR)/release \
+      $$(call DependOnVariable, $1_JAOTC_OPTS) \
+      $$(call DependOnVariable, JDK_IMAGE_DIR)
+	$$(call LogWarn, Generating $$(patsubst $$(OUTPUTDIR)/%, %, $$@))
+	$$(call MakeTargetDir)
+	$$(call ExecuteWithLog, $$@, \
+	    $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/jaotc \
+	    $$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \
+	)
+	$$(call ExecuteWithLog, $$@.check, \
+	  $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java \
+	  $$($1_VM_OPTIONS) -XX:+PrintAOT -XX:+UseAOTStrictLoading -XX:AOTLibrary=$$@ -version \
+	  > $$@.verify-aot \
+	)
+
+  $1_AOT_OPTIONS += -XX:AOTLibrary=$$($1_AOT_LIB)
+  $1_AOT_TARGETS += $$($1_AOT_LIB)
+endef
+
+# Parameter 1 is the name of the rule.
+#
+# Remaining parameters are named arguments.
+#   MODULES     The modules to generate a library for
+#   VM_OPTIONS  List of JVM arguments to use when creating libraries
+#
+# After calling this, the following variables are defined
+#   $1_AOT_OPTIONS List of all java options needed to use the AOT libraries
+#   $1_AOT_TARGETS List of all targets that the test rule will need to depend on
+#
+SetupAot = $(NamedParamsMacroTemplate)
+define SetupAotBody
+  $$(info Running with AOTd libraries for $$($1_MODULES))
+  # Put aot libraries in a separate directory so they are not deleted between
+  # test runs and may be reused between make invocations.
+  $$(foreach m, $$($1_MODULES), \
+    $$(eval $$(call SetupAotModule, $1_$$m, \
+        MODULE := $$m, \
+        BIN := $$(TEST_SUPPORT_DIR)/aot/$1, \
+        VM_OPTIONS := $$($1_VM_OPTIONS), \
+    )) \
+    $$(eval $1_AOT_OPTIONS += $$($1_$$m_AOT_OPTIONS)) \
+    $$(eval $1_AOT_TARGETS += $$($1_$$m_AOT_TARGETS)) \
+  )
+endef
+
+################################################################################
 # Setup global test running parameters
 ################################################################################
 
@@ -146,12 +230,15 @@
 $(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
 $(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
 
+$(eval $(call SetTestOpt,AOT_MODULES,JTREG))
+$(eval $(call SetTestOpt,AOT_MODULES,GTEST))
+
 $(eval $(call SetTestOpt,JOBS,JTREG))
 $(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
 
 $(eval $(call ParseKeywordVariable, JTREG, \
     SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \
-        EXTRA_PROBLEM_LISTS KEYWORDS, \
+        EXTRA_PROBLEM_LISTS KEYWORDS AOT_MODULES, \
     STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
 ))
 
@@ -161,7 +248,7 @@
 endif
 
 $(eval $(call ParseKeywordVariable, GTEST, \
-    SINGLE_KEYWORDS := REPEAT, \
+    SINGLE_KEYWORDS := REPEAT AOT_MODULES, \
     STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
 ))
 
@@ -318,7 +405,7 @@
       special:make:all \
     )
   ) \
-  $(if $(filter hotspot-internal failure-handler, $1), \
+  $(if $(filter failure-handler, $1), \
     special:$(strip $1) \
   )
 endef
@@ -407,7 +494,14 @@
     $1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
   endif
 
-  run-test-$1: $(TEST_PREREQS)
+  ifneq ($$(GTEST_AOT_MODULES), )
+    $$(eval $$(call SetupAot, $1, \
+        MODULES := $$(GTEST_AOT_MODULES), \
+        VM_OPTIONS := $$(GTEST_VM_OPTIONS) $$(GTEST_JAVA_OPTIONS), \
+    ))
+  endif
+
+  run-test-$1: $$($1_AOT_TARGETS)
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
@@ -416,7 +510,7 @@
 	        -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
 	        --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
 	        $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
-	        $$($1_GTEST_JAVA_OPTIONS) \
+	        $$(GTEST_JAVA_OPTIONS) $$($1_AOT_OPTIONS) \
 	        > >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \
 	    && $$(ECHO) $$$$? > $$($1_EXITCODE) \
 	    || $$(ECHO) $$$$? > $$($1_EXITCODE) \
@@ -600,10 +694,21 @@
     endif
   endif
 
+  ifneq ($$(JTREG_AOT_MODULES), )
+    $$(eval $$(call SetupAot, $1, \
+        MODULES := $$(JTREG_AOT_MODULES), \
+        VM_OPTIONS := $$(JTREG_VM_OPTIONS) $$(JTREG_JAVA_OPTIONS), \
+    ))
+  endif
+
+  ifneq ($$($1_AOT_OPTIONS), )
+    $1_JTREG_BASIC_OPTIONS += -vmoptions:"$$($1_AOT_OPTIONS)"
+  endif
+
   clean-workdir-$1:
 	$$(RM) -r $$($1_TEST_SUPPORT_DIR)
 
-  run-test-$1: clean-workdir-$1 $(TEST_PREREQS)
+  run-test-$1: clean-workdir-$1 $$($1_AOT_TARGETS)
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
@@ -674,11 +779,7 @@
     $1_TEST_ARGS :=
   endif
 
-  ifeq ($$($1_TEST_NAME), hotspot-internal)
-    $1_TEST_COMMAND_LINE := \
-        $$(JDK_IMAGE_DIR)/bin/java -XX:+ExecuteInternalVMTests \
-        -XX:+ShowMessageBoxOnError -version
-  else ifeq ($$($1_TEST_NAME), failure-handler)
+  ifeq ($$($1_TEST_NAME), failure-handler)
     ifeq ($(BUILD_FAILURE_HANDLER), true)
       $1_TEST_COMMAND_LINE := \
           ($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f \
--- a/make/RunTestsPrebuilt.gmk	Mon Nov 05 19:00:34 2018 -0500
+++ b/make/RunTestsPrebuilt.gmk	Mon Nov 05 19:05:15 2018 -0500
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 2018, 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
@@ -95,12 +95,12 @@
 # $1: The output file name
 # $2..$N: The lines to output to the file
 define CreateNewSpec
-  $(if $(strip $(26)), \
+  $(if $(strip $(30)), \
     $(error Internal makefile error: \
       Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
   ) \
   $(shell $(RM) $1) \
-  $(foreach i, $(call sequence, 2, 25), \
+  $(foreach i, $(call sequence, 2, 29), \
     $(if $(strip $($i)), \
       $(call AppendFile, $(strip $($i)), $1) \
     ) \
@@ -235,6 +235,34 @@
   NUM_CORES := 1
 endif
 
+# Setup LD for AOT support
+ifneq ($(DEVKIT_HOME), )
+  ifeq ($(OPENJDK_TARGET_OS), windows)
+    LD := $(DEVKIT_HOME)/VC/bin/x64/link
+    LIBRARY_PREFIX :=
+    SHARED_LIBRARY_SUFFIX := .dll
+    EXE_SUFFIX := .exe
+  else ifeq ($(OPENJDK_TARGET_OS), linux)
+    LD := $(DEVKIT_HOME)/bin/ld
+    LIBRARY_PREFIX := lib
+    SHARED_LIBRARY_SUFFIX := .so
+    EXE_SUFFIX :=
+  else ifeq ($(OPENJDK_TARGET_OS), macosx)
+    LD := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
+    LIBRARY_PREFIX := lib
+    SHARED_LIBRARY_SUFFIX := .dylib
+    EXE_SUFFIX :=
+  else ifeq ($(OPENJDK_TARGET_OS), solaris)
+    # Prefer system linker for AOT on Solaris.
+    LD := ld
+    LIBRARY_PREFIX := lib
+    SHARED_LIBRARY_SUFFIX := .so
+    EXE_SUFFIX :=
+  endif
+else
+  LD := ld
+endif
+
 ################################################################################
 # Generate the ephemeral spec file
 ################################################################################
@@ -270,6 +298,10 @@
     OPENJDK_TARGET_CPU_BITS := $(OPENJDK_TARGET_CPU_BITS), \
     OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
     NUM_CORES := $(NUM_CORES), \
+    LD := $(LD), \
+    LIBRARY_PREFIX := $(LIBRARY_PREFIX), \
+    SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \
+    EXE_SUFFIX := $(EXE_SUFFIX), \
     include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
     $(CUSTOM_NEW_SPEC_LINE), \
 )
--- a/make/RunTestsPrebuiltSpec.gmk	Mon Nov 05 19:00:34 2018 -0500
+++ b/make/RunTestsPrebuiltSpec.gmk	Mon Nov 05 19:05:15 2018 -0500
@@ -186,3 +186,7 @@
 ifeq ($(OPENJDK_BUILD_OS), windows)
   CYGPATH := cygpath
 endif
+
+################################################################################
+# Simple macros from spec.gmk.in
+SHARED_LIBRARY=$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX)
--- a/make/common/FindTests.gmk	Mon Nov 05 19:00:34 2018 -0500
+++ b/make/common/FindTests.gmk	Mon Nov 05 19:05:15 2018 -0500
@@ -79,7 +79,7 @@
 ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
 
 # Add special tests
-ALL_NAMED_TESTS += hotspot-internal failure-handler make
+ALL_NAMED_TESTS += failure-handler make
 
 ################################################################################
 
--- a/make/conf/jib-profiles.js	Mon Nov 05 19:00:34 2018 -0500
+++ b/make/conf/jib-profiles.js	Mon Nov 05 19:05:15 2018 -0500
@@ -201,10 +201,15 @@
     data.configuration_make_arg = "CONF_NAME=";
 
     // Exclude list to use when Jib creates a source bundle
-    data.src_bundle_excludes = "./build .build webrev* */webrev* */*/webrev* */*/*/webrev* .hg */.hg */*/.hg */*/*/.hg";
+    data.src_bundle_excludes = [
+        "build", "{,**/}webrev*", "{,**/}.hg", "{,**/}JTwork", "{,**/}JTreport",
+        "{,**/}.git"
+    ];
     // Include list to use when creating a minimal jib source bundle which
     // contains just the jib configuration files.
-    data.conf_bundle_includes = "*/conf/jib-profiles.* make/autoconf/version-numbers"
+    data.conf_bundle_includes = [
+        "make/autoconf/version-numbers",
+    ];
 
     // Define some common values
     var common = getJibProfilesCommon(input, data);
@@ -709,7 +714,8 @@
         "run-test-prebuilt": {
             target_os: input.build_os,
             target_cpu: input.build_cpu,
-            dependencies: [ "jtreg", "gnumake", "boot_jdk", "jib", testedProfile + ".jdk",
+            dependencies: [
+                "jtreg", "gnumake", "boot_jdk", "devkit", "jib", testedProfile + ".jdk",
                 testedProfile + ".test"
             ],
             src: "src.conf",
@@ -743,7 +749,6 @@
     // This gives us a guaranteed working version of lldb for the jtreg failure handler.
     if (input.build_os == "macosx") {
         macosxRunTestExtra = {
-            dependencies: [ "devkit" ],
             environment_path: input.get("devkit", "install_path")
                 + "/Xcode.app/Contents/Developer/usr/bin"
         };
@@ -836,7 +841,10 @@
             organization: common.organization,
             ext: "tar.gz",
             module: "devkit-" + devkit_platform,
-            revision: devkit_platform_revisions[devkit_platform]
+            revision: devkit_platform_revisions[devkit_platform],
+            environment: {
+                "DEVKIT_HOME": input.get("devkit", "home_path"),
+            }
         },
 
         build_devkit: {
@@ -937,14 +945,6 @@
         },
     };
 
-    // Need to add a value for the Visual Studio tools variable to make
-    // jaot be able to pick up the Visual Studio linker in testing.
-    if (input.target_os == "windows") {
-        dependencies.devkit.environment = {
-            VS120COMNTOOLS: input.get("devkit", "install_path") + "/Common7/Tools"
-        };
-    }
-
     return dependencies;
 };
 
--- a/src/hotspot/cpu/aarch64/aarch64.ad	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/cpu/aarch64/aarch64.ad	Mon Nov 05 19:05:15 2018 -0500
@@ -1036,7 +1036,7 @@
   }
 };
 
-  bool is_CAS(int opcode);
+ bool is_CAS(int opcode, bool maybe_volatile);
 
   // predicates controlling emit of ldr<x>/ldar<x> and associated dmb
 
@@ -1259,12 +1259,12 @@
   // relevant dmb instructions.
   //
 
-  // is_CAS(int opcode)
+  // is_CAS(int opcode, bool maybe_volatile)
   //
   // return true if opcode is one of the possible CompareAndSwapX
   // values otherwise false.
 
-  bool is_CAS(int opcode)
+  bool is_CAS(int opcode, bool maybe_volatile)
   {
     switch(opcode) {
       // We handle these
@@ -1272,23 +1272,28 @@
     case Op_CompareAndSwapL:
     case Op_CompareAndSwapP:
     case Op_CompareAndSwapN:
- // case Op_CompareAndSwapB:
- // case Op_CompareAndSwapS:
+    case Op_CompareAndSwapB:
+    case Op_CompareAndSwapS:
+    case Op_GetAndSetI:
+    case Op_GetAndSetL:
+    case Op_GetAndSetP:
+    case Op_GetAndSetN:
+    case Op_GetAndAddI:
+    case Op_GetAndAddL:
       return true;
-      // These are TBD
+    case Op_CompareAndExchangeI:
+    case Op_CompareAndExchangeN:
+    case Op_CompareAndExchangeB:
+    case Op_CompareAndExchangeS:
+    case Op_CompareAndExchangeL:
+    case Op_CompareAndExchangeP:
     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;
+      return maybe_volatile;
     default:
       return false;
     }
@@ -1318,7 +1323,7 @@
   if (mb->trailing_load_store()) {
     Node* load_store = mb->in(MemBarNode::Precedent);
     assert(load_store->is_LoadStore(), "unexpected graph shape");
-    return is_CAS(load_store->Opcode());
+    return is_CAS(load_store->Opcode(), true);
   }
 
   return false;
@@ -1365,7 +1370,7 @@
     } else {
       assert(mem->is_LoadStore(), "");
       assert(trailing_mb->Opcode() == Op_MemBarAcquire, "");
-      return is_CAS(mem->Opcode());
+      return is_CAS(mem->Opcode(), true);
     }
   }
   return false;
@@ -1416,13 +1421,17 @@
 
 bool needs_acquiring_load_exclusive(const Node *n)
 {
-  assert(is_CAS(n->Opcode()), "expecting a compare and swap");
+  assert(is_CAS(n->Opcode(), true), "expecting a compare and swap");
   if (UseBarriersForVolatile) {
     return false;
   }
 
   LoadStoreNode* ldst = n->as_LoadStore();
-  assert(ldst->trailing_membar() != NULL, "expected trailing membar");
+  if (is_CAS(n->Opcode(), false)) {
+    assert(ldst->trailing_membar() != NULL, "expected trailing membar");
+  } else {
+    return ldst->trailing_membar() != NULL;
+  }
 
   // so we can just return true here
   return true;
@@ -2943,6 +2952,21 @@
                /*weak*/ false, noreg);
   %}
 
+  enc_class aarch64_enc_cmpxchgs_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::halfword, /*acquire*/ true, /*release*/ true,
+               /*weak*/ false, noreg);
+  %}
+
+  enc_class aarch64_enc_cmpxchgb_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::byte, /*acquire*/ true, /*release*/ true,
+               /*weak*/ false, noreg);
+  %}
 
   // auxiliary used for CompareAndSwapX to set result register
   enc_class aarch64_enc_cset_eq(iRegINoSp res) %{
@@ -8240,6 +8264,44 @@
 
 // alternative CompareAndSwapX when we are eliding barriers
 
+instruct compareAndSwapBAcq(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval, rFlagsReg cr) %{
+
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (CompareAndSwapB mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+
+  effect(KILL cr);
+
+  format %{
+    "cmpxchgb_acq $mem, $oldval, $newval\t# (int) if $mem == $oldval then $mem <-- $newval"
+    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+
+  ins_encode(aarch64_enc_cmpxchgb_acq(mem, oldval, newval),
+            aarch64_enc_cset_eq(res));
+
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndSwapSAcq(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval, rFlagsReg cr) %{
+
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (CompareAndSwapS mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+
+  effect(KILL cr);
+
+  format %{
+    "cmpxchgs_acq $mem, $oldval, $newval\t# (int) if $mem == $oldval then $mem <-- $newval"
+    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+
+  ins_encode(aarch64_enc_cmpxchgs_acq(mem, oldval, newval),
+            aarch64_enc_cset_eq(res));
+
+  ins_pipe(pipe_slow);
+%}
+
 instruct compareAndSwapIAcq(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval, rFlagsReg cr) %{
 
   predicate(needs_acquiring_load_exclusive(n));
@@ -8338,11 +8400,10 @@
   ins_cost(2 * VOLATILE_REF_COST);
   effect(TEMP_DEF res, 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,
+    "cmpxchgb $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
                Assembler::byte, /*acquire*/ false, /*release*/ true,
                /*weak*/ false, $res$$Register);
     __ sxtbw($res$$Register, $res$$Register);
@@ -8355,11 +8416,10 @@
   ins_cost(2 * VOLATILE_REF_COST);
   effect(TEMP_DEF res, 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,
+    "cmpxchgs $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
                Assembler::halfword, /*acquire*/ false, /*release*/ true,
                /*weak*/ false, $res$$Register);
     __ sxthw($res$$Register, $res$$Register);
@@ -8372,7 +8432,7 @@
   ins_cost(2 * VOLATILE_REF_COST);
   effect(TEMP_DEF res, KILL cr);
   format %{
-    "cmpxchg $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval"
+    "cmpxchgw $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval"
   %}
   ins_encode %{
     __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
@@ -8402,7 +8462,7 @@
   ins_cost(2 * VOLATILE_REF_COST);
   effect(TEMP_DEF res, KILL cr);
   format %{
-    "cmpxchg $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval"
+    "cmpxchgw $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval"
   %}
   ins_encode %{
     __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
@@ -8427,17 +8487,116 @@
   ins_pipe(pipe_slow);
 %}
 
+instruct compareAndExchangeBAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (CompareAndExchangeB mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(TEMP_DEF res, KILL cr);
+  format %{
+    "cmpxchgb_acq $res = $mem, $oldval, $newval\t# (byte, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::byte, /*acquire*/ true, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+    __ sxtbw($res$$Register, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndExchangeSAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (CompareAndExchangeS mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(TEMP_DEF res, KILL cr);
+  format %{
+    "cmpxchgs_acq $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval"
+  %}
+  ins_encode %{
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
+               Assembler::halfword, /*acquire*/ true, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+    __ sxthw($res$$Register, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+
+instruct compareAndExchangeIAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (CompareAndExchangeI mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(TEMP_DEF res, KILL cr);
+  format %{
+    "cmpxchgw_acq $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*/ true, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndExchangeLAcq(iRegLNoSp res, indirect mem, iRegL oldval, iRegL newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (CompareAndExchangeL mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(TEMP_DEF res, KILL cr);
+  format %{
+    "cmpxchg_acq $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*/ true, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+
+instruct compareAndExchangeNAcq(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (CompareAndExchangeN mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(TEMP_DEF res, KILL cr);
+  format %{
+    "cmpxchgw_acq $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*/ true, /*release*/ true,
+               /*weak*/ false, $res$$Register);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct compareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (CompareAndExchangeP mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(TEMP_DEF res, KILL cr);
+  format %{
+    "cmpxchg_acq $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*/ true, /*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"
+    "cmpxchgb $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,
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
                Assembler::byte, /*acquire*/ false, /*release*/ true,
                /*weak*/ true, noreg);
     __ csetw($res$$Register, Assembler::EQ);
@@ -8450,12 +8609,11 @@
   ins_cost(2 * VOLATILE_REF_COST);
   effect(KILL cr);
   format %{
-    "cmpxchg $res = $mem, $oldval, $newval\t# (short, weak) if $mem == $oldval then $mem <-- $newval"
+    "cmpxchgs $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,
+    __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register,
                Assembler::halfword, /*acquire*/ false, /*release*/ true,
                /*weak*/ true, noreg);
     __ csetw($res$$Register, Assembler::EQ);
@@ -8468,7 +8626,7 @@
   ins_cost(2 * VOLATILE_REF_COST);
   effect(KILL cr);
   format %{
-    "cmpxchg $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval"
+    "cmpxchgw $res = $mem, $oldval, $newval\t# (int, weak) if $mem == $oldval then $mem <-- $newval"
     "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
   %}
   ins_encode %{
@@ -8502,7 +8660,7 @@
   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"
+    "cmpxchgw $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval"
     "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
   %}
   ins_encode %{
@@ -8531,11 +8689,120 @@
   ins_pipe(pipe_slow);
 %}
 
+instruct weakCompareAndSwapBAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (WeakCompareAndSwapB mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchgb_acq $res = $mem, $oldval, $newval\t# (byte, 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::byte, /*acquire*/ true, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapSAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (WeakCompareAndSwapS mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchgs_acq $res = $mem, $oldval, $newval\t# (short, 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::halfword, /*acquire*/ true, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapIAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (WeakCompareAndSwapI mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchgw_acq $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*/ true, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapLAcq(iRegINoSp res, indirect mem, iRegL oldval, iRegL newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (WeakCompareAndSwapL mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg_acq $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*/ true, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (WeakCompareAndSwapN mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchgw_acq $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*/ true, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
+instruct weakCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set res (WeakCompareAndSwapP mem (Binary oldval newval)));
+  ins_cost(VOLATILE_REF_COST);
+  effect(KILL cr);
+  format %{
+    "cmpxchg_acq $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*/ true, /*release*/ true,
+               /*weak*/ true, noreg);
+    __ csetw($res$$Register, Assembler::EQ);
+  %}
+  ins_pipe(pipe_slow);
+%}
+
 // END This section of the file is automatically generated. Do not edit --------------
 // ---------------------------------------------------------------------
 
 instruct get_and_setI(indirect mem, iRegI newv, iRegINoSp prev) %{
   match(Set prev (GetAndSetI mem newv));
+  ins_cost(2 * VOLATILE_REF_COST);
   format %{ "atomic_xchgw  $prev, $newv, [$mem]" %}
   ins_encode %{
     __ atomic_xchgw($prev$$Register, $newv$$Register, as_Register($mem$$base));
@@ -8545,6 +8812,7 @@
 
 instruct get_and_setL(indirect mem, iRegL newv, iRegLNoSp prev) %{
   match(Set prev (GetAndSetL mem newv));
+  ins_cost(2 * VOLATILE_REF_COST);
   format %{ "atomic_xchg  $prev, $newv, [$mem]" %}
   ins_encode %{
     __ atomic_xchg($prev$$Register, $newv$$Register, as_Register($mem$$base));
@@ -8554,6 +8822,7 @@
 
 instruct get_and_setN(indirect mem, iRegN newv, iRegINoSp prev) %{
   match(Set prev (GetAndSetN mem newv));
+  ins_cost(2 * VOLATILE_REF_COST);
   format %{ "atomic_xchgw $prev, $newv, [$mem]" %}
   ins_encode %{
     __ atomic_xchgw($prev$$Register, $newv$$Register, as_Register($mem$$base));
@@ -8563,6 +8832,7 @@
 
 instruct get_and_setP(indirect mem, iRegP newv, iRegPNoSp prev) %{
   match(Set prev (GetAndSetP mem newv));
+  ins_cost(2 * VOLATILE_REF_COST);
   format %{ "atomic_xchg  $prev, $newv, [$mem]" %}
   ins_encode %{
     __ atomic_xchg($prev$$Register, $newv$$Register, as_Register($mem$$base));
@@ -8570,10 +8840,54 @@
   ins_pipe(pipe_serial);
 %}
 
+instruct get_and_setIAcq(indirect mem, iRegI newv, iRegINoSp prev) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set prev (GetAndSetI mem newv));
+  ins_cost(VOLATILE_REF_COST);
+  format %{ "atomic_xchgw_acq  $prev, $newv, [$mem]" %}
+  ins_encode %{
+    __ atomic_xchgalw($prev$$Register, $newv$$Register, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_setLAcq(indirect mem, iRegL newv, iRegLNoSp prev) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set prev (GetAndSetL mem newv));
+  ins_cost(VOLATILE_REF_COST);
+  format %{ "atomic_xchg_acq  $prev, $newv, [$mem]" %}
+  ins_encode %{
+    __ atomic_xchgal($prev$$Register, $newv$$Register, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_setNAcq(indirect mem, iRegN newv, iRegINoSp prev) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set prev (GetAndSetN mem newv));
+  ins_cost(VOLATILE_REF_COST);
+  format %{ "atomic_xchgw_acq $prev, $newv, [$mem]" %}
+  ins_encode %{
+    __ atomic_xchgalw($prev$$Register, $newv$$Register, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_setPAcq(indirect mem, iRegP newv, iRegPNoSp prev) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set prev (GetAndSetP mem newv));
+  ins_cost(VOLATILE_REF_COST);
+  format %{ "atomic_xchg_acq  $prev, $newv, [$mem]" %}
+  ins_encode %{
+    __ atomic_xchgal($prev$$Register, $newv$$Register, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
 
 instruct get_and_addL(indirect mem, iRegLNoSp newval, iRegL incr) %{
   match(Set newval (GetAndAddL mem incr));
-  ins_cost(INSN_COST * 10);
+  ins_cost(2 * VOLATILE_REF_COST + 1);
   format %{ "get_and_addL $newval, [$mem], $incr" %}
   ins_encode %{
     __ atomic_add($newval$$Register, $incr$$Register, as_Register($mem$$base));
@@ -8584,7 +8898,7 @@
 instruct get_and_addL_no_res(indirect mem, Universe dummy, iRegL incr) %{
   predicate(n->as_LoadStore()->result_not_used());
   match(Set dummy (GetAndAddL mem incr));
-  ins_cost(INSN_COST * 9);
+  ins_cost(2 * VOLATILE_REF_COST);
   format %{ "get_and_addL [$mem], $incr" %}
   ins_encode %{
     __ atomic_add(noreg, $incr$$Register, as_Register($mem$$base));
@@ -8594,7 +8908,7 @@
 
 instruct get_and_addLi(indirect mem, iRegLNoSp newval, immLAddSub incr) %{
   match(Set newval (GetAndAddL mem incr));
-  ins_cost(INSN_COST * 10);
+  ins_cost(2 * VOLATILE_REF_COST + 1);
   format %{ "get_and_addL $newval, [$mem], $incr" %}
   ins_encode %{
     __ atomic_add($newval$$Register, $incr$$constant, as_Register($mem$$base));
@@ -8605,7 +8919,7 @@
 instruct get_and_addLi_no_res(indirect mem, Universe dummy, immLAddSub incr) %{
   predicate(n->as_LoadStore()->result_not_used());
   match(Set dummy (GetAndAddL mem incr));
-  ins_cost(INSN_COST * 9);
+  ins_cost(2 * VOLATILE_REF_COST);
   format %{ "get_and_addL [$mem], $incr" %}
   ins_encode %{
     __ atomic_add(noreg, $incr$$constant, as_Register($mem$$base));
@@ -8615,7 +8929,7 @@
 
 instruct get_and_addI(indirect mem, iRegINoSp newval, iRegIorL2I incr) %{
   match(Set newval (GetAndAddI mem incr));
-  ins_cost(INSN_COST * 10);
+  ins_cost(2 * VOLATILE_REF_COST + 1);
   format %{ "get_and_addI $newval, [$mem], $incr" %}
   ins_encode %{
     __ atomic_addw($newval$$Register, $incr$$Register, as_Register($mem$$base));
@@ -8626,7 +8940,7 @@
 instruct get_and_addI_no_res(indirect mem, Universe dummy, iRegIorL2I incr) %{
   predicate(n->as_LoadStore()->result_not_used());
   match(Set dummy (GetAndAddI mem incr));
-  ins_cost(INSN_COST * 9);
+  ins_cost(2 * VOLATILE_REF_COST);
   format %{ "get_and_addI [$mem], $incr" %}
   ins_encode %{
     __ atomic_addw(noreg, $incr$$Register, as_Register($mem$$base));
@@ -8636,7 +8950,7 @@
 
 instruct get_and_addIi(indirect mem, iRegINoSp newval, immIAddSub incr) %{
   match(Set newval (GetAndAddI mem incr));
-  ins_cost(INSN_COST * 10);
+  ins_cost(2 * VOLATILE_REF_COST + 1);
   format %{ "get_and_addI $newval, [$mem], $incr" %}
   ins_encode %{
     __ atomic_addw($newval$$Register, $incr$$constant, as_Register($mem$$base));
@@ -8647,7 +8961,7 @@
 instruct get_and_addIi_no_res(indirect mem, Universe dummy, immIAddSub incr) %{
   predicate(n->as_LoadStore()->result_not_used());
   match(Set dummy (GetAndAddI mem incr));
-  ins_cost(INSN_COST * 9);
+  ins_cost(2 * VOLATILE_REF_COST);
   format %{ "get_and_addI [$mem], $incr" %}
   ins_encode %{
     __ atomic_addw(noreg, $incr$$constant, as_Register($mem$$base));
@@ -8655,6 +8969,94 @@
   ins_pipe(pipe_serial);
 %}
 
+instruct get_and_addLAcq(indirect mem, iRegLNoSp newval, iRegL incr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set newval (GetAndAddL mem incr));
+  ins_cost(VOLATILE_REF_COST + 1);
+  format %{ "get_and_addL_acq $newval, [$mem], $incr" %}
+  ins_encode %{
+    __ atomic_addal($newval$$Register, $incr$$Register, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_addL_no_resAcq(indirect mem, Universe dummy, iRegL incr) %{
+  predicate(n->as_LoadStore()->result_not_used() && needs_acquiring_load_exclusive(n));
+  match(Set dummy (GetAndAddL mem incr));
+  ins_cost(VOLATILE_REF_COST);
+  format %{ "get_and_addL_acq [$mem], $incr" %}
+  ins_encode %{
+    __ atomic_addal(noreg, $incr$$Register, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_addLiAcq(indirect mem, iRegLNoSp newval, immLAddSub incr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set newval (GetAndAddL mem incr));
+  ins_cost(VOLATILE_REF_COST + 1);
+  format %{ "get_and_addL_acq $newval, [$mem], $incr" %}
+  ins_encode %{
+    __ atomic_addal($newval$$Register, $incr$$constant, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_addLi_no_resAcq(indirect mem, Universe dummy, immLAddSub incr) %{
+  predicate(n->as_LoadStore()->result_not_used() && needs_acquiring_load_exclusive(n));
+  match(Set dummy (GetAndAddL mem incr));
+  ins_cost(VOLATILE_REF_COST);
+  format %{ "get_and_addL_acq [$mem], $incr" %}
+  ins_encode %{
+    __ atomic_addal(noreg, $incr$$constant, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_addIAcq(indirect mem, iRegINoSp newval, iRegIorL2I incr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set newval (GetAndAddI mem incr));
+  ins_cost(VOLATILE_REF_COST + 1);
+  format %{ "get_and_addI_acq $newval, [$mem], $incr" %}
+  ins_encode %{
+    __ atomic_addalw($newval$$Register, $incr$$Register, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_addI_no_resAcq(indirect mem, Universe dummy, iRegIorL2I incr) %{
+  predicate(n->as_LoadStore()->result_not_used() && needs_acquiring_load_exclusive(n));
+  match(Set dummy (GetAndAddI mem incr));
+  ins_cost(VOLATILE_REF_COST);
+  format %{ "get_and_addI_acq [$mem], $incr" %}
+  ins_encode %{
+    __ atomic_addalw(noreg, $incr$$Register, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_addIiAcq(indirect mem, iRegINoSp newval, immIAddSub incr) %{
+  predicate(needs_acquiring_load_exclusive(n));
+  match(Set newval (GetAndAddI mem incr));
+  ins_cost(VOLATILE_REF_COST + 1);
+  format %{ "get_and_addI_acq $newval, [$mem], $incr" %}
+  ins_encode %{
+    __ atomic_addalw($newval$$Register, $incr$$constant, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
+instruct get_and_addIi_no_resAcq(indirect mem, Universe dummy, immIAddSub incr) %{
+  predicate(n->as_LoadStore()->result_not_used() && needs_acquiring_load_exclusive(n));
+  match(Set dummy (GetAndAddI mem incr));
+  ins_cost(VOLATILE_REF_COST);
+  format %{ "get_and_addI_acq [$mem], $incr" %}
+  ins_encode %{
+    __ atomic_addalw(noreg, $incr$$constant, as_Register($mem$$base));
+  %}
+  ins_pipe(pipe_serial);
+%}
+
 // Manifest a CmpL result in an integer register.
 // (src1 < src2) ? -1 : ((src1 > src2) ? 1 : 0)
 instruct cmpL3_reg_reg(iRegINoSp dst, iRegL src1, iRegL src2, rFlagsReg flags)
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -2367,21 +2367,18 @@
                              bool weak,
                              Register result) {
   if (result == noreg)  result = rscratch1;
+  BLOCK_COMMENT("cmpxchg {");
   if (UseLSE) {
     mov(result, expected);
     lse_cas(result, new_val, addr, size, acquire, release, /*not_pair*/ true);
-    cmp(result, expected);
+    compare_eq(result, expected, size);
   } 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(result, addr, size, acquire);
-    if (size == xword)
-      cmp(result, expected);
-    else
-      cmpw(result, expected);
+    compare_eq(result, expected, size);
     br(Assembler::NE, done);
     store_exclusive(rscratch1, new_val, addr, size, release);
     if (weak) {
@@ -2390,9 +2387,27 @@
       cbnzw(rscratch1, retry_load);
     }
     bind(done);
-    BLOCK_COMMENT("} cmpxchg");
   }
-}
+  BLOCK_COMMENT("} cmpxchg");
+}
+
+// A generic comparison. Only compares for equality, clobbers rscratch1.
+void MacroAssembler::compare_eq(Register rm, Register rn, enum operand_size size) {
+  if (size == xword) {
+    cmp(rm, rn);
+  } else if (size == word) {
+    cmpw(rm, rn);
+  } else if (size == halfword) {
+    eorw(rscratch1, rm, rn);
+    ands(zr, rscratch1, 0xffff);
+  } else if (size == byte) {
+    eorw(rscratch1, rm, rn);
+    ands(zr, rscratch1, 0xff);
+  } else {
+    ShouldNotReachHere();
+  }
+}
+
 
 static bool different(Register a, RegisterOrConstant b, Register c) {
   if (b.is_constant())
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -1020,7 +1020,10 @@
                enum operand_size size,
                bool acquire, bool release, bool weak,
                Register result);
+private:
+  void compare_eq(Register rn, Register rm, enum operand_size size);
 
+public:
   // Calls
 
   address trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
--- a/src/hotspot/cpu/ppc/ppc.ad	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/cpu/ppc/ppc.ad	Mon Nov 05 19:05:15 2018 -0500
@@ -7629,7 +7629,7 @@
 
   format %{ "CMOVE   $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_reg(dst, crx, src, cmp) );
   ins_pipe(pipe_class_default);
 %}
@@ -7642,7 +7642,7 @@
 
   format %{ "CMOVE   $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_imm(dst, crx, src, cmp) );
   ins_pipe(pipe_class_default);
 %}
@@ -7675,7 +7675,7 @@
 
   format %{ "CMOVE   $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_reg(dst, crx, src, cmp) );
   ins_pipe(pipe_class_default);
 %}
@@ -7688,7 +7688,7 @@
 
   format %{ "CMOVE   $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_imm(dst, crx, src, cmp) );
   ins_pipe(pipe_class_default);
 %}
@@ -7722,7 +7722,7 @@
 
   format %{ "CMOVE   $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_reg(dst, crx, src, cmp) );
   ins_pipe(pipe_class_default);
 %}
@@ -7735,7 +7735,7 @@
 
   format %{ "CMOVE   $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_imm(dst, crx, src, cmp) );
   ins_pipe(pipe_class_default);
 %}
@@ -7768,7 +7768,7 @@
 
   format %{ "CMOVE   $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_reg(dst, crx, src, cmp) );
   ins_pipe(pipe_class_default);
 %}
@@ -7781,7 +7781,7 @@
 
   format %{ "CMOVE   $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_imm(dst, crx, src, cmp) );
   ins_pipe(pipe_class_default);
 %}
@@ -7794,7 +7794,7 @@
 
   format %{ "CMOVEF  $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8));
   ins_encode %{
     // TODO: PPC port $archOpcode(ppc64Opcode_cmovef);
     Label done;
@@ -7816,7 +7816,7 @@
 
   format %{ "CMOVEF  $cmp, $crx, $dst, $src\n\t" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8));
   ins_encode %{
     // TODO: PPC port $archOpcode(ppc64Opcode_cmovef);
     Label done;
@@ -9277,7 +9277,7 @@
 
   format %{ "CMOVE   $dst, neg($src1), $crx" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8));
   ins_encode %{
     // TODO: PPC port $archOpcode(ppc64Opcode_cmove);
     Label done;
@@ -9340,7 +9340,7 @@
 
   format %{ "CMOVE   $dst, neg($src1), $crx" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8));
   ins_encode %{
     // TODO: PPC port $archOpcode(ppc64Opcode_cmove);
     Label done;
@@ -11114,7 +11114,7 @@
 
   format %{ "cmovI   $crx, $dst, $src" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8));
   ins_encode( enc_cmove_bso_stackSlotL(dst, crx, src) );
   ins_pipe(pipe_class_default);
 %}
@@ -11128,7 +11128,7 @@
 
   format %{ "cmovI   $crx, $dst, $src" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8));
   ins_encode( enc_cmove_bso_reg(dst, crx, src) );
   ins_pipe(pipe_class_default);
 %}
@@ -11383,7 +11383,7 @@
 
   format %{ "cmovL   $crx, $dst, $src" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_bso_stackSlotL(dst, crx, src) );
   ins_pipe(pipe_class_default);
 %}
@@ -11397,7 +11397,7 @@
 
   format %{ "cmovL   $crx, $dst, $src" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8);
+  size((false /* TODO: PPC PORT Compile::current()->do_hb_scheduling()*/ ? 12 : 8));
   ins_encode( enc_cmove_bso_reg(dst, crx, src) );
   ins_pipe(pipe_class_default);
 %}
@@ -11890,7 +11890,7 @@
 
   format %{ "cmovI   $crx, $dst, -1, 0, +1" %}
   // Worst case is branch + move + branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORTInsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 20 : 16);
+  size((false /* TODO: PPC PORTInsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 20 : 16));
   ins_encode %{
     // TODO: PPC port $archOpcode(ppc64Opcode_cmove);
     Label done;
@@ -12229,7 +12229,7 @@
 
   format %{ "cmov    $crx" %}
   // Worst case is branch + move + stop, no stop without scheduler.
-  size(false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 16 : 12);
+  size((false /* TODO: PPC PORT(InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 16 : 12));
   ins_encode %{
     // TODO: PPC port $archOpcode(ppc64Opcode_cmovecr);
     Label done;
--- a/src/hotspot/cpu/s390/s390.ad	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/cpu/s390/s390.ad	Mon Nov 05 19:05:15 2018 -0500
@@ -6480,7 +6480,7 @@
   match(DivModI dst1src1 src2);
   effect(KILL cr);
   ins_cost(2 * DEFAULT_COST + BRANCH_COST);
-  size(VM_Version::has_CompareBranch() ? 24 : 26);
+  size((VM_Version::has_CompareBranch() ? 24 : 26));
   format %{ "DIVMODI ($dst1src1, $dst2) $src2" %}
   ins_encode %{
     Register d1s1 = $dst1src1$$Register;
@@ -6513,7 +6513,7 @@
   match(Set dst (DivI src1 src2));
   effect(KILL tmp, KILL cr);
   ins_cost(2 * DEFAULT_COST + BRANCH_COST);
-  size(VM_Version::has_CompareBranch() ? 20 : 22);
+  size((VM_Version::has_CompareBranch() ? 20 : 22));
   format %{ "DIV_checked $dst, $src1,$src2\t # treats special case 0x80../-1" %}
   ins_encode %{
     Register a = $src1$$Register;
@@ -6564,7 +6564,7 @@
   match(DivModL dst1src1 src2);
   effect(KILL cr);
   ins_cost(2 * DEFAULT_COST + BRANCH_COST);
-  size(VM_Version::has_CompareBranch() ? 22 : 24);
+  size((VM_Version::has_CompareBranch() ? 22 : 24));
   format %{ "DIVMODL ($dst1src1, $dst2) $src2" %}
   ins_encode %{
     Register d1s1 = $dst1src1$$Register;
@@ -6594,7 +6594,7 @@
   match(Set dst (DivL dst src));
   effect(KILL tmp, KILL cr);
   ins_cost(2 * DEFAULT_COST + BRANCH_COST);
-  size(VM_Version::has_CompareBranch() ? 18 : 20);
+  size((VM_Version::has_CompareBranch() ? 18 : 20));
   format %{ "DIVG_checked  $dst, $src\t # long, treats special case 0x80../-1" %}
   ins_encode %{
     Register b = $src$$Register;
--- a/src/hotspot/os/linux/os_linux.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/os/linux/os_linux.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -5956,14 +5956,6 @@
 
 #ifndef PRODUCT
 
-#define test_log(...)              \
-  do {                             \
-    if (VerboseInternalVMTests) {  \
-      tty->print_cr(__VA_ARGS__);  \
-      tty->flush();                \
-    }                              \
-  } while (false)
-
 class TestReserveMemorySpecial : AllStatic {
  public:
   static void small_page_write(void* addr, size_t size) {
@@ -5980,8 +5972,6 @@
       return;
     }
 
-    test_log("test_reserve_memory_special_huge_tlbfs_only(" SIZE_FORMAT ")", size);
-
     char* addr = os::Linux::reserve_memory_special_huge_tlbfs_only(size, NULL, false);
 
     if (addr != NULL) {
@@ -6040,15 +6030,10 @@
     ::munmap(mapping1, mapping_size);
 
     // Case 1
-    test_log("%s, req_addr NULL:", __FUNCTION__);
-    test_log("size            align           result");
-
     for (int i = 0; i < num_sizes; i++) {
       const size_t size = sizes[i];
       for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) {
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, NULL, false);
-        test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " ->  " PTR_FORMAT " %s",
-                 size, alignment, p2i(p), (p != NULL ? "" : "(failed)"));
         if (p != NULL) {
           assert(is_aligned(p, alignment), "must be");
           small_page_write(p, size);
@@ -6058,17 +6043,11 @@
     }
 
     // Case 2
-    test_log("%s, req_addr non-NULL:", __FUNCTION__);
-    test_log("size            align           req_addr         result");
-
     for (int i = 0; i < num_sizes; i++) {
       const size_t size = sizes[i];
       for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) {
         char* const req_addr = align_up(mapping1, alignment);
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false);
-        test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " " PTR_FORMAT " ->  " PTR_FORMAT " %s",
-                 size, alignment, p2i(req_addr), p2i(p),
-                 ((p != NULL ? (p == req_addr ? "(exact match)" : "") : "(failed)")));
         if (p != NULL) {
           assert(p == req_addr, "must be");
           small_page_write(p, size);
@@ -6078,16 +6057,11 @@
     }
 
     // Case 3
-    test_log("%s, req_addr non-NULL with preexisting mapping:", __FUNCTION__);
-    test_log("size            align           req_addr         result");
-
     for (int i = 0; i < num_sizes; i++) {
       const size_t size = sizes[i];
       for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) {
         char* const req_addr = align_up(mapping2, alignment);
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false);
-        test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " " PTR_FORMAT " ->  " PTR_FORMAT " %s",
-                 size, alignment, p2i(req_addr), p2i(p), ((p != NULL ? "" : "(failed)")));
         // as the area around req_addr contains already existing mappings, the API should always
         // return NULL (as per contract, it cannot return another address)
         assert(p == NULL, "must be");
@@ -6112,8 +6086,6 @@
       return;
     }
 
-    test_log("test_reserve_memory_special_shm(" SIZE_FORMAT ", " SIZE_FORMAT ")", size, alignment);
-
     char* addr = os::Linux::reserve_memory_special_shm(size, alignment, NULL, false);
 
     if (addr != NULL) {
--- a/src/hotspot/os/windows/os_windows.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/os/windows/os_windows.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -5557,12 +5557,8 @@
 // that is reported is when the test tries to allocate at a particular location but gets a
 // different valid one. A NULL return value at this point is not considered an error but may
 // be legitimate.
-// If -XX:+VerboseInternalVMTests is enabled, print some explanatory messages.
 void TestReserveMemorySpecial_test() {
   if (!UseLargePages) {
-    if (VerboseInternalVMTests) {
-      tty->print("Skipping test because large pages are disabled");
-    }
     return;
   }
   // save current value of globals
@@ -5576,10 +5572,6 @@
   const size_t large_allocation_size = os::large_page_size() * 4;
   char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false);
   if (result == NULL) {
-    if (VerboseInternalVMTests) {
-      tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.",
-                          large_allocation_size);
-    }
   } else {
     os::release_memory_special(result, large_allocation_size);
 
@@ -5589,10 +5581,6 @@
     char* expected_location = result + os::large_page_size();
     char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false);
     if (actual_location == NULL) {
-      if (VerboseInternalVMTests) {
-        tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.",
-                            expected_location, large_allocation_size);
-      }
     } else {
       // release memory
       os::release_memory_special(actual_location, expected_allocation_size);
--- a/src/hotspot/share/classfile/javaClasses.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/classfile/javaClasses.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -3732,10 +3732,10 @@
 }
 #endif
 
-oop java_lang_invoke_CallSite::context(oop call_site) {
+oop java_lang_invoke_CallSite::context_no_keepalive(oop call_site) {
   assert(java_lang_invoke_CallSite::is_instance(call_site), "");
 
-  oop dep_oop = call_site->obj_field(_context_offset);
+  oop dep_oop = call_site->obj_field_access<AS_NO_KEEPALIVE>(_context_offset);
   return dep_oop;
 }
 
--- a/src/hotspot/share/classfile/javaClasses.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/classfile/javaClasses.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -1186,7 +1186,7 @@
   static void         set_target(          oop site, oop target);
   static void         set_target_volatile( oop site, oop target);
 
-  static oop              context(oop site);
+  static oop context_no_keepalive(oop site);
 
   // Testers
   static bool is_subclass(Klass* klass) {
--- a/src/hotspot/share/classfile/stringTable.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/classfile/stringTable.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -78,7 +78,6 @@
 
 // --------------------------------------------------------------------------
 StringTable* StringTable::_the_table = NULL;
-volatile bool StringTable::_shared_string_mapped = false;
 volatile bool StringTable::_alt_hash = false;
 
 static juint murmur_seed = 0;
@@ -871,7 +870,7 @@
   if (soc->writing()) {
     // Sanity. Make sure we don't use the shared table at dump time
     _shared_table.reset();
-  } else if (!_shared_string_mapped) {
+  } else if (!HeapShared::closed_archive_heap_region_mapped()) {
     _shared_table.reset();
   }
 }
--- a/src/hotspot/share/classfile/stringTable.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/classfile/stringTable.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -55,7 +55,6 @@
 
   // The string table
   static StringTable* _the_table;
-  static volatile bool _shared_string_mapped;
   static volatile bool _alt_hash;
 
 private:
@@ -166,8 +165,6 @@
   static void copy_shared_string_table(CompactHashtableWriter* ch_table) NOT_CDS_JAVA_HEAP_RETURN;
  public:
   static oop create_archived_string(oop s, Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN_(NULL);
-  static void set_shared_string_mapped() { _shared_string_mapped = true; }
-  static bool shared_string_mapped()     { return _shared_string_mapped; }
   static void shared_oops_do(OopClosure* f) NOT_CDS_JAVA_HEAP_RETURN;
   static void write_to_archive() NOT_CDS_JAVA_HEAP_RETURN;
   static void serialize_shared_table_header(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
--- a/src/hotspot/share/code/codeCache.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/code/codeCache.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -145,6 +145,7 @@
 address CodeCache::_high_bound = 0;
 int CodeCache::_number_of_nmethods_with_dependencies = 0;
 nmethod* CodeCache::_scavenge_root_nmethods = NULL;
+ExceptionCache* volatile CodeCache::_exception_cache_purge_list = NULL;
 
 // Initialize arrays of CodeHeap subsets
 GrowableArray<CodeHeap*>* CodeCache::_heaps = new(ResourceObj::C_HEAP, mtCode) GrowableArray<CodeHeap*> (CodeBlobType::All, true);
@@ -895,6 +896,34 @@
 #endif
 }
 
+// Defer freeing of concurrently cleaned ExceptionCache entries until
+// after a global handshake operation.
+void CodeCache::release_exception_cache(ExceptionCache* entry) {
+  if (SafepointSynchronize::is_at_safepoint()) {
+    delete entry;
+  } else {
+    for (;;) {
+      ExceptionCache* purge_list_head = Atomic::load(&_exception_cache_purge_list);
+      entry->set_purge_list_next(purge_list_head);
+      if (Atomic::cmpxchg(entry, &_exception_cache_purge_list, purge_list_head) == purge_list_head) {
+        break;
+      }
+    }
+  }
+}
+
+// Delete exception caches that have been concurrently unlinked,
+// followed by a global handshake operation.
+void CodeCache::purge_exception_caches() {
+  ExceptionCache* curr = _exception_cache_purge_list;
+  while (curr != NULL) {
+    ExceptionCache* next = curr->purge_list_next();
+    delete curr;
+    curr = next;
+  }
+  _exception_cache_purge_list = NULL;
+}
+
 void CodeCache::gc_prologue() { }
 
 void CodeCache::gc_epilogue() {
--- a/src/hotspot/share/code/codeCache.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/code/codeCache.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -72,8 +72,9 @@
 // existing ones, make sure to adapt the dtrace scripts (jhelper.d) for
 // Solaris and BSD.
 
+class ExceptionCache;
+class KlassDepChange;
 class OopClosure;
-class KlassDepChange;
 
 class CodeCache : AllStatic {
   friend class VMStructs;
@@ -94,6 +95,8 @@
   static nmethod* _scavenge_root_nmethods;              // linked via nm->scavenge_root_link()
   static uint8_t _unloading_cycle;                      // Global state for recognizing old nmethods that need to be unloaded
 
+  static ExceptionCache* volatile _exception_cache_purge_list;
+
   static void mark_scavenge_root_nmethods() PRODUCT_RETURN;
   static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN;
 
@@ -192,6 +195,8 @@
   static uint16_t unloading_cycle() { return _unloading_cycle; }
   static void increment_unloading_cycle();
   static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN;
+  static void release_exception_cache(ExceptionCache* entry);
+  static void purge_exception_caches();
 
   // Apply f to every live code blob in scavengable nmethods. Prune nmethods
   // from the list of scavengable nmethods if f->fix_relocations() and a nmethod
--- a/src/hotspot/share/code/compiledMethod.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/code/compiledMethod.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -103,34 +103,84 @@
 
 //-----------------------------------------------------------------------------
 
+ExceptionCache* CompiledMethod::exception_cache_acquire() const {
+  return OrderAccess::load_acquire(&_exception_cache);
+}
+
 void CompiledMethod::add_exception_cache_entry(ExceptionCache* new_entry) {
   assert(ExceptionCache_lock->owned_by_self(),"Must hold the ExceptionCache_lock");
   assert(new_entry != NULL,"Must be non null");
   assert(new_entry->next() == NULL, "Must be null");
 
-  ExceptionCache *ec = exception_cache();
-  if (ec != NULL) {
-    new_entry->set_next(ec);
+  for (;;) {
+    ExceptionCache *ec = exception_cache();
+    if (ec != NULL) {
+      Klass* ex_klass = ec->exception_type();
+      if (!ex_klass->is_loader_alive()) {
+        // We must guarantee that entries are not inserted with new next pointer
+        // edges to ExceptionCache entries with dead klasses, due to bad interactions
+        // with concurrent ExceptionCache cleanup. Therefore, the inserts roll
+        // the head pointer forward to the first live ExceptionCache, so that the new
+        // next pointers always point at live ExceptionCaches, that are not removed due
+        // to concurrent ExceptionCache cleanup.
+        ExceptionCache* next = ec->next();
+        if (Atomic::cmpxchg(next, &_exception_cache, ec) == ec) {
+          CodeCache::release_exception_cache(ec);
+        }
+        continue;
+      }
+      ec = exception_cache();
+      if (ec != NULL) {
+        new_entry->set_next(ec);
+      }
+    }
+    if (Atomic::cmpxchg(new_entry, &_exception_cache, ec) == ec) {
+      return;
+    }
   }
-  release_set_exception_cache(new_entry);
 }
 
 void CompiledMethod::clean_exception_cache() {
+  // For each nmethod, only a single thread may call this cleanup function
+  // at the same time, whether called in STW cleanup or concurrent cleanup.
+  // Note that if the GC is processing exception cache cleaning in a concurrent phase,
+  // then a single writer may contend with cleaning up the head pointer to the
+  // first ExceptionCache node that has a Klass* that is alive. That is fine,
+  // as long as there is no concurrent cleanup of next pointers from concurrent writers.
+  // And the concurrent writers do not clean up next pointers, only the head.
+  // Also note that concurent readers will walk through Klass* pointers that are not
+  // alive. That does not cause ABA problems, because Klass* is deleted after
+  // a handshake with all threads, after all stale ExceptionCaches have been
+  // unlinked. That is also when the CodeCache::exception_cache_purge_list()
+  // is deleted, with all ExceptionCache entries that were cleaned concurrently.
+  // That similarly implies that CAS operations on ExceptionCache entries do not
+  // suffer from ABA problems as unlinking and deletion is separated by a global
+  // handshake operation.
   ExceptionCache* prev = NULL;
-  ExceptionCache* curr = exception_cache();
+  ExceptionCache* curr = exception_cache_acquire();
 
   while (curr != NULL) {
     ExceptionCache* next = curr->next();
 
-    Klass* ex_klass = curr->exception_type();
-    if (ex_klass != NULL && !ex_klass->is_loader_alive()) {
+    if (!curr->exception_type()->is_loader_alive()) {
       if (prev == NULL) {
-        set_exception_cache(next);
+        // Try to clean head; this is contended by concurrent inserts, that
+        // both lazily clean the head, and insert entries at the head. If
+        // the CAS fails, the operation is restarted.
+        if (Atomic::cmpxchg(next, &_exception_cache, curr) != curr) {
+          prev = NULL;
+          curr = exception_cache_acquire();
+          continue;
+        }
       } else {
+        // It is impossible to during cleanup connect the next pointer to
+        // an ExceptionCache that has not been published before a safepoint
+        // prior to the cleanup. Therefore, release is not required.
         prev->set_next(next);
       }
-      delete curr;
       // prev stays the same.
+
+      CodeCache::release_exception_cache(curr);
     } else {
       prev = curr;
     }
@@ -145,7 +195,7 @@
   // We never grab a lock to read the exception cache, so we may
   // have false negatives. This is okay, as it can only happen during
   // the first few exception lookups for a given nmethod.
-  ExceptionCache* ec = exception_cache();
+  ExceptionCache* ec = exception_cache_acquire();
   while (ec != NULL) {
     address ret_val;
     if ((ret_val = ec->match(exception,pc)) != NULL) {
@@ -172,13 +222,11 @@
   }
 }
 
-//-------------end of code for ExceptionCache--------------
-
 // private method for handling exception cache
 // These methods are private, and used to manipulate the exception cache
 // directly.
 ExceptionCache* CompiledMethod::exception_cache_entry_for_exception(Handle exception) {
-  ExceptionCache* ec = exception_cache();
+  ExceptionCache* ec = exception_cache_acquire();
   while (ec != NULL) {
     if (ec->match_exception_with_space(exception)) {
       return ec;
@@ -188,6 +236,8 @@
   return NULL;
 }
 
+//-------------end of code for ExceptionCache--------------
+
 bool CompiledMethod::is_at_poll_return(address pc) {
   RelocIterator iter(this, pc, pc+1);
   while (iter.next()) {
@@ -243,6 +293,20 @@
   // first few bytes.  If an oop in the old code was there, that oop
   // should not get GC'd.  Skip the first few bytes of oops on
   // not-entrant methods.
+  if (frame_complete_offset() != CodeOffsets::frame_never_safe &&
+      code_begin() + frame_complete_offset() >
+      verified_entry_point() + NativeJump::instruction_size)
+  {
+    // If we have a frame_complete_offset after the native jump, then there
+    // is no point trying to look for oops before that. This is a requirement
+    // for being allowed to scan oops concurrently.
+    return code_begin() + frame_complete_offset();
+  }
+
+  // It is not safe to read oops concurrently using entry barriers, if their
+  // location depend on whether the nmethod is entrant or not.
+  assert(BarrierSet::barrier_set()->barrier_set_nmethod() == NULL, "Not safe oop scan");
+
   address low_boundary = verified_entry_point();
   if (!is_in_use() && is_nmethod()) {
     low_boundary += NativeJump::instruction_size;
--- a/src/hotspot/share/code/compiledMethod.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/code/compiledMethod.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -48,7 +48,8 @@
   address  _pc[cache_size];
   address  _handler[cache_size];
   volatile int _count;
-  ExceptionCache* _next;
+  ExceptionCache* volatile _next;
+  ExceptionCache* _purge_list_next;
 
   inline address pc_at(int index);
   void set_pc_at(int index, address a)      { assert(index >= 0 && index < cache_size,""); _pc[index] = a; }
@@ -65,8 +66,10 @@
   ExceptionCache(Handle exception, address pc, address handler);
 
   Klass*    exception_type()                { return _exception_type; }
-  ExceptionCache* next()                    { return _next; }
-  void      set_next(ExceptionCache *ec)    { _next = ec; }
+  ExceptionCache* next();
+  void      set_next(ExceptionCache *ec);
+  ExceptionCache* purge_list_next()                 { return _purge_list_next; }
+  void      set_purge_list_next(ExceptionCache *ec) { _purge_list_next = ec; }
 
   address match(Handle exception, address pc);
   bool    match_exception_with_space(Handle exception) ;
@@ -293,11 +296,14 @@
   virtual Metadata** metadata_addr_at(int index) const = 0;
   virtual void    set_original_pc(const frame* fr, address pc) = 0;
 
+protected:
   // Exception cache support
-  // Note: _exception_cache may be read concurrently. We rely on memory_order_consume here.
+  // Note: _exception_cache may be read and cleaned concurrently.
   ExceptionCache* exception_cache() const         { return _exception_cache; }
+  ExceptionCache* exception_cache_acquire() const;
   void set_exception_cache(ExceptionCache *ec)    { _exception_cache = ec; }
-  void release_set_exception_cache(ExceptionCache *ec);
+
+public:
   address handler_for_exception_and_pc(Handle exception, address pc);
   void add_handler_for_exception_and_pc(Handle exception, address pc, address handler);
   void clean_exception_cache();
--- a/src/hotspot/share/code/compiledMethod.inline.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/code/compiledMethod.inline.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -41,10 +41,6 @@
     ;
 }
 
-inline void CompiledMethod::release_set_exception_cache(ExceptionCache *ec) {
-  OrderAccess::release_store(&_exception_cache, ec);
-}
-
 // -----------------------------------------------------------------------------
 // CompiledMethod::get_deopt_original_pc
 //
--- a/src/hotspot/share/code/nmethod.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/code/nmethod.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -42,6 +42,7 @@
 #include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/access.inline.hpp"
 #include "oops/method.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/oop.inline.hpp"
@@ -244,6 +245,7 @@
   _count = 0;
   _exception_type = exception->klass();
   _next = NULL;
+  _purge_list_next = NULL;
 
   add_address_and_handler(pc,handler);
 }
@@ -293,6 +295,14 @@
   return false;
 }
 
+ExceptionCache* ExceptionCache::next() {
+  return Atomic::load(&_next);
+}
+
+void ExceptionCache::set_next(ExceptionCache *ec) {
+  Atomic::store(ec, &_next);
+}
+
 //-----------------------------------------------------------------------------
 
 
@@ -1325,6 +1335,13 @@
   CodeCache::free(this);
 }
 
+oop nmethod::oop_at(int index) const {
+  if (index == 0) {
+    return NULL;
+  }
+  return NativeAccess<AS_NO_KEEPALIVE>::oop_load(oop_addr_at(index));
+}
+
 //
 // Notify all classes this nmethod is dependent on that it is no
 // longer dependent. This should only be called in two situations.
--- a/src/hotspot/share/code/nmethod.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/code/nmethod.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -365,7 +365,7 @@
 
   // Support for oops in scopes and relocs:
   // Note: index 0 is reserved for null.
-  oop   oop_at(int index) const                   { return index == 0 ? (oop) NULL: *oop_addr_at(index); }
+  oop   oop_at(int index) const;
   oop*  oop_addr_at(int index) const {  // for GC
     // relocation indexes are biased by 1 (because 0 is reserved)
     assert(index > 0 && index <= oops_count(), "must be a valid non-zero index");
--- a/src/hotspot/share/gc/shared/gc_globals.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/gc/shared/gc_globals.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -372,12 +372,6 @@
   develop(uintx, MetadataAllocationFailALotInterval, 1000,                  \
           "Metadata allocation failure a lot interval")                     \
                                                                             \
-  notproduct(bool, ExecuteInternalVMTests, false,                           \
-          "Enable execution of internal VM tests")                          \
-                                                                            \
-  notproduct(bool, VerboseInternalVMTests, false,                           \
-          "Turn on logging for internal VM tests.")                         \
-                                                                            \
   product(bool, ExecutingUnitTests, false,                                  \
           "Whether the JVM is running unit tests or not")                   \
                                                                             \
--- a/src/hotspot/share/gc/shared/oopStorage.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/gc/shared/oopStorage.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -31,6 +31,7 @@
 #include "runtime/atomic.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/handles.inline.hpp"
+#include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/mutex.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/orderAccess.hpp"
@@ -254,15 +255,15 @@
   return bitmask_for_index(get_index(ptr));
 }
 
-// A block is deletable if
-// (1) It is empty.
-// (2) There is not a release() operation currently operating on it.
-// (3) It is not in the deferred updates list.
-// The order of tests is important for proper interaction between release()
-// and concurrent deletion.
-bool OopStorage::Block::is_deletable() const {
-  return (OrderAccess::load_acquire(&_allocated_bitmask) == 0) &&
-         (OrderAccess::load_acquire(&_release_refcount) == 0) &&
+// An empty block is not yet deletable if either:
+// (1) There is a release() operation currently operating on it.
+// (2) It is in the deferred updates list.
+// For interaction with release(), these must follow the empty check,
+// and the order of these checks is important.
+bool OopStorage::Block::is_safe_to_delete() const {
+  assert(is_empty(), "precondition");
+  OrderAccess::loadload();
+  return (OrderAccess::load_acquire(&_release_refcount) == 0) &&
          (OrderAccess::load_acquire(&_deferred_updates_next) == NULL);
 }
 
@@ -373,7 +374,7 @@
 // kept at the end of the _allocation_list, to make it easy for empty block
 // deletion to find them.
 //
-// allocate(), and delete_empty_blocks_concurrent() lock the
+// allocate(), and delete_empty_blocks() lock the
 // _allocation_mutex while performing any list and array modifications.
 //
 // allocate() and release() update a block's _allocated_bitmask using CAS
@@ -386,7 +387,10 @@
 // removed from the _allocation_list so it won't be considered by future
 // allocations until some entries in it are released.
 //
-// release() is performed lock-free. release() first looks up the block for
+// release() is performed lock-free. (Note: This means it can't notify the
+// service thread of pending cleanup work.  It must be lock-free because
+// it is called in all kinds of contexts where even quite low ranked locks
+// may be held.)  release() first looks up the block for
 // the entry, using address alignment to find the enclosing block (thereby
 // avoiding iteration over the _active_array).  Once the block has been
 // determined, its _allocated_bitmask needs to be updated, and its position in
@@ -400,7 +404,7 @@
 // locking the _allocation_mutex.  To keep the release() operation lock-free,
 // rather than updating the _allocation_list itself, it instead performs a
 // lock-free push of the block onto the _deferred_updates list.  Entries on
-// that list are processed by allocate() and delete_empty_blocks_XXX(), while
+// that list are processed by allocate() and delete_empty_blocks(), while
 // they already hold the necessary lock.  That processing makes the block's
 // list state consistent with its current _allocated_bitmask.  The block is
 // added to the _allocation_list if not already present and the bitmask is not
@@ -409,54 +413,17 @@
 
 oop* OopStorage::allocate() {
   MutexLockerEx ml(_allocation_mutex, Mutex::_no_safepoint_check_flag);
-  // Do some deferred update processing every time we allocate.
-  // Continue processing deferred updates if _allocation_list is empty,
-  // in the hope that we'll get a block from that, rather than
-  // allocating a new block.
-  while (reduce_deferred_updates() && (_allocation_list.head() == NULL)) {}
 
-  // Use the first block in _allocation_list for the allocation.
-  Block* block = _allocation_list.head();
-  if (block == NULL) {
-    // No available blocks; make a new one, and add to storage.
-    {
-      MutexUnlockerEx mul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
-      block = Block::new_block(this);
-    }
-    if (block == NULL) {
-      while (_allocation_list.head() == NULL) {
-        if (!reduce_deferred_updates()) {
-          // Failed to make new block, no other thread made a block
-          // available while the mutex was released, and didn't get
-          // one from a deferred update either, so return failure.
-          log_debug(oopstorage, blocks)("%s: failed block allocation", name());
-          return NULL;
-        }
-      }
-    } else {
-      // Add new block to storage.
-      log_debug(oopstorage, blocks)("%s: new block " PTR_FORMAT, name(), p2i(block));
+  // Note: Without this we might never perform cleanup.  As it is,
+  // cleanup is only requested here, when completing a concurrent
+  // iteration, or when someone entirely else wakes up the service
+  // thread, which isn't ideal.  But we can't notify in release().
+  if (reduce_deferred_updates()) {
+    notify_needs_cleanup();
+  }
 
-      // Add new block to the _active_array, growing if needed.
-      if (!_active_array->push(block)) {
-        if (expand_active_array()) {
-          guarantee(_active_array->push(block), "push failed after expansion");
-        } else {
-          log_debug(oopstorage, blocks)("%s: failed active array expand", name());
-          Block::delete_block(*block);
-          return NULL;
-        }
-      }
-      // Add to end of _allocation_list.  The mutex release allowed
-      // other threads to add blocks to the _allocation_list.  We prefer
-      // to allocate from non-empty blocks, to allow empty blocks to
-      // be deleted.
-      _allocation_list.push_back(*block);
-    }
-    block = _allocation_list.head();
-  }
-  // Allocate from first block.
-  assert(block != NULL, "invariant");
+  Block* block = block_for_allocation();
+  if (block == NULL) return NULL; // Block allocation failed.
   assert(!block->is_full(), "invariant");
   if (block->is_empty()) {
     // Transitioning from empty to not empty.
@@ -476,6 +443,62 @@
   return result;
 }
 
+bool OopStorage::try_add_block() {
+  assert_lock_strong(_allocation_mutex);
+  Block* block;
+  {
+    MutexUnlockerEx ul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
+    block = Block::new_block(this);
+  }
+  if (block == NULL) return false;
+
+  // Add new block to the _active_array, growing if needed.
+  if (!_active_array->push(block)) {
+    if (expand_active_array()) {
+      guarantee(_active_array->push(block), "push failed after expansion");
+    } else {
+      log_debug(oopstorage, blocks)("%s: failed active array expand", name());
+      Block::delete_block(*block);
+      return false;
+    }
+  }
+  // Add to end of _allocation_list.  The mutex release allowed other
+  // threads to add blocks to the _allocation_list.  We prefer to
+  // allocate from non-empty blocks, to allow empty blocks to be
+  // deleted.  But we don't bother notifying about the empty block
+  // because we're (probably) about to allocate an entry from it.
+  _allocation_list.push_back(*block);
+  log_debug(oopstorage, blocks)("%s: new block " PTR_FORMAT, name(), p2i(block));
+  return true;
+}
+
+OopStorage::Block* OopStorage::block_for_allocation() {
+  assert_lock_strong(_allocation_mutex);
+
+  while (true) {
+    // Use the first block in _allocation_list for the allocation.
+    Block* block = _allocation_list.head();
+    if (block != NULL) {
+      return block;
+    } else if (reduce_deferred_updates()) {
+      MutexUnlockerEx ul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
+      notify_needs_cleanup();
+    } else if (try_add_block()) {
+      block = _allocation_list.head();
+      assert(block != NULL, "invariant");
+      return block;
+    } else if (reduce_deferred_updates()) { // Once more before failure.
+      MutexUnlockerEx ul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
+      notify_needs_cleanup();
+    } else {
+      // Attempt to add a block failed, no other thread added a block,
+      // and no deferred updated added a block, then allocation failed.
+      log_debug(oopstorage, blocks)("%s: failed block allocation", name());
+      return NULL;
+    }
+  }
+}
+
 // Create a new, larger, active array with the same content as the
 // current array, and then replace, relinquishing the old array.
 // Return true if the array was successfully expanded, false to
@@ -572,7 +595,7 @@
   }
 }
 
-void OopStorage::Block::release_entries(uintx releasing, Block* volatile* deferred_list) {
+void OopStorage::Block::release_entries(uintx releasing, OopStorage* owner) {
   assert(releasing != 0, "preconditon");
   // Prevent empty block deletion when transitioning to empty.
   Atomic::inc(&_release_refcount);
@@ -591,8 +614,8 @@
   // (updated bitmask is empty or old bitmask was full), atomically push
   // this block onto the deferred updates list.  Some future call to
   // reduce_deferred_updates will make any needed changes related to this
-  // block and _allocation_list.  This deferral avoids list updates and the
-  // associated locking here.
+  // block and _allocation_list.  This deferral avoids _allocation_list
+  // updates and the associated locking here.
   if ((releasing == old_allocated) || is_full_bitmask(old_allocated)) {
     // Log transitions.  Both transitions are possible in a single update.
     if (log_is_enabled(Debug, oopstorage, blocks)) {
@@ -605,13 +628,14 @@
     // anything further.
     if (Atomic::replace_if_null(this, &_deferred_updates_next)) {
       // Successfully claimed.  Push, with self-loop for end-of-list.
-      Block* head = *deferred_list;
+      Block* head = owner->_deferred_updates;
       while (true) {
         _deferred_updates_next = (head == NULL) ? this : head;
-        Block* fetched = Atomic::cmpxchg(this, deferred_list, head);
+        Block* fetched = Atomic::cmpxchg(this, &owner->_deferred_updates, head);
         if (fetched == head) break; // Successful update.
         head = fetched;             // Retry with updated head.
       }
+      owner->record_needs_cleanup();
       log_debug(oopstorage, blocks)("%s: deferred update " PTR_FORMAT,
                                     _owner->name(), p2i(this));
     }
@@ -622,7 +646,7 @@
 
 // Process one available deferred update.  Returns true if one was processed.
 bool OopStorage::reduce_deferred_updates() {
-  assert_locked_or_safepoint(_allocation_mutex);
+  assert_lock_strong(_allocation_mutex);
   // Atomically pop a block off the list, if any available.
   // No ABA issue because this is only called by one thread at a time.
   // The atomicity is wrto pushes by release().
@@ -641,7 +665,7 @@
   // ordering with release().  Without this, we may be processing a stale
   // bitmask state here while blocking a release() operation from recording
   // the deferred update needed for its bitmask change.
-  OrderAccess::storeload();
+  OrderAccess::fence();
   // Process popped block.
   uintx allocated = block->allocated_bitmask();
 
@@ -660,6 +684,7 @@
   if (is_empty_bitmask(allocated)) {
     _allocation_list.unlink(*block);
     _allocation_list.push_back(*block);
+    notify_needs_cleanup();
   }
 
   log_debug(oopstorage, blocks)("%s: processed deferred update " PTR_FORMAT,
@@ -677,7 +702,7 @@
   Block* block = find_block_or_null(ptr);
   assert(block != NULL, "%s: invalid release " PTR_FORMAT, name(), p2i(ptr));
   log_trace(oopstorage, ref)("%s: released " PTR_FORMAT, name(), p2i(ptr));
-  block->release_entries(block->bitmask_for_entry(ptr), &_deferred_updates);
+  block->release_entries(block->bitmask_for_entry(ptr), this);
   Atomic::dec(&_allocation_count);
 }
 
@@ -704,7 +729,7 @@
       ++count;
     }
     // Release the contiguous entries that are in block.
-    block->release_entries(releasing, &_deferred_updates);
+    block->release_entries(releasing, this);
     Atomic::sub(count, &_allocation_count);
   }
 }
@@ -715,6 +740,11 @@
   return dup;
 }
 
+// Possible values for OopStorage::_needs_cleanup.
+const uint needs_cleanup_none = 0;     // No cleanup needed.
+const uint needs_cleanup_marked = 1;   // Requested, but no notification made.
+const uint needs_cleanup_notified = 2; // Requested and Service thread notified.
+
 const size_t initial_active_array_size = 8;
 
 OopStorage::OopStorage(const char* name,
@@ -727,11 +757,14 @@
   _allocation_mutex(allocation_mutex),
   _active_mutex(active_mutex),
   _allocation_count(0),
-  _concurrent_iteration_count(0)
+  _concurrent_iteration_count(0),
+  _needs_cleanup(needs_cleanup_none)
 {
   _active_array->increment_refcount();
   assert(_active_mutex->rank() < _allocation_mutex->rank(),
          "%s: active_mutex must have lower rank than allocation_mutex", _name);
+  assert(Service_lock->rank() < _active_mutex->rank(),
+         "%s: active_mutex must have higher rank than Service_lock", _name);
   assert(_active_mutex->_safepoint_check_required != Mutex::_safepoint_check_always,
          "%s: active mutex requires safepoint check", _name);
   assert(_allocation_mutex->_safepoint_check_required != Mutex::_safepoint_check_always,
@@ -763,56 +796,82 @@
   FREE_C_HEAP_ARRAY(char, _name);
 }
 
-void OopStorage::delete_empty_blocks_safepoint() {
-  assert_at_safepoint();
-  // Process any pending release updates, which may make more empty
-  // blocks available for deletion.
-  while (reduce_deferred_updates()) {}
-  // Don't interfere with a concurrent iteration.
-  if (_concurrent_iteration_count > 0) return;
-  // Delete empty (and otherwise deletable) blocks from end of _allocation_list.
-  for (Block* block = _allocation_list.tail();
-       (block != NULL) && block->is_deletable();
-       block = _allocation_list.tail()) {
-    _active_array->remove(block);
-    _allocation_list.unlink(*block);
-    delete_empty_block(*block);
+// Called by service thread to check for pending work.
+bool OopStorage::needs_delete_empty_blocks() const {
+  return Atomic::load(&_needs_cleanup) != needs_cleanup_none;
+}
+
+// Record that cleanup is needed, without notifying the Service thread.
+// Used by release(), where we can't lock even Service_lock.
+void OopStorage::record_needs_cleanup() {
+  Atomic::cmpxchg(needs_cleanup_marked, &_needs_cleanup, needs_cleanup_none);
+}
+
+// Record that cleanup is needed, and notify the Service thread.
+void OopStorage::notify_needs_cleanup() {
+  // Avoid re-notification if already notified.
+  const uint notified = needs_cleanup_notified;
+  if (Atomic::xchg(notified, &_needs_cleanup) != notified) {
+    MonitorLockerEx ml(Service_lock, Monitor::_no_safepoint_check_flag);
+    ml.notify_all();
   }
 }
 
-void OopStorage::delete_empty_blocks_concurrent() {
+bool OopStorage::delete_empty_blocks() {
   MutexLockerEx ml(_allocation_mutex, Mutex::_no_safepoint_check_flag);
-  // Other threads could be adding to the empty block count while we
-  // release the mutex across the block deletions.  Set an upper bound
-  // on how many blocks we'll try to release, so other threads can't
-  // cause an unbounded stay in this function.
+
+  // Clear the request before processing.
+  Atomic::store(needs_cleanup_none, &_needs_cleanup);
+  OrderAccess::fence();
+
+  // Other threads could be adding to the empty block count or the
+  // deferred update list while we're working.  Set an upper bound on
+  // how many updates we'll process and blocks we'll try to release,
+  // so other threads can't cause an unbounded stay in this function.
   size_t limit = block_count();
+  if (limit == 0) return false; // Empty storage; nothing at all to do.
 
   for (size_t i = 0; i < limit; ++i) {
-    // Additional updates might become available while we dropped the
-    // lock.  But limit number processed to limit lock duration.
-    reduce_deferred_updates();
-
-    Block* block = _allocation_list.tail();
-    if ((block == NULL) || !block->is_deletable()) {
-      // No block to delete, so done.  There could be more pending
-      // deferred updates that could give us more work to do; deal with
-      // that in some later call, to limit lock duration here.
-      return;
-    }
+    // Process deferred updates, which might make empty blocks available.
+    // Continue checking once deletion starts, since additional updates
+    // might become available while we're working.
+    if (reduce_deferred_updates()) {
+      // Be safepoint-polite while looping.
+      MutexUnlockerEx ul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
+      ThreadBlockInVM tbiv(JavaThread::current());
+    } else {
+      Block* block = _allocation_list.tail();
+      if ((block == NULL) || !block->is_empty()) {
+        return false;
+      } else if (!block->is_safe_to_delete()) {
+        // Look for other work while waiting for block to be deletable.
+        break;
+      }
 
-    {
-      MutexLockerEx aml(_active_mutex, Mutex::_no_safepoint_check_flag);
-      // Don't interfere with a concurrent iteration.
-      if (_concurrent_iteration_count > 0) return;
-      _active_array->remove(block);
+      // Try to delete the block.  First, try to remove from _active_array.
+      {
+        MutexLockerEx aml(_active_mutex, Mutex::_no_safepoint_check_flag);
+        // Don't interfere with an active concurrent iteration.
+        // Instead, give up immediately.  There is more work to do,
+        // but don't re-notify, to avoid useless spinning of the
+        // service thread.  Instead, iteration completion notifies.
+        if (_concurrent_iteration_count > 0) return true;
+        _active_array->remove(block);
+      }
+      // Remove block from _allocation_list and delete it.
+      _allocation_list.unlink(*block);
+      // Be safepoint-polite while deleting and looping.
+      MutexUnlockerEx ul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
+      delete_empty_block(*block);
+      ThreadBlockInVM tbiv(JavaThread::current());
     }
-    // Remove block from _allocation_list and delete it.
-    _allocation_list.unlink(*block);
-    // Release mutex while deleting block.
-    MutexUnlockerEx ul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
-    delete_empty_block(*block);
   }
+  // Exceeded work limit or can't delete last block.  This will
+  // cause the service thread to loop, giving other subtasks an
+  // opportunity to run too.  There's no need for a notification,
+  // because we are part of the service thread (unless gtesting).
+  record_needs_cleanup();
+  return true;
 }
 
 OopStorage::EntryStatus OopStorage::allocation_status(const oop* ptr) const {
@@ -886,6 +945,10 @@
 OopStorage::BasicParState::~BasicParState() {
   _storage->relinquish_block_array(_active_array);
   update_concurrent_iteration_count(-1);
+  if (_concurrent) {
+    // We may have deferred some work.
+    const_cast<OopStorage*>(_storage)->notify_needs_cleanup();
+  }
 }
 
 void OopStorage::BasicParState::update_concurrent_iteration_count(int value) {
--- a/src/hotspot/share/gc/shared/oopStorage.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/gc/shared/oopStorage.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -151,11 +151,19 @@
   // Other clients must use serial iteration.
   template<bool concurrent, bool is_const> class ParState;
 
-  // Block cleanup functions are for the exclusive use of the GC.
-  // Both stop deleting if there is an in-progress concurrent iteration.
-  // Concurrent deletion locks both the _allocation_mutex and the _active_mutex.
-  void delete_empty_blocks_safepoint();
-  void delete_empty_blocks_concurrent();
+  // Service thread cleanup support.
+  // Stops deleting if there is an in-progress concurrent iteration.
+  // Locks both the _allocation_mutex and the _active_mutex, and may
+  // safepoint.  Deletion may be throttled, with only some available
+  // work performed, in order to allow other Service thread subtasks
+  // to run.  Returns true if there may be more work to do, false if
+  // nothing to do.
+  bool delete_empty_blocks();
+
+  // Service thread cleanup support.
+  // Called by the service thread (while holding Service_lock) to test
+  // whether a call to delete_empty_blocks should be made.
+  bool needs_delete_empty_blocks() const;
 
   // Debugging and logging support.
   const char* name() const;
@@ -208,7 +216,9 @@
   const char* _name;
   ActiveArray* _active_array;
   AllocationList _allocation_list;
+AIX_ONLY(public:)               // xlC 12 on AIX doesn't implement C++ DR45.
   Block* volatile _deferred_updates;
+AIX_ONLY(private:)
 
   Mutex* _allocation_mutex;
   Mutex* _active_mutex;
@@ -222,9 +232,18 @@
   // mutable because this gets set even for const iteration.
   mutable int _concurrent_iteration_count;
 
+  volatile uint _needs_cleanup;
+
+  bool try_add_block();
+  Block* block_for_allocation();
+
   Block* find_block_or_null(const oop* ptr) const;
   void delete_empty_block(const Block& block);
   bool reduce_deferred_updates();
+  void notify_needs_cleanup();
+AIX_ONLY(public:)               // xlC 12 on AIX doesn't implement C++ DR45.
+  void record_needs_cleanup();
+AIX_ONLY(private:)
 
   // Managing _active_array.
   bool expand_active_array();
--- a/src/hotspot/share/gc/shared/oopStorage.inline.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/gc/shared/oopStorage.inline.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -173,7 +173,8 @@
   bool is_full() const;
   bool is_empty() const;
   uintx allocated_bitmask() const;
-  bool is_deletable() const;
+
+  bool is_safe_to_delete() const;
 
   Block* deferred_updates_next() const;
   void set_deferred_updates_next(Block* new_next);
@@ -191,7 +192,7 @@
   static Block* new_block(const OopStorage* owner);
   static void delete_block(const Block& block);
 
-  void release_entries(uintx releasing, Block* volatile* deferred_list);
+  void release_entries(uintx releasing, OopStorage* owner);
 
   template<typename F> bool iterate(F f);
   template<typename F> bool iterate(F f) const;
--- a/src/hotspot/share/gc/shared/oopStorageParState.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/gc/shared/oopStorageParState.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -45,7 +45,7 @@
 // locked.  This prevents concurrent iteration and empty block deletion from
 // interfering with with each other.
 //
-// Both allocate() and delete_empty_blocks_concurrent() lock the
+// Both allocate() and delete_empty_blocks() lock the
 // _allocation_mutex while performing their respective list and array
 // manipulations, preventing them from interfering with each other.
 //
@@ -71,11 +71,6 @@
 // iteration.  To help with this, allocate() and release() have an invariant
 // that an entry's value must be NULL when it is not in use.
 //
-// An in-progress delete_empty_blocks_concurrent() operation can contend with
-// the start of a concurrent iteration over the _active_mutex.  Since both are
-// under GC control, that potential contention can be eliminated by never
-// scheduling both operations to run at the same time.
-//
 // ParState<concurrent, is_const>
 //   concurrent must be true if iteration may be concurrent with the
 //   mutators.
--- a/src/hotspot/share/gc/z/zNMethodTable.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/gc/z/zNMethodTable.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -51,7 +51,6 @@
   nmethod* method() const;
   size_t immediate_oops_count() const;
   oop** immediate_oops_begin() const;
-  oop** immediate_oops_begin_safe() const;
   oop** immediate_oops_end() const;
 };
 
@@ -95,24 +94,6 @@
   return (oop**)((uintptr_t)this + header_size());
 }
 
-oop** ZNMethodWithImmediateOops::immediate_oops_begin_safe() const {
-  // Non-entrant nmethods have a jump instruction patched into the beginning
-  // of the verified entry point, which could have overwritten an immediate
-  // oop. If so, make sure we skip over that oop.
-  if (_nm->is_not_entrant()) {
-    oop* const first_immediate_oop = *immediate_oops_begin();
-    oop* const safe_begin = (oop*)(_nm->verified_entry_point() + NativeJump::instruction_size);
-    if (first_immediate_oop < safe_begin) {
-      // First immediate oop overwritten, skip it
-      return immediate_oops_begin() + 1;
-    }
-  }
-
-  // First immediate oop not overwritten
-  return immediate_oops_begin();
-}
-
-
 oop** ZNMethodWithImmediateOops::immediate_oops_end() const {
   return immediate_oops_begin() + immediate_oops_count();
 }
@@ -429,7 +410,7 @@
   if (entry.immediate_oops()) {
     // Process immediate oops
     const ZNMethodWithImmediateOops* const nmi = entry.method_with_immediate_oops();
-    oop** const begin = nmi->immediate_oops_begin_safe();
+    oop** const begin = nmi->immediate_oops_begin();
     oop** const end = nmi->immediate_oops_end();
     for (oop** p = begin; p < end; p++) {
       cl->do_oop(*p);
--- a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -446,6 +446,12 @@
       assert(element != NULL, "invariant");
       JfrJavaSupport::set_array_element(settings, element, i, CHECK);
     }
+  } else {
+    settings = JfrJavaSupport::new_string_array(1, CHECK);
+    assert(settings != NULL, "invariant");
+    jobject element = JfrJavaSupport::new_string("default", CHECK);
+    assert(element != NULL, "invariant");
+    JfrJavaSupport::set_array_element(settings, element, 0, CHECK);
   }
 
   static const char klass[] = "jdk/jfr/internal/dcmd/DCmdStart";
--- a/src/hotspot/share/memory/filemap.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/memory/filemap.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -26,7 +26,6 @@
 #include "jvm.h"
 #include "classfile/classLoader.inline.hpp"
 #include "classfile/classLoaderExt.hpp"
-#include "classfile/stringTable.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionaryShared.hpp"
 #include "classfile/altHashing.hpp"
@@ -615,7 +614,7 @@
   } else {
     si->_file_offset = _file_offset;
   }
-  if (MetaspaceShared::is_heap_region(region)) {
+  if (HeapShared::is_heap_region(region)) {
     assert((base - (char*)Universe::narrow_oop_base()) % HeapWordSize == 0, "Sanity");
     if (base != NULL) {
       si->_addr._offset = (intx)CompressedOops::encode_not_null((oop)base);
@@ -814,7 +813,7 @@
                                             "String1", "String2", "OpenArchive1", "OpenArchive2" };
 
 char* FileMapInfo::map_region(int i, char** top_ret) {
-  assert(!MetaspaceShared::is_heap_region(i), "sanity");
+  assert(!HeapShared::is_heap_region(i), "sanity");
   CDSFileMapRegion* si = space_at(i);
   size_t used = si->_used;
   size_t alignment = os::vm_allocation_granularity();
@@ -857,14 +856,14 @@
   }
 }
 
-static MemRegion *string_ranges = NULL;
+static MemRegion *closed_archive_heap_ranges = NULL;
 static MemRegion *open_archive_heap_ranges = NULL;
-static int num_string_ranges = 0;
+static int num_closed_archive_heap_ranges = 0;
 static int num_open_archive_heap_ranges = 0;
 
 #if INCLUDE_CDS_JAVA_HEAP
 bool FileMapInfo::has_heap_regions() {
-  return (_header->_space[MetaspaceShared::first_string]._used > 0);
+  return (_header->_space[MetaspaceShared::first_closed_archive_heap_region]._used > 0);
 }
 
 // Returns the address range of the archived heap regions computed using the
@@ -875,7 +874,9 @@
   address start = (address) max_uintx;
   address end   = NULL;
 
-  for (int i = MetaspaceShared::first_string; i <= MetaspaceShared::last_valid_region; i++) {
+  for (int i = MetaspaceShared::first_closed_archive_heap_region;
+           i <= MetaspaceShared::last_valid_region;
+           i++) {
     CDSFileMapRegion* si = space_at(i);
     size_t size = si->_used;
     if (size > 0) {
@@ -894,16 +895,16 @@
 }
 
 //
-// Map the shared string objects and open archive heap objects to the runtime
-// java heap.
+// Map the closed and open archive heap objects to the runtime java heap.
 //
-// The shared strings are mapped close to the end of the java heap top in
-// closed archive regions. The mapped strings contain no out-going references
-// to any other java heap regions. GC does not write into the mapped shared strings.
+// The shared objects are mapped at (or close to ) the java heap top in
+// closed archive regions. The mapped objects contain no out-going
+// references to any other java heap regions. GC does not write into the
+// mapped closed archive heap region.
 //
-// The open archive heap objects are mapped below the shared strings in
-// the runtime java heap. The mapped open archive heap data only contain
-// references to the shared strings and open archive objects initially.
+// The open archive heap objects are mapped below the shared objects in
+// the runtime java heap. The mapped open archive heap data only contains
+// references to the shared objects and open archive objects initially.
 // During runtime execution, out-going references to any other java heap
 // regions may be added. GC may mark and update references in the mapped
 // open archive objects.
@@ -983,29 +984,31 @@
   log_info(cds)("CDS heap data relocation delta = " INTX_FORMAT " bytes", delta);
   HeapShared::init_narrow_oop_decoding(narrow_oop_base() + delta, narrow_oop_shift());
 
-  CDSFileMapRegion* si = space_at(MetaspaceShared::first_string);
-  address relocated_strings_bottom = start_address_as_decoded_from_archive(si);
-  if (!is_aligned(relocated_strings_bottom, HeapRegion::GrainBytes)) {
-    // Align the bottom of the string regions at G1 region boundary. This will avoid
-    // the situation where the highest open region and the lowest string region sharing
-    // the same G1 region. Otherwise we will fail to map the open regions.
-    size_t align = size_t(relocated_strings_bottom) % HeapRegion::GrainBytes;
+  CDSFileMapRegion* si = space_at(MetaspaceShared::first_closed_archive_heap_region);
+  address relocated_closed_heap_region_bottom = start_address_as_decoded_from_archive(si);
+  if (!is_aligned(relocated_closed_heap_region_bottom, HeapRegion::GrainBytes)) {
+    // Align the bottom of the closed archive heap regions at G1 region boundary.
+    // This will avoid the situation where the highest open region and the lowest
+    // closed region sharing the same G1 region. Otherwise we will fail to map the
+    // open regions.
+    size_t align = size_t(relocated_closed_heap_region_bottom) % HeapRegion::GrainBytes;
     delta -= align;
     log_info(cds)("CDS heap data need to be relocated lower by a further " SIZE_FORMAT
-                  " bytes to " INTX_FORMAT " to be aligned with HeapRegion::GrainBytes", align, delta);
+                  " bytes to " INTX_FORMAT " to be aligned with HeapRegion::GrainBytes",
+                  align, delta);
     HeapShared::init_narrow_oop_decoding(narrow_oop_base() + delta, narrow_oop_shift());
     _heap_pointers_need_patching = true;
-    relocated_strings_bottom = start_address_as_decoded_from_archive(si);
+    relocated_closed_heap_region_bottom = start_address_as_decoded_from_archive(si);
   }
-  assert(is_aligned(relocated_strings_bottom, HeapRegion::GrainBytes), "must be");
+  assert(is_aligned(relocated_closed_heap_region_bottom, HeapRegion::GrainBytes),
+         "must be");
 
-  // First, map string regions as closed archive heap regions.
-  // GC does not write into the regions.
-  if (map_heap_data(&string_ranges,
-                    MetaspaceShared::first_string,
-                    MetaspaceShared::max_strings,
-                    &num_string_ranges)) {
-    StringTable::set_shared_string_mapped();
+  // Map the closed_archive_heap regions, GC does not write into the regions.
+  if (map_heap_data(&closed_archive_heap_ranges,
+                    MetaspaceShared::first_closed_archive_heap_region,
+                    MetaspaceShared::max_closed_archive_heap_region,
+                    &num_closed_archive_heap_ranges)) {
+    HeapShared::set_closed_archive_heap_region_mapped();
 
     // Now, map open_archive heap regions, GC can write into the regions.
     if (map_heap_data(&open_archive_heap_ranges,
@@ -1023,8 +1026,9 @@
     map_heap_regions_impl();
   }
 
-  if (!StringTable::shared_string_mapped()) {
-    assert(string_ranges == NULL && num_string_ranges == 0, "sanity");
+  if (!HeapShared::closed_archive_heap_region_mapped()) {
+    assert(closed_archive_heap_ranges == NULL &&
+           num_closed_archive_heap_ranges == 0, "sanity");
   }
 
   if (!HeapShared::open_archive_heap_region_mapped()) {
@@ -1115,9 +1119,9 @@
     return;
   }
 
-  patch_archived_heap_embedded_pointers(string_ranges,
-                                        num_string_ranges,
-                                        MetaspaceShared::first_string);
+  patch_archived_heap_embedded_pointers(closed_archive_heap_ranges,
+                                        num_closed_archive_heap_ranges,
+                                        MetaspaceShared::first_closed_archive_heap_region);
 
   patch_archived_heap_embedded_pointers(open_archive_heap_ranges,
                                         num_open_archive_heap_ranges,
@@ -1136,11 +1140,13 @@
 // This internally allocates objects using SystemDictionary::Object_klass(), so it
 // must be called after the well-known classes are resolved.
 void FileMapInfo::fixup_mapped_heap_regions() {
-  // If any string regions were found, call the fill routine to make them parseable.
-  // Note that string_ranges may be non-NULL even if no ranges were found.
-  if (num_string_ranges != 0) {
-    assert(string_ranges != NULL, "Null string_ranges array with non-zero count");
-    G1CollectedHeap::heap()->fill_archive_regions(string_ranges, num_string_ranges);
+  // If any closed regions were found, call the fill routine to make them parseable.
+  // Note that closed_archive_heap_ranges may be non-NULL even if no ranges were found.
+  if (num_closed_archive_heap_ranges != 0) {
+    assert(closed_archive_heap_ranges != NULL,
+           "Null closed_archive_heap_ranges array with non-zero count");
+    G1CollectedHeap::heap()->fill_archive_regions(closed_archive_heap_ranges,
+                                                  num_closed_archive_heap_ranges);
   }
 
   // do the same for mapped open archive heap regions
@@ -1170,9 +1176,9 @@
   if (sz == 0) {
     return true; // no data
   }
-  if ((MetaspaceShared::is_string_region(i) &&
-       !StringTable::shared_string_mapped()) ||
-      (MetaspaceShared::is_open_archive_heap_region(i) &&
+  if ((HeapShared::is_closed_archive_heap_region(i) &&
+       !HeapShared::closed_archive_heap_region_mapped()) ||
+      (HeapShared::is_open_archive_heap_region(i) &&
        !HeapShared::open_archive_heap_region_mapped())) {
     return true; // archived heap data is not mapped
   }
@@ -1188,7 +1194,7 @@
 // Unmap a memory region in the address space.
 
 void FileMapInfo::unmap_region(int i) {
-  assert(!MetaspaceShared::is_heap_region(i), "sanity");
+  assert(!HeapShared::is_heap_region(i), "sanity");
   CDSFileMapRegion* si = space_at(i);
   size_t used = si->_used;
   size_t size = align_up(used, os::vm_allocation_granularity());
@@ -1259,7 +1265,7 @@
 
 char* FileMapInfo::region_addr(int idx) {
   CDSFileMapRegion* si = space_at(idx);
-  if (MetaspaceShared::is_heap_region(idx)) {
+  if (HeapShared::is_heap_region(idx)) {
     assert(DumpSharedSpaces, "The following doesn't work at runtime");
     return si->_used > 0 ?
           (char*)start_address_as_decoded_with_current_oop_encoding_mode(si) : NULL;
@@ -1326,7 +1332,7 @@
   if (prop != NULL) {
     warning("Archived non-system classes are disabled because the "
             "java.system.class.loader property is specified (value = \"%s\"). "
-            "To use archived non-system classes, this property must be not be set", prop);
+            "To use archived non-system classes, this property must not be set", prop);
     _has_platform_or_app_classes = false;
   }
 
@@ -1383,7 +1389,7 @@
   if (map_info) {
     map_info->fail_continue("%s", msg);
     for (int i = 0; i < MetaspaceShared::num_non_heap_spaces; i++) {
-      if (!MetaspaceShared::is_heap_region(i)) {
+      if (!HeapShared::is_heap_region(i)) {
         char *addr = map_info->region_addr(i);
         if (addr != NULL) {
           map_info->unmap_region(i);
@@ -1395,7 +1401,8 @@
     // of the java heap. Unmapping of the heap regions are managed by GC.
     map_info->dealloc_archive_heap_regions(open_archive_heap_ranges,
                                            num_open_archive_heap_ranges);
-    map_info->dealloc_archive_heap_regions(string_ranges, num_string_ranges);
+    map_info->dealloc_archive_heap_regions(closed_archive_heap_ranges,
+                                           num_closed_archive_heap_ranges);
   } else if (DumpSharedSpaces) {
     fail_stop("%s", msg);
   }
--- a/src/hotspot/share/memory/heapShared.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/memory/heapShared.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -37,6 +37,7 @@
 #include "memory/metaspaceClosure.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/compressedOops.inline.hpp"
+#include "oops/fieldStreams.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
 #include "runtime/safepointVerifiers.hpp"
@@ -47,12 +48,40 @@
 
 #if INCLUDE_CDS_JAVA_HEAP
 
+bool HeapShared::_closed_archive_heap_region_mapped = false;
 bool HeapShared::_open_archive_heap_region_mapped = false;
 bool HeapShared::_archive_heap_region_fixed = false;
 
 address   HeapShared::_narrow_oop_base;
 int       HeapShared::_narrow_oop_shift;
 
+//
+// If you add new entries to the following tables, you should know what you're doing!
+//
+
+// Entry fields for shareable subgraphs archived in the closed archive heap
+// region. Warning: Objects in the subgraphs should not have reference fields
+// assigned at runtime.
+static ArchivableStaticFieldInfo closed_archive_subgraph_entry_fields[] = {
+  {"java/lang/Integer$IntegerCache",           "archivedCache"},
+};
+// Entry fields for subgraphs archived in the open archive heap region.
+static ArchivableStaticFieldInfo open_archive_subgraph_entry_fields[] = {
+  {"jdk/internal/module/ArchivedModuleGraph",  "archivedSystemModules"},
+  {"jdk/internal/module/ArchivedModuleGraph",  "archivedModuleFinder"},
+  {"jdk/internal/module/ArchivedModuleGraph",  "archivedMainModule"},
+  {"jdk/internal/module/ArchivedModuleGraph",  "archivedConfiguration"},
+  {"java/util/ImmutableCollections$ListN",     "EMPTY_LIST"},
+  {"java/util/ImmutableCollections$MapN",      "EMPTY_MAP"},
+  {"java/util/ImmutableCollections$SetN",      "EMPTY_SET"},
+  {"java/lang/module/Configuration",           "EMPTY_CONFIGURATION"},
+};
+
+const static int num_closed_archive_subgraph_entry_fields =
+  sizeof(closed_archive_subgraph_entry_fields) / sizeof(ArchivableStaticFieldInfo);
+const static int num_open_archive_subgraph_entry_fields =
+  sizeof(open_archive_subgraph_entry_fields) / sizeof(ArchivableStaticFieldInfo);
+
 ////////////////////////////////////////////////////////////////
 //
 // Java heap object archiving support
@@ -189,6 +218,10 @@
   // Archive interned string objects
   StringTable::write_to_archive();
 
+  archive_object_subgraphs(closed_archive_subgraph_entry_fields,
+                           num_closed_archive_subgraph_entry_fields,
+                           true /* is_closed_archive */, THREAD);
+
   G1CollectedHeap::heap()->end_archive_alloc_range(closed_archive,
                                                    os::vm_allocation_granularity());
 }
@@ -204,7 +237,10 @@
 
   archive_klass_objects(THREAD);
 
-  archive_object_subgraphs(THREAD);
+  archive_object_subgraphs(open_archive_subgraph_entry_fields,
+                           num_open_archive_subgraph_entry_fields,
+                           false /* is_closed_archive */,
+                           THREAD);
 
   G1CollectedHeap::heap()->end_archive_alloc_range(open_archive,
                                                    os::vm_allocation_granularity());
@@ -237,7 +273,8 @@
 }
 
 // Add an entry field to the current KlassSubGraphInfo.
-void KlassSubGraphInfo::add_subgraph_entry_field(int static_field_offset, oop v) {
+void KlassSubGraphInfo::add_subgraph_entry_field(
+      int static_field_offset, oop v, bool is_closed_archive) {
   assert(DumpSharedSpaces, "dump time only");
   if (_subgraph_entry_fields == NULL) {
     _subgraph_entry_fields =
@@ -245,6 +282,7 @@
   }
   _subgraph_entry_fields->append((juint)static_field_offset);
   _subgraph_entry_fields->append(CompressedOops::encode(v));
+  _subgraph_entry_fields->append(is_closed_archive ? 1 : 0);
 }
 
 // Add the Klass* for an object in the current KlassSubGraphInfo's subgraphs.
@@ -315,7 +353,7 @@
   GrowableArray<juint>* entry_fields = info->subgraph_entry_fields();
   if (entry_fields != NULL) {
     int num_entry_fields = entry_fields->length();
-    assert(num_entry_fields % 2 == 0, "sanity");
+    assert(num_entry_fields % 3 == 0, "sanity");
     _entry_field_records =
       MetaspaceShared::new_ro_array<juint>(num_entry_fields);
     for (int i = 0 ; i < num_entry_fields; i++) {
@@ -365,8 +403,8 @@
 // Build the records of archived subgraph infos, which include:
 // - Entry points to all subgraphs from the containing class mirror. The entry
 //   points are static fields in the mirror. For each entry point, the field
-//   offset and value are recorded in the sub-graph info. The value are stored
-//   back to the corresponding field at runtime.
+//   offset, value and is_closed_archive flag are recorded in the sub-graph
+//   info. The value is stored back to the corresponding field at runtime.
 // - A list of klasses that need to be loaded/initialized before archived
 //   java object sub-graph can be accessed at runtime.
 void HeapShared::write_subgraph_info_table() {
@@ -448,15 +486,25 @@
     Array<juint>* entry_field_records = record->entry_field_records();
     if (entry_field_records != NULL) {
       int efr_len = entry_field_records->length();
-      assert(efr_len % 2 == 0, "sanity");
+      assert(efr_len % 3 == 0, "sanity");
       for (i = 0; i < efr_len;) {
         int field_offset = entry_field_records->at(i);
-        // The object refereced by the field becomes 'known' by GC from this
-        // point. All objects in the subgraph reachable from the object are
-        // also 'known' by GC.
-        oop v = materialize_archived_object(entry_field_records->at(i+1));
+        narrowOop nv = entry_field_records->at(i+1);
+        int is_closed_archive = entry_field_records->at(i+2);
+        oop v;
+        if (is_closed_archive == 0) {
+          // It's an archived object in the open archive heap regions, not shared.
+          // The object refereced by the field becomes 'known' by GC from this
+          // point. All objects in the subgraph reachable from the object are
+          // also 'known' by GC.
+          v = materialize_archived_object(nv);
+        } else {
+          // Shared object in the closed archive heap regions. Decode directly.
+          assert(!CompressedOops::is_null(nv), "shared object is null");
+          v = HeapShared::decode_from_archive(nv);
+        }
         m->obj_field_put(field_offset, v);
-        i += 2;
+        i += 3;
 
         log_debug(cds, heap)("  " PTR_FORMAT " init field @ %2d = " PTR_FORMAT, p2i(k), field_offset, p2i(v));
       }
@@ -469,16 +517,20 @@
 
 class WalkOopAndArchiveClosure: public BasicOopIterateClosure {
   int _level;
+  bool _is_closed_archive;
   bool _record_klasses_only;
   KlassSubGraphInfo* _subgraph_info;
   oop _orig_referencing_obj;
   oop _archived_referencing_obj;
   Thread* _thread;
  public:
-  WalkOopAndArchiveClosure(int level, bool record_klasses_only,
+  WalkOopAndArchiveClosure(int level,
+                           bool is_closed_archive,
+                           bool record_klasses_only,
                            KlassSubGraphInfo* subgraph_info,
                            oop orig, oop archived, TRAPS) :
-    _level(level), _record_klasses_only(record_klasses_only),
+    _level(level), _is_closed_archive(is_closed_archive),
+    _record_klasses_only(record_klasses_only),
     _subgraph_info(subgraph_info),
     _orig_referencing_obj(orig), _archived_referencing_obj(archived),
     _thread(THREAD) {}
@@ -506,7 +558,8 @@
         obj->print_on(&out);
       }
 
-      oop archived = HeapShared::archive_reachable_objects_from(_level + 1, _subgraph_info, obj, THREAD);
+      oop archived = HeapShared::archive_reachable_objects_from(
+          _level + 1, _subgraph_info, obj, _is_closed_archive, THREAD);
       assert(archived != NULL, "VM should have exited with unarchivable objects for _level > 1");
       assert(HeapShared::is_archived_object(archived), "must be");
 
@@ -520,11 +573,32 @@
   }
 };
 
+void HeapShared::check_closed_archive_heap_region_object(InstanceKlass* k,
+                                                         Thread* THREAD) {
+  // Check fields in the object
+  for (JavaFieldStream fs(k); !fs.done(); fs.next()) {
+    if (!fs.access_flags().is_static()) {
+      BasicType ft = fs.field_descriptor().field_type();
+      if (!fs.access_flags().is_final() && (ft == T_ARRAY || T_OBJECT)) {
+        ResourceMark rm(THREAD);
+        log_warning(cds, heap)(
+          "Please check reference field in %s instance in closed archive heap region: %s %s",
+          k->external_name(), (fs.name())->as_C_string(),
+          (fs.signature())->as_C_string());
+      }
+    }
+  }
+}
+
 // (1) If orig_obj has not been archived yet, archive it.
 // (2) If orig_obj has not been seen yet (since start_recording_subgraph() was called),
 //     trace all  objects that are reachable from it, and make sure these objects are archived.
 // (3) Record the klasses of all orig_obj and all reachable objects.
-oop HeapShared::archive_reachable_objects_from(int level, KlassSubGraphInfo* subgraph_info, oop orig_obj, TRAPS) {
+oop HeapShared::archive_reachable_objects_from(int level,
+                                               KlassSubGraphInfo* subgraph_info,
+                                               oop orig_obj,
+                                               bool is_closed_archive,
+                                               TRAPS) {
   assert(orig_obj != NULL, "must be");
   assert(!is_archived_object(orig_obj), "sanity");
 
@@ -578,8 +652,12 @@
   Klass *relocated_k = archived_obj->klass();
   subgraph_info->add_subgraph_object_klass(orig_k, relocated_k);
 
-  WalkOopAndArchiveClosure walker(level, record_klasses_only, subgraph_info, orig_obj, archived_obj, THREAD);
+  WalkOopAndArchiveClosure walker(level, is_closed_archive, record_klasses_only,
+                                  subgraph_info, orig_obj, archived_obj, THREAD);
   orig_obj->oop_iterate(&walker);
+  if (is_closed_archive && orig_k->is_instance_klass()) {
+    check_closed_archive_heap_region_object(InstanceKlass::cast(orig_k), THREAD);
+  }
   return archived_obj;
 }
 
@@ -621,15 +699,12 @@
                                                              const char* klass_name,
                                                              int field_offset,
                                                              const char* field_name,
+                                                             bool is_closed_archive,
                                                              TRAPS) {
   assert(DumpSharedSpaces, "dump time only");
   assert(k->is_shared_boot_class(), "must be boot class");
 
   oop m = k->java_mirror();
-  oop archived_m = find_archived_heap_object(m);
-  if (CompressedOops::is_null(archived_m)) {
-    return;
-  }
 
   KlassSubGraphInfo* subgraph_info = get_subgraph_info(k);
   oop f = m->obj_field(field_offset);
@@ -643,7 +718,8 @@
       f->print_on(&out);
     }
 
-    oop af = archive_reachable_objects_from(1, subgraph_info, f, CHECK);
+    oop af = archive_reachable_objects_from(1, subgraph_info, f,
+                                            is_closed_archive, CHECK);
 
     if (af == NULL) {
       log_error(cds, heap)("Archiving failed %s::%s (some reachable objects cannot be archived)",
@@ -652,13 +728,13 @@
       // Note: the field value is not preserved in the archived mirror.
       // Record the field as a new subGraph entry point. The recorded
       // information is restored from the archive at runtime.
-      subgraph_info->add_subgraph_entry_field(field_offset, af);
+      subgraph_info->add_subgraph_entry_field(field_offset, af, is_closed_archive);
       log_info(cds, heap)("Archived field %s::%s => " PTR_FORMAT, klass_name, field_name, p2i(af));
     }
   } else {
     // The field contains null, we still need to record the entry point,
     // so it can be restored at runtime.
-    subgraph_info->add_subgraph_entry_field(field_offset, NULL);
+    subgraph_info->add_subgraph_entry_field(field_offset, NULL, false);
   }
 }
 
@@ -687,10 +763,6 @@
   assert(k->is_shared_boot_class(), "must be boot class");
 
   oop m = k->java_mirror();
-  oop archived_m = find_archived_heap_object(m);
-  if (CompressedOops::is_null(archived_m)) {
-    return;
-  }
   oop f = m->obj_field(field_offset);
   if (!CompressedOops::is_null(f)) {
     verify_subgraph_from(f);
@@ -783,30 +855,6 @@
   _num_total_recorded_klasses +=  num_new_recorded_klasses;
 }
 
-struct ArchivableStaticFieldInfo {
-  const char* klass_name;
-  const char* field_name;
-  InstanceKlass* klass;
-  int offset;
-  BasicType type;
-};
-
-// If you add new entries to this table, you should know what you're doing!
-static ArchivableStaticFieldInfo archivable_static_fields[] = {
-  {"jdk/internal/module/ArchivedModuleGraph",  "archivedSystemModules"},
-  {"jdk/internal/module/ArchivedModuleGraph",  "archivedModuleFinder"},
-  {"jdk/internal/module/ArchivedModuleGraph",  "archivedMainModule"},
-  {"jdk/internal/module/ArchivedModuleGraph",  "archivedConfiguration"},
-  {"java/util/ImmutableCollections$ListN",     "EMPTY_LIST"},
-  {"java/util/ImmutableCollections$MapN",      "EMPTY_MAP"},
-  {"java/util/ImmutableCollections$SetN",      "EMPTY_SET"},
-  {"java/lang/Integer$IntegerCache",           "archivedCache"},
-  {"java/lang/module/Configuration",           "EMPTY_CONFIGURATION"},
-};
-
-const static int num_archivable_static_fields =
-  sizeof(archivable_static_fields) / sizeof(ArchivableStaticFieldInfo);
-
 class ArchivableStaticFieldFinder: public FieldClosure {
   InstanceKlass* _ik;
   Symbol* _field_name;
@@ -828,11 +876,10 @@
   int offset()     { return _offset; }
 };
 
-void HeapShared::init_archivable_static_fields(Thread* THREAD) {
-  _dump_time_subgraph_info_table = new (ResourceObj::C_HEAP, mtClass)DumpTimeKlassSubGraphInfoTable();
-
-  for (int i = 0; i < num_archivable_static_fields; i++) {
-    ArchivableStaticFieldInfo* info = &archivable_static_fields[i];
+void HeapShared::init_subgraph_entry_fields(ArchivableStaticFieldInfo fields[],
+                                            int num, Thread* THREAD) {
+  for (int i = 0; i < num; i++) {
+    ArchivableStaticFieldInfo* info = &fields[i];
     TempNewSymbol klass_name =  SymbolTable::new_symbol(info->klass_name, THREAD);
     TempNewSymbol field_name =  SymbolTable::new_symbol(info->field_name, THREAD);
 
@@ -849,7 +896,26 @@
   }
 }
 
-void HeapShared::archive_object_subgraphs(Thread* THREAD) {
+void HeapShared::init_subgraph_entry_fields(Thread* THREAD) {
+  _dump_time_subgraph_info_table = new (ResourceObj::C_HEAP, mtClass)DumpTimeKlassSubGraphInfoTable();
+
+  init_subgraph_entry_fields(closed_archive_subgraph_entry_fields,
+                             num_closed_archive_subgraph_entry_fields,
+                             THREAD);
+  init_subgraph_entry_fields(open_archive_subgraph_entry_fields,
+                             num_open_archive_subgraph_entry_fields,
+                             THREAD);
+}
+
+void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
+                                          int num, bool is_closed_archive,
+                                          Thread* THREAD) {
+  _num_total_subgraph_recordings = 0;
+  _num_total_walked_objs = 0;
+  _num_total_archived_objs = 0;
+  _num_total_recorded_klasses = 0;
+  _num_total_verifications = 0;
+
   // For each class X that has one or more archived fields:
   // [1] Dump the subgraph of each archived field
   // [2] Create a list of all the class of the objects that can be reached
@@ -857,38 +923,40 @@
   //     At runtime, these classes are initialized before X's archived fields
   //     are restored by HeapShared::initialize_from_archived_subgraph().
   int i;
-  for (i = 0; i < num_archivable_static_fields; ) {
-    ArchivableStaticFieldInfo* info = &archivable_static_fields[i];
+  for (i = 0; i < num; ) {
+    ArchivableStaticFieldInfo* info = &fields[i];
     const char* klass_name = info->klass_name;
     start_recording_subgraph(info->klass, klass_name);
 
     // If you have specified consecutive fields of the same klass in
-    // archivable_static_fields[], these will be archived in the same
+    // fields[], these will be archived in the same
     // {start_recording_subgraph ... done_recording_subgraph} pass to
     // save time.
-    for (; i < num_archivable_static_fields; i++) {
-      ArchivableStaticFieldInfo* f = &archivable_static_fields[i];
+    for (; i < num; i++) {
+      ArchivableStaticFieldInfo* f = &fields[i];
       if (f->klass_name != klass_name) {
         break;
       }
       archive_reachable_objects_from_static_field(f->klass, f->klass_name,
-                                                  f->offset, f->field_name, CHECK);
+                                                  f->offset, f->field_name,
+                                                  is_closed_archive, CHECK);
     }
     done_recording_subgraph(info->klass, klass_name);
   }
 
-  log_info(cds, heap)("Performed subgraph records = %d times", _num_total_subgraph_recordings);
-  log_info(cds, heap)("Walked %d objects", _num_total_walked_objs);
-  log_info(cds, heap)("Archived %d objects", _num_total_archived_objs);
-  log_info(cds, heap)("Recorded %d klasses", _num_total_recorded_klasses);
-
+  log_info(cds, heap)("Archived subgraph records in %s archive heap region = %d",
+                      is_closed_archive ? "closed" : "open",
+                      _num_total_subgraph_recordings);
+  log_info(cds, heap)("  Walked %d objects", _num_total_walked_objs);
+  log_info(cds, heap)("  Archived %d objects", _num_total_archived_objs);
+  log_info(cds, heap)("  Recorded %d klasses", _num_total_recorded_klasses);
 
 #ifndef PRODUCT
-  for (int i = 0; i < num_archivable_static_fields; i++) {
-    ArchivableStaticFieldInfo* f = &archivable_static_fields[i];
+  for (int i = 0; i < num; i++) {
+    ArchivableStaticFieldInfo* f = &fields[i];
     verify_subgraph_from_static_field(f->klass, f->offset);
   }
-  log_info(cds, heap)("Verified %d references", _num_total_verifications);
+  log_info(cds, heap)("  Verified %d references", _num_total_verifications);
 #endif
 }
 
--- a/src/hotspot/share/memory/heapShared.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/memory/heapShared.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -28,6 +28,7 @@
 #include "classfile/compactHashtable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "memory/allocation.hpp"
+#include "memory/metaspaceShared.hpp"
 #include "memory/universe.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/oop.hpp"
@@ -37,6 +38,14 @@
 #include "utilities/resourceHash.hpp"
 
 #if INCLUDE_CDS_JAVA_HEAP
+struct ArchivableStaticFieldInfo {
+  const char* klass_name;
+  const char* field_name;
+  InstanceKlass* klass;
+  int offset;
+  BasicType type;
+};
+
 // A dump time sub-graph info for Klass _k. It includes the entry points
 // (static fields in _k's mirror) of the archived sub-graphs reachable
 // from _k's mirror. It also contains a list of Klasses of the objects
@@ -50,7 +59,8 @@
   // object sub-graphs can be accessed at runtime.
   GrowableArray<Klass*>* _subgraph_object_klasses;
   // A list of _k's static fields as the entry points of archived sub-graphs.
-  // For each entry field, it is a pair of field_offset and field_value.
+  // For each entry field, it is a tuple of field_offset, field_value and
+  // is_closed_archive flag.
   GrowableArray<juint>*  _subgraph_entry_fields;
 
  public:
@@ -73,7 +83,8 @@
   GrowableArray<juint>*  subgraph_entry_fields() {
     return _subgraph_entry_fields;
   }
-  void add_subgraph_entry_field(int static_field_offset, oop v);
+  void add_subgraph_entry_field(int static_field_offset, oop v,
+                                bool is_closed_archive);
   void add_subgraph_object_klass(Klass *orig_k, Klass *relocated_k);
   int num_subgraph_object_klasses() {
     return _subgraph_object_klasses == NULL ? 0 :
@@ -109,6 +120,7 @@
  private:
 
 #if INCLUDE_CDS_JAVA_HEAP
+  static bool _closed_archive_heap_region_mapped;
   static bool _open_archive_heap_region_mapped;
   static bool _archive_heap_region_fixed;
 
@@ -160,21 +172,34 @@
   static DumpTimeKlassSubGraphInfoTable* _dump_time_subgraph_info_table;
   static RunTimeKlassSubGraphInfoTable _run_time_subgraph_info_table;
 
+  static void check_closed_archive_heap_region_object(InstanceKlass* k,
+                                                      Thread* THREAD);
+
+  static void archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
+                                       int num,
+                                       bool is_closed_archive,
+                                       Thread* THREAD);
+
   // Archive object sub-graph starting from the given static field
   // in Klass k's mirror.
   static void archive_reachable_objects_from_static_field(
     InstanceKlass* k, const char* klass_name,
-    int field_offset, const char* field_name, TRAPS);
+    int field_offset, const char* field_name,
+    bool is_closed_archive, TRAPS);
+
   static void verify_subgraph_from_static_field(
     InstanceKlass* k, int field_offset) PRODUCT_RETURN;
-
   static void verify_reachable_objects_from(oop obj, bool is_archived) PRODUCT_RETURN;
+  static void verify_subgraph_from(oop orig_obj) PRODUCT_RETURN;
 
   static KlassSubGraphInfo* get_subgraph_info(Klass *k);
   static int num_of_subgraph_infos();
 
   static void build_archived_subgraph_info_records(int num_records);
 
+  static void init_subgraph_entry_fields(ArchivableStaticFieldInfo fields[],
+                                         int num, Thread* THREAD);
+
   // Used by decode_from_archive
   static address _narrow_oop_base;
   static int     _narrow_oop_shift;
@@ -245,6 +270,14 @@
                                         GrowableArray<MemRegion> *open);
   static void copy_closed_archive_heap_objects(GrowableArray<MemRegion> * closed_archive);
   static void copy_open_archive_heap_objects(GrowableArray<MemRegion> * open_archive);
+
+  static oop archive_reachable_objects_from(int level,
+                                            KlassSubGraphInfo* subgraph_info,
+                                            oop orig_obj,
+                                            bool is_closed_archive,
+                                            TRAPS);
+
+  static ResourceBitMap calculate_oopmap(MemRegion region);
 #endif // INCLUDE_CDS_JAVA_HEAP
 
  public:
@@ -253,6 +286,30 @@
     NOT_CDS_JAVA_HEAP(return false;)
   }
 
+  static bool is_heap_region(int idx) {
+    CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_closed_archive_heap_region &&
+                               idx <= MetaspaceShared::last_open_archive_heap_region));
+    NOT_CDS_JAVA_HEAP_RETURN_(false);
+  }
+  static bool is_closed_archive_heap_region(int idx) {
+    CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_closed_archive_heap_region &&
+                               idx <= MetaspaceShared::last_closed_archive_heap_region));
+    NOT_CDS_JAVA_HEAP_RETURN_(false);
+  }
+  static bool is_open_archive_heap_region(int idx) {
+    CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_open_archive_heap_region &&
+                               idx <= MetaspaceShared::last_open_archive_heap_region));
+    NOT_CDS_JAVA_HEAP_RETURN_(false);
+  }
+
+  static void set_closed_archive_heap_region_mapped() {
+    CDS_JAVA_HEAP_ONLY(_closed_archive_heap_region_mapped = true);
+    NOT_CDS_JAVA_HEAP_RETURN;
+  }
+  static bool closed_archive_heap_region_mapped() {
+    CDS_JAVA_HEAP_ONLY(return _closed_archive_heap_region_mapped);
+    NOT_CDS_JAVA_HEAP_RETURN_(false);
+  }
   static void set_open_archive_heap_region_mapped() {
     CDS_JAVA_HEAP_ONLY(_open_archive_heap_region_mapped = true);
     NOT_CDS_JAVA_HEAP_RETURN;
@@ -283,15 +340,8 @@
   static void patch_archived_heap_embedded_pointers(MemRegion mem, address  oopmap,
                                                     size_t oopmap_in_bits) NOT_CDS_JAVA_HEAP_RETURN;
 
-  static void init_archivable_static_fields(Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN;
-  static void archive_object_subgraphs(Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN;
+  static void init_subgraph_entry_fields(Thread* THREAD) NOT_CDS_JAVA_HEAP_RETURN;
   static void write_subgraph_info_table() NOT_CDS_JAVA_HEAP_RETURN;
   static void serialize_subgraph_info_table_header(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
-
-#if INCLUDE_CDS_JAVA_HEAP
-  static ResourceBitMap calculate_oopmap(MemRegion region);
-  static oop archive_reachable_objects_from(int level, KlassSubGraphInfo* subgraph_info, oop orig_obj, TRAPS);
-  static void verify_subgraph_from(oop orig_obj) PRODUCT_RETURN;
-#endif
 };
 #endif // SHARE_VM_MEMORY_HEAPSHARED_HPP
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -86,8 +86,8 @@
 //     md  - misc data (the c++ vtables)
 //     od  - optional data (original class files)
 //
-//     s0  - shared strings(closed archive heap space) #0
-//     s1  - shared strings(closed archive heap space) #1 (may be empty)
+//     ca0 - closed archive heap space #0
+//     ca1 - closed archive heap space #1 (may be empty)
 //     oa0 - open archive heap space #0
 //     oa1 - open archive heap space #1 (may be empty)
 //
@@ -198,7 +198,7 @@
 
 
 DumpRegion _mc_region("mc"), _ro_region("ro"), _rw_region("rw"), _md_region("md"), _od_region("od");
-size_t _total_string_region_size = 0, _total_open_archive_region_size = 0;
+size_t _total_closed_archive_region_size = 0, _total_open_archive_region_size = 0;
 
 char* MetaspaceShared::misc_code_space_alloc(size_t num_bytes) {
   return _mc_region.allocate(num_bytes);
@@ -1274,9 +1274,8 @@
     // NOTE: after this point, we shouldn't have any globals that can reach the old
     // objects.
 
-    // We cannot use any of the objects in the heap anymore (except for the objects
-    // in the CDS shared string regions) because their headers no longer point to
-    // valid Klasses.
+    // We cannot use any of the objects in the heap anymore (except for the
+    // shared strings) because their headers no longer point to valid Klasses.
   }
 
   static void iterate_roots(MetaspaceClosure* it) {
@@ -1491,11 +1490,11 @@
     write_region(mapinfo, MetaspaceShared::md, &_md_region, /*read_only=*/false,/*allow_exec=*/false);
     write_region(mapinfo, MetaspaceShared::od, &_od_region, /*read_only=*/true, /*allow_exec=*/false);
 
-    _total_string_region_size = mapinfo->write_archive_heap_regions(
+    _total_closed_archive_region_size = mapinfo->write_archive_heap_regions(
                                         _closed_archive_heap_regions,
                                         _closed_archive_heap_oopmaps,
-                                        MetaspaceShared::first_string,
-                                        MetaspaceShared::max_strings);
+                                        MetaspaceShared::first_closed_archive_heap_region,
+                                        MetaspaceShared::max_closed_archive_heap_region);
     _total_open_archive_region_size = mapinfo->write_archive_heap_regions(
                                         _open_archive_heap_regions,
                                         _open_archive_heap_oopmaps,
@@ -1529,12 +1528,12 @@
   const size_t total_reserved = _ro_region.reserved()  + _rw_region.reserved() +
                                 _mc_region.reserved()  + _md_region.reserved() +
                                 _od_region.reserved()  +
-                                _total_string_region_size +
+                                _total_closed_archive_region_size +
                                 _total_open_archive_region_size;
   const size_t total_bytes = _ro_region.used()  + _rw_region.used() +
                              _mc_region.used()  + _md_region.used() +
                              _od_region.used()  +
-                             _total_string_region_size +
+                             _total_closed_archive_region_size +
                              _total_open_archive_region_size;
   const double total_u_perc = percent_of(total_bytes, total_reserved);
 
@@ -1543,7 +1542,7 @@
   _ro_region.print(total_reserved);
   _md_region.print(total_reserved);
   _od_region.print(total_reserved);
-  print_heap_region_stats(_closed_archive_heap_regions, "st", total_reserved);
+  print_heap_region_stats(_closed_archive_heap_regions, "ca", total_reserved);
   print_heap_region_stats(_open_archive_heap_regions, "oa", total_reserved);
 
   tty->print_cr("total    : " SIZE_FORMAT_W(9) " [100.0%% of total] out of " SIZE_FORMAT_W(9) " bytes [%5.1f%% used]",
@@ -1715,7 +1714,7 @@
     tty->print_cr("Rewriting and linking classes: done");
 
     SystemDictionary::clear_invoke_method_table();
-    HeapShared::init_archivable_static_fields(THREAD);
+    HeapShared::init_subgraph_entry_fields(THREAD);
 
     VM_PopulateDumpSharedSpace op;
     VMThread::execute(&op);
--- a/src/hotspot/share/memory/metaspaceShared.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/memory/metaspaceShared.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -76,13 +76,14 @@
     num_non_heap_spaces = od + 1,
 
     // mapped java heap regions
-    first_string = od + 1, // index of first string region
-    max_strings = 2, // max number of string regions in string space
-    last_string = first_string + max_strings - 1,
-    first_open_archive_heap_region = first_string + max_strings,
+    first_closed_archive_heap_region = od + 1,
+    max_closed_archive_heap_region = 2,
+    last_closed_archive_heap_region = first_closed_archive_heap_region + max_closed_archive_heap_region - 1,
+    first_open_archive_heap_region = last_closed_archive_heap_region + 1,
     max_open_archive_heap_region = 2,
+    last_open_archive_heap_region = first_open_archive_heap_region + max_open_archive_heap_region - 1,
 
-    last_valid_region = first_open_archive_heap_region + max_open_archive_heap_region - 1,
+    last_valid_region = last_open_archive_heap_region,
     n_regions =  last_valid_region + 1 // total number of regions
   };
 
@@ -131,23 +132,6 @@
   // Return true if given address is in the shared region corresponding to the idx
   static bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false);
 
-  static bool is_heap_region(int idx) {
-    CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_string &&
-                               idx < MetaspaceShared::first_open_archive_heap_region +
-                                     MetaspaceShared::max_open_archive_heap_region));
-    NOT_CDS_JAVA_HEAP_RETURN_(false);
-  }
-  static bool is_string_region(int idx) {
-    CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_string &&
-                               idx < MetaspaceShared::first_string + MetaspaceShared::max_strings));
-    NOT_CDS_JAVA_HEAP_RETURN_(false);
-  }
-  static bool is_open_archive_heap_region(int idx) {
-    CDS_JAVA_HEAP_ONLY(return (idx >= MetaspaceShared::first_open_archive_heap_region &&
-                               idx < MetaspaceShared::first_open_archive_heap_region +
-                                     MetaspaceShared::max_open_archive_heap_region));
-    NOT_CDS_JAVA_HEAP_RETURN_(false);
-  }
   static bool is_in_trampoline_frame(address addr) NOT_CDS_RETURN_(false);
 
   static void allocate_cpp_vtable_clones();
--- a/src/hotspot/share/memory/virtualspace.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/memory/virtualspace.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -1059,14 +1059,6 @@
 
 #ifndef PRODUCT
 
-#define test_log(...) \
-  do {\
-    if (VerboseInternalVMTests) { \
-      tty->print_cr(__VA_ARGS__); \
-      tty->flush(); \
-    }\
-  } while (false)
-
 class TestReservedSpace : AllStatic {
  public:
   static void small_page_write(void* addr, size_t size) {
@@ -1087,8 +1079,6 @@
   }
 
   static void test_reserved_space1(size_t size, size_t alignment) {
-    test_log("test_reserved_space1(%p)", (void*) (uintptr_t) size);
-
     assert(is_aligned(size, alignment), "Incorrect input parameters");
 
     ReservedSpace rs(size,          // size
@@ -1096,8 +1086,6 @@
                      UseLargePages, // large
                      (char *)NULL); // requested_address
 
-    test_log(" rs.special() == %d", rs.special());
-
     assert(rs.base() != NULL, "Must be");
     assert(rs.size() == size, "Must be");
 
@@ -1112,14 +1100,10 @@
   }
 
   static void test_reserved_space2(size_t size) {
-    test_log("test_reserved_space2(%p)", (void*)(uintptr_t)size);
-
     assert(is_aligned(size, os::vm_allocation_granularity()), "Must be at least AG aligned");
 
     ReservedSpace rs(size);
 
-    test_log(" rs.special() == %d", rs.special());
-
     assert(rs.base() != NULL, "Must be");
     assert(rs.size() == size, "Must be");
 
@@ -1131,9 +1115,6 @@
   }
 
   static void test_reserved_space3(size_t size, size_t alignment, bool maybe_large) {
-    test_log("test_reserved_space3(%p, %p, %d)",
-        (void*)(uintptr_t)size, (void*)(uintptr_t)alignment, maybe_large);
-
     if (size < alignment) {
       // Tests might set -XX:LargePageSizeInBytes=<small pages> and cause unexpected input arguments for this test.
       assert((size_t)os::vm_page_size() == os::large_page_size(), "Test needs further refinement");
@@ -1147,8 +1128,6 @@
 
     ReservedSpace rs(size, alignment, large, false);
 
-    test_log(" rs.special() == %d", rs.special());
-
     assert(rs.base() != NULL, "Must be");
     assert(rs.size() == size, "Must be");
 
--- a/src/hotspot/share/opto/loopPredicate.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/opto/loopPredicate.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -301,6 +301,73 @@
   return clone_loop_predicates(old_entry, new_entry, clone_limit_check, this, &this->_igvn);
 }
 
+void PhaseIdealLoop::clone_loop_predicates_fix_mem(ProjNode* dom_proj , ProjNode* proj,
+                                                   PhaseIdealLoop* loop_phase,
+                                                   PhaseIterGVN* igvn) {
+  Compile* C = NULL;
+  if (loop_phase != NULL) {
+    igvn = &loop_phase->igvn();
+  }
+  C = igvn->C;
+  ProjNode* other_dom_proj = dom_proj->in(0)->as_Multi()->proj_out(1-dom_proj->_con);
+  Node* dom_r = other_dom_proj->unique_ctrl_out();
+  if (dom_r->is_Region()) {
+    assert(dom_r->unique_ctrl_out()->is_Call(), "unc expected");
+    ProjNode* other_proj = proj->in(0)->as_Multi()->proj_out(1-proj->_con);
+    Node* r = other_proj->unique_ctrl_out();
+    assert(r->is_Region() && r->unique_ctrl_out()->is_Call(), "cloned predicate should have caused region to be added");
+    for (DUIterator_Fast imax, i = dom_r->fast_outs(imax); i < imax; i++) {
+      Node* dom_use = dom_r->fast_out(i);
+      if (dom_use->is_Phi() && dom_use->bottom_type() == Type::MEMORY) {
+        assert(dom_use->in(0) == dom_r, "");
+        Node* phi = NULL;
+        for (DUIterator_Fast jmax, j = r->fast_outs(jmax); j < jmax; j++) {
+          Node* use = r->fast_out(j);
+          if (use->is_Phi() && use->bottom_type() == Type::MEMORY &&
+              use->adr_type() == dom_use->adr_type()) {
+            assert(use->in(0) == r, "");
+            assert(phi == NULL, "only one phi");
+            phi = use;
+          }
+        }
+        if (phi == NULL) {
+          const TypePtr* adr_type = dom_use->adr_type();
+          int alias = C->get_alias_index(adr_type);
+          Node* call = r->unique_ctrl_out();
+          Node* mem = call->in(TypeFunc::Memory);
+          MergeMemNode* mm = NULL;
+          if (mem->is_MergeMem()) {
+            mm = mem->clone()->as_MergeMem();
+            if (adr_type == TypePtr::BOTTOM) {
+              mem = mem->as_MergeMem()->base_memory();
+            } else {
+              mem = mem->as_MergeMem()->memory_at(alias);
+            }
+          } else {
+            mm = MergeMemNode::make(mem);
+          }
+          phi = PhiNode::make(r, mem, Type::MEMORY, adr_type);
+          if (adr_type == TypePtr::BOTTOM) {
+            mm->set_base_memory(phi);
+          } else {
+            mm->set_memory_at(alias, phi);
+          }
+          if (loop_phase != NULL) {
+            loop_phase->register_new_node(mm, r);
+            loop_phase->register_new_node(phi, r);
+          } else {
+            igvn->register_new_node_with_optimizer(mm);
+            igvn->register_new_node_with_optimizer(phi);
+          }
+          igvn->replace_input_of(call, TypeFunc::Memory, mm);
+        }
+        igvn->replace_input_of(phi, r->find_edge(other_proj), dom_use->in(dom_r->find_edge(other_dom_proj)));
+      }
+    }
+  }
+}
+
+
 // Clone loop predicates to cloned loops (peeled, unswitched, split_if).
 Node* PhaseIdealLoop::clone_loop_predicates(Node* old_entry, Node* new_entry,
                                                 bool clone_limit_check,
@@ -333,14 +400,24 @@
   }
   if (predicate_proj != NULL) { // right pattern that can be used by loop predication
     // clone predicate
-    new_entry = clone_predicate(predicate_proj, new_entry,
-                                Deoptimization::Reason_predicate,
-                                loop_phase, igvn);
-    assert(new_entry != NULL && new_entry->is_Proj(), "IfTrue or IfFalse after clone predicate");
+    ProjNode* proj = clone_predicate(predicate_proj, new_entry,
+                                     Deoptimization::Reason_predicate,
+                                     loop_phase, igvn);
+    assert(proj != NULL, "IfTrue or IfFalse after clone predicate");
+    new_entry = proj;
     if (TraceLoopPredicate) {
       tty->print("Loop Predicate cloned: ");
       debug_only( new_entry->in(0)->dump(); );
     }
+    if (profile_predicate_proj != NULL) {
+      // A node that produces memory may be out of loop and depend on
+      // a profiled predicates. In that case the memory state at the
+      // end of profiled predicates and at the end of predicates are
+      // not the same. The cloned predicates are dominated by the
+      // profiled predicates but may have the wrong memory
+      // state. Update it.
+      clone_loop_predicates_fix_mem(profile_predicate_proj, proj, loop_phase, igvn);
+    }
   }
   if (profile_predicate_proj != NULL) { // right pattern that can be used by loop predication
     // clone predicate
--- a/src/hotspot/share/opto/loopnode.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/opto/loopnode.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -1081,6 +1081,10 @@
                                    PhaseIdealLoop* loop_phase,
                                    PhaseIterGVN* igvn);
 
+  static void clone_loop_predicates_fix_mem(ProjNode* dom_proj , ProjNode* proj,
+                                            PhaseIdealLoop* loop_phase,
+                                            PhaseIterGVN* igvn);
+
   static Node* clone_loop_predicates(Node* old_entry, Node* new_entry,
                                          bool clone_limit_check,
                                          PhaseIdealLoop* loop_phase,
--- a/src/hotspot/share/precompiled/precompiled.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/precompiled/precompiled.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -22,316 +22,60 @@
  *
  */
 
-// Precompiled headers are turned off for Sun Studion,
+// Precompiled headers are turned off for Solaris Studio,
 // or if the user passes --disable-precompiled-headers to configure.
 
 #ifndef DONT_USE_PRECOMPILED_HEADER
-# include "jni.h"
-# include "jvm.h"
-# include "asm/assembler.hpp"
-# include "asm/assembler.inline.hpp"
-# include "asm/codeBuffer.hpp"
-# include "asm/register.hpp"
-# include "ci/ciArray.hpp"
-# include "ci/ciArrayKlass.hpp"
-# include "ci/ciClassList.hpp"
-# include "ci/ciConstant.hpp"
-# include "ci/ciConstantPoolCache.hpp"
-# include "ci/ciEnv.hpp"
-# include "ci/ciExceptionHandler.hpp"
-# include "ci/ciField.hpp"
-# include "ci/ciFlags.hpp"
-# include "ci/ciInstance.hpp"
-# include "ci/ciInstanceKlass.hpp"
-# include "ci/ciKlass.hpp"
-# include "ci/ciMethod.hpp"
-# include "ci/ciNullObject.hpp"
-# include "ci/ciObjArrayKlass.hpp"
-# include "ci/ciObject.hpp"
-# include "ci/ciObjectFactory.hpp"
-# include "ci/ciSignature.hpp"
-# include "ci/ciStreams.hpp"
-# include "ci/ciSymbol.hpp"
-# include "ci/ciType.hpp"
-# include "ci/ciTypeArrayKlass.hpp"
-# include "ci/ciUtilities.inline.hpp"
-# include "ci/compilerInterface.hpp"
-# include "classfile/classFileParser.hpp"
-# include "classfile/classFileStream.hpp"
-# include "classfile/classLoader.hpp"
-# include "classfile/javaClasses.hpp"
-# include "classfile/moduleEntry.hpp"
-# include "classfile/modules.hpp"
-# include "classfile/packageEntry.hpp"
-# include "classfile/symbolTable.hpp"
-# include "classfile/systemDictionary.hpp"
-# include "classfile/vmSymbols.hpp"
-# include "code/codeBlob.hpp"
-# include "code/codeCache.hpp"
-# include "code/compressedStream.hpp"
-# include "code/debugInfo.hpp"
-# include "code/debugInfoRec.hpp"
-# include "code/dependencies.hpp"
-# include "code/exceptionHandlerTable.hpp"
-# include "code/location.hpp"
-# include "code/nativeInst.hpp"
-# include "code/nmethod.hpp"
-# include "code/oopRecorder.hpp"
-# include "code/pcDesc.hpp"
-# include "code/relocInfo.hpp"
-# include "code/stubs.hpp"
-# include "code/vmreg.hpp"
-# include "compiler/disassembler.hpp"
-# include "compiler/methodLiveness.hpp"
-# include "compiler/oopMap.hpp"
-# include "gc/shared/adaptiveSizePolicy.hpp"
-# include "gc/shared/ageTable.hpp"
-# include "gc/shared/barrierSet.hpp"
-# include "gc/shared/blockOffsetTable.hpp"
-# include "gc/shared/cardTableBarrierSet.hpp"
-# include "gc/shared/collectedHeap.hpp"
-# include "gc/shared/collectorCounters.hpp"
-# include "gc/shared/collectorPolicy.hpp"
-# include "gc/shared/gcCause.hpp"
-# include "gc/shared/gcLocker.hpp"
-# include "gc/shared/gcStats.hpp"
-# include "gc/shared/gcUtil.hpp"
-# include "gc/shared/genCollectedHeap.hpp"
-# include "gc/shared/generation.hpp"
-# include "gc/shared/generationCounters.hpp"
-# include "gc/shared/jvmFlagConstraintsGC.hpp"
-# include "gc/shared/modRefBarrierSet.hpp"
-# include "gc/shared/ptrQueue.hpp"
-# include "gc/shared/referencePolicy.hpp"
-# include "gc/shared/referenceProcessor.hpp"
-# include "gc/shared/satbMarkQueue.hpp"
-# include "gc/shared/space.hpp"
-# include "gc/shared/spaceDecorator.hpp"
-# include "gc/shared/taskqueue.hpp"
-# include "gc/shared/threadLocalAllocBuffer.hpp"
-# include "gc/shared/workgroup.hpp"
-# include "interpreter/abstractInterpreter.hpp"
-# include "interpreter/bytecode.hpp"
-# include "interpreter/bytecodeHistogram.hpp"
-# include "interpreter/bytecodeInterpreter.hpp"
-# include "interpreter/bytecodeInterpreter.inline.hpp"
-# include "interpreter/bytecodeTracer.hpp"
-# include "interpreter/bytecodes.hpp"
-# include "interpreter/cppInterpreter.hpp"
-# include "interpreter/interp_masm.hpp"
-# include "interpreter/interpreter.hpp"
-# include "interpreter/invocationCounter.hpp"
-# include "interpreter/linkResolver.hpp"
-# include "interpreter/templateInterpreter.hpp"
-# include "interpreter/templateTable.hpp"
-# include "jvmtifiles/jvmti.h"
-# include "logging/log.hpp"
-# include "memory/allocation.hpp"
-# include "memory/arena.hpp"
-# include "memory/heap.hpp"
-# include "memory/iterator.hpp"
-# include "memory/memRegion.hpp"
-# include "memory/oopFactory.hpp"
-# include "memory/resourceArea.hpp"
-# include "memory/universe.hpp"
-# include "memory/universe.hpp"
-# include "memory/virtualspace.hpp"
-# include "oops/array.hpp"
-# include "oops/arrayKlass.hpp"
-# include "oops/arrayOop.hpp"
-# include "oops/constMethod.hpp"
-# include "oops/instanceKlass.hpp"
-# include "oops/instanceOop.hpp"
-# include "oops/instanceRefKlass.hpp"
-# include "oops/klass.hpp"
-# include "oops/klassVtable.hpp"
-# include "oops/markOop.hpp"
-# include "oops/markOop.inline.hpp"
-# include "oops/method.hpp"
-# include "oops/methodData.hpp"
-# include "oops/objArrayKlass.hpp"
-# include "oops/objArrayOop.hpp"
-# include "oops/oop.hpp"
-# include "oops/oopsHierarchy.hpp"
-# include "oops/symbol.hpp"
-# include "oops/typeArrayKlass.hpp"
-# include "oops/typeArrayOop.hpp"
-# include "prims/jvmtiExport.hpp"
-# include "prims/methodHandles.hpp"
-# include "runtime/arguments.hpp"
-# include "runtime/atomic.hpp"
-# include "runtime/deoptimization.hpp"
-# include "runtime/extendedPC.hpp"
-# include "runtime/fieldDescriptor.hpp"
-# include "runtime/fieldType.hpp"
-# include "runtime/flags/flagSetting.hpp"
-# include "runtime/flags/jvmFlag.hpp"
-# include "runtime/flags/jvmFlagConstraintList.hpp"
-# include "runtime/flags/jvmFlagConstraintsCompiler.hpp"
-# include "runtime/flags/jvmFlagConstraintsRuntime.hpp"
-# include "runtime/flags/jvmFlagRangeList.hpp"
-# include "runtime/flags/jvmFlagWriteableList.hpp"
-# include "runtime/frame.hpp"
-# include "runtime/frame.inline.hpp"
-# include "runtime/globals.hpp"
-# include "runtime/globals_extension.hpp"
-# include "runtime/handles.hpp"
-# include "runtime/handles.inline.hpp"
-# include "runtime/icache.hpp"
-# include "runtime/init.hpp"
-# include "runtime/interfaceSupport.inline.hpp"
-# include "runtime/java.hpp"
-# include "runtime/javaCalls.hpp"
-# include "runtime/javaFrameAnchor.hpp"
-# include "runtime/jniHandles.hpp"
-# include "runtime/monitorChunk.hpp"
-# include "runtime/mutex.hpp"
-# include "runtime/mutexLocker.hpp"
-# include "runtime/objectMonitor.hpp"
-# include "runtime/orderAccess.hpp"
-# include "runtime/orderAccess.hpp"
-# include "runtime/os.hpp"
-# include "runtime/osThread.hpp"
-# include "runtime/perfData.hpp"
-# include "runtime/perfMemory.hpp"
-# include "runtime/prefetch.hpp"
-# include "runtime/prefetch.inline.hpp"
-# include "runtime/reflection.hpp"
-# include "runtime/reflectionUtils.hpp"
-# include "runtime/registerMap.hpp"
-# include "runtime/safepoint.hpp"
-# include "runtime/sharedRuntime.hpp"
-# include "runtime/signature.hpp"
-# include "runtime/stackValue.hpp"
-# include "runtime/stackValueCollection.hpp"
-# include "runtime/stubCodeGenerator.hpp"
-# include "runtime/stubRoutines.hpp"
-# include "runtime/synchronizer.hpp"
-# include "runtime/thread.hpp"
-# include "runtime/timer.hpp"
-# include "runtime/unhandledOops.hpp"
-# include "runtime/vframe.hpp"
-# include "runtime/vmThread.hpp"
-# include "runtime/vm_operations.hpp"
-# include "runtime/vm_version.hpp"
-# include "services/allocationSite.hpp"
-# include "services/lowMemoryDetector.hpp"
-# include "services/mallocTracker.hpp"
-# include "services/memBaseline.hpp"
-# include "services/memReporter.hpp"
-# include "services/memTracker.hpp"
-# include "services/memoryPool.hpp"
-# include "services/memoryService.hpp"
-# include "services/memoryUsage.hpp"
-# include "services/nmtCommon.hpp"
-# include "services/virtualMemoryTracker.hpp"
-# include "utilities/accessFlags.hpp"
-# include "utilities/bitMap.hpp"
-# include "utilities/bitMap.inline.hpp"
-# include "utilities/bytes.hpp"
-# include "utilities/constantTag.hpp"
-# include "utilities/copy.hpp"
-# include "utilities/debug.hpp"
-# include "utilities/exceptions.hpp"
-# include "utilities/globalDefinitions.hpp"
-# include "utilities/growableArray.hpp"
-# include "utilities/hashtable.hpp"
-# include "utilities/histogram.hpp"
-# include "utilities/macros.hpp"
-# include "utilities/nativeCallStack.hpp"
-# include "utilities/numberSeq.hpp"
-# include "utilities/ostream.hpp"
-# include "utilities/preserveException.hpp"
-# include "utilities/sizes.hpp"
-# include "utilities/utf8.hpp"
-#ifdef COMPILER2
-# include "libadt/dict.hpp"
-# include "libadt/set.hpp"
-# include "libadt/vectset.hpp"
-# include "opto/ad.hpp"
-# include "opto/addnode.hpp"
-# include "opto/adlcVMDeps.hpp"
-# include "opto/block.hpp"
-# include "opto/c2_globals.hpp"
-# include "opto/callnode.hpp"
-# include "opto/castnode.hpp"
-# include "opto/cfgnode.hpp"
-# include "opto/compile.hpp"
-# include "opto/connode.hpp"
-# include "opto/convertnode.hpp"
-# include "opto/countbitsnode.hpp"
-# include "opto/idealGraphPrinter.hpp"
-# include "opto/intrinsicnode.hpp"
-# include "opto/loopnode.hpp"
-# include "opto/machnode.hpp"
-# include "opto/matcher.hpp"
-# include "opto/memnode.hpp"
-# include "opto/movenode.hpp"
-# include "opto/mulnode.hpp"
-# include "opto/multnode.hpp"
-# include "opto/narrowptrnode.hpp"
-# include "opto/opaquenode.hpp"
-# include "opto/opcodes.hpp"
-# include "opto/optoreg.hpp"
-# include "opto/phase.hpp"
-# include "opto/phaseX.hpp"
-# include "opto/regalloc.hpp"
-# include "opto/regmask.hpp"
-# include "opto/runtime.hpp"
-# include "opto/subnode.hpp"
-# include "opto/type.hpp"
-# include "opto/vectornode.hpp"
-#endif // COMPILER2
-#ifdef COMPILER1
-# include "c1/c1_Compilation.hpp"
-# include "c1/c1_Defs.hpp"
-# include "c1/c1_FrameMap.hpp"
-# include "c1/c1_LIR.hpp"
-# include "c1/c1_MacroAssembler.hpp"
-# include "c1/c1_ValueType.hpp"
-# include "c1/c1_globals.hpp"
-#endif // COMPILER1
-#if INCLUDE_JVMCI
-# include "jvmci/jvmci_globals.hpp"
-#endif // INCLUDE_JVMCI
-#if INCLUDE_CMSGC
-# include "gc/cms/allocationStats.hpp"
-# include "gc/cms/compactibleFreeListSpace.hpp"
-# include "gc/cms/concurrentMarkSweepGeneration.hpp"
-# include "gc/cms/freeChunk.hpp"
-# include "gc/cms/gSpaceCounters.hpp"
-# include "gc/cms/jvmFlagConstraintsCMS.hpp"
-# include "gc/cms/parOopClosures.hpp"
-# include "gc/cms/promotionInfo.hpp"
-# include "gc/cms/yieldingWorkgroup.hpp"
-#endif // INCLUDE_CMSGC
-#if INCLUDE_G1GC
-# include "gc/g1/dirtyCardQueue.hpp"
-# include "gc/g1/g1BlockOffsetTable.hpp"
-# include "gc/g1/g1OopClosures.hpp"
-# include "gc/g1/g1_globals.hpp"
-# include "gc/g1/jvmFlagConstraintsG1.hpp"
-#endif // INCLUDE_G1GC
-#if INCLUDE_PARALLELGC
-# include "gc/parallel/gcAdaptivePolicyCounters.hpp"
-# include "gc/parallel/immutableSpace.hpp"
-# include "gc/parallel/jvmFlagConstraintsParallel.hpp"
-# include "gc/parallel/mutableSpace.hpp"
-# include "gc/parallel/objectStartArray.hpp"
-# include "gc/parallel/parMarkBitMap.hpp"
-# include "gc/parallel/parallelScavengeHeap.hpp"
-# include "gc/parallel/psAdaptiveSizePolicy.hpp"
-# include "gc/parallel/psCompactionManager.hpp"
-# include "gc/parallel/psGCAdaptivePolicyCounters.hpp"
-# include "gc/parallel/psGenerationCounters.hpp"
-# include "gc/parallel/psOldGen.hpp"
-# include "gc/parallel/psVirtualspace.hpp"
-# include "gc/parallel/psYoungGen.hpp"
-# include "gc/parallel/spaceCounters.hpp"
-#endif // INCLUDE_PARALLELGC
-#if INCLUDE_SERIALGC
-# include "gc/serial/cSpaceCounters.hpp"
-# include "gc/serial/defNewGeneration.hpp"
-#endif // INCLUDE_SERIALGC
+
+// These header files are included in at least 130 C++ files, as of
+// measurements made in November 2018. This list excludes files named
+// *.include.hpp, since including them decreased build performance.
+
+#include "classfile/classLoaderData.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc/shared/collectedHeap.hpp"
+#include "gc/shared/gcCause.hpp"
+#include "logging/log.hpp"
+#include "memory/allocation.hpp"
+#include "memory/iterator.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/resourceArea.hpp"
+#include "memory/universe.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klass.hpp"
+#include "oops/method.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/mutex.hpp"
+#include "runtime/orderAccess.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/timer.hpp"
+#include "services/memTracker.hpp"
+#include "utilities/align.hpp"
+#include "utilities/bitMap.hpp"
+#include "utilities/copy.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/exceptions.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/macros.hpp"
+#include "utilities/ostream.hpp"
+#include "utilities/ticks.hpp"
+
+#ifdef TARGET_COMPILER_visCPP
+// For Visual Studio, including the *.inline.hpp files actually
+// increased performance.
+#include "memory/allocation.inline.hpp"
+#include "oops/access.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#endif // TARGET_COMPILER_visCPP
 
 #endif // !DONT_USE_PRECOMPILED_HEADER
--- a/src/hotspot/share/prims/jni.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/prims/jni.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -86,7 +86,6 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/histogram.hpp"
-#include "utilities/internalVMTests.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/vmError.hpp"
 #if INCLUDE_JVMCI
@@ -3977,9 +3976,6 @@
     // Some platforms (like Win*) need a wrapper around these test
     // functions in order to properly handle error conditions.
     VMError::test_error_handler();
-    if (ExecuteInternalVMTests) {
-      InternalVMTests::run();
-    }
 #endif
 
     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
--- a/src/hotspot/share/prims/methodHandles.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/prims/methodHandles.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -1075,7 +1075,7 @@
 void MethodHandles::add_dependent_nmethod(oop call_site, nmethod* nm) {
   assert_locked_or_safepoint(CodeCache_lock);
 
-  oop context = java_lang_invoke_CallSite::context(call_site);
+  oop context = java_lang_invoke_CallSite::context_no_keepalive(call_site);
   DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context);
   // Try to purge stale entries on updates.
   // Since GC doesn't clean dependency contexts rooted at CallSiteContext objects,
@@ -1088,7 +1088,7 @@
 void MethodHandles::remove_dependent_nmethod(oop call_site, nmethod* nm) {
   assert_locked_or_safepoint(CodeCache_lock);
 
-  oop context = java_lang_invoke_CallSite::context(call_site);
+  oop context = java_lang_invoke_CallSite::context_no_keepalive(call_site);
   DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context);
   deps.remove_dependent_nmethod(nm, /*expunge_stale_entries=*/safe_to_expunge());
 }
@@ -1102,7 +1102,7 @@
     NoSafepointVerifier nsv;
     MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 
-    oop context = java_lang_invoke_CallSite::context(call_site());
+    oop context = java_lang_invoke_CallSite::context_no_keepalive(call_site());
     DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context);
     marked = deps.mark_dependent_nmethods(changes);
   }
--- a/src/hotspot/share/prims/whitebox.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/prims/whitebox.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -1774,7 +1774,7 @@
 WB_END
 
 WB_ENTRY(jboolean, WB_AreSharedStringsIgnored(JNIEnv* env))
-  return !StringTable::shared_string_mapped();
+  return !HeapShared::closed_archive_heap_region_mapped();
 WB_END
 
 WB_ENTRY(jobject, WB_GetResolvedReferences(JNIEnv* env, jobject wb, jclass clazz))
--- a/src/hotspot/share/runtime/serviceThread.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/runtime/serviceThread.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -29,6 +29,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
+#include "runtime/jniHandles.hpp"
 #include "runtime/serviceThread.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/os.hpp"
@@ -80,7 +81,39 @@
   }
 }
 
+static bool needs_oopstorage_cleanup(OopStorage* const* storages,
+                                     bool* needs_cleanup,
+                                     size_t size) {
+  bool any_needs_cleanup = false;
+  for (size_t i = 0; i < size; ++i) {
+    assert(!needs_cleanup[i], "precondition");
+    if (storages[i]->needs_delete_empty_blocks()) {
+      needs_cleanup[i] = true;
+      any_needs_cleanup = true;
+    }
+  }
+  return any_needs_cleanup;
+}
+
+static void cleanup_oopstorages(OopStorage* const* storages,
+                                const bool* needs_cleanup,
+                                size_t size) {
+  for (size_t i = 0; i < size; ++i) {
+    if (needs_cleanup[i]) {
+      storages[i]->delete_empty_blocks();
+    }
+  }
+}
+
 void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
+  OopStorage* const oopstorages[] = {
+    JNIHandles::global_handles(),
+    JNIHandles::weak_global_handles(),
+    StringTable::weak_storage(),
+    SystemDictionary::vm_weak_oop_storage()
+  };
+  const size_t oopstorage_count = ARRAY_SIZE(oopstorages);
+
   while (true) {
     bool sensors_changed = false;
     bool has_jvmti_events = false;
@@ -90,6 +123,8 @@
     bool symboltable_work = false;
     bool resolved_method_table_work = false;
     bool protection_domain_table_work = false;
+    bool oopstorage_work = false;
+    bool oopstorages_cleanup[oopstorage_count] = {}; // Zero (false) initialize.
     JvmtiDeferredEvent jvmti_event;
     {
       // Need state transition ThreadBlockInVM so that this thread
@@ -102,7 +137,7 @@
 
       ThreadBlockInVM tbivm(jt);
 
-      MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
+      MonitorLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
       // Process all available work on each (outer) iteration, rather than
       // only the first recognized bit of work, to avoid frequently true early
       // tests from potentially starving later work.  Hence the use of
@@ -114,10 +149,14 @@
               (stringtable_work = StringTable::has_work()) |
               (symboltable_work = SymbolTable::has_work()) |
               (resolved_method_table_work = ResolvedMethodTable::has_work()) |
-              (protection_domain_table_work = SystemDictionary::pd_cache_table()->has_work()))
+              (protection_domain_table_work = SystemDictionary::pd_cache_table()->has_work()) |
+              (oopstorage_work = needs_oopstorage_cleanup(oopstorages,
+                                                          oopstorages_cleanup,
+                                                          oopstorage_count)))
+
              == 0) {
         // Wait until notified that there is some work to do.
-        Service_lock->wait(Mutex::_no_safepoint_check_flag);
+        ml.wait(Mutex::_no_safepoint_check_flag);
       }
 
       if (has_jvmti_events) {
@@ -156,6 +195,10 @@
     if (protection_domain_table_work) {
       SystemDictionary::pd_cache_table()->unlink();
     }
+
+    if (oopstorage_work) {
+      cleanup_oopstorages(oopstorages, oopstorages_cleanup, oopstorage_count);
+    }
   }
 }
 
--- a/src/hotspot/share/services/writeableFlags.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/services/writeableFlags.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -116,7 +116,7 @@
 JVMFlag::Error WriteableFlags::set_int_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
   int value;
 
-  if (sscanf(arg, "%d", &value)) {
+  if (sscanf(arg, "%d", &value) == 1) {
     return set_int_flag(name, value, origin, err_msg);
   }
   err_msg.print("flag value must be an integer");
@@ -133,7 +133,7 @@
 JVMFlag::Error WriteableFlags::set_uint_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
   uint value;
 
-  if (sscanf(arg, "%u", &value)) {
+  if (sscanf(arg, "%u", &value) == 1) {
     return set_uint_flag(name, value, origin, err_msg);
   }
   err_msg.print("flag value must be an unsigned integer");
@@ -150,7 +150,7 @@
 JVMFlag::Error WriteableFlags::set_intx_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
   intx value;
 
-  if (sscanf(arg, INTX_FORMAT, &value)) {
+  if (sscanf(arg, INTX_FORMAT, &value) == 1) {
     return set_intx_flag(name, value, origin, err_msg);
   }
   err_msg.print("flag value must be an integer");
@@ -167,7 +167,7 @@
 JVMFlag::Error WriteableFlags::set_uintx_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
   uintx value;
 
-  if (sscanf(arg, UINTX_FORMAT, &value)) {
+  if (sscanf(arg, UINTX_FORMAT, &value) == 1) {
     return set_uintx_flag(name, value, origin, err_msg);
   }
   err_msg.print("flag value must be an unsigned integer");
@@ -184,7 +184,7 @@
 JVMFlag::Error WriteableFlags::set_uint64_t_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
   uint64_t value;
 
-  if (sscanf(arg, UINT64_FORMAT, &value)) {
+  if (sscanf(arg, UINT64_FORMAT, &value) == 1) {
     return set_uint64_t_flag(name, value, origin, err_msg);
   }
   err_msg.print("flag value must be an unsigned 64-bit integer");
@@ -201,7 +201,7 @@
 JVMFlag::Error WriteableFlags::set_size_t_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
   size_t value;
 
-  if (sscanf(arg, SIZE_FORMAT, &value)) {
+  if (sscanf(arg, SIZE_FORMAT, &value) == 1) {
     return set_size_t_flag(name, value, origin, err_msg);
   }
   err_msg.print("flag value must be an unsigned integer");
@@ -214,6 +214,23 @@
   return err;
 }
 
+// set a double global flag
+JVMFlag::Error WriteableFlags::set_double_flag(const char* name, const char* arg, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
+  double value;
+
+  if (sscanf(arg, "%lf", &value) == 1) {
+    return set_double_flag(name, value, origin, err_msg);
+  }
+  err_msg.print("flag value must be a double");
+  return JVMFlag::WRONG_FORMAT;
+}
+
+JVMFlag::Error WriteableFlags::set_double_flag(const char* name, double value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
+  JVMFlag::Error err = JVMFlag::doubleAtPut(name, &value, origin);
+  print_flag_error_message_if_needed(err, name, err_msg);
+  return err;
+}
+
 // set a string global flag using value from AttachOperation
 JVMFlag::Error WriteableFlags::set_ccstr_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg) {
   JVMFlag::Error err = JVMFlag::ccstrAtPut((char*)name, &value, origin);
@@ -286,6 +303,8 @@
     return set_uint64_t_flag(f->_name, flag_value, origin, err_msg);
   } else if (f->is_size_t()) {
     return set_size_t_flag(f->_name, flag_value, origin, err_msg);
+  } else if (f->is_double()) {
+    return set_double_flag(f->_name, flag_value, origin, err_msg);
   } else if (f->is_ccstr()) {
     return set_ccstr_flag(f->_name, flag_value, origin, err_msg);
   } else {
@@ -319,6 +338,9 @@
   } else if (f->is_size_t()) {
     size_t svalue = (size_t)new_value.j;
     return set_size_t_flag(f->_name, svalue, origin, err_msg);
+  } else if (f->is_double()) {
+    double dvalue = (double)new_value.d;
+    return set_double_flag(f->_name, dvalue, origin, err_msg);
   } else if (f->is_ccstr()) {
     oop str = JNIHandles::resolve_external_guard(new_value.l);
     if (str == NULL) {
--- a/src/hotspot/share/services/writeableFlags.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/services/writeableFlags.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -52,6 +52,8 @@
   static JVMFlag::Error set_uint64_t_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg);
   // set a size_t global flag using value from AttachOperation
   static JVMFlag::Error set_size_t_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg);
+  // set a double global flag using value from AttachOperation
+  static JVMFlag::Error set_double_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg);
   // set a boolean global flag
   static JVMFlag::Error set_bool_flag(const char* name, bool value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg);
   // set a int global flag
@@ -66,6 +68,8 @@
   static JVMFlag::Error set_uint64_t_flag(const char* name, uint64_t value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg);
   // set a size_t global flag using value from AttachOperation
   static JVMFlag::Error set_size_t_flag(const char* name, size_t value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg);
+  // set a double global flag using value from AttachOperation
+  static JVMFlag::Error set_double_flag(const char* name, double value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg);
   // set a string global flag
   static JVMFlag::Error set_ccstr_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg);
 
--- a/src/hotspot/share/utilities/bitMap.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/utilities/bitMap.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -61,6 +61,17 @@
   bm_word_t* _map;     // First word in bitmap
   idx_t      _size;    // Size of bitmap (in bits)
 
+  // Helper for get_next_{zero,one}_bit variants.
+  // - flip designates whether searching for 1s or 0s.  Must be one of
+  //   find_{zeros,ones}_flip.
+  // - aligned_right is true if r_index is a priori on a bm_word_t boundary.
+  template<bm_word_t flip, bool aligned_right>
+  inline idx_t get_next_bit_impl(idx_t l_index, idx_t r_index) const;
+
+  // Values for get_next_bit_impl flip parameter.
+  static const bm_word_t find_ones_flip = 0;
+  static const bm_word_t find_zeros_flip = ~(bm_word_t)0;
+
  protected:
   // Return the position of bit within the word that contains it (e.g., if
   // bitmap words are 32 bits, return a number 0 <= n <= 31).
--- a/src/hotspot/share/utilities/bitMap.inline.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/utilities/bitMap.inline.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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 "runtime/atomic.hpp"
 #include "utilities/bitMap.hpp"
+#include "utilities/count_trailing_zeros.hpp"
 
 inline void BitMap::set_bit(idx_t bit) {
   verify_index(bit);
@@ -141,152 +142,84 @@
   }
 }
 
+template<BitMap::bm_word_t flip, bool aligned_right>
+inline BitMap::idx_t BitMap::get_next_bit_impl(idx_t l_index, idx_t r_index) const {
+  STATIC_ASSERT(flip == find_ones_flip || flip == find_zeros_flip);
+  verify_range(l_index, r_index);
+  assert(!aligned_right || is_word_aligned(r_index), "r_index not aligned");
+
+  // The first word often contains an interesting bit, either due to
+  // density or because of features of the calling algorithm.  So it's
+  // important to examine that first word with a minimum of fuss,
+  // minimizing setup time for later words that will be wasted if the
+  // first word is indeed interesting.
+
+  // The benefit from aligned_right being true is relatively small.
+  // It saves a couple instructions in the setup for the word search
+  // loop.  It also eliminates the range check on the final result.
+  // However, callers often have a comparison with r_index, and
+  // inlining often allows the two comparisons to be combined; it is
+  // important when !aligned_right that return paths either return
+  // r_index or a value dominated by a comparison with r_index.
+  // aligned_right is still helpful when the caller doesn't have a
+  // range check because features of the calling algorithm guarantee
+  // an interesting bit will be present.
+
+  if (l_index < r_index) {
+    // Get the word containing l_index, and shift out low bits.
+    idx_t index = word_index(l_index);
+    bm_word_t cword = (map(index) ^ flip) >> bit_in_word(l_index);
+    if ((cword & 1) != 0) {
+      // The first bit is similarly often interesting. When it matters
+      // (density or features of the calling algorithm make it likely
+      // the first bit is set), going straight to the next clause compares
+      // poorly with doing this check first; count_trailing_zeros can be
+      // relatively expensive, plus there is the additional range check.
+      // But when the first bit isn't set, the cost of having tested for
+      // it is relatively small compared to the rest of the search.
+      return l_index;
+    } else if (cword != 0) {
+      // Flipped and shifted first word is non-zero.
+      idx_t result = l_index + count_trailing_zeros(cword);
+      if (aligned_right || (result < r_index)) return result;
+      // Result is beyond range bound; return r_index.
+    } else {
+      // Flipped and shifted first word is zero.  Word search through
+      // aligned up r_index for a non-zero flipped word.
+      idx_t limit = aligned_right
+        ? word_index(r_index)
+        : (word_index(r_index - 1) + 1); // Align up, knowing r_index > 0.
+      while (++index < limit) {
+        cword = map(index) ^ flip;
+        if (cword != 0) {
+          idx_t result = bit_index(index) + count_trailing_zeros(cword);
+          if (aligned_right || (result < r_index)) return result;
+          // Result is beyond range bound; return r_index.
+          assert((index + 1) == limit, "invariant");
+          break;
+        }
+      }
+      // No bits in range; return r_index.
+    }
+  }
+  return r_index;
+}
+
 inline BitMap::idx_t
 BitMap::get_next_one_offset(idx_t l_offset, idx_t r_offset) const {
-  assert(l_offset <= size(), "BitMap index out of bounds");
-  assert(r_offset <= size(), "BitMap index out of bounds");
-  assert(l_offset <= r_offset, "l_offset > r_offset ?");
-
-  if (l_offset == r_offset) {
-    return l_offset;
-  }
-  idx_t   index = word_index(l_offset);
-  idx_t r_index = word_index(r_offset-1) + 1;
-  idx_t res_offset = l_offset;
-
-  // check bits including and to the _left_ of offset's position
-  idx_t pos = bit_in_word(res_offset);
-  bm_word_t res = map(index) >> pos;
-  if (res != 0) {
-    // find the position of the 1-bit
-    for (; !(res & 1); res_offset++) {
-      res = res >> 1;
-    }
-
-#ifdef ASSERT
-    // In the following assert, if r_offset is not bitamp word aligned,
-    // checking that res_offset is strictly less than r_offset is too
-    // strong and will trip the assert.
-    //
-    // Consider the case where l_offset is bit 15 and r_offset is bit 17
-    // of the same map word, and where bits [15:16:17:18] == [00:00:00:01].
-    // All the bits in the range [l_offset:r_offset) are 0.
-    // The loop that calculates res_offset, above, would yield the offset
-    // of bit 18 because it's in the same map word as l_offset and there
-    // is a set bit in that map word above l_offset (i.e. res != NoBits).
-    //
-    // In this case, however, we can assert is that res_offset is strictly
-    // less than size() since we know that there is at least one set bit
-    // at an offset above, but in the same map word as, r_offset.
-    // Otherwise, if r_offset is word aligned then it will not be in the
-    // same map word as l_offset (unless it equals l_offset). So either
-    // there won't be a set bit between l_offset and the end of it's map
-    // word (i.e. res == NoBits), or res_offset will be less than r_offset.
-
-    idx_t limit = is_word_aligned(r_offset) ? r_offset : size();
-    assert(res_offset >= l_offset && res_offset < limit, "just checking");
-#endif // ASSERT
-    return MIN2(res_offset, r_offset);
-  }
-  // skip over all word length 0-bit runs
-  for (index++; index < r_index; index++) {
-    res = map(index);
-    if (res != 0) {
-      // found a 1, return the offset
-      for (res_offset = bit_index(index); !(res & 1); res_offset++) {
-        res = res >> 1;
-      }
-      assert(res & 1, "tautology; see loop condition");
-      assert(res_offset >= l_offset, "just checking");
-      return MIN2(res_offset, r_offset);
-    }
-  }
-  return r_offset;
+  return get_next_bit_impl<find_ones_flip, false>(l_offset, r_offset);
 }
 
 inline BitMap::idx_t
 BitMap::get_next_zero_offset(idx_t l_offset, idx_t r_offset) const {
-  assert(l_offset <= size(), "BitMap index out of bounds");
-  assert(r_offset <= size(), "BitMap index out of bounds");
-  assert(l_offset <= r_offset, "l_offset > r_offset ?");
-
-  if (l_offset == r_offset) {
-    return l_offset;
-  }
-  idx_t   index = word_index(l_offset);
-  idx_t r_index = word_index(r_offset-1) + 1;
-  idx_t res_offset = l_offset;
-
-  // check bits including and to the _left_ of offset's position
-  idx_t pos = bit_in_word(res_offset);
-  bm_word_t res = ~map(index) >> pos; // flip bits and shift for l_offset
-
-  if (res != 0) {
-    // find the position of the 1-bit
-    for (; !(res & 1); res_offset++) {
-      res = res >> 1;
-    }
-    assert(res_offset >= l_offset, "just checking");
-    return MIN2(res_offset, r_offset);
-  }
-  // skip over all word length 1-bit runs
-  for (index++; index < r_index; index++) {
-    res = map(index);
-    if (res != ~(bm_word_t)0) {
-      // found a 0, return the offset
-      for (res_offset = index << LogBitsPerWord; res & 1;
-           res_offset++) {
-        res = res >> 1;
-      }
-      assert(!(res & 1), "tautology; see loop condition");
-      assert(res_offset >= l_offset, "just checking");
-      return MIN2(res_offset, r_offset);
-    }
-  }
-  return r_offset;
+  return get_next_bit_impl<find_zeros_flip, false>(l_offset, r_offset);
 }
 
 inline BitMap::idx_t
-BitMap::get_next_one_offset_aligned_right(idx_t l_offset, idx_t r_offset) const
-{
-  verify_range(l_offset, r_offset);
-  assert(bit_in_word(r_offset) == 0, "r_offset not word-aligned");
-
-  if (l_offset == r_offset) {
-    return l_offset;
-  }
-  idx_t   index = word_index(l_offset);
-  idx_t r_index = word_index(r_offset);
-  idx_t res_offset = l_offset;
-
-  // check bits including and to the _left_ of offset's position
-  bm_word_t res = map(index) >> bit_in_word(res_offset);
-  if (res != 0) {
-    // find the position of the 1-bit
-    for (; !(res & 1); res_offset++) {
-      res = res >> 1;
-    }
-    assert(res_offset >= l_offset &&
-           res_offset < r_offset, "just checking");
-    return res_offset;
-  }
-  // skip over all word length 0-bit runs
-  for (index++; index < r_index; index++) {
-    res = map(index);
-    if (res != 0) {
-      // found a 1, return the offset
-      for (res_offset = bit_index(index); !(res & 1); res_offset++) {
-        res = res >> 1;
-      }
-      assert(res & 1, "tautology; see loop condition");
-      assert(res_offset >= l_offset && res_offset < r_offset, "just checking");
-      return res_offset;
-    }
-  }
-  return r_offset;
+BitMap::get_next_one_offset_aligned_right(idx_t l_offset, idx_t r_offset) const {
+  return get_next_bit_impl<find_ones_flip, true>(l_offset, r_offset);
 }
 
-
 // Returns a bit mask for a range of bits [beg, end) within a single word.  Each
 // bit in the mask is 0 if the bit is in the range, 1 if not in the range.  The
 // returned mask can be used directly to clear the range, or inverted to set the
--- a/src/hotspot/share/utilities/hashtable.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/utilities/hashtable.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -97,67 +97,6 @@
   return entry;
 }
 
-// Check to see if the hashtable is unbalanced.  The caller set a flag to
-// rehash at the next safepoint.  If this bucket is 60 times greater than the
-// expected average bucket length, it's an unbalanced hashtable.
-// This is somewhat an arbitrary heuristic but if one bucket gets to
-// rehash_count which is currently 100, there's probably something wrong.
-
-template <class T, MEMFLAGS F> bool RehashableHashtable<T, F>::check_rehash_table(int count) {
-  assert(this->table_size() != 0, "underflow");
-  if (count > (((double)this->number_of_entries()/(double)this->table_size())*rehash_multiple)) {
-    // Set a flag for the next safepoint, which should be at some guaranteed
-    // safepoint interval.
-    return true;
-  }
-  return false;
-}
-
-// Create a new table and using alternate hash code, populate the new table
-// with the existing elements.   This can be used to change the hash code
-// and could in the future change the size of the table.
-
-template <class T, MEMFLAGS F> void RehashableHashtable<T, F>::move_to(RehashableHashtable<T, F>* new_table) {
-
-  // Initialize the global seed for hashing.
-  _seed = AltHashing::compute_seed();
-  assert(seed() != 0, "shouldn't be zero");
-
-  int saved_entry_count = this->number_of_entries();
-
-  // Iterate through the table and create a new entry for the new table
-  for (int i = 0; i < new_table->table_size(); ++i) {
-    for (HashtableEntry<T, F>* p = this->bucket(i); p != NULL; ) {
-      HashtableEntry<T, F>* next = p->next();
-      T string = p->literal();
-      // Use alternate hashing algorithm on the symbol in the first table
-      unsigned int hashValue = string->new_hash(seed());
-      // Get a new index relative to the new table (can also change size)
-      int index = new_table->hash_to_index(hashValue);
-      p->set_hash(hashValue);
-      // Keep the shared bit in the Hashtable entry to indicate that this entry
-      // can't be deleted.   The shared bit is the LSB in the _next field so
-      // walking the hashtable past these entries requires
-      // BasicHashtableEntry::make_ptr() call.
-      bool keep_shared = p->is_shared();
-      this->unlink_entry(p);
-      new_table->add_entry(index, p);
-      if (keep_shared) {
-        p->set_shared();
-      }
-      p = next;
-    }
-  }
-  // give the new table the free list as well
-  new_table->copy_freelist(this);
-
-  // Destroy memory used by the buckets in the hashtable.  The memory
-  // for the elements has been used in a new table and is not
-  // destroyed.  The memory reuse will benefit resizing the SystemDictionary
-  // to avoid a memory allocation spike at safepoint.
-  BasicHashtable<F>::free_buckets();
-}
-
 template <MEMFLAGS F> void BasicHashtable<F>::free_buckets() {
   if (NULL != _buckets) {
     // Don't delete the buckets in the shared space.  They aren't
@@ -452,8 +391,6 @@
 template class HashtableEntry<nmethod*, mtGC>;
 template class BasicHashtable<mtGC>;
 template class Hashtable<ConstantPool*, mtClass>;
-template class RehashableHashtable<Symbol*, mtSymbol>;
-template class RehashableHashtable<oop, mtSymbol>;
 template class Hashtable<Symbol*, mtSymbol>;
 template class Hashtable<Klass*, mtClass>;
 template class Hashtable<InstanceKlass*, mtClass>;
--- a/src/hotspot/share/utilities/hashtable.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/hotspot/share/utilities/hashtable.hpp	Mon Nov 05 19:05:15 2018 -0500
@@ -285,38 +285,4 @@
   }
 };
 
-template <class T, MEMFLAGS F> class RehashableHashtable : public Hashtable<T, F> {
- friend class VMStructs;
- protected:
-
-  enum {
-    rehash_count = 100,
-    rehash_multiple = 60
-  };
-
-  // Check that the table is unbalanced
-  bool check_rehash_table(int count);
-
- public:
-  RehashableHashtable(int table_size, int entry_size)
-    : Hashtable<T, F>(table_size, entry_size) { }
-
-  RehashableHashtable(int table_size, int entry_size,
-                   HashtableBucket<F>* buckets, int number_of_entries)
-    : Hashtable<T, F>(table_size, entry_size, buckets, number_of_entries) { }
-
-
-  // Function to move these elements into the new table.
-  void move_to(RehashableHashtable<T, F>* new_table);
-  static bool use_alternate_hashcode();
-  static juint seed();
-
- private:
-  static juint _seed;
-};
-
-template <class T, MEMFLAGS F> juint RehashableHashtable<T, F>::_seed = 0;
-template <class T, MEMFLAGS F> juint RehashableHashtable<T, F>::seed() { return _seed; };
-template <class T, MEMFLAGS F> bool  RehashableHashtable<T, F>::use_alternate_hashcode() { return _seed != 0; };
-
 #endif // SHARE_VM_UTILITIES_HASHTABLE_HPP
--- a/src/hotspot/share/utilities/internalVMTests.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2016, 2018, 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"
-
-#ifndef PRODUCT
-#include <locale.h>
-
-#include "utilities/internalVMTests.hpp"
-#include "utilities/macros.hpp"
-#include "utilities/ostream.hpp"
-
-#define run_unit_test(unit_test_function_call)                \
-  void unit_test_function_call();                             \
-  run_test(#unit_test_function_call, unit_test_function_call);
-
-void InternalVMTests::run_test(const char* name, void (*test)()) {
-  tty->print_cr("Running test: %s", name);
-  test();
-}
-
-void InternalVMTests::run() {
-  tty->print_cr("Running internal VM tests");
-  run_unit_test(TestReserveMemorySpecial_test);
-  tty->print_cr("All internal VM tests passed");
-}
-
-#endif
--- a/src/hotspot/share/utilities/internalVMTests.hpp	Mon Nov 05 19:00:34 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP
-#define SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP
-
-#ifndef PRODUCT
-
-#include "memory/allocation.hpp"
-
-class InternalVMTests : public AllStatic {
-  static void run_test(const char* name, void (*test)());
- public:
-  static void run();
-};
-
-#endif
-
-#endif // SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP
--- a/src/java.base/share/classes/java/lang/Integer.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/java.base/share/classes/java/lang/Integer.java	Mon Nov 05 19:05:15 2018 -0500
@@ -992,6 +992,12 @@
      * During VM initialization, java.lang.Integer.IntegerCache.high property
      * may be set and saved in the private system properties in the
      * jdk.internal.misc.VM class.
+     *
+     * WARNING: The cache is archived with CDS and reloaded from the shared
+     * archive at runtime. The archived cache (Integer[]) and Integer objects
+     * reside in the closed archive heap regions. Care should be taken when
+     * changing the implementation and the cache array should not be assigned
+     * with new Integer object(s) after initialization.
      */
 
     private static class IntegerCache {
--- a/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java	Mon Nov 05 19:05:15 2018 -0500
@@ -143,11 +143,26 @@
      * simply because a {@code module-info} file for that module was
      * created.
      *
+     * <p> Note: An implementation of this method typically performs
+     * an internal conversion from the runtime reflective
+     * representation of an annotation type as a {@code Class} object
+     * to a different representation used for annotation
+     * processing. The set of annotation types present in the runtime
+     * context may differ from the set of annotation types present in
+     * the context of annotation processing in a particular
+     * environmental configuration. If an runtime annotation type is
+     * not present in the annotation processing context, the situation
+     * is not treated as an error and no elements are found for that
+     * annotation type.
+     *
      * @param a  annotation type being requested
      * @return the elements annotated with the given annotation type,
      * or an empty set if there are none
      * @throws IllegalArgumentException if the argument does not
      * represent an annotation type
+     *
+     * @see javax.lang.model.AnnotatedConstruct#getAnnotation(Class)
+     * @see javax.lang.model.AnnotatedConstruct#getAnnotationsByType(Class)
      */
     Set<? extends Element> getElementsAnnotatedWith(Class<? extends Annotation> a);
 
@@ -155,6 +170,18 @@
      * Returns the elements annotated with one or more of the given
      * annotation types.
      *
+     * <p> Note: An implementation of this method typically performs
+     * an internal conversion from the runtime reflective
+     * representation of an annotation type as a {@code Class} object
+     * to a different representation used for annotation
+     * processing. The set of annotation types present in the runtime
+     * context may differ from the set of annotation types present in
+     * the context of annotation processing in a particular
+     * environmental configuration. If an runtime annotation type is
+     * not present in the annotation processing context, the situation
+     * is not treated as an error and no elements are found for that
+     * annotation type.
+     *
      * @apiNote This method may be useful when processing repeating
      * annotations by looking for an annotation type and its
      * containing annotation type at the same time.
@@ -172,6 +199,10 @@
      * @throws IllegalArgumentException if the any elements of the
      * argument set do not represent an annotation type
      * @jls 9.6.3 Repeatable Annotation Types
+     *
+     * @see javax.lang.model.AnnotatedConstruct#getAnnotation(Class)
+     * @see javax.lang.model.AnnotatedConstruct#getAnnotationsByType(Class)
+     *
      * @since 9
      */
     default Set<? extends Element> getElementsAnnotatedWithAny(Set<Class<? extends Annotation>> annotations){
--- a/src/java.xml/share/classes/javax/xml/namespace/package-info.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/java.xml/share/classes/javax/xml/namespace/package-info.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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,10 +35,10 @@
  *     <li><a href="http://www.w3.org/TR/xmlschema-2/#QName">
  *             XML Schema Part2: Datatypes specification</a>
  *     </li>
- *     <li><a href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
+ *     <li><a href="https://www.w3.org/TR/REC-xml-names/">
  *             Namespaces in XML</a>
  *     </li>
- *     <li><a href="http://www.w3.org/XML/xml-names-19990114-errata">
+ *     <li><a href="https://www.w3.org/XML/xml-names-19990114-errata.html">
  *             Namespaces in XML Errata</a>
  *     </li>
  * </ul>
--- a/src/java.xml/share/classes/org/w3c/dom/ls/LSOutput.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/java.xml/share/classes/org/w3c/dom/ls/LSOutput.java	Mon Nov 05 19:05:15 2018 -0500
@@ -117,19 +117,19 @@
 
     /**
      *  The character encoding to use for the output. The encoding must be a
-     * string acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
+     * string acceptable for an XML encoding declaration ([<a href='https://www.w3.org/TR/xml/'>XML 1.0</a>] section
      * 4.3.3 "Character Encoding in Entities"), it is recommended that
      * character encodings registered (as charsets) with the Internet
-     * Assigned Numbers Authority [<a href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>IANA-CHARSETS</a>]
+     * Assigned Numbers Authority [<a href='http://www.iana.org/assignments/character-sets/character-sets.xhtml'>IANA-CHARSETS</a>]
      *  should be referred to using their registered names.
      */
     public String getEncoding();
     /**
      *  The character encoding to use for the output. The encoding must be a
-     * string acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
+     * string acceptable for an XML encoding declaration ([<a href='https://www.w3.org/TR/xml/'>XML 1.0</a>] section
      * 4.3.3 "Character Encoding in Entities"), it is recommended that
      * character encodings registered (as charsets) with the Internet
-     * Assigned Numbers Authority [<a href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>IANA-CHARSETS</a>]
+     * Assigned Numbers Authority [<a href='http://www.iana.org/assignments/character-sets/character-sets.xhtml'>IANA-CHARSETS</a>]
      *  should be referred to using their registered names.
      */
     public void setEncoding(String encoding);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java	Mon Nov 05 19:05:15 2018 -0500
@@ -31,6 +31,7 @@
 import javax.lang.model.util.*;
 import java.util.*;
 
+import com.sun.tools.javac.code.Source.Feature;
 import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
 
@@ -53,17 +54,20 @@
     private final ProcessingEnvironment processingEnv;
     private final Elements eltUtils;
 
+    private final boolean allowModules;
+
     // Caller must pass in an immutable set
     private final Set<? extends Element> rootElements;
 
     JavacRoundEnvironment(boolean processingOver,
                           boolean errorRaised,
                           Set<? extends Element> rootElements,
-                          ProcessingEnvironment processingEnv) {
+                          JavacProcessingEnvironment processingEnv) {
         this.processingOver = processingOver;
         this.errorRaised = errorRaised;
         this.rootElements = rootElements;
         this.processingEnv = processingEnv;
+        this.allowModules = Feature.MODULES.allowedInSource(processingEnv.source);
         this.eltUtils = processingEnv.getElementUtils();
     }
 
@@ -287,9 +291,11 @@
         TypeElement annotationElement = eltUtils.getTypeElement(name);
         if (annotationElement != null)
             return annotationElement;
-        else {
+        else if (allowModules) {
             String moduleName = Objects.requireNonNullElse(annotation.getModule().getName(), "");
             return eltUtils.getTypeElement(eltUtils.getModuleElement(moduleName), name);
+        } else {
+            return null;
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js	Mon Nov 05 19:05:15 2018 -0500
@@ -149,7 +149,7 @@
 $(function() {
     $("#search").catcomplete({
         minLength: 1,
-        delay: 100,
+        delay: 300,
         source: function(request, response) {
             var result = new Array();
             var presult = new Array();
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMSupport.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMSupport.java	Mon Nov 05 19:05:15 2018 -0500
@@ -81,4 +81,7 @@
     public static boolean isNotAvailable() {
         return notAvailable;
     }
+
+    public static void tryToInitializeJVM() {
+    }
 }
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java	Mon Nov 05 19:05:15 2018 -0500
@@ -80,19 +80,11 @@
     JFR_DCMD(10);
 
     /* set from native side */
-    private volatile int tagSetLevel = 100; // prevent logging if JVM log system has not been initialized
+    volatile int tagSetLevel = 100; // prevent logging if JVM log system has not been initialized
 
     final int id;
 
     LogTag(int tagId) {
         id = tagId;
     }
-
-    public boolean shouldLog(int level) {
-        return level >= tagSetLevel;
-    }
-
-    public boolean shouldLog(LogLevel logLevel) {
-        return shouldLog(logLevel.level);
-    }
 }
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Logger.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Logger.java	Mon Nov 05 19:05:15 2018 -0500
@@ -35,15 +35,20 @@
 public final class Logger {
 
     private final static int MAX_SIZE = 10000;
+    static {
+        // This will try to initialize the JVM logging system
+        JVMSupport.tryToInitializeJVM();
+    }
+
 
     public static void log(LogTag logTag, LogLevel logLevel, String message) {
-        if (logTag.shouldLog(logLevel.level)) {
+        if (shouldLog(logTag, logLevel)) {
             logInternal(logTag, logLevel, message);
         }
     }
 
     public static void log(LogTag logTag, LogLevel logLevel, Supplier<String> messageSupplier) {
-        if (logTag.shouldLog(logLevel.level)) {
+        if (shouldLog(logTag, logLevel)) {
             logInternal(logTag, logLevel, messageSupplier.get());
         }
     }
@@ -55,4 +60,8 @@
             JVM.log(logTag.id, logLevel.level, message.substring(0, MAX_SIZE));
         }
     }
+
+    public static boolean shouldLog(LogTag tag, LogLevel level) {
+        return level.level >= tag.tagSetLevel;
+    }
 }
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java	Mon Nov 05 19:05:15 2018 -0500
@@ -79,7 +79,7 @@
         descriptor.gmtOffset = time.attribute(MetadataDescriptor.ATTRIBUTE_GMT_OFFSET, 1);
         descriptor.locale = time.attribute(MetadataDescriptor.ATTRIBUTE_LOCALE, "");
         descriptor.root = root;
-        if (LogTag.JFR_SYSTEM_PARSER.shouldLog(LogLevel.TRACE.level)) {
+        if (Logger.shouldLog(LogTag.JFR_SYSTEM_PARSER, LogLevel.TRACE)) {
              List<Type> ts = new ArrayList<>(types.values());
              Collections.sort(ts, (x,y) -> x.getName().compareTo(y.getName()));
              for (Type t : ts) {
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java	Mon Nov 05 19:05:15 2018 -0500
@@ -453,7 +453,7 @@
     }
 
     private void setSettings(Map<String, String> settings, boolean update) {
-        if (LogTag.JFR_SETTING.shouldLog(LogLevel.INFO.level) && update) {
+        if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO) && update) {
             TreeMap<String, String> ordered = new TreeMap<>(settings);
             Logger.log(LogTag.JFR_SETTING, LogLevel.INFO, "New settings for recording \"" + getName() + "\" (" + getId() + ")");
             for (Map.Entry<String, String> entry : ordered.entrySet()) {
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java	Mon Nov 05 19:05:15 2018 -0500
@@ -139,7 +139,7 @@
                 ec.disable();
             }
         } else {
-            if (LogTag.JFR_SETTING.shouldLog(LogLevel.INFO.level)) {
+            if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO)) {
                 Collections.sort(eventControls, (x,y) -> x.getEventType().getName().compareTo(y.getEventType().getName()));
             }
             for (EventControl ec : eventControls) {
@@ -224,7 +224,7 @@
             if (values != null) {
                 control.apply(values);
                 String after = control.getLastValue();
-                if (LogTag.JFR_SETTING.shouldLog(LogLevel.INFO.level)) {
+                if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO)) {
                     if (Utils.isSettingVisible(control, ec.getEventType().hasEventHook())) {
                         if (values.size() > 1) {
                             StringJoiner sj = new StringJoiner(", ", "{", "}");
@@ -241,7 +241,7 @@
                 }
             } else {
                 control.setDefault();
-                if (LogTag.JFR_SETTING.shouldLog(LogLevel.INFO.level)) {
+                if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO)) {
                     String message = "  " + settingName + "=\"" + control.getLastValue() + "\"";
                     Logger.log(LogTag.JFR_SETTING, LogLevel.INFO, message);
                 }
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java	Mon Nov 05 19:05:15 2018 -0500
@@ -271,7 +271,7 @@
     }
 
     void log(String action, LogTag logTag, LogLevel level) {
-        if (logTag.shouldLog(level.level) && !isSimpleType()) {
+        if (Logger.shouldLog(logTag, level) && !isSimpleType()) {
             Logger.log(logTag, LogLevel.TRACE, action + " " + typeText() + " " + getLogName() + " {");
             for (ValueDescriptor v : getFields()) {
                 String array = v.isArray() ? "[]" : "";
@@ -279,7 +279,7 @@
             }
             Logger.log(logTag, LogLevel.TRACE, "}");
         } else {
-            if (logTag.shouldLog(LogLevel.INFO.level) && !isSimpleType()) {
+            if (Logger.shouldLog(logTag, LogLevel.INFO) && !isSimpleType()) {
                 Logger.log(logTag, LogLevel.INFO, action + " " + typeText() + " " + getLogName());
             }
         }
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java	Mon Nov 05 19:05:15 2018 -0500
@@ -68,7 +68,7 @@
 
     private TypeLibrary(List<Type> jvmTypes) {
         visitReachable(jvmTypes, t -> !types.containsKey(t.getId()), t -> types.put(t.getId(), t));
-        if (LogTag.JFR_SYSTEM_METADATA.shouldLog(LogLevel.INFO.level)) {
+        if (Logger.shouldLog(LogTag.JFR_SYSTEM_METADATA, LogLevel.INFO)) {
             Stream<Type> s = types.values().stream().sorted((x, y) -> Long.compare(x.getId(), y.getId()));
             s.forEach(t -> t.log("Added", LogTag.JFR_SYSTEM_METADATA, LogLevel.INFO));
         }
@@ -422,7 +422,7 @@
         for (Type type :  types.values()) {
             if (type.getRemove() && !Type.isDefinedByJVM(type.getId())) {
                 removeIds.add(type.getId());
-                if (LogTag.JFR_METADATA.shouldLog(LogLevel.TRACE.level)) {
+                if (Logger.shouldLog(LogTag.JFR_METADATA, LogLevel.TRACE)) {
                     Logger.log(LogTag.JFR_METADATA, LogLevel.TRACE, "Removed obsolete metadata " + type.getName());
                 }
             }
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java	Mon Nov 05 19:05:15 2018 -0500
@@ -63,7 +63,7 @@
     }
 
     private void executeInternal(String name, Boolean verbose) throws DCmdException {
-        if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) {
+        if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) {
             Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdCheck: name=" + name + ", verbose=" + verbose);
         }
 
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java	Mon Nov 05 19:05:15 2018 -0500
@@ -70,7 +70,7 @@
             Boolean sampleThreads
 
     ) throws DCmdException {
-        if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) {
+        if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) {
             Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdConfigure: repositorypath=" + repositoryPath +
                     ", dumppath=" + dumpPath +
                     ", stackdepth=" + stackDepth +
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java	Mon Nov 05 19:05:15 2018 -0500
@@ -70,7 +70,7 @@
      * @throws DCmdException if the dump could not be completed
      */
     public String execute(String name, String filename, Long maxAge, Long maxSize, String begin, String end, Boolean pathToGcRoots) throws DCmdException {
-        if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) {
+        if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) {
             Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG,
                     "Executing DCmdDump: name=" + name +
                     ", filename=" + filename +
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java	Mon Nov 05 19:05:15 2018 -0500
@@ -81,7 +81,7 @@
      */
     @SuppressWarnings("resource")
     public String execute(String name, String[] settings, Long delay, Long duration, Boolean disk, String path, Long maxAge, Long maxSize, Boolean dumpOnExit, Boolean pathToGcRoots) throws DCmdException {
-        if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) {
+        if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) {
             Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdStart: name=" + name +
                     ", settings=" + Arrays.asList(settings) +
                     ", delay=" + delay +
@@ -106,13 +106,7 @@
             throw new DCmdException("Filename can only be set for a time bound recording or if dumponexit=true. Set duration/dumponexit or omit filename.");
         }
 
-
         Map<String, String> s = new HashMap<>();
-
-        if (settings == null || settings.length == 0) {
-            settings = new String[] { "default" };
-        }
-
         for (String configName : settings) {
             try {
                 s.putAll(JFC.createKnown(configName).getSettings());
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java	Mon Nov 05 19:05:15 2018 -0500
@@ -56,7 +56,7 @@
      * @throws DCmdException if recording could not be stopped
      */
     public String execute(String name, String filename) throws DCmdException {
-        if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) {
+        if (Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG)) {
             Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdStart: name=" + name + ", filename=" + filename);
         }
 
--- a/test/hotspot/gtest/gc/shared/test_oopStorage.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/gtest/gc/shared/test_oopStorage.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -216,8 +216,6 @@
 
   static const size_t _max_entries = 1000;
   oop* _entries[_max_entries];
-
-  class VM_DeleteBlocksAtSafepoint;
 };
 
 OopStorageTestWithAllocation::OopStorageTestWithAllocation() {
@@ -230,19 +228,6 @@
 
 const size_t OopStorageTestWithAllocation::_max_entries;
 
-class OopStorageTestWithAllocation::VM_DeleteBlocksAtSafepoint
-  : public VM_GTestExecuteAtSafepoint {
-public:
-  VM_DeleteBlocksAtSafepoint(OopStorage* storage) : _storage(storage) {}
-
-  void doit() {
-    _storage->delete_empty_blocks_safepoint();
-  }
-
-private:
-  OopStorage* _storage;
-};
-
 static bool is_allocation_list_sorted(const OopStorage& storage) {
   // The allocation_list isn't strictly sorted.  Rather, all empty
   // blocks are segregated to the end of the list.
@@ -1027,7 +1012,7 @@
   vstate.check();
 }
 
-TEST_VM_F(OopStorageTestWithAllocation, delete_empty_blocks_safepoint) {
+TEST_VM_F(OopStorageTestWithAllocation, delete_empty_blocks) {
   size_t initial_active_size = active_count(_storage);
   EXPECT_EQ(initial_active_size, _storage.block_count());
   ASSERT_LE(3u, initial_active_size); // Need at least 3 blocks for test
@@ -1040,37 +1025,15 @@
   EXPECT_EQ(initial_active_size, active_count(_storage));
   EXPECT_EQ(initial_active_size, _storage.block_count());
   EXPECT_EQ(3u, empty_block_count(_storage));
-
   {
     ThreadInVMfromNative invm(JavaThread::current());
-    VM_DeleteBlocksAtSafepoint op(&_storage);
-    VMThread::execute(&op);
+    while (_storage.delete_empty_blocks()) {}
   }
   EXPECT_EQ(0u, empty_block_count(_storage));
   EXPECT_EQ(initial_active_size - 3, active_count(_storage));
   EXPECT_EQ(initial_active_size - 3, _storage.block_count());
 }
 
-TEST_VM_F(OopStorageTestWithAllocation, delete_empty_blocks_concurrent) {
-  size_t initial_active_size = active_count(_storage);
-  EXPECT_EQ(initial_active_size, _storage.block_count());
-  ASSERT_LE(3u, initial_active_size); // Need at least 3 blocks for test
-
-  for (size_t i = 0; empty_block_count(_storage) < 3; ++i) {
-    ASSERT_GT(_max_entries, i);
-    release_entry(_storage, _entries[i]);
-  }
-
-  EXPECT_EQ(initial_active_size, active_count(_storage));
-  EXPECT_EQ(initial_active_size, _storage.block_count());
-  EXPECT_EQ(3u, empty_block_count(_storage));
-
-  _storage.delete_empty_blocks_concurrent();
-  EXPECT_EQ(0u, empty_block_count(_storage));
-  EXPECT_EQ(initial_active_size - 3, active_count(_storage));
-  EXPECT_EQ(initial_active_size - 3, _storage.block_count());
-}
-
 TEST_VM_F(OopStorageTestWithAllocation, allocation_status) {
   oop* retained = _entries[200];
   oop* released = _entries[300];
@@ -1092,8 +1055,7 @@
 
   {
     ThreadInVMfromNative invm(JavaThread::current());
-    VM_DeleteBlocksAtSafepoint op(&_storage);
-    VMThread::execute(&op);
+    while (_storage.delete_empty_blocks()) {}
   }
   EXPECT_EQ(OopStorage::ALLOCATED_ENTRY, _storage.allocation_status(retained));
 #ifndef DISABLE_GARBAGE_ALLOCATION_STATUS_TESTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/gtest/runtime/test_os_linux.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2018, 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"
+
+#ifdef LINUX
+
+#include <sys/mman.h>
+
+#include "runtime/os.hpp"
+#include "unittest.hpp"
+
+namespace {
+  static void small_page_write(void* addr, size_t size) {
+    size_t page_size = os::vm_page_size();
+
+    char* end = (char*)addr + size;
+    for (char* p = (char*)addr; p < end; p += page_size) {
+      *p = 1;
+    }
+  }
+
+  class HugeTlbfsMemory : private ::os::Linux {
+    char* const _ptr;
+    const size_t _size;
+   public:
+    static char* reserve_memory_special_huge_tlbfs_only(size_t bytes, char* req_addr, bool exec) {
+      return os::Linux::reserve_memory_special_huge_tlbfs_only(bytes, req_addr, exec);
+    }
+    static char* reserve_memory_special_huge_tlbfs_mixed(size_t bytes, size_t alignment, char* req_addr, bool exec) {
+      return os::Linux::reserve_memory_special_huge_tlbfs_mixed(bytes, alignment, req_addr, exec);
+    }
+    HugeTlbfsMemory(char* const ptr, size_t size) : _ptr(ptr), _size(size) { }
+    ~HugeTlbfsMemory() {
+      if (_ptr != NULL) {
+        os::Linux::release_memory_special_huge_tlbfs(_ptr, _size);
+      }
+    }
+  };
+
+  class ShmMemory : private ::os::Linux {
+    char* const _ptr;
+    const size_t _size;
+   public:
+    static char* reserve_memory_special_shm(size_t bytes, size_t alignment, char* req_addr, bool exec) {
+      return os::Linux::reserve_memory_special_shm(bytes, alignment, req_addr, exec);
+    }
+    ShmMemory(char* const ptr, size_t size) : _ptr(ptr), _size(size) { }
+    ~ShmMemory() {
+      os::Linux::release_memory_special_shm(_ptr, _size);
+    }
+  };
+
+  // have to use these functions, as gtest's _PRED macros don't like is_aligned
+  // nor (is_aligned<size_t, size_t>)
+  static bool is_size_aligned(size_t size, size_t alignment) {
+    return is_aligned(size, alignment);
+  }
+  static bool is_ptr_aligned(char* ptr, size_t alignment) {
+    return is_aligned(ptr, alignment);
+  }
+
+  static void test_reserve_memory_special_shm(size_t size, size_t alignment) {
+    ASSERT_TRUE(UseSHM) << "must be used only when UseSHM is true";
+    char* addr = ShmMemory::reserve_memory_special_shm(size, alignment, NULL, false);
+    if (addr != NULL) {
+      ShmMemory mr(addr, size);
+      EXPECT_PRED2(is_ptr_aligned, addr, alignment);
+      EXPECT_PRED2(is_ptr_aligned, addr, os::large_page_size());
+
+      small_page_write(addr, size);
+    }
+  }
+}
+
+TEST_VM(os_linux, reserve_memory_special_huge_tlbfs_only) {
+  if (!UseHugeTLBFS) {
+    return;
+  }
+  size_t lp = os::large_page_size();
+
+  for (size_t size = lp; size <= lp * 10; size += lp) {
+    char* addr = HugeTlbfsMemory::reserve_memory_special_huge_tlbfs_only(size, NULL, false);
+
+    if (addr != NULL) {
+      HugeTlbfsMemory mr(addr, size);
+      small_page_write(addr, size);
+    }
+  }
+}
+
+TEST_VM(os_linux, reserve_memory_special_huge_tlbfs_mixed_without_addr) {
+  if (!UseHugeTLBFS) {
+    return;
+  }
+  size_t lp = os::large_page_size();
+  size_t ag = os::vm_allocation_granularity();
+
+  // sizes to test
+  const size_t sizes[] = {
+    lp, lp + ag, lp + lp / 2, lp * 2,
+    lp * 2 + ag, lp * 2 - ag, lp * 2 + lp / 2,
+    lp * 10, lp * 10 + lp / 2
+  };
+  const int num_sizes = sizeof(sizes) / sizeof(size_t);
+  for (int i = 0; i < num_sizes; i++) {
+    const size_t size = sizes[i];
+    for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) {
+      char* p = HugeTlbfsMemory::reserve_memory_special_huge_tlbfs_mixed(size, alignment, NULL, false);
+      if (p != NULL) {
+        HugeTlbfsMemory mr(p, size);
+        EXPECT_PRED2(is_ptr_aligned, p, alignment) << " size = " << size;
+        small_page_write(p, size);
+      }
+    }
+  }
+}
+
+TEST_VM(os_linux, reserve_memory_special_huge_tlbfs_mixed_with_good_req_addr) {
+  if (!UseHugeTLBFS) {
+    return;
+  }
+  size_t lp = os::large_page_size();
+  size_t ag = os::vm_allocation_granularity();
+
+  // sizes to test
+  const size_t sizes[] = {
+    lp, lp + ag, lp + lp / 2, lp * 2,
+    lp * 2 + ag, lp * 2 - ag, lp * 2 + lp / 2,
+    lp * 10, lp * 10 + lp / 2
+  };
+  const int num_sizes = sizeof(sizes) / sizeof(size_t);
+
+  // Pre-allocate an area as large as the largest allocation
+  // and aligned to the largest alignment we will be testing.
+  const size_t mapping_size = sizes[num_sizes - 1] * 2;
+  char* const mapping = (char*) ::mmap(NULL, mapping_size,
+      PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,
+      -1, 0);
+  ASSERT_TRUE(mapping != NULL) << " mmap failed, mapping_size = " << mapping_size;
+  // Unmap the mapping, it will serve as a value for a "good" req_addr
+  ::munmap(mapping, mapping_size);
+
+  for (int i = 0; i < num_sizes; i++) {
+    const size_t size = sizes[i];
+    for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) {
+      char* const req_addr = align_up(mapping, alignment);
+      char* p = HugeTlbfsMemory::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false);
+      if (p != NULL) {
+        HugeTlbfsMemory mr(p, size);
+        ASSERT_EQ(req_addr, p) << " size = " << size << ", alignment = " << alignment;
+        small_page_write(p, size);
+      }
+    }
+  }
+}
+
+
+TEST_VM(os_linux, reserve_memory_special_huge_tlbfs_mixed_with_bad_req_addr) {
+  if (!UseHugeTLBFS) {
+    return;
+  }
+  size_t lp = os::large_page_size();
+  size_t ag = os::vm_allocation_granularity();
+
+  // sizes to test
+  const size_t sizes[] = {
+    lp, lp + ag, lp + lp / 2, lp * 2,
+    lp * 2 + ag, lp * 2 - ag, lp * 2 + lp / 2,
+    lp * 10, lp * 10 + lp / 2
+  };
+  const int num_sizes = sizeof(sizes) / sizeof(size_t);
+
+  // Pre-allocate an area as large as the largest allocation
+  // and aligned to the largest alignment we will be testing.
+  const size_t mapping_size = sizes[num_sizes - 1] * 2;
+  char* const mapping = (char*) ::mmap(NULL, mapping_size,
+      PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,
+      -1, 0);
+  ASSERT_TRUE(mapping != NULL) << " mmap failed, mapping_size = " << mapping_size;
+  // Leave the mapping intact, it will server as "bad" req_addr
+
+  class MappingHolder {
+    char* const _mapping;
+    size_t _size;
+   public:
+    MappingHolder(char* mapping, size_t size) : _mapping(mapping), _size(size) { }
+    ~MappingHolder() {
+      ::munmap(_mapping, _size);
+    }
+  } holder(mapping, mapping_size);
+
+  for (int i = 0; i < num_sizes; i++) {
+    const size_t size = sizes[i];
+    for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) {
+      char* const req_addr = align_up(mapping, alignment);
+      char* p = HugeTlbfsMemory::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false);
+      HugeTlbfsMemory mr(p, size);
+      // as the area around req_addr contains already existing mappings, the API should always
+      // return NULL (as per contract, it cannot return another address)
+      EXPECT_TRUE(p == NULL) << " size = " << size
+                             << ", alignment = " << alignment
+                             << ", req_addr = " << req_addr
+                             << ", p = " << p;
+    }
+  }
+}
+
+TEST_VM(os_linux, reserve_memory_special_shm) {
+  if (!UseSHM) {
+    return;
+  }
+  size_t lp = os::large_page_size();
+  size_t ag = os::vm_allocation_granularity();
+
+  for (size_t size = ag; size < lp * 3; size += ag) {
+    for (size_t alignment = ag; is_size_aligned(size, alignment); alignment *= 2) {
+      EXPECT_NO_FATAL_FAILURE(test_reserve_memory_special_shm(size, alignment));
+    }
+  }
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/gtest/runtime/test_os_windows.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018, 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"
+
+#ifdef _WINDOWS
+
+#include "runtime/os.hpp"
+#include "runtime/flags/flagSetting.hpp"
+#include "runtime/globals_extension.hpp"
+#include "unittest.hpp"
+
+namespace {
+  class MemoryReleaser {
+    char* const _ptr;
+    const size_t _size;
+   public:
+    MemoryReleaser(char* ptr, size_t size) : _ptr(ptr), _size(size) { }
+    ~MemoryReleaser() {
+      os::release_memory_special(_ptr, _size);
+    }
+  };
+}
+
+// test tries to allocate memory in a single contiguous memory block at a particular address.
+// The test first tries to find a good approximate address to allocate at by using the same
+// method to allocate some memory at any address. The test then tries to allocate memory in
+// the vicinity (not directly after it to avoid possible by-chance use of that location)
+// This is of course only some dodgy assumption, there is no guarantee that the vicinity of
+// the previously allocated memory is available for allocation. The only actual failure
+// that is reported is when the test tries to allocate at a particular location but gets a
+// different valid one. A NULL return value at this point is not considered an error but may
+// be legitimate.
+TEST_VM(os_windows, reserve_memory_special) {
+  if (!UseLargePages) {
+    return;
+  }
+
+  // set globals to make sure we hit the correct code path
+  FLAG_GUARD(UseLargePagesIndividualAllocation);
+  FLAG_GUARD(UseNUMAInterleaving);
+  FLAG_SET_CMDLINE(bool, UseLargePagesIndividualAllocation, false);
+  FLAG_SET_CMDLINE(bool, UseNUMAInterleaving, false);
+
+  const size_t large_allocation_size = os::large_page_size() * 4;
+  char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false);
+  if (result != NULL) {
+      // failed to allocate memory, skipping the test
+      return;
+  }
+  MemoryReleaser mr(result, large_allocation_size);
+
+  // allocate another page within the recently allocated memory area which seems to be a good location. At least
+  // we managed to get it once.
+  const size_t expected_allocation_size = os::large_page_size();
+  char* expected_location = result + os::large_page_size();
+  char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false);
+  if (actual_location != NULL) {
+      // failed to allocate memory, skipping the test
+      return;
+  }
+  MemoryReleaser mr2(actual_location, expected_allocation_size);
+
+  EXPECT_EQ(expected_location, actual_location)
+        << "Failed to allocate memory at requested location " << expected_location << " of size " << expected_allocation_size;
+}
+
+#endif
--- a/test/hotspot/jtreg/Makefile	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/Makefile	Mon Nov 05 19:05:15 2018 -0500
@@ -49,9 +49,6 @@
 	$(ECHO) "Running tests: $@"
 	$(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests;
 
-hotspot_internal:
-	$(ALT_OUTPUTDIR)/jdk/bin/java -XX:+ExecuteInternalVMTests -XX:+ShowMessageBoxOnError -version
-
 ################################################################
 
 # Set up the directory in which the jvm directories live (client/, server/, etc.)
--- a/test/hotspot/jtreg/ProblemList.txt	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/ProblemList.txt	Mon Nov 05 19:05:15 2018 -0500
@@ -83,6 +83,7 @@
 
 runtime/appcds/javaldr/GCSharedStringsDuringDump.java 8208778 macosx-x64
 runtime/appcds/javaldr/GCDuringDump.java 8208778 macosx-x64
+runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 8213299 generic-all
 runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
 runtime/RedefineTests/RedefineRunningMethods.java 8208778 macosx-x64
 runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all
--- a/test/hotspot/jtreg/TEST.groups	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/TEST.groups	Mon Nov 05 19:05:15 2018 -0500
@@ -180,7 +180,6 @@
   -gc/g1/ihop/TestIHOPErgo.java
 
 tier1_gc_2 = \
-  sanity/ExecuteInternalVMTests.java \
   gc/ \
   -gc/epsilon/ \
   -gc/g1/ \
--- a/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt	Mon Nov 05 19:05:15 2018 -0500
@@ -1,4 +1,4 @@
-# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 2018 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
@@ -18,18 +18,3 @@
 # 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.
-
-# jaotc: java.lang.StackOverflowError
-exclude sun.util.resources.LocaleNames.getContents()[[Ljava/lang/Object;
-exclude sun.util.resources.TimeZoneNames.getContents()[[Ljava/lang/Object;
-exclude sun.util.resources.cldr.LocaleNames.getContents()[[Ljava/lang/Object;
-exclude sun.util.resources..*.LocaleNames_.*.getContents\(\)\[\[Ljava/lang/Object;
-exclude sun.util.resources..*.LocaleNames_.*_.*.getContents\(\)\[\[Ljava/lang/Object;
-exclude sun.util.resources..*.TimeZoneNames_.*.getContents\(\)\[\[Ljava/lang/Object;
-exclude sun.util.resources..*.TimeZoneNames_.*_.*.getContents\(\)\[\[Ljava/lang/Object;
-# java.lang.Error: Trampoline must not be defined by the bootstrap classloader
-exclude sun.reflect.misc.Trampoline.<clinit>()V
-exclude sun.reflect.misc.Trampoline.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
-# assert(referenceMask != -1) failed: must not be a derived reference type
-exclude com.sun.crypto.provider.AESWrapCipher.engineUnwrap([BLjava/lang/String;I)Ljava/security/Key;
-exclude sun.security.ssl.*
--- a/test/hotspot/jtreg/compiler/aot/scripts/jdk.internal.vm.compiler-list.txt	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/aot/scripts/jdk.internal.vm.compiler-list.txt	Mon Nov 05 19:05:15 2018 -0500
@@ -1,4 +1,4 @@
-# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 2018, 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
@@ -19,20 +19,27 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 
+#
 exclude org.graalvm.compiler.hotspot.replacements.arraycopy.ArrayCopyCallNode.*
 exclude org.graalvm.compiler.hotspot.replacements.AESCryptSubstitutions.*
 exclude org.graalvm.compiler.hotspot.replacements.CipherBlockChainingSubstitutions.crypt(Ljava/lang/Object;[BII[BILjava/lang/Object;ZZ)V
+exclude org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayAllocationSize(III)I
+exclude org.graalvm.compiler.hotspot.replacements.PluginFactory_HotSpotReplacementsUtil\$config.execute(.*).*
+exclude org.graalvm.compiler.hotspot.replacements.PluginFactory_HotSpotReplacementsUtil\$getWordKind.execute(.*).*
+exclude org.graalvm.compiler.hotspot.replacements.PluginFactory_HotSpotReplacementsUtil\$getConfig.execute(.*).
+#
 exclude org.graalvm.compiler.hotspot.stubs.StubUtil.printf(.*).*
 exclude org.graalvm.compiler.hotspot.stubs.StubUtil.decipher(J)V
 exclude org.graalvm.compiler.hotspot.stubs.StubUtil.fatal(.*).*
 #
+exclude org.graalvm.compiler.nodes.java.NewArrayNode.newUninitializedArray(Ljava/lang/Class;I)Ljava/lang/Object;
+exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object;
+exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newUninitializedArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object;
+exclude org.graalvm.compiler.nodes.PiNode.piCastNonNull(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
+#
 exclude org.graalvm.compiler.replacements.nodes.ArrayEqualsNode.equals(.*).*
 exclude org.graalvm.compiler.replacements.Log.print.*
 exclude org.graalvm.compiler.replacements.ReplacementsUtil.*
 exclude org.graalvm.compiler.replacements.SnippetCounter.*
 exclude org.graalvm.compiler.replacements.SnippetCounterNode.*
-#
-exclude org.graalvm.compiler.nodes.java.NewArrayNode.newUninitializedArray(Ljava/lang/Class;I)Ljava/lang/Object;
-exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newUninitializedArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object;
-exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object;
-exclude org.graalvm.compiler.nodes.PiNode.piCastNonNull(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
+exclude org.graalvm.compiler.replacements.SnippetIntegerHistogram.inc(J)V
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAE.java	Mon Nov 05 19:05:15 2018 -0500
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+package compiler.c2.aarch64;
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+class TestUnsafeVolatileCAE
+{
+    public volatile int f_int = 0;
+    public volatile Integer f_obj = Integer.valueOf(0);
+    public volatile long f_long = 0;
+    public volatile byte f_byte = 0;
+    public volatile short f_short = 0;
+
+    public static Unsafe unsafe = Unsafe.getUnsafe();
+    public static Field f_int_field;
+    public static Field f_obj_field;
+    public static Field f_long_field;
+    public static Field f_byte_field;
+    public static Field f_short_field;
+    public static long f_int_off;
+    public static long f_obj_off;
+    public static long f_long_off;
+    public static long f_byte_off;
+    public static long f_short_off;
+
+    static {
+        try {
+            f_int_field = TestUnsafeVolatileCAE.class.getField("f_int");
+            f_obj_field = TestUnsafeVolatileCAE.class.getField("f_obj");
+            f_long_field = TestUnsafeVolatileCAE.class.getField("f_long");
+            f_byte_field = TestUnsafeVolatileCAE.class.getField("f_byte");
+            f_short_field = TestUnsafeVolatileCAE.class.getField("f_short");
+            f_int_off = unsafe.objectFieldOffset(f_int_field);
+            f_obj_off = unsafe.objectFieldOffset(f_obj_field);
+            f_long_off = unsafe.objectFieldOffset(f_long_field);
+            f_byte_off = unsafe.objectFieldOffset(f_byte_field);
+            f_short_off = unsafe.objectFieldOffset(f_short_field);
+        } catch (Exception e) {
+            System.out.println("reflection failed " + e);
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args)
+    {
+        final TestUnsafeVolatileCAE t = new TestUnsafeVolatileCAE();
+        for (int i = 0; i < 100_000; i++) {
+            t.f_int = -1;
+            int res = t.testInt(-1, i);
+            if (res != -1 || t.f_int != i) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_long = -1;
+            long res = t.testLong(-1, i);
+            if (res != -1 || t.f_long != i) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_byte = -1;
+            byte i_b = (byte)i;
+            byte res = t.testByte((byte)-1, i_b);
+            if (res != (byte)-1 || t.f_byte != i_b) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_short = -1;
+            short i_s = (short)i;
+            short res = t.testShort((byte)-1, i_s);
+            if (res != (short)-1 || t.f_short != i_s) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        Integer minusOne = Integer.valueOf(-1);
+        for (int i = 0; i < 100_000; i++) {
+            t.f_obj = minusOne;
+            Object res = t.testObj(minusOne, Integer.valueOf(i));
+            if (res != minusOne || t.f_obj != i) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+    }
+
+    public int testInt(int x, int i)
+    {
+        return unsafe.compareAndExchangeInt(this, f_int_off, x, i);
+    }
+
+    public Object testObj(Object x, Object o)
+    {
+        return unsafe.compareAndExchangeReference(this, f_obj_off, x, o);
+    }
+    public long testLong(long x, long i)
+    {
+        return unsafe.compareAndExchangeLong(this, f_long_off, x, i);
+    }
+
+    public byte testByte(byte x, byte i)
+    {
+        return unsafe.compareAndExchangeByte(this, f_byte_off, x, i);
+    }
+
+    public short testShort(short x, short i)
+    {
+        return unsafe.compareAndExchangeShort(this, f_short_off, x, i);
+    }
+}
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java	Mon Nov 05 19:05:15 2018 -0500
@@ -30,19 +30,34 @@
 {
     public volatile int f_int = 0;
     public volatile Integer f_obj = Integer.valueOf(0);
+    public volatile long f_long = 0;
+    public volatile byte f_byte = 0;
+    public volatile short f_short = 0;
 
     public static Unsafe unsafe = Unsafe.getUnsafe();
     public static Field f_int_field;
     public static Field f_obj_field;
+    public static Field f_long_field;
+    public static Field f_byte_field;
+    public static Field f_short_field;
     public static long f_int_off;
     public static long f_obj_off;
+    public static long f_long_off;
+    public static long f_byte_off;
+    public static long f_short_off;
 
     static {
         try {
             f_int_field = TestUnsafeVolatileCAS.class.getField("f_int");
             f_obj_field = TestUnsafeVolatileCAS.class.getField("f_obj");
+            f_long_field = TestUnsafeVolatileCAS.class.getField("f_long");
+            f_byte_field = TestUnsafeVolatileCAS.class.getField("f_byte");
+            f_short_field = TestUnsafeVolatileCAS.class.getField("f_short");
             f_int_off = unsafe.objectFieldOffset(f_int_field);
             f_obj_off = unsafe.objectFieldOffset(f_obj_field);
+            f_long_off = unsafe.objectFieldOffset(f_long_field);
+            f_byte_off = unsafe.objectFieldOffset(f_byte_field);
+            f_short_off = unsafe.objectFieldOffset(f_short_field);
         } catch (Exception e) {
             System.out.println("reflection failed " + e);
             e.printStackTrace();
@@ -59,6 +74,29 @@
                 throw new RuntimeException("bad result!");
             }
         }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_long = -1;
+            t.testLong(-1, i);
+            if (t.f_long != i) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_byte = -1;
+            byte i_b = (byte)i;
+            t.testByte((byte)-1, i_b);
+            if (t.f_byte != i_b) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_short = -1;
+            short i_s = (short)i;
+            t.testShort((byte)-1, i_s);
+            if (t.f_short != i_s) {
+                throw new RuntimeException("bad result!");
+            }
+        }
         Integer minusOne = Integer.valueOf(-1);
         for (int i = 0; i < 100_000; i++) {
             t.f_obj = minusOne;
@@ -68,6 +106,7 @@
             }
         }
     }
+
     public void testInt(int x, int i)
     {
         unsafe.compareAndSetInt(this, f_int_off, x, i);
@@ -77,4 +116,19 @@
     {
         unsafe.compareAndSetReference(this, f_obj_off, x, o);
     }
+
+    public void testLong(long x, long i)
+    {
+        unsafe.compareAndSetLong(this, f_long_off, x, i);
+    }
+
+    public void testByte(byte x, byte i)
+    {
+        unsafe.compareAndSetByte(this, f_byte_off, x, i);
+    }
+
+    public void testShort(short x, short i)
+    {
+        unsafe.compareAndSetShort(this, f_short_off, x, i);
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAA.java	Mon Nov 05 19:05:15 2018 -0500
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+package compiler.c2.aarch64;
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+class TestUnsafeVolatileGAA
+{
+    public volatile int f_int = -1;
+    public volatile long f_long = -1;
+
+    public static Unsafe unsafe = Unsafe.getUnsafe();
+    public static Field f_int_field;
+    public static Field f_long_field;
+    public static long f_int_off;
+    public static long f_long_off;
+
+    static {
+        try {
+            f_int_field = TestUnsafeVolatileGAA.class.getField("f_int");
+            f_long_field = TestUnsafeVolatileGAA.class.getField("f_long");
+            f_int_off = unsafe.objectFieldOffset(f_int_field);
+            f_long_off = unsafe.objectFieldOffset(f_long_field);
+        } catch (Exception e) {
+            System.out.println("reflection failed " + e);
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args)
+    {
+        final TestUnsafeVolatileGAA t = new TestUnsafeVolatileGAA();
+        for (int i = 0; i < 100_000; i++) {
+            if (t.testInt() != i-1) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            if (t.testLong() != i-1) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+    }
+
+    public int testInt()
+    {
+        return unsafe.getAndAddInt(this, f_int_off, 1);
+    }
+
+    public long testLong()
+    {
+        return unsafe.getAndAddLong(this, f_long_off, 1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileGAS.java	Mon Nov 05 19:05:15 2018 -0500
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+package compiler.c2.aarch64;
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+class TestUnsafeVolatileGAS
+{
+    public volatile int f_int = -1;
+    public volatile Integer f_obj = Integer.valueOf(-1);
+    public volatile long f_long = -1;
+
+    public static Unsafe unsafe = Unsafe.getUnsafe();
+    public static Field f_int_field;
+    public static Field f_obj_field;
+    public static Field f_long_field;
+    public static long f_int_off;
+    public static long f_obj_off;
+    public static long f_long_off;
+
+    static {
+        try {
+            f_int_field = TestUnsafeVolatileGAS.class.getField("f_int");
+            f_obj_field = TestUnsafeVolatileGAS.class.getField("f_obj");
+            f_long_field = TestUnsafeVolatileGAS.class.getField("f_long");
+            f_int_off = unsafe.objectFieldOffset(f_int_field);
+            f_obj_off = unsafe.objectFieldOffset(f_obj_field);
+            f_long_off = unsafe.objectFieldOffset(f_long_field);
+        } catch (Exception e) {
+            System.out.println("reflection failed " + e);
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args)
+    {
+        final TestUnsafeVolatileGAS t = new TestUnsafeVolatileGAS();
+        for (int i = 0; i < 100_000; i++) {
+            if (t.testInt(i) != i-1) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            if (t.testLong(i) != i-1) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            if ((Integer)t.testObj(Integer.valueOf(i)) != i-1) {
+                throw new RuntimeException("bad result!");
+            }
+        }
+    }
+
+    public int testInt(int i)
+    {
+        return unsafe.getAndSetInt(this, f_int_off, i);
+    }
+
+    public Object testObj(Object o)
+    {
+        return unsafe.getAndSetReference(this, f_obj_off, o);
+    }
+    public long testLong(long i)
+    {
+        return unsafe.getAndSetLong(this, f_long_off, i);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileWeakCAS.java	Mon Nov 05 19:05:15 2018 -0500
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+package compiler.c2.aarch64;
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+class TestUnsafeVolatileWeakCAS
+{
+    public volatile int f_int = 0;
+    public volatile Integer f_obj = Integer.valueOf(0);
+    public volatile long f_long = 0;
+    public volatile byte f_byte = 0;
+    public volatile short f_short = 0;
+
+    public static Unsafe unsafe = Unsafe.getUnsafe();
+    public static Field f_int_field;
+    public static Field f_obj_field;
+    public static Field f_long_field;
+    public static Field f_byte_field;
+    public static Field f_short_field;
+    public static long f_int_off;
+    public static long f_obj_off;
+    public static long f_long_off;
+    public static long f_byte_off;
+    public static long f_short_off;
+
+    static {
+        try {
+            f_int_field = TestUnsafeVolatileWeakCAS.class.getField("f_int");
+            f_obj_field = TestUnsafeVolatileWeakCAS.class.getField("f_obj");
+            f_long_field = TestUnsafeVolatileWeakCAS.class.getField("f_long");
+            f_byte_field = TestUnsafeVolatileWeakCAS.class.getField("f_byte");
+            f_short_field = TestUnsafeVolatileWeakCAS.class.getField("f_short");
+            f_int_off = unsafe.objectFieldOffset(f_int_field);
+            f_obj_off = unsafe.objectFieldOffset(f_obj_field);
+            f_long_off = unsafe.objectFieldOffset(f_long_field);
+            f_byte_off = unsafe.objectFieldOffset(f_byte_field);
+            f_short_off = unsafe.objectFieldOffset(f_short_field);
+        } catch (Exception e) {
+            System.out.println("reflection failed " + e);
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args)
+    {
+        final TestUnsafeVolatileWeakCAS t = new TestUnsafeVolatileWeakCAS();
+        for (int i = 0; i < 100_000; i++) {
+            t.f_int = -1;
+            if (t.testInt(-1, i)) {
+                if (t.f_int != i) {
+                    throw new RuntimeException("bad result!");
+                }
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_long = -1;
+            if (t.testLong(-1, i)) {
+                if (t.f_long != i) {
+                    throw new RuntimeException("bad result!");
+                }
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_byte = -1;
+            byte i_b = (byte)i;
+            if (t.testByte((byte)-1, i_b)) {
+                if (t.f_byte != i_b) {
+                    throw new RuntimeException("bad result!");
+                }
+            }
+        }
+        for (int i = 0; i < 100_000; i++) {
+            t.f_short = -1;
+            short i_s = (short)i;
+            if (t.testShort((byte)-1, i_s)) {
+                if (t.f_short != i_s) {
+                    throw new RuntimeException("bad result!");
+                }
+            }
+        }
+        Integer minusOne = Integer.valueOf(-1);
+        for (int i = 0; i < 100_000; i++) {
+            t.f_obj = minusOne;
+            if (t.testObj(minusOne, Integer.valueOf(i))) {
+                if (t.f_obj != i) {
+                    throw new RuntimeException("bad result!");
+                }
+            }
+        }
+    }
+
+    public boolean testInt(int x, int i)
+    {
+        return unsafe.weakCompareAndSetInt(this, f_int_off, x, i);
+    }
+
+    public boolean testObj(Object x, Object o)
+    {
+        return unsafe.weakCompareAndSetReference(this, f_obj_off, x, o);
+    }
+
+    public boolean testLong(long x, long i)
+    {
+        return unsafe.weakCompareAndSetLong(this, f_long_off, x, i);
+    }
+
+    public boolean testByte(byte x, byte i)
+    {
+        return unsafe.weakCompareAndSetByte(this, f_byte_off, x, i);
+    }
+
+    public boolean testShort(short x, short i)
+    {
+        return unsafe.weakCompareAndSetShort(this, f_short_off, x, i);
+    }
+}
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java	Mon Nov 05 19:05:15 2018 -0500
@@ -31,7 +31,10 @@
  *                       TestVolatileStore,
  *                       TestUnsafeVolatileLoad,
  *                       TestUnsafeVolatileStore,
- *                       TestUnsafeVolatileCAS}
+ *                       TestUnsafeVolatileCAS,
+ *                       TestUnsafeVolatileWeakCAS,
+ *                       TestUnsafeVolatileCAE,
+ *                       TestUnsafeVolatileGAS}
  * and <testtype> in {G1,
  *                    CMS,
  *                    CMSCondMark,
@@ -43,13 +46,16 @@
 package compiler.c2.aarch64;
 
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Iterator;
+import java.util.regex.Pattern;
 import java.io.*;
 
 import jdk.test.lib.Asserts;
 import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
+import sun.hotspot.WhiteBox;
 
 // runner class that spawns a new JVM to exercises a combination of
 // volatile MemOp and GC. The ops are compiled with the dmb -->
@@ -68,28 +74,28 @@
         // i.e. GC type plus GC conifg
         switch(testType) {
         case "G1":
-            argcount = 8;
+            argcount = 9;
             procArgs = new String[argcount];
             procArgs[argcount - 2] = "-XX:+UseG1GC";
             break;
         case "Parallel":
-            argcount = 8;
+            argcount = 9;
             procArgs = new String[argcount];
             procArgs[argcount - 2] = "-XX:+UseParallelGC";
             break;
         case "Serial":
-            argcount = 8;
+            argcount = 9;
             procArgs = new String[argcount];
             procArgs[argcount - 2] = "-XX:+UseSerialGC";
             break;
         case "CMS":
-            argcount = 9 ;
+            argcount = 10;
             procArgs = new String[argcount];
             procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC";
             procArgs[argcount - 2] = "-XX:-UseCondCardMark";
             break;
         case "CMSCondMark":
-            argcount = 9 ;
+            argcount = 10;
             procArgs = new String[argcount];
             procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC";
             procArgs[argcount - 2] = "-XX:+UseCondCardMark";
@@ -106,14 +112,34 @@
         // disable the transform.
 
         procArgs[0] = "-XX:-UseBarriersForVolatile";
+        procArgs[1] = "-XX:+UseCompressedOops";
 
-        procArgs[1] = "-XX:-TieredCompilation";
-        procArgs[2] = "-XX:+PrintOptoAssembly";
-        procArgs[3] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*";
-        procArgs[4] = "--add-exports";
-        procArgs[5] = "java.base/jdk.internal.misc=ALL-UNNAMED";
+        procArgs[2] = "-XX:-TieredCompilation";
+        procArgs[3] = "-XX:+PrintOptoAssembly";
+        procArgs[4] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*";
+        procArgs[5] = "--add-exports";
+        procArgs[6] = "java.base/jdk.internal.misc=ALL-UNNAMED";
         procArgs[argcount - 1] = fullclassname;
 
+        runtest(classname, testType, false, true, procArgs);
+        // rerun the test class without the transform applied and
+        // check the alternative generation is as expected
+
+        procArgs[0] = "-XX:+UseBarriersForVolatile";
+        runtest(classname, testType, true, true, procArgs);
+
+        if (!classname.equals("TestUnsafeVolatileGAA")) {
+            procArgs[0] = "-XX:-UseBarriersForVolatile";
+            procArgs[1] = "-XX:-UseCompressedOops";
+            runtest(classname, testType, false, false, procArgs);
+
+            procArgs[0] = "-XX:+UseBarriersForVolatile";
+            runtest(classname, testType, true, false, procArgs);
+        }
+    }
+
+
+    public void runtest(String classname, String testType, boolean useBarriersForVolatile, boolean useCompressedOops, String[] procArgs) throws Throwable {
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
 
@@ -125,23 +151,7 @@
         // appropriate to test class, test type and whether transform
         // was applied
 
-        checkoutput(output, classname, testType, false);
-
-        // rerun the test class without the transform applied and
-        // check the alternative generation is as expected
-
-        procArgs[0] = "-XX:+UseBarriersForVolatile";
-
-        pb = ProcessTools.createJavaProcessBuilder(procArgs);
-        output = new OutputAnalyzer(pb.start());
-
-        output.stderrShouldBeEmptyIgnoreVMWarnings();
-        output.stdoutShouldNotBeEmpty();
-        output.shouldHaveExitValue(0);
-
-        // again check the output for the correct asm sequence
-
-        checkoutput(output, classname, testType, true);
+        checkoutput(output, classname, testType, useBarriersForVolatile, useCompressedOops);
     }
 
     // skip through output returning a line containing the desireed
@@ -150,7 +160,7 @@
     {
         while (iter.hasNext()) {
             String nextLine = iter.next();
-            if (nextLine.contains(substring)) {
+            if (nextLine.matches(".*" + substring + ".*")) {
                 return nextLine;
             }
         }
@@ -163,7 +173,7 @@
     // n.b. the spawned JVM's output is included in the exception
     // message to make it easeir to identify what is missing.
 
-    private void checkCompile(Iterator<String> iter, String methodname, String[] expected, OutputAnalyzer output)
+    private boolean checkCompile(Iterator<String> iter, String methodname, String[] expected, OutputAnalyzer output, boolean do_throw)
     {
         // trace call to allow eyeball check of what we are checking against
         System.out.println("checkCompile(" + methodname + ",");
@@ -176,30 +186,43 @@
         System.out.println(" })");
 
         // look for the start of an opto assembly print block
-        String match = skipTo(iter, "{method}");
+        String match = skipTo(iter, Pattern.quote("{method}"));
         if (match == null) {
-            throw new RuntimeException("Missing compiler output for " + methodname + "!\n\n" + output.getOutput());
+            if (do_throw) {
+                throw new RuntimeException("Missing compiler output for " + methodname + "!\n\n" + output.getOutput());
+            }
+            return false;
         }
         // check the compiled method name is right
-        match = skipTo(iter, "- name:");
+        match = skipTo(iter, Pattern.quote("- name:"));
         if (match == null) {
-            throw new RuntimeException("Missing compiled method name!\n\n" + output.getOutput());
+            if (do_throw) {
+                throw new RuntimeException("Missing compiled method name!\n\n" + output.getOutput());
+            }
+            return false;
         }
         if (!match.contains(methodname)) {
-            throw new RuntimeException("Wrong method " + match + "!\n  -- expecting " + methodname + "\n\n" + output.getOutput());
+            if (do_throw) {
+                throw new RuntimeException("Wrong method " + match + "!\n  -- expecting " + methodname + "\n\n" + output.getOutput());
+            }
+            return false;
         }
         // make sure we can match each expected term in order
         for (String s : expected) {
             match = skipTo(iter, s);
             if (match == null) {
-                throw new RuntimeException("Missing expected output " + s + "!\n\n" + output.getOutput());
+                if (do_throw) {
+                    throw new RuntimeException("Missing expected output " + s + "!\n\n" + output.getOutput());
+                }
+                return false;
             }
         }
+        return true;
     }
 
     // check for expected asm output from a volatile load
 
-    private void checkload(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
+    private void checkload(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
     {
         Iterator<String> iter = output.asLines().listIterator();
 
@@ -211,7 +234,7 @@
         if (!useBarriersForVolatile) {
             matches = new String[] {
                 "ldarw",
-                "membar_acquire (elided)",
+                "membar_acquire \\(elided\\)",
                 "ret"
             };
         } else {
@@ -223,15 +246,30 @@
             };
         }
 
-        checkCompile(iter, "testInt", matches, output);
+        checkCompile(iter, "testInt", matches, output, true);
 
-        checkCompile(iter, "testObj", matches, output) ;
+        if (!useBarriersForVolatile) {
+            matches = new String[] {
+                useCompressedOops ? "ldarw?" : "ldar",
+                "membar_acquire \\(elided\\)",
+                "ret"
+            };
+        } else {
+            matches = new String[] {
+                useCompressedOops ? "ldrw?" : "ldr",
+                "membar_acquire",
+                "dmb ish",
+                "ret"
+            };
+        }
+
+        checkCompile(iter, "testObj", matches, output, true);
 
     }
 
     // check for expected asm output from a volatile store
 
-    private void checkstore(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
+    private void checkstore(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
     {
         Iterator<String> iter = output.asLines().listIterator();
 
@@ -241,9 +279,9 @@
         if (!useBarriersForVolatile) {
             // this is the sequence of instructions for all cases
             matches = new String[] {
-                "membar_release (elided)",
+                "membar_release \\(elided\\)",
                 "stlrw",
-                "membar_volatile (elided)",
+                "membar_volatile \\(elided\\)",
                 "ret"
             };
         } else {
@@ -258,7 +296,7 @@
             };
         }
 
-        checkCompile(iter, "testInt", matches, output);
+        checkCompile(iter, "testInt", matches, output, true);
 
         // object stores will be as above except for when the GC
         // introduces barriers for card marking
@@ -268,9 +306,9 @@
             default:
                 // this is the basic sequence of instructions
                 matches = new String[] {
-                    "membar_release (elided)",
-                    "stlrw",
-                    "membar_volatile (elided)",
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "stlrw?" : "stlr",
+                    "membar_volatile \\(elided\\)",
                     "ret"
                 };
                 break;
@@ -278,12 +316,12 @@
                 // a card mark volatile barrier should be generated
                 // before the card mark strb
                 matches = new String[] {
-                    "membar_release (elided)",
-                    "stlrw",
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "stlrw?" : "stlr",
                     "membar_volatile",
                     "dmb ish",
                     "strb",
-                    "membar_volatile (elided)",
+                    "membar_volatile \\(elided\\)",
                     "ret"
                 };
                 break;
@@ -292,13 +330,13 @@
                 // before the card mark strb from the StoreCM and the
                 // storestore barrier from the StoreCM should be elided
                 matches = new String[] {
-                    "membar_release (elided)",
-                    "stlrw",
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "stlrw?" : "stlr",
                     "membar_volatile",
                     "dmb ish",
-                    "storestore (elided)",
+                    "storestore \\(elided\\)",
                     "strb",
-                    "membar_volatile (elided)",
+                    "membar_volatile \\(elided\\)",
                     "ret"
                 };
                 break;
@@ -308,12 +346,12 @@
                 // storestore barrier from the StoreCM should be
                 // generated as "dmb ishst"
                 matches = new String[] {
-                    "membar_release (elided)",
-                    "stlrw",
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "stlrw?" : "stlr",
                     "storestore",
                     "dmb ishst",
                     "strb",
-                    "membar_volatile (elided)",
+                    "membar_volatile \\(elided\\)",
                     "ret"
                 };
                 break;
@@ -325,7 +363,7 @@
                 matches = new String[] {
                     "membar_release",
                     "dmb ish",
-                    "strw",
+                    useCompressedOops ? "strw?" : "str",
                     "membar_volatile",
                     "dmb ish",
                     "ret"
@@ -337,7 +375,7 @@
                 matches = new String[] {
                     "membar_release",
                     "dmb ish",
-                    "strw",
+                    useCompressedOops ? "strw?" : "str",
                     "membar_volatile",
                     "dmb ish",
                     "strb",
@@ -353,10 +391,10 @@
                 matches = new String[] {
                     "membar_release",
                     "dmb ish",
-                    "strw",
+                    useCompressedOops ? "strw?" : "str",
                     "membar_volatile",
                     "dmb ish",
-                    "storestore (elided)",
+                    "storestore \\(elided\\)",
                     "strb",
                     "membar_volatile",
                     "dmb ish",
@@ -371,7 +409,7 @@
                 matches = new String[] {
                     "membar_release",
                     "dmb ish",
-                    "strw",
+                    useCompressedOops ? "strw?" : "str",
                     "storestore",
                     "dmb ishst",
                     "strb",
@@ -383,40 +421,48 @@
             }
         }
 
-        checkCompile(iter, "testObj", matches, output);
+        checkCompile(iter, "testObj", matches, output, true);
     }
 
     // check for expected asm output from a volatile cas
 
-    private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
+    private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
     {
         Iterator<String> iter = output.asLines().listIterator();
 
         String[] matches;
+        String[][] tests = {
+            { "testInt", "cmpxchgw" },
+            { "testLong", "cmpxchg" },
+            { "testByte", "cmpxchgb" },
+            { "testShort", "cmpxchgs" },
+        };
 
-        // non object stores are straightforward
-        if (!useBarriersForVolatile) {
-            // this is the sequence of instructions for all cases
-            matches = new String[] {
-                "membar_release (elided)",
-                "cmpxchgw_acq",
-                "membar_acquire (elided)",
-                "ret"
-            };
-        } else {
-            // this is the alternative sequence of instructions
-            matches = new String[] {
-                "membar_release",
-                "dmb ish",
-                "cmpxchgw",
-                "membar_acquire",
-                "dmb ish",
-                "ret"
-            };
+        for (String[] test : tests) {
+            // non object stores are straightforward
+            if (!useBarriersForVolatile) {
+                // this is the sequence of instructions for all cases
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    test[1] + "_acq",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+            } else {
+                // this is the alternative sequence of instructions
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    test[1] + " ",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+            }
+
+            checkCompile(iter, test[0], matches, output, true);
         }
 
-        checkCompile(iter, "testInt", matches, output);
-
         // object stores will be as above except for when the GC
         // introduces barriers for card marking
 
@@ -425,10 +471,10 @@
             default:
                 // this is the basic sequence of instructions
                 matches = new String[] {
-                    "membar_release (elided)",
-                    "cmpxchgw_acq",
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
                     "strb",
-                    "membar_acquire (elided)",
+                    "membar_acquire \\(elided\\)",
                     "ret"
                 };
                 break;
@@ -436,12 +482,12 @@
                 // a card mark volatile barrier should be generated
                 // before the card mark strb
                 matches = new String[] {
-                    "membar_release (elided)",
-                    "cmpxchgw_acq",
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
                     "membar_volatile",
                     "dmb ish",
                     "strb",
-                    "membar_acquire (elided)",
+                    "membar_acquire \\(elided\\)",
                     "ret"
                 };
                 break;
@@ -450,13 +496,13 @@
                 // before the card mark strb from the StoreCM and the
                 // storestore barrier from the StoreCM should be elided
                 matches = new String[] {
-                    "membar_release (elided)",
-                    "cmpxchgw_acq",
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
                     "membar_volatile",
                     "dmb ish",
-                    "storestore (elided)",
+                    "storestore \\(elided\\)",
                     "strb",
-                    "membar_acquire (elided)",
+                    "membar_acquire \\(elided\\)",
                     "ret"
                 };
                 break;
@@ -465,12 +511,12 @@
                 // before the card mark strb from the StoreCM and the
                 // storestore barrier from the StoreCM should be elided
                 matches = new String[] {
-                    "membar_release (elided)",
-                    "cmpxchgw_acq",
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
                     "storestore",
                     "dmb ishst",
                     "strb",
-                    "membar_acquire (elided)",
+                    "membar_acquire \\(elided\\)",
                     "ret"
                 };
                 break;
@@ -482,7 +528,7 @@
                 matches = new String[] {
                     "membar_release",
                     "dmb ish",
-                    "cmpxchgw",
+                    useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
                     "membar_acquire",
                     "dmb ish",
                     "ret"
@@ -494,7 +540,7 @@
                 matches = new String[] {
                     "membar_release",
                     "dmb ish",
-                    "cmpxchgw",
+                    useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
                     "membar_volatile",
                     "dmb ish",
                     "strb",
@@ -510,10 +556,191 @@
                 matches = new String[] {
                     "membar_release",
                     "dmb ish",
-                    "cmpxchgw",
+                    useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
                     "membar_volatile",
                     "dmb ish",
-                    "storestore (elided)",
+                    "storestore \\(elided\\)",
+                    "strb",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+                break;
+            case "CMS":
+                // a volatile card mark membar should not be generated
+                // before the card mark strb from the StoreCM and the
+                // storestore barrier from the StoreCM should be generated
+                // as "dmb ishst"
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
+                    "storestore",
+                    "dmb ishst",
+                    "strb",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+                break;
+            }
+        }
+
+        checkCompile(iter, "testObj", matches, output, true);
+    }
+
+    private void checkcae(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
+    {
+        ListIterator<String> iter = output.asLines().listIterator();
+
+        String[] matches;
+        String[][] tests = {
+            { "testInt", "cmpxchgw" },
+            { "testLong", "cmpxchg" },
+            { "testByte", "cmpxchgb" },
+            { "testShort", "cmpxchgs" },
+        };
+
+        for (String[] test : tests) {
+            // non object stores are straightforward
+            if (!useBarriersForVolatile) {
+                // this is the sequence of instructions for all cases
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    test[1] + "_acq",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+            } else {
+                // this is the alternative sequence of instructions
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    test[1] + " ",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+            }
+
+            checkCompile(iter, test[0], matches, output, true);
+        }
+
+        // object stores will be as above except for when the GC
+        // introduces barriers for card marking
+
+        if (!useBarriersForVolatile) {
+            switch (testType) {
+            default:
+                // this is the basic sequence of instructions
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    "strb",
+                    useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+
+                // card marking store may be scheduled before or after
+                // the cmpxchg so try both sequences.
+                int idx = iter.nextIndex();
+                if (!checkCompile(iter, "testObj", matches, output, false)) {
+                    iter = output.asLines().listIterator(idx);
+
+                    matches = new String[] {
+                        "membar_release \\(elided\\)",
+                        useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+                        "strb",
+                        "membar_acquire \\(elided\\)",
+                        "ret"
+                    };
+
+                    checkCompile(iter, "testObj", matches, output, true);
+                }
+                return;
+
+            case "G1":
+                // a card mark volatile barrier should be generated
+                // before the card mark strb
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+                    "membar_volatile",
+                    "dmb ish",
+                    "strb",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+                break;
+            case "CMSCondMark":
+                // a card mark volatile barrier should be generated
+                // before the card mark strb from the StoreCM and the
+                // storestore barrier from the StoreCM should be elided
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+                    "membar_volatile",
+                    "dmb ish",
+                    "storestore \\(elided\\)",
+                    "strb",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+                break;
+            case "CMS":
+                // a volatile card mark membar should not be generated
+                // before the card mark strb from the StoreCM and the
+                // storestore barrier from the StoreCM should be elided
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+                    "storestore",
+                    "dmb ishst",
+                    "strb",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+                break;
+            }
+        } else {
+            switch (testType) {
+            default:
+                // this is the basic sequence of instructions
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+                break;
+            case "G1":
+                // a card mark volatile barrier should be generated
+                // before the card mark strb
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
+                    "membar_volatile",
+                    "dmb ish",
+                    "strb",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+                break;
+            case "CMSCondMark":
+                // a card mark volatile barrier should be generated
+                // before the card mark strb from the StoreCM and the
+                // storestore barrier from the StoreCM should be elided
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
+                    "membar_volatile",
+                    "dmb ish",
+                    "storestore \\(elided\\)",
                     "strb",
                     "membar_acquire",
                     "dmb ish",
@@ -528,7 +755,7 @@
                 matches = new String[] {
                     "membar_release",
                     "dmb ish",
-                    "cmpxchgw",
+                    useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
                     "storestore",
                     "dmb ishst",
                     "strb",
@@ -540,12 +767,210 @@
             }
         }
 
-        checkCompile(iter, "testObj", matches, output);
+        checkCompile(iter, "testObj", matches, output, true);
+    }
+
+    private void checkgas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
+    {
+        Iterator<String> iter = output.asLines().listIterator();
+
+        String[] matches;
+        String[][] tests = {
+            { "testInt", "atomic_xchgw" },
+            { "testLong", "atomic_xchg" },
+        };
+
+        for (String[] test : tests) {
+            // non object stores are straightforward
+            if (!useBarriersForVolatile) {
+                // this is the sequence of instructions for all cases
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    test[1] + "_acq",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+            } else {
+                // this is the alternative sequence of instructions
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    test[1] + " ",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+            }
+
+            checkCompile(iter, test[0], matches, output, true);
+        }
+
+        // object stores will be as above except for when the GC
+        // introduces barriers for card marking
+
+        if (!useBarriersForVolatile) {
+            switch (testType) {
+            default:
+                // this is the basic sequence of instructions
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
+                    "strb",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+                break;
+            case "G1":
+                // a card mark volatile barrier should be generated
+                // before the card mark strb
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
+                    "membar_volatile",
+                    "dmb ish",
+                    "strb",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+                break;
+            case "CMSCondMark":
+                // a card mark volatile barrier should be generated
+                // before the card mark strb from the StoreCM and the
+                // storestore barrier from the StoreCM should be elided
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
+                    "membar_volatile",
+                    "dmb ish",
+                    "storestore \\(elided\\)",
+                    "strb",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+                break;
+            case "CMS":
+                // a volatile card mark membar should not be generated
+                // before the card mark strb from the StoreCM and the
+                // storestore barrier from the StoreCM should be elided
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
+                    "storestore",
+                    "dmb ishst",
+                    "strb",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+                break;
+            }
+        } else {
+            switch (testType) {
+            default:
+                // this is the basic sequence of instructions
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+                break;
+            case "G1":
+                // a card mark volatile barrier should be generated
+                // before the card mark strb
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
+                    "membar_volatile",
+                    "dmb ish",
+                    "strb",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+                break;
+            case "CMSCondMark":
+                // a card mark volatile barrier should be generated
+                // before the card mark strb from the StoreCM and the
+                // storestore barrier from the StoreCM should be elided
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
+                    "membar_volatile",
+                    "dmb ish",
+                    "storestore \\(elided\\)",
+                    "strb",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+                break;
+            case "CMS":
+                // a volatile card mark membar should not be generated
+                // before the card mark strb from the StoreCM and the
+                // storestore barrier from the StoreCM should be generated
+                // as "dmb ishst"
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
+                    "storestore",
+                    "dmb ishst",
+                    "strb",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+                break;
+            }
+        }
+
+        checkCompile(iter, "testObj", matches, output, true);
+    }
+
+    private void checkgaa(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
+    {
+        Iterator<String> iter = output.asLines().listIterator();
+
+        String[] matches;
+        String[][] tests = {
+            { "testInt", "get_and_addI" },
+            { "testLong", "get_and_addL" },
+        };
+
+        for (String[] test : tests) {
+            // non object stores are straightforward
+            if (!useBarriersForVolatile) {
+                // this is the sequence of instructions for all cases
+                matches = new String[] {
+                    "membar_release \\(elided\\)",
+                    test[1] + "_acq",
+                    "membar_acquire \\(elided\\)",
+                    "ret"
+                };
+            } else {
+                // this is the alternative sequence of instructions
+                matches = new String[] {
+                    "membar_release",
+                    "dmb ish",
+                    test[1] + " ",
+                    "membar_acquire",
+                    "dmb ish",
+                    "ret"
+                };
+            }
+
+            checkCompile(iter, test[0], matches, output, true);
+        }
+
     }
 
     // perform a check appropriate to the classname
 
-    private void checkoutput(OutputAnalyzer output, String classname, String testType, boolean useBarriersForVolatile) throws Throwable
+    private void checkoutput(OutputAnalyzer output, String classname, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
     {
         // trace call to allow eyeball check of what is being checked
         System.out.println("checkoutput(" +
@@ -556,19 +981,29 @@
 
         switch (classname) {
         case "TestVolatileLoad":
-            checkload(output, testType, useBarriersForVolatile);
+            checkload(output, testType, useBarriersForVolatile, useCompressedOops);
             break;
         case "TestVolatileStore":
-            checkstore(output, testType, useBarriersForVolatile);
+            checkstore(output, testType, useBarriersForVolatile, useCompressedOops);
             break;
         case "TestUnsafeVolatileLoad":
-            checkload(output, testType, useBarriersForVolatile);
+            checkload(output, testType, useBarriersForVolatile, useCompressedOops);
             break;
         case "TestUnsafeVolatileStore":
-            checkstore(output, testType, useBarriersForVolatile);
+            checkstore(output, testType, useBarriersForVolatile, useCompressedOops);
             break;
         case "TestUnsafeVolatileCAS":
-            checkcas(output, testType, useBarriersForVolatile);
+        case "TestUnsafeVolatileWeakCAS":
+            checkcas(output, testType, useBarriersForVolatile, useCompressedOops);
+            break;
+        case "TestUnsafeVolatileCAE":
+            checkcae(output, testType, useBarriersForVolatile, useCompressedOops);
+            break;
+        case "TestUnsafeVolatileGAS":
+            checkgas(output, testType, useBarriersForVolatile, useCompressedOops);
+            break;
+        case "TestUnsafeVolatileGAA":
+            checkgaa(output, testType, useBarriersForVolatile);
             break;
         }
     }
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java	Mon Nov 05 19:05:15 2018 -0500
@@ -38,6 +38,9 @@
  *        compiler.c2.aarch64.TestVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileCAE
+ *        compiler.c2.aarch64.TestUnsafeVolatileGAS
  *
  * @run driver compiler.c2.aarch64.TestVolatilesCMS
  *      TestVolatileLoad CMS
@@ -53,6 +56,15 @@
  *
  * @run driver compiler.c2.aarch64.TestVolatilesCMS
  *      TestUnsafeVolatileCAS CMS
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMS
+ *      TestUnsafeVolatileWeakCAS CMS
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMS
+ *      TestUnsafeVolatileCAE CMS
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMS
+ *      TestUnsafeVolatileGAS CMS
  */
 
 package compiler.c2.aarch64;
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java	Mon Nov 05 19:05:15 2018 -0500
@@ -38,6 +38,9 @@
  *        compiler.c2.aarch64.TestVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileCAE
+ *        compiler.c2.aarch64.TestUnsafeVolatileGAS
  *
  * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
  *      TestVolatileLoad CMSCondMark
@@ -53,6 +56,15 @@
  *
  * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
  *      TestUnsafeVolatileCAS CMSCondMark
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
+ *      TestUnsafeVolatileWeakCAS CMSCondMark
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
+ *      TestUnsafeVolatileCAE CMSCondMark
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
+ *      TestUnsafeVolatileGAS CMSCondMark
  */
 
 package compiler.c2.aarch64;
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java	Mon Nov 05 19:05:15 2018 -0500
@@ -38,6 +38,10 @@
  *        compiler.c2.aarch64.TestVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileCAE
+ *        compiler.c2.aarch64.TestUnsafeVolatileGAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileGAA
  *
  * @run driver compiler.c2.aarch64.TestVolatilesG1
  *      TestVolatileLoad G1
@@ -53,8 +57,21 @@
  *
  * @run driver compiler.c2.aarch64.TestVolatilesG1
  *      TestUnsafeVolatileCAS G1
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesG1
+ *      TestUnsafeVolatileWeakCAS G1
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesG1
+ *      TestUnsafeVolatileCAE G1
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesG1
+ *      TestUnsafeVolatileGAS G1
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesG1
+ *      TestUnsafeVolatileGAA G1
  */
 
+
 package compiler.c2.aarch64;
 
 public class TestVolatilesG1 {
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java	Mon Nov 05 19:05:15 2018 -0500
@@ -38,6 +38,9 @@
  *        compiler.c2.aarch64.TestVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileCAE
+ *        compiler.c2.aarch64.TestUnsafeVolatileGAS
  *
  * @run driver compiler.c2.aarch64.TestVolatilesParallel
  *      TestVolatileLoad Parallel
@@ -53,6 +56,15 @@
  *
  * @run driver compiler.c2.aarch64.TestVolatilesParallel
  *      TestUnsafeVolatileCAS Parallel
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesParallel
+ *      TestUnsafeVolatileWeakCAS Parallel
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesParallel
+ *      TestUnsafeVolatileCAE Parallel
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesParallel
+ *      TestUnsafeVolatileGAS Parallel
  */
 
 package compiler.c2.aarch64;
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java	Mon Nov 05 19:05:15 2018 -0500
@@ -38,6 +38,9 @@
  *        compiler.c2.aarch64.TestVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileStore
  *        compiler.c2.aarch64.TestUnsafeVolatileCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ *        compiler.c2.aarch64.TestUnsafeVolatileCAE
+ *        compiler.c2.aarch64.TestUnsafeVolatileGAS
  *
  * @run driver compiler.c2.aarch64.TestVolatilesSerial
  *      TestVolatileLoad Serial
@@ -53,6 +56,15 @@
  *
  * @run driver compiler.c2.aarch64.TestVolatilesSerial
  *      TestUnsafeVolatileCAS Serial
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesSerial
+ *      TestUnsafeVolatileWeakCAS Serial
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesSerial
+ *      TestUnsafeVolatileCAE Serial
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesSerial
+ *      TestUnsafeVolatileGAS Serial
  */
 
 package compiler.c2.aarch64;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/unsafe/CASandCAEwithNegExpected.java	Mon Nov 05 19:05:15 2018 -0500
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2018, 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 8211320
+ * @summary Aarch64: unsafe.compareAndSetByte() and unsafe.compareAndSetShort() c2 intrinsics broken with negative expected value
+ *
+ * @modules java.base/jdk.internal.misc
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation  CASandCAEwithNegExpected
+ */
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+public class CASandCAEwithNegExpected {
+    public volatile int f_int = -1;
+    public volatile long f_long = -1;
+    public volatile byte f_byte = -1;
+    public volatile short f_short = -1;
+
+    public static Unsafe unsafe = Unsafe.getUnsafe();
+    public static Field f_int_field;
+    public static Field f_long_field;
+    public static Field f_byte_field;
+    public static Field f_short_field;
+    public static long f_int_off;
+    public static long f_long_off;
+    public static long f_byte_off;
+    public static long f_short_off;
+
+    static {
+        try {
+            f_int_field = CASandCAEwithNegExpected.class.getField("f_int");
+            f_long_field = CASandCAEwithNegExpected.class.getField("f_long");
+            f_byte_field = CASandCAEwithNegExpected.class.getField("f_byte");
+            f_short_field = CASandCAEwithNegExpected.class.getField("f_short");
+            f_int_off = unsafe.objectFieldOffset(f_int_field);
+            f_long_off = unsafe.objectFieldOffset(f_long_field);
+            f_byte_off = unsafe.objectFieldOffset(f_byte_field);
+            f_short_off = unsafe.objectFieldOffset(f_short_field);
+        } catch (Exception e) {
+            System.out.println("reflection failed " + e);
+            e.printStackTrace();
+        }
+    }
+
+    static public void main(String[] args) {
+        CASandCAEwithNegExpected t = new CASandCAEwithNegExpected();
+        for (int i = 0; i < 20_000; i++) {
+            t.test();
+        }
+    }
+
+    // check proper handling of sign extension of expected value in comparison
+    void test() {
+        f_int = -1;
+        f_long = -1;
+        f_byte = -1;
+        f_short = -1;
+
+        unsafe.compareAndSetInt(this, f_int_off, -1, 42);
+        if (f_int != 42) {
+            throw new RuntimeException("CAS failed");
+        }
+        unsafe.compareAndSetLong(this, f_long_off, -1, 42);
+        if (f_long != 42) {
+            throw new RuntimeException("CAS failed");
+        }
+        unsafe.compareAndSetByte(this, f_byte_off, (byte)-1, (byte)42);
+        if (f_byte != 42) {
+            throw new RuntimeException("CAS failed");
+        }
+        unsafe.compareAndSetShort(this, f_short_off, (short)-1, (short)42);
+        if (f_short != 42) {
+            throw new RuntimeException("CAS failed");
+        }
+
+        f_int = -1;
+        f_long = -1;
+        f_byte = -1;
+        f_short = -1;
+
+        unsafe.compareAndExchangeInt(this, f_int_off, -1, 42);
+        if (f_int != 42) {
+            throw new RuntimeException("CAE failed");
+        }
+        unsafe.compareAndExchangeLong(this, f_long_off, -1, 42);
+        if (f_long != 42) {
+            throw new RuntimeException("CAE failed");
+        }
+        unsafe.compareAndExchangeByte(this, f_byte_off, (byte)-1, (byte)42);
+        if (f_byte != 42) {
+            throw new RuntimeException("CAE failed");
+        }
+        unsafe.compareAndExchangeShort(this, f_short_off, (short)-1, (short)42);
+        if (f_short != 42) {
+            throw new RuntimeException("CAE failed");
+        }
+
+        f_int = -1;
+        f_long = -1;
+        f_byte = -1;
+        f_short = -1;
+
+        if (unsafe.weakCompareAndSetInt(this, f_int_off, -1, 42) && f_int != 42) {
+            throw new RuntimeException("CAS failed");
+        }
+
+        if (unsafe.weakCompareAndSetLong(this, f_long_off, -1, 42) && f_long != 42) {
+            throw new RuntimeException("CAS failed");
+        }
+
+        if (unsafe.weakCompareAndSetByte(this, f_byte_off, (byte)-1, (byte)42) && f_byte != 42) {
+            throw new RuntimeException("CAS failed");
+        }
+
+        if (unsafe.weakCompareAndSetShort(this, f_short_off, (short)-1, (short)42) && f_short != 42) {
+            throw new RuntimeException("CAS failed");
+        }
+    }
+
+}
--- a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java	Mon Nov 05 19:05:15 2018 -0500
@@ -53,8 +53,8 @@
         output = new OutputAnalyzer(pb.start());
         output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM.");
 
-        pb = ProcessTools.createJavaProcessBuilder("-XX:+ExecuteInternalVMTests", "-version");
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-version");
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Error: VM option 'ExecuteInternalVMTests' is notproduct and is available only in debug version of VM.");
+        output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM.");
     }
 }
--- a/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java	Mon Nov 05 19:05:15 2018 -0500
@@ -30,7 +30,7 @@
  * @modules jdk.jfr
  * @build Hello GetFlightRecorder
  * @run driver ClassFileInstaller -jar CDSandJFR.jar Hello GetFlightRecorder GetFlightRecorder$TestEvent GetFlightRecorder$SimpleEvent
- * @run driver CDSandJFR
+ * @run driver/timeout=500 CDSandJFR
  */
 
 import jdk.test.lib.BuildHelper;
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,17 +27,16 @@
  * @summary Exercise GC with shared strings
  * @requires vm.cds.archived.java.heap
  * @library /test/hotspot/jtreg/runtime/appcds /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @build HelloStringGC sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run driver ExerciseGC
- * @run main/othervm -XX:+UseStringDeduplication ExerciseGC
- * @run main/othervm -XX:-CompactStrings ExerciseGC
  */
 public class ExerciseGC {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, ExerciseGC::test);
+    }
+    public static void test(String[] args) throws Exception {
         SharedStringsUtils.buildJarAndWhiteBox("HelloStringGC");
 
         SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("HelloStringGC"),
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Mon Nov 05 19:05:15 2018 -0500
@@ -22,6 +22,11 @@
  *
  */
 
+// NOTE: the test takes a long time for each VM option combination, so we split
+// it into 3 @test parts, so that they can be executed in parallel. If you make a
+// change, please ensure all @test blocks are in sync.
+
+
 /*
  * @test
  * @summary Test options that are incompatible with use of shared strings
@@ -36,9 +41,35 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @build HelloString
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions 0
  */
 
+
+/*
+ * @test
+ * @requires vm.cds.archived.java.heap
+ * @requires (vm.gc=="null")
+ * @library /test/lib /test/hotspot/jtreg/runtime/appcds
+ * @modules jdk.jartool/sun.tools.jar
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build HelloString
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions 1
+ */
+
+/*
+ * @test
+ * @requires vm.cds.archived.java.heap
+ * @requires (vm.gc=="null")
+ * @library /test/lib /test/hotspot/jtreg/runtime/appcds
+ * @modules jdk.jartool/sun.tools.jar
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build HelloString
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions 2
+ */
+
+
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Platform;
 import jdk.test.lib.process.OutputAnalyzer;
@@ -59,10 +90,17 @@
         "The shared archive file's CompactStrings setting .* does not equal the current CompactStrings setting";
 
     static String appJar;
-    static String[] globalVmOptions;
+    static String[] vmOptionsPrefix = {};
 
     public static void main(String[] args) throws Exception {
-        globalVmOptions = args; // specified by "@run main" in IncompatibleOptions_*.java
+        String[] noargs = {};
+        SharedStringsUtils.run(Integer.parseInt(args[0]), 3, noargs, IncompatibleOptions::test);
+        // Add a new @test block if you get an assert ----^ about this number. See
+        // SharedStringsUtils.java for details.
+    }
+
+    public static void test(String[] args_ignored) throws Exception {
+        vmOptionsPrefix = SharedStringsUtils.getChildVMOptionsPrefix();
         appJar = JarBuilder.build("IncompatibleOptions", "HelloString");
 
         // Uncompressed OOPs
@@ -118,7 +156,7 @@
 
         System.out.println("Testcase: " + testCaseNr);
         OutputAnalyzer output = TestCommon.dump(appJar, TestCommon.list("Hello"),
-            TestCommon.concat(globalVmOptions,
+            TestCommon.concat(vmOptionsPrefix,
                 "-XX:+UseCompressedOops",
                 collectorOption,
                 "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile("SharedStringsBasic.txt"),
@@ -145,12 +183,12 @@
         // main class param, and fails with "Could not find or load main class"
         if (!extraOption.isEmpty()) {
             output = TestCommon.exec(appJar,
-                TestCommon.concat(globalVmOptions,
+                TestCommon.concat(vmOptionsPrefix,
                     "-XX:+UseCompressedOops",
                     collectorOption, "-Xlog:cds", extraOption, "HelloString"));
         } else {
             output = TestCommon.exec(appJar,
-                TestCommon.concat(globalVmOptions,
+                TestCommon.concat(vmOptionsPrefix,
                     "-XX:+UseCompressedOops",
                     collectorOption, "-Xlog:cds", "HelloString"));
         }
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java	Mon Nov 05 19:00:34 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2018, 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 Test options that are incompatible with use of shared strings
- *          Also test mismatch in oops encoding between dump time and run time
- * @requires vm.cds.archived.java.heap
- * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set
- * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed
- * vm options.
- * @requires (vm.gc=="null")
- * @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules jdk.jartool/sun.tools.jar
- * @build sun.hotspot.WhiteBox
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
- * @build HelloString
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions -XX:-CompactStrings
- */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java	Mon Nov 05 19:00:34 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2018, 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 Test options that are incompatible with use of shared strings
- *          Also test mismatch in oops encoding between dump time and run time
- * @requires vm.cds.archived.java.heap
- * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set
- * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed
- * vm options.
- * @requires (vm.gc=="null")
- * @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules jdk.jartool/sun.tools.jar
- * @build sun.hotspot.WhiteBox
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
- * @build HelloString
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions -XX:+UseStringDeduplication
- */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,19 +27,19 @@
  * @summary Test shared strings together with string intern operation
  * @requires vm.cds.archived.java.heap
  * @library /test/hotspot/jtreg/runtime/appcds /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @compile InternStringTest.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run driver InternSharedString
- * @run main/othervm -XX:+UseStringDeduplication InternSharedString
- * @run main/othervm -XX:-CompactStrings InternSharedString
  */
 
 public class InternSharedString {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, InternSharedString::test);
+    }
+
+    public static void test(String[] args) throws Exception {
         SharedStringsUtils.buildJarAndWhiteBox("InternStringTest");
 
         SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("InternStringTest"),
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,13 +27,9 @@
  * @summary Check most common errors in file format
  * @requires vm.cds.archived.java.heap
  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @build HelloString
  * @run driver InvalidFileFormat
- * @run main/othervm -XX:+UseStringDeduplication InvalidFileFormat
- * @run main/othervm -XX:-CompactStrings InvalidFileFormat
  */
 
 import java.io.File;
@@ -46,6 +42,10 @@
 // the previledge person in the server environment.
 public class InvalidFileFormat {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, InvalidFileFormat::test);
+    }
+
+    public static void test(String[] args) throws Exception {
         SharedStringsUtils.buildJar("HelloString");
 
         test("NonExistentFile.txt", "Unable to get hashtable dump file size");
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,17 +27,18 @@
  * @summary Basic shared string test with large pages
  * @requires vm.cds.archived.java.heap
  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @build HelloString
  * @run driver LargePages
- * @run main/othervm -XX:+UseStringDeduplication LargePages
- * @run main/othervm -XX:-CompactStrings LargePages
  */
 public class LargePages {
     static final String CDS_LOGGING = "-Xlog:cds,cds+hashtables";
+
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, LargePages::test);
+    }
+
+    public static void test(String[] args) throws Exception {
         SharedStringsUtils.buildJar("HelloString");
 
         SharedStringsUtils.dump(TestCommon.list("HelloString"),
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,19 +27,19 @@
  * @summary Test locking on shared strings
  * @requires vm.cds.archived.java.heap
  * @library /test/hotspot/jtreg/runtime/appcds /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @compile LockStringTest.java LockStringValueTest.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run driver LockSharedStrings
- * @run main/othervm -XX:+UseStringDeduplication LockSharedStrings
- * @run main/othervm -XX:-CompactStrings LockSharedStrings
  */
 
 public class LockSharedStrings {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, LockSharedStrings::test);
+    }
+
+    public static void test(String[] args) throws Exception {
         SharedStringsUtils.buildJarAndWhiteBox("LockStringTest", "LockStringValueTest");
 
         SharedStringsUtils.dumpWithWhiteBox(
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,44 +27,49 @@
  * @summary Basic test for shared strings
  * @requires vm.cds.archived.java.heap
  * @library /test/hotspot/jtreg/runtime/appcds /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @build HelloString
  * @run driver SharedStringsBasic
- * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasic
- * @run main/othervm -XX:-CompactStrings SharedStringsBasic
  */
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
-// This test does not use SharedStringsUtils intentionally:
+// This test does not use SharedStringsUtils.dumpXXX()
+// and SharedStringsUtils.runWithXXX() intentionally:
 // - in order to demonstrate the basic use of the functionality
 // - to provide sanity check and catch potential problems in the utils
 public class SharedStringsBasic {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, SharedStringsBasic::test);
+    }
+
+    public static void test(String[] args) throws Exception {
+        String vmOptionsPrefix[] = SharedStringsUtils.getChildVMOptionsPrefix();
+
         String appJar = JarBuilder.build("SharedStringsBasic", "HelloString");
 
         String sharedArchiveConfigFile =
             TestCommon.getSourceFile("SharedStringsBasic.txt").toString();
 
         ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true,
+          TestCommon.concat(vmOptionsPrefix,
             "-cp", appJar,
             "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile,
             "-XX:SharedArchiveFile=./SharedStringsBasic.jsa",
             "-Xshare:dump",
-            "-Xlog:cds,cds+hashtables");
+            "-Xlog:cds,cds+hashtables"));
 
         TestCommon.executeAndLog(dumpPb, "dump")
             .shouldContain("Shared string table stats")
             .shouldHaveExitValue(0);
 
         ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true,
+          TestCommon.concat(vmOptionsPrefix,
             "-cp", appJar,
             "-XX:SharedArchiveFile=./SharedStringsBasic.jsa",
             "-Xshare:auto",
             "-showversion",
-            "HelloString");
+            "HelloString"));
 
         TestCommon.executeAndLog(runPb, "run").shouldHaveExitValue(0);
     }
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,18 +27,18 @@
  * @summary Basic plus test for shared strings
  * @requires vm.cds.archived.java.heap
  * @library /test/hotspot/jtreg/runtime/appcds /test/lib
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @build HelloStringPlus sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run driver SharedStringsBasicPlus
- * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasicPlus
- * @run main/othervm -XX:-CompactStrings SharedStringsBasicPlus
  */
 
 public class SharedStringsBasicPlus {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, SharedStringsBasicPlus::test);
+    }
+
+    public static void test(String[] args) throws Exception {
         SharedStringsUtils.buildJarAndWhiteBox("HelloStringPlus");
 
         SharedStringsUtils.dumpWithWhiteBox( TestCommon.list("HelloStringPlus"),
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java	Mon Nov 05 19:05:15 2018 -0500
@@ -30,8 +30,6 @@
  * @modules jdk.jartool/sun.tools.jar
  * @build HelloString
  * @run driver SharedStringsStress
- * @run main/othervm -XX:+UseStringDeduplication SharedStringsStress
- * @run main/othervm -XX:-CompactStrings SharedStringsStress
  */
 import java.io.File;
 import java.io.FileOutputStream;
@@ -42,6 +40,12 @@
 
 public class SharedStringsStress {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, SharedStringsStress::test);
+    }
+
+    public static void test(String[] args) throws Exception {
+        String vmOptionsPrefix[] = SharedStringsUtils.getChildVMOptionsPrefix();
+
         String appJar = JarBuilder.build("SharedStringsStress", "HelloString");
 
         String sharedArchiveConfigFile = System.getProperty("user.dir") + File.separator + "SharedStringsStress_gen.txt";
@@ -58,9 +62,11 @@
         }
 
         OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"),
-                                                    "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile);
+            TestCommon.concat(vmOptionsPrefix,
+                "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile));
         TestCommon.checkDump(dumpOutput);
-        OutputAnalyzer execOutput = TestCommon.exec(appJar, "HelloString");
+        OutputAnalyzer execOutput = TestCommon.exec(appJar,
+            TestCommon.concat(vmOptionsPrefix, "HelloString"));
         TestCommon.checkExec(execOutput);
     }
 }
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -24,6 +24,7 @@
 
 import jdk.test.lib.cds.CDSOptions;
 import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.Asserts;
 
 // A helper/utility class for testing shared strings
 public class SharedStringsUtils {
@@ -31,6 +32,49 @@
     public static final String TEST_JAR_NAME_FULL = "test.jar";
     public static final String WHITEBOX_JAR_NAME =  "whitebox";
 
+    public static interface Test {
+        public void dotest(String args[]) throws Exception ;
+    }
+
+    private static String[][] vmOptionCombos = {
+        {},
+        {"-XX:+UseStringDeduplication"},
+        {"-XX:-CompactStrings"}
+    };
+
+    private static String childVMOptionsPrefix[] = {};
+
+    // SharedStringsUtils.run() is for running the main test body multiple times, each with a different
+    // set of extra VM options that are passed to the child processes.
+    //
+    // See ./ExerciseGC.java for an example.
+    public static void run(String args[], Test t) throws Exception {
+        int numSetOfChildVMOptions = vmOptionCombos.length;
+        for (int i=0; i< numSetOfChildVMOptions; i++) {
+            run(i, numSetOfChildVMOptions, args, t);
+        }
+    }
+
+    public static void run(int i, int numSetOfChildVMOptions, String args[], Test t) throws Exception {
+        // When you add a new set of options to vmOptionCombos, we make sure all
+        // callers of this method (i.e., IncompatibleOptions.java) knows about it and will
+        // add new @test blocks accordingly.
+        Asserts.assertEQ(numSetOfChildVMOptions, vmOptionCombos.length);
+        String opts[] = vmOptionCombos[i];
+
+        System.out.print("Running with extra VM option prefix for child processes [" + opts.length + "] =");
+        for (String o : opts) {
+            System.out.print(" " + o);
+        }
+        System.out.println();
+        childVMOptionsPrefix = opts;
+        t.dotest(args);
+    }
+
+    public static String[] getChildVMOptionsPrefix() {
+        return childVMOptionsPrefix;
+    }
+
     public static String getWbParam() {
         return "-Xbootclasspath/a:" + TestCommon.getTestJar(WHITEBOX_JAR_NAME + ".jar");
     }
@@ -55,6 +99,7 @@
             TestCommon.concat(extraOptions, "-XX:+UseCompressedOops", "-XX:+UseG1GC",
             "-XX:SharedArchiveConfigFile=" +
             TestCommon.getSourceFile(sharedDataFile));
+        args = TestCommon.concat(childVMOptionsPrefix, args);
 
         return TestCommon.dump(appJar, appClasses, args);
     }
@@ -80,6 +125,7 @@
         String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL);
         String[] args = TestCommon.concat(extraOptions,
             "-cp", appJar, "-XX:+UseCompressedOops", "-XX:+UseG1GC", className);
+        args = TestCommon.concat(childVMOptionsPrefix, args);
 
         OutputAnalyzer output = TestCommon.execAuto(args);
         checkExecAuto(output);
@@ -98,6 +144,7 @@
         String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL);
         String[] args = TestCommon.concat(extraOptions,
             "-XX:+UseCompressedOops", "-XX:+UseG1GC", className);
+        args = TestCommon.concat(childVMOptionsPrefix, args);
 
         OutputAnalyzer output = TestCommon.exec(appJar, args);
         checkExec(output, extraMatches);
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,14 +27,10 @@
  * @summary White box test for shared strings
  * @requires vm.cds.archived.java.heap
  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules java.base/jdk.internal.misc
- * @modules java.management
- *          jdk.jartool/sun.tools.jar
+ * @modules jdk.jartool/sun.tools.jar
  * @build sun.hotspot.WhiteBox SharedStringsWb
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run driver SharedStringsWbTest
- * @run main/othervm -XX:+UseStringDeduplication SharedStringsWbTest
- * @run main/othervm -XX:-CompactStrings SharedStringsWbTest
  */
 
 import java.io.*;
@@ -42,6 +38,10 @@
 
 public class SharedStringsWbTest {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, SharedStringsWbTest::test);
+    }
+
+    public static void test(String[] args) throws Exception {
         SharedStringsUtils.buildJarAndWhiteBox("SharedStringsWb");
 
         SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("SharedStringsWb"),
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java	Mon Nov 05 19:05:15 2018 -0500
@@ -27,12 +27,9 @@
  * @summary Regression test for JDK-8098821
  * @bug 8098821
  * @requires vm.cds.archived.java.heap
+ * @modules jdk.jartool/sun.tools.jar
  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules java.base/jdk.internal.misc
- * @modules java.management
  * @run driver SysDictCrash
- * @run main/othervm -XX:+UseStringDeduplication SysDictCrash
- * @run main/othervm -XX:-CompactStrings SysDictCrash
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
@@ -40,22 +37,30 @@
 
 public class SysDictCrash {
     public static void main(String[] args) throws Exception {
+        SharedStringsUtils.run(args, SysDictCrash::test);
+    }
+
+    public static void test(String[] args) throws Exception {
+        String vmOptionsPrefix[] = SharedStringsUtils.getChildVMOptionsPrefix();
+
         // SharedBaseAddress=0 puts the archive at a very high address on solaris,
         // which provokes the crash.
         ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true,
+          TestCommon.concat(vmOptionsPrefix,
             "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5",
             "-cp", ".",
             "-XX:SharedBaseAddress=0", "-XX:SharedArchiveFile=./SysDictCrash.jsa",
             "-Xshare:dump",
-            "-showversion", "-Xlog:cds,cds+hashtables");
+            "-showversion", "-Xlog:cds,cds+hashtables"));
 
         TestCommon.checkDump(TestCommon.executeAndLog(dumpPb, "dump"));
 
         ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true,
+          TestCommon.concat(vmOptionsPrefix,
             "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5",
             "-XX:SharedArchiveFile=./SysDictCrash.jsa",
             "-Xshare:on",
-            "-version");
+            "-version"));
 
         TestCommon.checkExec(TestCommon.executeAndLog(runPb, "exec"));
     }
--- a/test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java	Mon Nov 05 19:00:34 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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 ExecuteInternalVMTests
- * @bug 8004691
- * @summary Add a jtreg test that exercises the ExecuteInternalVMTests flag
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ExecuteInternalVMTests ExecuteInternalVMTests
- */
-public class ExecuteInternalVMTests {
-    public static void main(String[] args) throws Exception {
-        // The tests that are run are the HotSpot internal tests which are
-        // executed only when the flag -XX:+ExecuteInternalVMTests is used.
-
-        // The flag -XX:+ExecuteInternalVMTests can only be used for
-        // non-product builds of HotSpot. Therefore, the flag
-        // -XX:+IgnoreUnrecognizedVMOptions is also used, which means that this
-        // test will do nothing on a product build.
-    }
-}
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.cpp	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.cpp	Mon Nov 05 19:05:15 2018 -0500
@@ -163,7 +163,7 @@
       } else if (strlen(msg_buf2) != 0) {
         msg_buf2[strlen(msg_buf2)-1] = '\n'; // Make sure we have a newline char at the end.
       }
-      (void) nsk_printf("The following fake exception stacktrace is for failuire analysis. \n");
+      (void) nsk_printf("The following fake exception stacktrace is for failure analysis. \n");
       (void) nsk_printf("nsk.share.Fake_Exception_for_RULE_Creation: ");
       if (file != NULL) {
         (void) nsk_printf("(%s:%d) ", file_basename(file), line);
--- a/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack001.java	Mon Nov 05 19:05:15 2018 -0500
@@ -34,7 +34,7 @@
  * COMMENTS
  *     Kestrel for Solaris_JDK_1.3-b10 crashes while trying to execute
  *     this test with Client HS VM.
- *     See lots of bugs concerning similar failuires:
+ *     See lots of bugs concerning similar failures:
  *     Evaluated:
  *     4217960 [native stack overflow bug] reflection test causes crash
  *     Accepted:
--- a/test/jaxp/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jaxp/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/SurrogatesTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/systempkg/log/SystemLoggerAccessor.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/systempkg/log/SystemLoggerAccessor.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/Base.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/Base.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/math/BigInteger/PrimeTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/math/BigInteger/PrimeTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestClient.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestClient.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTestServer.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/Inet6Address/serialize/Inet6AddressSerTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/URLConnection/ContentHandlers/plain.template	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/URLConnection/ContentHandlers/plain.template	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/httpclient/DigestEchoServer.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/httpclient/DigestEchoServer.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/httpclient/ProxyAuthTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/httpclient/ProxyAuthTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/net/httpclient/http2/server/Queue.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/net/httpclient/http2/server/Queue.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/nio/channels/SelectionKey/AtomicUpdates.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/nio/channels/SelectionKey/AtomicUpdates.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/util/Formatter/spi/NoGroupingUsed.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/util/Formatter/spi/NoGroupingUsed.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/util/Locale/Bug8179071.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/util/Locale/Bug8179071.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/util/Locale/LocaleCmdOverrides.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/util/Locale/LocaleCmdOverrides.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/util/Locale/SoftKeys.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/util/Locale/SoftKeys.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/util/logging/LogManager/LinkageErrorTest.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/util/logging/LogManager/LinkageErrorTest.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/java/util/spi/ResourceBundleControlProvider/com/foo/XmlRB.xml	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/util/spi/ResourceBundleControlProvider/com/foo/XmlRB.xml	Mon Nov 05 19:05:15 2018 -0500
@@ -1,13 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2018, 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.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
+ 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
--- a/test/jdk/java/util/spi/ResourceBundleControlProvider/com/foo/XmlRB_ja.xml	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/util/spi/ResourceBundleControlProvider/com/foo/XmlRB_ja.xml	Mon Nov 05 19:05:15 2018 -0500
@@ -1,13 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2018, 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.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
+ 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
--- a/test/jdk/java/util/zip/zip.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/java/util/zip/zip.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/BackEnd.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/BackEnd.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Checksum.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Checksum.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/DayOfWeek.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/DayOfWeek.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Gen.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Gen.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/GenDoc.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/GenDoc.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Main.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Main.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Mappings.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Mappings.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Month.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Month.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Rule.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Rule.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/RuleDay.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/RuleDay.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/RuleRec.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/RuleRec.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Simple.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Simple.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Time.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Time.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Timezone.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Timezone.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/TzIDOldMapping.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/TzIDOldMapping.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Zone.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Zone.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/ZoneInfoFile.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/ZoneInfoFile.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/ZoneInfoOld.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/ZoneInfoOld.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/ZoneRec.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/ZoneRec.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/Zoneinfo.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/Zoneinfo.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/VERSION	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/VERSION	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/africa	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/africa	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/antarctica	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/antarctica	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/asia	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/asia	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/australasia	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/australasia	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/backward	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/backward	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/etcetera	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/etcetera	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/europe	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/europe	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/factory	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/factory	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/gmt	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/gmt	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 #
-# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/iso3166.tab	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/iso3166.tab	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/jdk11_backward	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/jdk11_backward	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 #
-# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/leapseconds	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/leapseconds	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/northamerica	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/northamerica	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/pacificnew	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/pacificnew	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/solar87	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/solar87	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/solar88	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/solar88	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/solar89	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/solar89	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/southamerica	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/southamerica	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/systemv	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/systemv	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata/zone.tab	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata/zone.tab	Mon Nov 05 19:05:15 2018 -0500
@@ -3,9 +3,7 @@
 #
 # 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata_jdk/gmt	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata_jdk/gmt	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 #
-# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_backward	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_backward	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 #
-# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_full_backward	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_full_backward	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 #
-# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2018, 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.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# 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
--- a/test/jdk/sun/util/locale/provider/Bug8152817.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/locale/provider/Bug8152817.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/sun/util/resources/cldr/Bug8204603.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/sun/util/resources/cldr/Bug8204603.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/jmod/src/apa/jdk/test/apa/Apa.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/jmod/src/apa/jdk/test/apa/Apa.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/jmod/src/apa/module-info.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/jmod/src/apa/module-info.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/jmod/src/foo/jdk/test/foo/Foo.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/jmod/src/foo/jdk/test/foo/Foo.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/jmod/src/foo/jdk/test/foo/internal/Message.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/jmod/src/foo/jdk/test/foo/internal/Message.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/jmod/src/foo/module-info.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/jmod/src/foo/module-info.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/annotation/processing/Generated.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/annotation/processing/Generated.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java	Mon Nov 05 19:05:15 2018 -0500
@@ -4,9 +4,7 @@
  *
  * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/CommandLineParser.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/CommandLineParser.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/TokenList.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/TokenList.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/XMLKit.java	Mon Nov 05 19:00:34 2018 -0500
+++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/XMLKit.java	Mon Nov 05 19:05:15 2018 -0500
@@ -1,12 +1,10 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
+ * 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/processing/rounds/GetElementsAnnotatedWithOnMissing.java	Mon Nov 05 19:05:15 2018 -0500
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2018, 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 8213103
+ * @summary Checking getElementsAnnotatedWith works for unknown annotations and with -source 8.
+ * @library /tools/lib /tools/javac/lib
+ * @modules
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @build toolbox.ToolBox toolbox.JavacTask JavacTestingAbstractProcessor
+ * @run main GetElementsAnnotatedWithOnMissing
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Set;
+
+import javax.annotation.processing.RoundEnvironment;
+import javax.lang.model.element.TypeElement;
+
+import toolbox.JavacTask;
+import toolbox.Task;
+import toolbox.TestRunner;
+import toolbox.ToolBox;
+
+public class GetElementsAnnotatedWithOnMissing extends TestRunner {
+
+    public static void main(String... args) throws Exception {
+        new GetElementsAnnotatedWithOnMissing().runTests(
+                m -> new Object[] { Paths.get(m.getName()) }
+        );
+    }
+
+    private ToolBox tb = new ToolBox();
+
+    public GetElementsAnnotatedWithOnMissing() {
+        super(System.err);
+    }
+
+    @Test
+    public void testModuleInfoInWrongPlace(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path classes = base.resolve("classes");
+
+        Files.createDirectories(classes);
+
+        tb.writeJavaFiles(src, "package test; public class Test {}");
+
+        new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "-source", "8",
+                         "-classpath", "",
+                         "-sourcepath", src.toString(),
+                         "-processorpath", System.getProperty("test.class.path"),
+                         "-processor", AP.class.getName())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "-classpath", "",
+                         "-sourcepath", src.toString(),
+                         "-processorpath", System.getProperty("test.class.path"),
+                         "-processor", AP.class.getName())
+                .outdir(classes)
+                .files(tb.findJavaFiles(src))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+    }
+
+    public static final class AP extends JavacTestingAbstractProcessor {
+
+        @Override
+        public boolean process(Set<? extends TypeElement> annot, RoundEnvironment env) {
+            if (elements.getTypeElement(Ann.class.getCanonicalName()) != null) {
+                throw new IllegalStateException("Can resolve @Ann!");
+            }
+            env.getElementsAnnotatedWith(Ann.class);
+            return false;
+        }
+
+    }
+
+    public @interface Ann {}
+}