Merge JDK-8200758-branch
authorherrick
Thu, 08 Nov 2018 19:15:42 -0500
branchJDK-8200758-branch
changeset 57024 8bb1fcdd611f
parent 57023 8bf89434f0a5 (current diff)
parent 52464 c139884bd80e (diff)
child 57025 bab8a5dae662
Merge
src/hotspot/share/prims/privilegedStack.cpp
src/hotspot/share/prims/privilegedStack.hpp
src/java.base/share/classes/jdk/internal/misc/JavaAWTAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaAWTFontAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaBeansAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaIOAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaIOFileDescriptorAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaIOFilePermissionAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaIORandomAccessFileAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetHttpCookieAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetInetAddressAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetSocketAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetURLAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetURLClassLoaderAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetUriAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaObjectInputFilterAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaObjectInputStreamAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaSecurityAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaUtilZipFileAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaxCryptoSealedObjectAccess.java
src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/internal/ReflectionAccessJDK.java
test/jdk/java/util/TimeZone/Bug8066652.sh
test/jdk/java/util/TimeZone/OldIDMappingTest.sh
test/jdk/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
--- a/.hgtags	Thu Nov 08 19:07:57 2018 -0500
+++ b/.hgtags	Thu Nov 08 19:15:42 2018 -0500
@@ -521,3 +521,4 @@
 199658d1ef860cdc17055b4fd3e94b057f292fe9 jdk-12+16
 eefa65e142af305923d2adcd596fab9c639723a1 jdk-12+17
 e38473506688e0995e701fc7f77d5a91b438ef93 jdk-12+18
+dc1f9dec2018a37fedba47d8a2aedef99faaec64 jdk-12+19
--- a/make/Main.gmk	Thu Nov 08 19:07:57 2018 -0500
+++ b/make/Main.gmk	Thu Nov 08 19:15:42 2018 -0500
@@ -485,7 +485,10 @@
 # ALL_NAMED_TESTS is defined in FindTests.gmk
 $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t)))
 ALL_TEST_TARGETS := $(addprefix test-, $(ALL_NAMED_TESTS))
-ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-test-, $(ALL_NAMED_TESTS))
+
+# We only support the "exploded-test-gtest" shortcut
+ALL_EXPLODED_TESTS := gtest
+ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-test-, $(ALL_EXPLODED_TESTS))
 
 ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS)
 
@@ -687,16 +690,17 @@
   # copied and processed.
   java.desktop-gensrc-src: java.base-gensrc java.base-copy
 
-  # The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler
-  # needs classes from the current JDK.
-  jdk.internal.vm.ci-gensrc-src: $(addsuffix -java, \
-      $(call FindTransitiveDepsForModule, jdk.internal.vm.ci))
+  # The annotation processing for jdk.internal.vm.compiler
+  # and jdk.internal.vm.compiler.management needs classes from the current JDK.
   jdk.internal.vm.compiler-gensrc-src: $(addsuffix -java, \
       $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler))
+  jdk.internal.vm.compiler.management-gensrc-src: $(addsuffix -java, \
+      $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler.management))
 
-  # For jdk.internal.vm.compiler, the gensrc step is generating a module-info.java.extra
+  # For these modules, the gensrc step is generating a module-info.java.extra
   # file to be processed by the gensrc-moduleinfo target.
   jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-src
+  jdk.internal.vm.compiler.management-gensrc-moduleinfo: jdk.internal.vm.compiler.management-gensrc-src
 
   jdk.jdeps-gendata: java rmic
 
@@ -852,7 +856,7 @@
 
   # Declare dependency for all generated test targets
   $(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image))
-  $(foreach t, $(filter-out exploded-test-make%, $(ALL_EXPLODED_TEST_TARGETS)), $(eval $t: exploded-image test-image))
+  $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image))
 
   create-buildjdk-copy: jdk.jlink-java java.base-gendata \
       $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
@@ -1054,9 +1058,7 @@
 
 # Let "run-test" be an alias for "test"
 $(foreach t, $(ALL_NAMED_TESTS), $(eval run-test-$t: test-$t))
-$(foreach t, $(ALL_NAMED_TESTS), $(eval exploded-run-test-$t: exploded-test-$t))
-RUN_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS)) \
-    $(addprefix exploded-run-test-, $(ALL_NAMED_TESTS))
+RUN_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS))
 
 run-test: test
 exploded-run-test: exploded-test
--- a/make/autoconf/lib-freetype.m4	Thu Nov 08 19:07:57 2018 -0500
+++ b/make/autoconf/lib-freetype.m4	Thu Nov 08 19:15:42 2018 -0500
@@ -186,6 +186,9 @@
           FREETYPE_BASE_DIR="$SYSROOT/usr"
           if (test "x$OPENJDK_TARGET_CPU_BITS" = "x64"); then
             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/$OPENJDK_TARGET_CPU-linux-gnu], [well-known location])
+            if (test "x$FOUND_FREETYPE" != "xyes"); then
+              LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib64], [well-known location])
+            fi
           else
             LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
             if (test "x$FOUND_FREETYPE" != "xyes"); then
--- a/make/conf/jib-profiles.js	Thu Nov 08 19:07:57 2018 -0500
+++ b/make/conf/jib-profiles.js	Thu Nov 08 19:15:42 2018 -0500
@@ -527,6 +527,27 @@
         profiles[debugName] = concatObjects(profiles[name], common.debug_profile_base);
     });
 
+    // Define a profile with precompiled headers disabled. This is just used for
+    // verfication of this build configuration.
+    var noPchProfiles = {
+        "linux-x64-debug-nopch": {
+            target_os: "linux",
+            target_cpu: "x64",
+            dependencies: ["devkit"],
+            configure_args: concat(common.configure_args_64bit,
+                "--with-zlib=system", "--disable-precompiled-headers"),
+        },
+    };
+    profiles = concatObjects(profiles, noPchProfiles);
+    // Add base settings to noPch profiles
+    Object.keys(noPchProfiles).forEach(function (name) {
+        profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
+        profiles[name] = concatObjects(common.debug_profile_base, profiles[name]);
+        // Override default make target with hotspot as that's the only part of
+        // the build using precompiled headers.
+        profiles[name].default_make_targets = ["hotspot"];
+    });
+
     // Bootcycle profiles runs the build with itself as the boot jdk. This can
     // be done in two ways. Either using the builtin bootcycle target in the
     // build system. Or by supplying the main jdk build as bootjdk to configure.
--- a/make/data/docs-resources/resources/jdk-default.css	Thu Nov 08 19:07:57 2018 -0500
+++ b/make/data/docs-resources/resources/jdk-default.css	Thu Nov 08 19:15:42 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
@@ -127,3 +127,14 @@
 th {
   background: #DDF;
 }
+
+table.centered {
+  margin-left: auto;
+  margin-right: auto;
+}
+table.centered td {
+  text-align: left;
+}
+.centered {
+  text-align: center;
+}
--- a/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk	Thu Nov 08 19:07:57 2018 -0500
+++ b/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 #
-# 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
@@ -67,7 +67,7 @@
 
 PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
 
-ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src)
+ALL_SRC_DIRS := $(SRC_DIR) $(wildcard $(SRC_DIR)/*/src)
 SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
 
 PROCESSOR_JARS := \
@@ -81,23 +81,23 @@
 
 ADD_EXPORTS := \
     --add-modules jdk.internal.vm.ci \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.events=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspotvmconfig=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.inittimer=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.site=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.stack=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.events=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspotvmconfig=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.inittimer=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.services=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=jdk.internal.vm.compiler \
     #
 
 $(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) $(PROCESSOR_JARS)
@@ -121,6 +121,7 @@
 ################################################################################
 
 $(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
+	$(ECHO) "" > $@;
 	($(CD) $(GENSRC_DIR)/META-INF/providers && \
 	    p=""; \
 	    impl=""; \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/gensrc/Gensrc-jdk.internal.vm.compiler.management.gmk	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,101 @@
+#
+# 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.
+#
+# 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.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+
+GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)
+SRC_DIR := $(TOPDIR)/src/$(MODULE)/share/classes
+
+################################################################################
+
+PROC_SRC_SUBDIRS := \
+    org.graalvm.compiler.hotspot.management \
+    #
+
+PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))
+
+PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
+
+ALL_SRC_DIRS := $(SRC_DIR) $(wildcard $(SRC_DIR)/*/src)
+SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
+
+PROCESSOR_JARS := \
+    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor.jar \
+    #
+PROCESSOR_PATH := $(call PathList, $(PROCESSOR_JARS))
+
+$(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) $(PROCESSOR_JARS)
+	$(call MakeDir, $(@D))
+	$(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files))
+	$(JAVA) $(NEW_JAVAC) \
+	    -XDignore.symbol.file \
+	    --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \
+	    -sourcepath $(SOURCEPATH) \
+	    -implicit:none \
+	    -proc:only \
+	    -processorpath $(PROCESSOR_PATH) \
+	    -d $(GENSRC_DIR) \
+	    -s $(GENSRC_DIR) \
+	    @$(@D)/_gensrc_proc_files
+	$(TOUCH) $@
+
+TARGETS += $(GENSRC_DIR)/_gensrc_proc_done
+
+################################################################################
+
+$(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
+	$(ECHO) "" > $@;
+	($(CD) $(GENSRC_DIR)/META-INF/providers && \
+	    p=""; \
+	    impl=""; \
+	    for i in $$($(GREP) '^' * | $(SORT) -t ':' -k 2 | $(SED) 's/:.*//'); do \
+	      c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
+	      if test x$$p != x$$c; then \
+                if test x$$p != x; then \
+	          $(ECHO) "    ;" >> $@; \
+	        fi; \
+	        $(ECHO) "provides $$c with" >> $@; \
+                p=$$c; \
+	        impl=""; \
+	      fi; \
+              if test x$$impl != x; then \
+	        $(ECHO) "  , $$i" >> $@; \
+              else \
+	        $(ECHO) "    $$i" >> $@; \
+              fi; \
+              impl=$$i; \
+	    done); \
+	$(ECHO) "    ;" >> $@;
+
+TARGETS += $(GENSRC_DIR)/module-info.java.extra
+
+################################################################################
+
+all: $(TARGETS)
+
+.PHONY: default all
--- a/make/hotspot/symbols/symbols-unix	Thu Nov 08 19:07:57 2018 -0500
+++ b/make/hotspot/symbols/symbols-unix	Thu Nov 08 19:15:42 2018 -0500
@@ -52,7 +52,6 @@
 JVM_DefineClass
 JVM_DefineClassWithSource
 JVM_DesiredAssertionStatus
-JVM_DoPrivileged
 JVM_DumpAllStacks
 JVM_DumpThreads
 JVM_FillInStackTrace
--- a/src/hotspot/.mx.jvmci/suite.py	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/.mx.jvmci/suite.py	Thu Nov 08 19:15:42 2018 -0500
@@ -43,6 +43,9 @@
     "jdk.vm.ci.services" : {
       "subDir" : "../jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
+      "imports" : [
+        "jdk.internal.misc"
+      ],
       "javaCompliance" : "9+",
       "checkstyleVersion" : "8.8",
       "workingSets" : "API,JVMCI",
--- a/src/hotspot/cpu/aarch64/globals_aarch64.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/aarch64/globals_aarch64.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2015, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -65,8 +65,6 @@
 define_pd_global(bool, RewriteBytecodes,     true);
 define_pd_global(bool, RewriteFrequentPairs, true);
 
-define_pd_global(bool, UseMembar,            true);
-
 define_pd_global(bool, PreserveFramePointer, false);
 
 // GC Ergo Flags
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -288,10 +288,6 @@
   return address(((uint64_t)insn_addr + (offset << 2)));
 }
 
-void MacroAssembler::serialize_memory(Register thread, Register tmp) {
-  dsb(Assembler::SY);
-}
-
 void MacroAssembler::safepoint_poll(Label& slow_path) {
   if (SafepointMechanism::uses_thread_local_poll()) {
     ldr(rscratch1, Address(rthread, Thread::polling_page_offset()));
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -582,6 +582,7 @@
 
   virtual void null_check(Register reg, int offset = -1);
   static bool needs_explicit_null_check(intptr_t offset);
+  static bool uses_implicit_null_check(void* address);
 
   static address target_addr_for_insn(address insn_addr, unsigned insn);
   static address target_addr_for_insn(address insn_addr) {
@@ -975,9 +976,6 @@
                                                 Register tmp,
                                                 int offset);
 
-  // Support for serializing memory accesses between threads
-  void serialize_memory(Register thread, Register tmp);
-
   // Arithmetics
 
   void addptr(const Address &dst, int32_t src);
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1950,21 +1950,10 @@
   //     didn't see any synchronization is progress, and escapes.
   __ mov(rscratch1, _thread_in_native_trans);
 
-  if (UseMembar) {
-    __ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
-
-    // Force this write out before the read below
-    __ dmb(Assembler::ISH);
-  } else {
-    __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
-    __ stlrw(rscratch1, rscratch2);
-
-    // Write serialization page so VM thread can do a pseudo remote membar.
-    // We use the current thread pointer to calculate a thread specific
-    // offset to write to within the page. This minimizes bus traffic
-    // due to cache line collision.
-    __ serialize_memory(rthread, r2);
-  }
+  __ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
+
+  // Force this write out before the read below
+  __ dmb(Assembler::ISH);
 
   // check for safepoint operation in progress and/or pending suspend requests
   Label safepoint_in_progress, safepoint_in_progress_done;
--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1394,16 +1394,8 @@
   __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
   __ stlrw(rscratch1, rscratch2);
 
-  if (UseMembar) {
-    // Force this write out before the read below
-    __ dmb(Assembler::ISH);
-  } else {
-    // Write serialization page so VM thread can do a pseudo remote membar.
-    // We use the current thread pointer to calculate a thread specific
-    // offset to write to within the page. This minimizes bus traffic
-    // due to cache line collision.
-    __ serialize_memory(rthread, rscratch2);
-  }
+  // Force this write out before the read below
+  __ dmb(Assembler::ISH);
 
   // check for safepoint operation in progress and/or pending suspend requests
   {
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2015, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -217,11 +217,6 @@
     if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) {
       FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true);
     }
-#ifdef COMPILER2
-    if (FLAG_IS_DEFAULT(UseFPUForSpilling)) {
-      FLAG_SET_DEFAULT(UseFPUForSpilling, true);
-    }
-#endif
   }
 
   // Cortex A53
--- a/src/hotspot/cpu/arm/globals_arm.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/arm/globals_arm.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, 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
@@ -65,8 +65,6 @@
 define_pd_global(bool,  RewriteBytecodes,         true);
 define_pd_global(bool,  RewriteFrequentPairs,     true);
 
-define_pd_global(bool,  UseMembar,                true);
-
 define_pd_global(bool,  PreserveFramePointer,     false);
 
 // GC Ergo Flags
--- a/src/hotspot/cpu/arm/macroAssembler_arm.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -358,6 +358,7 @@
   void zero_memory(Register start, Register end, Register tmp);
 
   static bool needs_explicit_null_check(intptr_t offset);
+  static bool uses_implicit_null_check(void* address);
 
   void arm_stack_overflow_check(int frame_size_in_bytes, Register tmp);
   void arm_stack_overflow_check(Register Rsize, Register tmp);
@@ -1095,4 +1096,3 @@
 
 
 #endif // CPU_ARM_VM_MACROASSEMBLER_ARM_HPP
-
--- a/src/hotspot/cpu/ppc/globals_ppc.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/ppc/globals_ppc.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -69,8 +69,6 @@
 define_pd_global(bool, RewriteBytecodes,      true);
 define_pd_global(bool, RewriteFrequentPairs,  true);
 
-define_pd_global(bool, UseMembar,             true);
-
 define_pd_global(bool, PreserveFramePointer,  false);
 
 // GC Ergo Flags
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1302,35 +1302,6 @@
 #endif
 }
 
-bool MacroAssembler::is_memory_serialization(int instruction, JavaThread* thread, void* ucontext) {
-#ifdef LINUX
-  ucontext_t* uc = (ucontext_t*) ucontext;
-
-  if (is_stwx(instruction) || is_stwux(instruction)) {
-    int ra = inv_ra_field(instruction);
-    int rb = inv_rb_field(instruction);
-
-    // look up content of ra and rb in ucontext
-    address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
-    long rb_val=(long)uc->uc_mcontext.regs->gpr[rb];
-    return os::is_memory_serialize_page(thread, ra_val+rb_val);
-  } else if (is_stw(instruction) || is_stwu(instruction)) {
-    int ra = inv_ra_field(instruction);
-    int d1 = inv_d1_field(instruction);
-
-    // look up content of ra in ucontext
-    address ra_val=(address)uc->uc_mcontext.regs->gpr[ra];
-    return os::is_memory_serialize_page(thread, ra_val+d1);
-  } else {
-    return false;
-  }
-#else
-  // workaround not needed on !LINUX :-)
-  ShouldNotCallThis();
-  return false;
-#endif
-}
-
 void MacroAssembler::bang_stack_with_offset(int offset) {
   // When increasing the stack, the old stack pointer will be written
   // to the new top of stack according to the PPC64 abi.
@@ -3046,27 +3017,6 @@
   // flag == NE indicates failure
 }
 
-// Write serialization page so VM thread can do a pseudo remote membar.
-// We use the current thread pointer to calculate a thread specific
-// offset to write to within the page. This minimizes bus traffic
-// due to cache line collision.
-void MacroAssembler::serialize_memory(Register thread, Register tmp1, Register tmp2) {
-  srdi(tmp2, thread, os::get_serialize_page_shift_count());
-
-  int mask = os::vm_page_size() - sizeof(int);
-  if (Assembler::is_simm(mask, 16)) {
-    andi(tmp2, tmp2, mask);
-  } else {
-    lis(tmp1, (int)((signed short) (mask >> 16)));
-    ori(tmp1, tmp1, mask & 0x0000ffff);
-    andr(tmp2, tmp2, tmp1);
-  }
-
-  load_const(tmp1, (long) os::get_memory_serialize_page());
-  release();
-  stwx(R0, tmp1, tmp2);
-}
-
 void MacroAssembler::safepoint_poll(Label& slow_path, Register temp_reg) {
   if (SafepointMechanism::uses_thread_local_poll()) {
     ld(temp_reg, in_bytes(Thread::polling_page_offset()), R16_thread);
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -395,11 +395,6 @@
   static bool is_load_from_polling_page(int instruction, void* ucontext/*may be NULL*/,
                                         address* polling_address_ptr = NULL);
 
-  // Check whether instruction is a write access to the memory
-  // serialization page realized by one of the instructions stw, stwu,
-  // stwx, or stwux.
-  static bool is_memory_serialization(int instruction, JavaThread* thread, void* ucontext);
-
   // Support for NULL-checks
   //
   // Generates code that causes a NULL OS exception if the content of reg is NULL.
@@ -645,9 +640,6 @@
                                    Register tmp1, Register tmp2, Register tmp3,
                                    bool try_bias = UseBiasedLocking, bool use_rtm = false);
 
-  // Support for serializing memory accesses between threads
-  void serialize_memory(Register thread, Register tmp1, Register tmp2);
-
   // Check if safepoint requested and if so branch
   void safepoint_poll(Label& slow_path, Register temp_reg);
 
@@ -667,6 +659,7 @@
   void get_vm_result_2(Register metadata_result);
 
   static bool needs_explicit_null_check(intptr_t offset);
+  static bool uses_implicit_null_check(void* address);
 
   // Trap-instruction-based checks.
   // Range checks can be distinguished from zero checks as they check 32 bit,
--- a/src/hotspot/cpu/ppc/nativeInst_ppc.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/ppc/nativeInst_ppc.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -100,12 +100,6 @@
     return MacroAssembler::is_load_from_polling_page(long_at(0), NULL);
   }
 
-  bool is_memory_serialization(JavaThread *thread, void *ucontext) {
-    // Is the current instruction a write access of thread to the
-    // memory serialization page?
-    return MacroAssembler::is_memory_serialization(long_at(0), thread, ucontext);
-  }
-
   address get_stack_bang_address(void *ucontext) {
     // If long_at(0) is not a stack bang, return 0. Otherwise, return
     // banged address.
--- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -2430,16 +2430,8 @@
   {
     Label no_block, sync;
 
-    if (UseMembar) {
-      // Force this write out before the read below.
-      __ fence();
-    } else {
-      // Write serialization page so VM thread can do a pseudo remote membar.
-      // We use the current thread pointer to calculate a thread specific
-      // offset to write to within the page. This minimizes bus traffic
-      // due to cache line collision.
-      __ serialize_memory(R16_thread, r_temp_4, r_temp_5);
-    }
+    // Force this write out before the read below.
+    __ fence();
 
     Register sync_state_addr = r_temp_4;
     Register sync_state      = r_temp_5;
--- a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1486,16 +1486,7 @@
   __ li(R0/*thread_state*/, _thread_in_native_trans);
   __ release();
   __ stw(R0/*thread_state*/, thread_(thread_state));
-  if (UseMembar) {
-    __ fence();
-  }
-  // Write serialization page so that the VM thread can do a pseudo remote
-  // membar. We use the current thread pointer to calculate a thread
-  // specific offset to write to within the page. This minimizes bus
-  // traffic due to cache line collision.
-  else {
-    __ serialize_memory(R16_thread, R11_scratch1, R12_scratch2);
-  }
+  __ fence();
 
   // Now before we return to java we must look for a current safepoint
   // (a new safepoint can not start since we entered native_trans).
--- a/src/hotspot/cpu/s390/globals_s390.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/s390/globals_s390.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2016, 2018 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -71,8 +71,6 @@
 define_pd_global(bool, RewriteBytecodes,     true);
 define_pd_global(bool, RewriteFrequentPairs, true);
 
-define_pd_global(bool, UseMembar,            true);
-
 define_pd_global(bool, PreserveFramePointer, false);
 
 // GC Ergo Flags
--- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -2685,33 +2685,6 @@
   return 0;
 }
 
-bool MacroAssembler::is_memory_serialization(int instruction, JavaThread* thread, void* ucontext) {
-  ShouldNotCallThis();
-  return false;
-}
-
-// Write serialization page so VM thread can do a pseudo remote membar
-// We use the current thread pointer to calculate a thread specific
-// offset to write to within the page. This minimizes bus traffic
-// due to cache line collision.
-void MacroAssembler::serialize_memory(Register thread, Register tmp1, Register tmp2) {
-  assert_different_registers(tmp1, tmp2);
-  z_sllg(tmp2, thread, os::get_serialize_page_shift_count());
-  load_const_optimized(tmp1, (long) os::get_memory_serialize_page());
-
-  int mask = os::get_serialize_page_mask();
-  if (Immediate::is_uimm16(mask)) {
-    z_nill(tmp2, mask);
-    z_llghr(tmp2, tmp2);
-  } else {
-    z_nilf(tmp2, mask);
-    z_llgfr(tmp2, tmp2);
-  }
-
-  z_release();
-  z_st(Z_R0, 0, tmp2, tmp1);
-}
-
 void MacroAssembler::safepoint_poll(Label& slow_path, Register temp_reg) {
   if (SafepointMechanism::uses_thread_local_poll()) {
     const Address poll_byte_addr(Z_thread, in_bytes(Thread::polling_page_offset()) + 7 /* Big Endian */);
--- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -635,13 +635,6 @@
   // Extract poll register from instruction.
   static uint get_poll_register(address instr_loc);
 
-  // Check if instruction is a write access to the memory serialization page
-  // realized by one of the instructions stw, stwu, stwx, or stwux.
-  static bool is_memory_serialization(int instruction, JavaThread* thread, void* ucontext);
-
-  // Support for serializing memory accesses between threads.
-  void serialize_memory(Register thread, Register tmp1, Register tmp2);
-
   // Check if safepoint requested and if so branch
   void safepoint_poll(Label& slow_path, Register temp_reg);
 
@@ -779,6 +772,7 @@
 
   void null_check(Register reg, Register tmp = Z_R0, int64_t offset = -1);
   static bool needs_explicit_null_check(intptr_t offset);  // Implemented in shared file ?!
+  static bool uses_implicit_null_check(void* address);
 
   // Klass oop manipulations if compressed.
   void encode_klass_not_null(Register dst, Register src = noreg);
--- a/src/hotspot/cpu/s390/nativeInst_s390.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/s390/nativeInst_s390.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -104,12 +104,6 @@
     return MacroAssembler::get_poll_register(addr_at(0));
   }
 
-  bool is_memory_serialization(JavaThread *thread, void *ucontext) {
-    // Is the current instruction a write access of thread to the
-    // memory serialization page?
-    return MacroAssembler::is_memory_serialization(long_at(0), thread, ucontext);
-  }
-
  public:
 
   // The output of __ breakpoint_trap().
--- a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -2161,16 +2161,8 @@
 
     save_native_result(masm, ret_type, workspace_slot_offset); // Make Z_R2 available as work reg.
 
-    if (UseMembar) {
-      // Force this write out before the read below.
-      __ z_fence();
-    } else {
-      // Write serialization page so VM thread can do a pseudo remote membar.
-      // We use the current thread pointer to calculate a thread specific
-      // offset to write to within the page. This minimizes bus traffic
-      // due to cache line collision.
-      __ serialize_memory(Z_thread, Z_R1, Z_R2);
-    }
+    // Force this write out before the read below.
+    __ z_fence();
 
     __ safepoint_poll(sync, Z_R1);
 
--- a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1598,15 +1598,8 @@
   // synchronization is progress, and escapes.
 
   __ set_thread_state(_thread_in_native_trans);
-  if (UseMembar) {
-    __ z_fence();
-  } else {
-    // Write serialization page so VM thread can do a pseudo remote
-    // membar. We use the current thread pointer to calculate a thread
-    // specific offset to write to within the page. This minimizes bus
-    // traffic due to cache line collision.
-    __ serialize_memory(Z_thread, Z_R1, Z_R0);
-  }
+  __ z_fence();
+
   // Now before we return to java we must look for a current safepoint
   // (a new safepoint can not start since we entered native_trans).
   // We must check here because a current safepoint could be modifying
--- a/src/hotspot/cpu/sparc/globals_sparc.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/sparc/globals_sparc.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, 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
@@ -74,8 +74,6 @@
 define_pd_global(bool, RewriteBytecodes,     true);
 define_pd_global(bool, RewriteFrequentPairs, true);
 
-define_pd_global(bool, UseMembar,            true);
-
 define_pd_global(bool, PreserveFramePointer, false);
 
 // GC Ergo Flags
--- a/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -236,24 +236,6 @@
   trap(ST_RESERVED_FOR_USER_0);
 }
 
-// Write serialization page so VM thread can do a pseudo remote membar
-// We use the current thread pointer to calculate a thread specific
-// offset to write to within the page. This minimizes bus traffic
-// due to cache line collision.
-void MacroAssembler::serialize_memory(Register thread, Register tmp1, Register tmp2) {
-  srl(thread, os::get_serialize_page_shift_count(), tmp2);
-  if (Assembler::is_simm13(os::vm_page_size())) {
-    and3(tmp2, (os::vm_page_size() - sizeof(int)), tmp2);
-  }
-  else {
-    set((os::vm_page_size() - sizeof(int)), tmp1);
-    and3(tmp2, tmp1, tmp2);
-  }
-  set(os::get_memory_serialize_page(), tmp1);
-  st(G0, tmp1, tmp2);
-}
-
-
 void MacroAssembler::safepoint_poll(Label& slow_path, bool a, Register thread_reg, Register temp_reg) {
   if (SafepointMechanism::uses_thread_local_poll()) {
     ldx(Address(thread_reg, Thread::polling_page_offset()), temp_reg, 0);
--- a/src/hotspot/cpu/sparc/macroAssembler_sparc.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -575,6 +575,7 @@
 
   void null_check(Register reg, int offset = -1);
   static bool needs_explicit_null_check(intptr_t offset);
+  static bool uses_implicit_null_check(void* address);
 
   // support for delayed instructions
   MacroAssembler* delayed() { Assembler::delayed();  return this; }
@@ -951,9 +952,6 @@
   void breakpoint_trap();
   void breakpoint_trap(Condition c, CC cc);
 
-  // Support for serializing memory accesses between threads
-  void serialize_memory(Register thread, Register tmp1, Register tmp2);
-
   void safepoint_poll(Label& slow_path, bool a, Register thread_reg, Register temp_reg);
 
   // Stack frame creation/removal
--- a/src/hotspot/cpu/sparc/sharedRuntime_sparc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/sparc/sharedRuntime_sparc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -2372,16 +2372,8 @@
     __ set(_thread_in_native_trans, G3_scratch);
     __ st(G3_scratch, G2_thread, JavaThread::thread_state_offset());
 
-    if (UseMembar) {
-      // Force this write out before the read below
-      __ membar(Assembler::StoreLoad);
-    } else {
-      // Write serialization page so VM thread can do a pseudo remote membar.
-      // We use the current thread pointer to calculate a thread specific
-      // offset to write to within the page. This minimizes bus traffic
-      // due to cache line collision.
-      __ serialize_memory(G2_thread, G1_scratch, G3_scratch);
-    }
+    // Force this write out before the read below
+    __ membar(Assembler::StoreLoad);
 
     Label L;
     Address suspend_state(G2_thread, JavaThread::suspend_flags_offset());
--- a/src/hotspot/cpu/sparc/templateInterpreterGenerator_sparc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/sparc/templateInterpreterGenerator_sparc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1374,16 +1374,8 @@
     __ set(_thread_in_native_trans, G3_scratch);
     __ st(G3_scratch, thread_state);
 
-    if (UseMembar) {
-      // Force this write out before the read below
-      __ membar(Assembler::StoreLoad);
-    } else {
-      // Write serialization page so VM thread can do a pseudo remote membar.
-      // We use the current thread pointer to calculate a thread specific
-      // offset to write to within the page. This minimizes bus traffic
-      // due to cache line collision.
-      __ serialize_memory(G2_thread, G1_scratch, G3_scratch);
-    }
+    // Force this write out before the read below
+    __ membar(Assembler::StoreLoad);
 
     Label L;
     __ safepoint_poll(L, false, G2_thread, G3_scratch);
--- a/src/hotspot/cpu/x86/globals_x86.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/x86/globals_x86.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -84,8 +84,6 @@
 define_pd_global(bool, RewriteBytecodes,     true);
 define_pd_global(bool, RewriteFrequentPairs, true);
 
-define_pd_global(bool, UseMembar,            true);
-
 // GC Ergo Flags
 define_pd_global(size_t, CMSYoungGenPerWorker, 64*M);  // default max size of CMS young gen, per GC worker thread
 
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -3517,22 +3517,6 @@
   else if (tmp != rax) mov(tmp, rax);
 }
 
-// Write serialization page so VM thread can do a pseudo remote membar.
-// We use the current thread pointer to calculate a thread specific
-// offset to write to within the page. This minimizes bus traffic
-// due to cache line collision.
-void MacroAssembler::serialize_memory(Register thread, Register tmp) {
-  movl(tmp, thread);
-  shrl(tmp, os::get_serialize_page_shift_count());
-  andl(tmp, (os::vm_page_size() - sizeof(int)));
-
-  Address index(noreg, tmp, Address::times_1);
-  ExternalAddress page(os::get_memory_serialize_page());
-
-  // Size of store must match masking code above
-  movl(as_Address(ArrayAddress(page, index)), tmp);
-}
-
 void MacroAssembler::safepoint_poll(Label& slow_path, Register thread_reg, Register temp_reg) {
   if (SafepointMechanism::uses_thread_local_poll()) {
 #ifdef _LP64
--- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -96,6 +96,7 @@
 
   void null_check(Register reg, int offset = -1);
   static bool needs_explicit_null_check(intptr_t offset);
+  static bool uses_implicit_null_check(void* address);
 
   // Required platform-specific helpers for Label::patch_instructions.
   // They _shadow_ the declarations in AbstractAssembler, which are undefined.
@@ -644,9 +645,6 @@
                                                 Register tmp,
                                                 int offset);
 
-  // Support for serializing memory accesses between threads
-  void serialize_memory(Register thread, Register tmp);
-
   // If thread_reg is != noreg the code assumes the register passed contains
   // the thread (required on 64 bit).
   void safepoint_poll(Label& slow_path, Register thread_reg, Register temp_reg);
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -2088,18 +2088,10 @@
   //     didn't see any synchronization is progress, and escapes.
   __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_native_trans);
 
-  if (UseMembar) {
-    // Force this write out before the read below
-    __ membar(Assembler::Membar_mask_bits(
-              Assembler::LoadLoad | Assembler::LoadStore |
-              Assembler::StoreLoad | Assembler::StoreStore));
-  } else {
-    // Write serialization page so VM thread can do a pseudo remote membar.
-    // We use the current thread pointer to calculate a thread specific
-    // offset to write to within the page. This minimizes bus traffic
-    // due to cache line collision.
-    __ serialize_memory(thread, rcx);
-  }
+  // Force this write out before the read below
+  __ membar(Assembler::Membar_mask_bits(
+            Assembler::LoadLoad | Assembler::LoadStore |
+            Assembler::StoreLoad | Assembler::StoreStore));
 
   if (AlwaysRestoreFPU) {
     // Make sure the control word is correct.
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -2560,18 +2560,10 @@
   //     didn't see any synchronization is progress, and escapes.
   __ movl(Address(r15_thread, JavaThread::thread_state_offset()), _thread_in_native_trans);
 
-  if (UseMembar) {
-    // Force this write out before the read below
-    __ membar(Assembler::Membar_mask_bits(
-                Assembler::LoadLoad | Assembler::LoadStore |
-                Assembler::StoreLoad | Assembler::StoreStore));
-  } else {
-    // Write serialization page so VM thread can do a pseudo remote membar.
-    // We use the current thread pointer to calculate a thread specific
-    // offset to write to within the page. This minimizes bus traffic
-    // due to cache line collision.
-    __ serialize_memory(r15_thread, rcx);
-  }
+  // Force this write out before the read below
+  __ membar(Assembler::Membar_mask_bits(
+              Assembler::LoadLoad | Assembler::LoadStore |
+              Assembler::StoreLoad | Assembler::StoreStore));
 
   Label after_transition;
 
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1090,18 +1090,10 @@
   __ movl(Address(thread, JavaThread::thread_state_offset()),
           _thread_in_native_trans);
 
-  if (UseMembar) {
-    // Force this write out before the read below
-    __ membar(Assembler::Membar_mask_bits(
-                Assembler::LoadLoad | Assembler::LoadStore |
-                Assembler::StoreLoad | Assembler::StoreStore));
-  } else {
-    // Write serialization page so VM thread can do a pseudo remote membar.
-    // We use the current thread pointer to calculate a thread specific
-    // offset to write to within the page. This minimizes bus traffic
-    // due to cache line collision.
-    __ serialize_memory(thread, rcx);
-  }
+  // Force this write out before the read below
+  __ membar(Assembler::Membar_mask_bits(
+              Assembler::LoadLoad | Assembler::LoadStore |
+              Assembler::StoreLoad | Assembler::StoreStore));
 
 #ifndef _LP64
   if (AlwaysRestoreFPU) {
--- a/src/hotspot/cpu/x86/x86_64.ad	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/x86/x86_64.ad	Thu Nov 08 19:15:42 2018 -0500
@@ -9263,6 +9263,18 @@
 %}
 
 // And Memory with Register
+instruct andB_mem_rReg(memory dst, rRegI src, rFlagsReg cr)
+%{
+  match(Set dst (StoreB dst (AndI (LoadB dst) src)));
+  effect(KILL cr);
+
+  ins_cost(150);
+  format %{ "andb    $dst, $src\t# byte" %}
+  opcode(0x20);
+  ins_encode(REX_breg_mem(src, dst), OpcP, reg_mem(src, dst));
+  ins_pipe(ialu_mem_reg);
+%}
+
 instruct andI_mem_rReg(memory dst, rRegI src, rFlagsReg cr)
 %{
   match(Set dst (StoreI dst (AndI (LoadI dst) src)));
@@ -9444,6 +9456,18 @@
 %}
 
 // Or Memory with Register
+instruct orB_mem_rReg(memory dst, rRegI src, rFlagsReg cr)
+%{
+  match(Set dst (StoreB dst (OrI (LoadB dst) src)));
+  effect(KILL cr);
+
+  ins_cost(150);
+  format %{ "orb    $dst, $src\t# byte" %}
+  opcode(0x08);
+  ins_encode(REX_breg_mem(src, dst), OpcP, reg_mem(src, dst));
+  ins_pipe(ialu_mem_reg);
+%}
+
 instruct orI_mem_rReg(memory dst, rRegI src, rFlagsReg cr)
 %{
   match(Set dst (StoreI dst (OrI (LoadI dst) src)));
@@ -9520,6 +9544,18 @@
 %}
 
 // Xor Memory with Register
+instruct xorB_mem_rReg(memory dst, rRegI src, rFlagsReg cr)
+%{
+  match(Set dst (StoreB dst (XorI (LoadB dst) src)));
+  effect(KILL cr);
+
+  ins_cost(150);
+  format %{ "xorb    $dst, $src\t# byte" %}
+  opcode(0x30);
+  ins_encode(REX_breg_mem(src, dst), OpcP, reg_mem(src, dst));
+  ins_pipe(ialu_mem_reg);
+%}
+
 instruct xorI_mem_rReg(memory dst, rRegI src, rFlagsReg cr)
 %{
   match(Set dst (StoreI dst (XorI (LoadI dst) src)));
--- a/src/hotspot/cpu/zero/cppInterpreter_zero.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/zero/cppInterpreter_zero.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -381,7 +381,7 @@
 
   // Handle safepoint operations, pending suspend requests,
   // and pending asynchronous exceptions.
-  if (SafepointMechanism::poll(thread) ||
+  if (SafepointMechanism::should_block(thread) ||
       thread->has_special_condition_for_native_trans()) {
     JavaThread::check_special_condition_for_native_trans(thread);
     CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops());
@@ -513,7 +513,7 @@
   intptr_t *locals = stack->sp();
 
   // Drop into the slow path if we need a safepoint check
-  if (SafepointMechanism::poll(THREAD)) {
+  if (SafepointMechanism::should_block(THREAD)) {
     return normal_entry(method, 0, THREAD);
   }
 
@@ -645,7 +645,7 @@
   ZeroStack *stack = thread->zero_stack();
 
   // Drop into the slow path if we need a safepoint check
-  if (SafepointMechanism::poll(THREAD)) {
+  if (SafepointMechanism::should_block(THREAD)) {
     return normal_entry(method, 0, THREAD);
   }
 
--- a/src/hotspot/cpu/zero/globals_zero.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/cpu/zero/globals_zero.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -69,8 +69,6 @@
 define_pd_global(bool,  RewriteBytecodes,     true);
 define_pd_global(bool,  RewriteFrequentPairs, true);
 
-define_pd_global(bool,  UseMembar,            true);
-
 // GC Ergo Flags
 define_pd_global(size_t, CMSYoungGenPerWorker, 16*M);  // default max size of CMS young gen, per GC worker thread
 
--- a/src/hotspot/os/posix/os_posix.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os/posix/os_posix.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -130,11 +130,6 @@
 #endif
 };
 
-// On POSIX platforms the signal handler is global so we just do the write.
-static void write_memory_serialize_page_with_handler(JavaThread* thread) {
-  write_memory_serialize_page(thread);
-}
-
 /*
  * Crash protection for the watcher thread. Wrap the callback
  * with a sigsetjmp and in case of a SIGSEGV/SIGBUS we siglongjmp
--- a/src/hotspot/os/windows/os_windows.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os/windows/os_windows.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -2414,23 +2414,6 @@
   }
 #endif // _WIN64
 
-  // Check to see if we caught the safepoint code in the
-  // process of write protecting the memory serialization page.
-  // It write enables the page immediately after protecting it
-  // so just return.
-  if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
-    if (t != NULL && t->is_Java_thread()) {
-      JavaThread* thread = (JavaThread*) t;
-      PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
-      address addr = (address) exceptionRecord->ExceptionInformation[1];
-      if (os::is_memory_serialize_page(thread, addr)) {
-        // Block current thread until the memory serialize page permission restored.
-        os::block_on_serialize_page_trap();
-        return EXCEPTION_CONTINUE_EXECUTION;
-      }
-    }
-  }
-
   if ((exception_code == EXCEPTION_ACCESS_VIOLATION) &&
       VM_Version::is_cpuinfo_segv_addr(pc)) {
     // Verify that OS save/restore AVX registers.
@@ -2509,7 +2492,7 @@
 #endif
           {
             // Null pointer exception.
-            if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr)) {
+            if (MacroAssembler::uses_implicit_null_check((void*)addr)) {
               address stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
               if (stub != NULL) return Handle_Exception(exceptionInfo, stub);
             }
@@ -5330,22 +5313,6 @@
   return result;
 }
 
-LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {
-  DWORD exception_code = e->ExceptionRecord->ExceptionCode;
-
-  if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
-    JavaThread* thread = JavaThread::current();
-    PEXCEPTION_RECORD exceptionRecord = e->ExceptionRecord;
-    address addr = (address) exceptionRecord->ExceptionInformation[1];
-
-    if (os::is_memory_serialize_page(thread, addr)) {
-      return EXCEPTION_CONTINUE_EXECUTION;
-    }
-  }
-
-  return EXCEPTION_CONTINUE_SEARCH;
-}
-
 static jint initSock() {
   WSADATA wsadata;
 
--- a/src/hotspot/os/windows/os_windows.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os/windows/os_windows.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -108,9 +108,6 @@
   static address fast_jni_accessor_wrapper(BasicType);
 #endif
 
-  // filter function to ignore faults on serializations page
-  static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e);
-
   // Fast access to current thread
 protected:
   static int _thread_ptr_offset;
@@ -123,21 +120,6 @@
   static inline int get_thread_ptr_offset() { return _thread_ptr_offset; }
 };
 
-static void write_memory_serialize_page_with_handler(JavaThread* thread) {
-  // Due to chained nature of SEH handlers we have to be sure
-  // that our handler is always last handler before an attempt to write
-  // into serialization page - it can fault if we access this page
-  // right in the middle of protect/unprotect sequence by remote
-  // membar logic.
-  // __try/__except are very lightweight operations (only several
-  // instructions not affecting control flow directly on x86)
-  // so we can use it here, on very time critical path
-  __try {
-    write_memory_serialize_page(thread);
-  } __except (win32::serialize_fault_filter((_EXCEPTION_POINTERS*)_exception_info()))
-    {}
-}
-
 /*
  * Crash protection for the watcher thread. Wrap the callback
  * with a __try { call() }
--- a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -409,7 +409,7 @@
       // SIGSEGV-based implicit null check in compiled code.
       else if (sig == SIGSEGV && ImplicitNullChecks &&
                CodeCache::contains((void*) pc) &&
-               !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
+               MacroAssembler::uses_implicit_null_check(info->si_addr)) {
         if (TraceTraps) {
           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc);
         }
@@ -469,18 +469,6 @@
         return 1;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    if ((sig == SIGSEGV) &&
-        os::is_memory_serialize_page(thread, addr)) {
-      // Synchronization problem in the pseudo memory barrier code (bug id 6546278)
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
 run_stub:
@@ -624,5 +612,3 @@
   AixNativeCallstack::print_callstack_for_context(st, (const ucontext_t*)context, true, buf, (size_t) buf_size);
   return true;
 }
-
-
--- a/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -580,7 +580,7 @@
       // 64-bit Darwin may also use a SIGBUS (seen with compressed oops).
       // Catching SIGBUS here prevents the implicit SIGBUS NULL check below from
       // being called, so only do so if the implicit NULL check is not necessary.
-      } else if (sig == SIGBUS && MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
+      } else if (sig == SIGBUS && !MacroAssembler::uses_implicit_null_check(info->si_addr)) {
 #else
       } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) {
 #endif
@@ -655,7 +655,7 @@
         }
 #endif // AMD64
       } else if ((sig == SIGSEGV || sig == SIGBUS) &&
-               !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
+                 MacroAssembler::uses_implicit_null_check(info->si_addr)) {
           // Determination of interpreter/vtable stub/compiled code null exception
           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -674,17 +674,6 @@
         stub = addr;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    if ((sig == SIGSEGV || sig == SIGBUS) &&
-        os::is_memory_serialize_page(thread, (address) info->si_addr)) {
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
 #ifndef AMD64
--- a/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -206,17 +206,6 @@
         stub = addr;
       }
     }*/
-
-    // Check to see if we caught the safepoint code in the process
-    // of write protecting the memory serialization page.  It write
-    // enables the page immediately after protecting it so we can
-    // just return to retry the write.
-    if ((sig == SIGSEGV || sig == SIGBUS) &&
-        os::is_memory_serialize_page(thread, (address) info->si_addr)) {
-      // Block current thread until permission is restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
   // signal-chaining
--- a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -357,10 +357,15 @@
     }
 #endif
 
+    address addr = (address) info->si_addr;
+
+    // Make sure the high order byte is sign extended, as it may be masked away by the hardware.
+    if ((uintptr_t(addr) & (uintptr_t(1) << 55)) != 0) {
+      addr = address(uintptr_t(addr) | (uintptr_t(0xFF) << 56));
+    }
+
     // Handle ALL stack overflow variations here
     if (sig == SIGSEGV) {
-      address addr = (address) info->si_addr;
-
       // check if fault address is within thread stack
       if (thread->on_local_stack(addr)) {
         // stack overflow
@@ -456,7 +461,7 @@
                                               SharedRuntime::
                                               IMPLICIT_DIVIDE_BY_ZERO);
       } else if (sig == SIGSEGV &&
-               !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
+                 MacroAssembler::uses_implicit_null_check((void*)addr)) {
           // Determination of interpreter/vtable stub/compiled code null exception
           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -475,17 +480,6 @@
         stub = addr;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    if ((sig == SIGSEGV) &&
-        os::is_memory_serialize_page(thread, (address) info->si_addr)) {
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
   if (stub != NULL) {
--- a/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -384,7 +384,8 @@
         if (nm != NULL && nm->has_unsafe_access()) {
           unsafe_access = true;
         }
-      } else if (sig == SIGSEGV && !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
+      } else if (sig == SIGSEGV &&
+                 MacroAssembler::uses_implicit_null_check(info->si_addr)) {
           // Determination of interpreter/vtable stub/compiled code null exception
           CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
           if (cb != NULL) {
@@ -407,16 +408,6 @@
         stub = addr;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    if (sig == SIGSEGV && os::is_memory_serialize_page(thread, (address) info->si_addr)) {
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
   if (unsafe_access && stub == NULL) {
@@ -692,4 +683,3 @@
   // ARM does not require an additional stack bang.
   return 0;
 }
-
--- a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -431,7 +431,7 @@
       // SIGSEGV-based implicit null check in compiled code.
       else if (sig == SIGSEGV && ImplicitNullChecks &&
                CodeCache::contains((void*) pc) &&
-               !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
+               MacroAssembler::uses_implicit_null_check(info->si_addr)) {
         if (TraceTraps) {
           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
         }
@@ -477,20 +477,6 @@
         return true;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    if ((sig == SIGSEGV) &&
-        // Si_addr may not be valid due to a bug in the linux-ppc64 kernel (see comment above).
-        // Use is_memory_serialization instead of si_addr.
-        ((NativeInstruction*)pc)->is_memory_serialization(thread, ucVoid)) {
-      // Synchronization problem in the pseudo memory barrier code (bug id 6546278)
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
   if (stub != NULL) {
--- a/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -418,7 +418,7 @@
 
       else if (sig == SIGSEGV && ImplicitNullChecks &&
                CodeCache::contains((void*) pc) &&
-               !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
+               MacroAssembler::uses_implicit_null_check(info->si_addr)) {
         if (TraceTraps) {
           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
         }
@@ -477,19 +477,6 @@
         return true;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    // Info->si_addr need not be the exact address, it is only
-    // guaranteed to be on the same page as the address that caused
-    // the SIGSEGV.
-    if ((sig == SIGSEGV) && !UseMembar &&
-        (os::get_memory_serialize_page() ==
-         (address)((uintptr_t)info->si_addr & ~(os::vm_page_size()-1)))) {
-      return true;
-    }
   }
 
   if (stub != NULL) {
--- a/src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -416,9 +416,9 @@
   return false;
 }
 
-inline static bool checkNullPointer(address pc, intptr_t fault,
+inline static bool checkNullPointer(address pc, void* fault,
                                     JavaThread* thread, address* stub) {
-  if (!MacroAssembler::needs_explicit_null_check(fault)) {
+  if (MacroAssembler::uses_implicit_null_check(fault)) {
     // Determination of interpreter/vtable stub/compiled code null
     // exception
     *stub =
@@ -439,10 +439,6 @@
   return false;
 }
 
-inline static bool checkSerializePage(JavaThread* thread, address addr) {
-  return os::is_memory_serialize_page(thread, addr);
-}
-
 inline static bool checkZombie(sigcontext* uc, address* pc, address* stub) {
   if (nativeInstruction_at(*pc)->is_zombie()) {
     // zombie method (ld [%g0],%o7 instruction)
@@ -542,16 +538,6 @@
     pc = address(SIG_PC(uc));
     npc = address(SIG_NPC(uc));
 
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    if ((sig == SIGSEGV) && checkSerializePage(thread, (address)info->si_addr)) {
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return 1;
-    }
-
     if (checkPrefetch(uc, pc)) {
       return 1;
     }
@@ -600,7 +586,7 @@
         }
 
         if ((sig == SIGSEGV) &&
-            checkNullPointer(pc, (intptr_t)info->si_addr, thread, &stub)) {
+            checkNullPointer(pc, info->si_addr, thread, &stub)) {
           break;
         }
       } while (0);
--- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -479,7 +479,7 @@
         }
 #endif // AMD64
       } else if (sig == SIGSEGV &&
-               !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
+                 MacroAssembler::uses_implicit_null_check(info->si_addr)) {
           // Determination of interpreter/vtable stub/compiled code null exception
           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -498,17 +498,6 @@
         stub = addr;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    if ((sig == SIGSEGV) &&
-        os::is_memory_serialize_page(thread, (address) info->si_addr)) {
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
 #ifndef AMD64
--- a/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -220,17 +220,6 @@
         stub = addr;
       }
     }*/
-
-    // Check to see if we caught the safepoint code in the process
-    // of write protecting the memory serialization page.  It write
-    // enables the page immediately after protecting it so we can
-    // just return to retry the write.
-    if (sig == SIGSEGV &&
-        os::is_memory_serialize_page(thread, (address) info->si_addr)) {
-      // Block current thread until permission is restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
   // signal-chaining
--- a/src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -505,7 +505,7 @@
       }
 #endif  // COMPILER2
 
-      else if (sig == SIGSEGV && info->si_code > 0 && !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
+      else if (sig == SIGSEGV && info->si_code > 0 && MacroAssembler::uses_implicit_null_check(info->si_addr)) {
         // Determination of interpreter/vtable stub/compiled code null exception
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -519,17 +519,6 @@
         stub = addr;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so just return.
-    if ((sig == SIGSEGV) &&
-        os::is_memory_serialize_page(thread, (address)info->si_addr)) {
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
   if (stub != NULL) {
--- a/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -579,7 +579,8 @@
         // QQQ It doesn't seem that we need to do this on x86 because we should be able
         // to return properly from the handler without this extra stuff on the back side.
 
-      else if (sig == SIGSEGV && info->si_code > 0 && !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
+      else if (sig == SIGSEGV && info->si_code > 0 &&
+               MacroAssembler::uses_implicit_null_check(info->si_addr)) {
         // Determination of interpreter/vtable stub/compiled code null exception
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -593,17 +594,6 @@
         stub = addr;
       }
     }
-
-    // Check to see if we caught the safepoint code in the
-    // process of write protecting the memory serialization page.
-    // It write enables the page immediately after protecting it
-    // so we can just return to retry the write.
-    if ((sig == SIGSEGV) &&
-        os::is_memory_serialize_page(thread, (address)info->si_addr)) {
-      // Block current thread until the memory serialize page permission restored.
-      os::block_on_serialize_page_trap();
-      return true;
-    }
   }
 
   // Execution protection violation
--- a/src/hotspot/share/asm/assembler.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/asm/assembler.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -26,6 +26,7 @@
 #include "asm/codeBuffer.hpp"
 #include "asm/macroAssembler.hpp"
 #include "asm/macroAssembler.inline.hpp"
+#include "gc/shared/collectedHeap.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/icache.hpp"
 #include "runtime/os.hpp"
@@ -307,21 +308,32 @@
   return NULL;
 }
 
-bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
+bool MacroAssembler::uses_implicit_null_check(void* address) {
   // Exception handler checks the nmethod's implicit null checks table
   // only when this method returns false.
+  intptr_t int_address = reinterpret_cast<intptr_t>(address);
+  intptr_t cell_header_size = Universe::heap()->cell_header_size();
+  size_t region_size = os::vm_page_size() + cell_header_size;
 #ifdef _LP64
   if (UseCompressedOops && Universe::narrow_oop_base() != NULL) {
-    assert (Universe::heap() != NULL, "java heap should be initialized");
-    // The first page after heap_base is unmapped and
-    // the 'offset' is equal to [heap_base + offset] for
-    // narrow oop implicit null checks.
-    uintptr_t base = (uintptr_t)Universe::narrow_oop_base();
-    if ((uintptr_t)offset >= base) {
-      // Normalize offset for the next check.
-      offset = (intptr_t)(pointer_delta((void*)offset, (void*)base, 1));
+    // A SEGV can legitimately happen in C2 code at address
+    // (heap_base + offset) if  Matcher::narrow_oop_use_complex_address
+    // is configured to allow narrow oops field loads to be implicitly
+    // null checked
+    intptr_t start = ((intptr_t)Universe::narrow_oop_base()) - cell_header_size;
+    intptr_t end = start + region_size;
+    if (int_address >= start && int_address < end) {
+      return true;
     }
   }
 #endif
-  return offset < 0 || os::vm_page_size() <= offset;
+  intptr_t start = -cell_header_size;
+  intptr_t end = start + region_size;
+  return int_address >= start && int_address < end;
 }
+
+bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
+  // Check if offset is outside of [-cell_header_size, os::vm_page_size)
+  return offset < -Universe::heap()->cell_header_size() ||
+         offset >= os::vm_page_size();
+}
--- a/src/hotspot/share/ci/ciInstanceKlass.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/ci/ciInstanceKlass.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -554,6 +554,12 @@
   _has_injected_fields = has_injected_fields;
 }
 
+bool ciInstanceKlass::has_object_fields() const {
+  GUARDED_VM_ENTRY(
+      return get_instanceKlass()->nonstatic_oop_map_size() > 0;
+    );
+}
+
 // ------------------------------------------------------------------
 // ciInstanceKlass::find_method
 //
--- a/src/hotspot/share/ci/ciInstanceKlass.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/ci/ciInstanceKlass.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -202,6 +202,8 @@
     return _has_injected_fields > 0 ? true : false;
   }
 
+  bool has_object_fields() const;
+
   // nth nonstatic field (presented by ascending address)
   ciField* nonstatic_field_at(int i) {
     assert(_nonstatic_fields != NULL, "");
--- a/src/hotspot/share/classfile/classFileParser.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1066,7 +1066,7 @@
     _method_DontInline,
     _method_InjectedProfile,
     _method_LambdaForm_Compiled,
-    _method_LambdaForm_Hidden,
+    _method_Hidden,
     _method_HotSpotIntrinsicCandidate,
     _jdk_internal_vm_annotation_Contended,
     _field_Stable,
@@ -2121,7 +2121,12 @@
     case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_LambdaForm_Hidden_signature): {
       if (_location != _in_method)  break;  // only allow for methods
       if (!privileged)              break;  // only allow in privileged code
-      return _method_LambdaForm_Hidden;
+      return _method_Hidden;
+    }
+    case vmSymbols::VM_SYMBOL_ENUM_NAME(java_security_AccessController_Hidden_signature): {
+      if (_location != _in_method)  break;  // only allow for methods
+      if (!privileged)              break;  // only allow in privileged code
+      return _method_Hidden;
     }
     case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_HotSpotIntrinsicCandidate_signature): {
       if (_location != _in_method)  break;  // only allow for methods
@@ -2178,7 +2183,7 @@
     m->set_has_injected_profile(true);
   if (has_annotation(_method_LambdaForm_Compiled) && m->intrinsic_id() == vmIntrinsics::_none)
     m->set_intrinsic_id(vmIntrinsics::_compiledLambdaForm);
-  if (has_annotation(_method_LambdaForm_Hidden))
+  if (has_annotation(_method_Hidden))
     m->set_hidden(true);
   if (has_annotation(_method_HotSpotIntrinsicCandidate) && !m->is_synthetic())
     m->set_intrinsic_candidate(true);
--- a/src/hotspot/share/classfile/javaClasses.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/classfile/javaClasses.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -3786,12 +3786,6 @@
 }
 #endif
 
-bool java_security_AccessControlContext::is_authorized(Handle context) {
-  assert(context.not_null() && context->klass() == SystemDictionary::AccessControlContext_klass(), "Invalid type");
-  assert(_isAuthorized_offset != -1, "should be set");
-  return context->bool_field(_isAuthorized_offset) != 0;
-}
-
 oop java_security_AccessControlContext::create(objArrayHandle context, bool isPrivileged, Handle privileged_context, TRAPS) {
   assert(_isPrivileged_offset != 0, "offsets should have been initialized");
   // Ensure klass is initialized
@@ -3975,13 +3969,6 @@
 int java_lang_System::out_offset_in_bytes() { return static_out_offset; }
 int java_lang_System::err_offset_in_bytes() { return static_err_offset; }
 
-
-bool java_lang_System::has_security_manager() {
-  InstanceKlass* ik = SystemDictionary::System_klass();
-  oop base = ik->static_field_base_raw();
-  return base->obj_field(static_security_offset) != NULL;
-}
-
 int java_lang_Class::_klass_offset;
 int java_lang_Class::_array_klass_offset;
 int java_lang_Class::_oop_size_offset;
--- a/src/hotspot/share/classfile/javaClasses.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/classfile/javaClasses.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1241,8 +1241,6 @@
   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
   static oop create(objArrayHandle context, bool isPrivileged, Handle privileged_context, TRAPS);
 
-  static bool is_authorized(Handle context);
-
   // Debugging/initialization
   friend class JavaClasses;
 };
@@ -1316,8 +1314,6 @@
   static int out_offset_in_bytes();
   static int err_offset_in_bytes();
 
-  static bool has_security_manager();
-
   static void compute_offsets();
   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 
--- a/src/hotspot/share/classfile/systemDictionary.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/classfile/systemDictionary.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -116,6 +116,7 @@
   do_klass(SecurityManager_klass,                       java_lang_SecurityManager                             ) \
   do_klass(ProtectionDomain_klass,                      java_security_ProtectionDomain                        ) \
   do_klass(AccessControlContext_klass,                  java_security_AccessControlContext                    ) \
+  do_klass(AccessController_klass,                      java_security_AccessController                        ) \
   do_klass(SecureClassLoader_klass,                     java_security_SecureClassLoader                       ) \
   do_klass(ClassNotFoundException_klass,                java_lang_ClassNotFoundException                      ) \
   do_klass(NoClassDefFoundError_klass,                  java_lang_NoClassDefFoundError                        ) \
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -99,6 +99,8 @@
   template(java_lang_CharSequence,                    "java/lang/CharSequence")                   \
   template(java_lang_SecurityManager,                 "java/lang/SecurityManager")                \
   template(java_security_AccessControlContext,        "java/security/AccessControlContext")       \
+  template(java_security_AccessController,            "java/security/AccessController")           \
+  template(executePrivileged_name,                    "executePrivileged")                        \
   template(java_security_CodeSource,                  "java/security/CodeSource")                 \
   template(java_security_ProtectionDomain,            "java/security/ProtectionDomain")           \
   template(java_security_SecureClassLoader,           "java/security/SecureClassLoader")          \
@@ -303,6 +305,7 @@
   template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \
   template(java_lang_invoke_LambdaForm_Hidden_signature, "Ljava/lang/invoke/LambdaForm$Hidden;")  \
   template(java_lang_invoke_MethodHandleNatives_CallSiteContext_signature, "Ljava/lang/invoke/MethodHandleNatives$CallSiteContext;") \
+  template(java_security_AccessController_Hidden_signature, "Ljava/security/AccessController$Hidden;")  \
   /* internal up-calls made only by the JVM, via class sun.invoke.MethodHandleNatives: */         \
   template(findMethodHandleType_name,                 "findMethodHandleType")                     \
   template(findMethodHandleType_signature,       "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/invoke/MethodType;") \
@@ -546,7 +549,6 @@
   template(char_StringBuffer_signature,               "(C)Ljava/lang/StringBuffer;")                              \
   template(int_String_signature,                      "(I)Ljava/lang/String;")                                    \
   template(boolean_boolean_int_signature,             "(ZZ)I")                                                    \
-  template(codesource_permissioncollection_signature, "(Ljava/security/CodeSource;Ljava/security/PermissionCollection;)V") \
   /* signature symbols needed by intrinsics */                                                                    \
   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, template, VM_ALIAS_IGNORE)            \
                                                                                                                   \
--- a/src/hotspot/share/code/codeCache.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/code/codeCache.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -192,7 +192,7 @@
     }
   };
   static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred);
-  static uint16_t unloading_cycle() { return _unloading_cycle; }
+  static uint8_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);
--- a/src/hotspot/share/code/compiledMethod.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/code/compiledMethod.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -546,47 +546,72 @@
   DEBUG_ONLY(metadata_do(check_class));
 }
 
-// The IsUnloadingStruct represents a tuple comprising a result of
-// IsUnloadingBehaviour::is_unloading() for a given unloading cycle.
-struct IsUnloadingStruct {
-  unsigned int _is_unloading:1;
-  unsigned int _unloading_cycle:2;
-};
+// The _is_unloading_state encodes a tuple comprising the unloading cycle
+// and the result of IsUnloadingBehaviour::is_unloading() fpr that cycle.
+// This is the bit layout of the _is_unloading_state byte: 00000CCU
+// CC refers to the cycle, which has 2 bits, and U refers to the result of
+// IsUnloadingBehaviour::is_unloading() for that unloading cycle.
+
+class IsUnloadingState: public AllStatic {
+  static const uint8_t _is_unloading_mask = 1;
+  static const uint8_t _is_unloading_shift = 0;
+  static const uint8_t _unloading_cycle_mask = 6;
+  static const uint8_t _unloading_cycle_shift = 1;
 
-// The IsUnloadingUnion allows treating the tuple of the IsUnloadingStruct
-// like a uint8_t, making it possible to read and write the tuple atomically.
-union IsUnloadingUnion {
-  IsUnloadingStruct _inflated;
-  uint8_t _value;
+  static uint8_t set_is_unloading(uint8_t state, bool value) {
+    state &= ~_is_unloading_mask;
+    if (value) {
+      state |= 1 << _is_unloading_shift;
+    }
+    assert(is_unloading(state) == value, "unexpected unloading cycle overflow");
+    return state;
+  }
+
+  static uint8_t set_unloading_cycle(uint8_t state, uint8_t value) {
+    state &= ~_unloading_cycle_mask;
+    state |= value << _unloading_cycle_shift;
+    assert(unloading_cycle(state) == value, "unexpected unloading cycle overflow");
+    return state;
+  }
+
+public:
+  static bool is_unloading(uint8_t state) { return (state & _is_unloading_mask) >> _is_unloading_shift == 1; }
+  static uint8_t unloading_cycle(uint8_t state) { return (state & _unloading_cycle_mask) >> _unloading_cycle_shift; }
+
+  static uint8_t create(bool is_unloading, uint8_t unloading_cycle) {
+    uint8_t state = 0;
+    state = set_is_unloading(state, is_unloading);
+    state = set_unloading_cycle(state, unloading_cycle);
+    return state;
+  }
 };
 
 bool CompiledMethod::is_unloading() {
-  IsUnloadingUnion state;
-  state._value = RawAccess<MO_RELAXED>::load(&_is_unloading_state);
-  if (state._inflated._is_unloading == 1) {
+  uint8_t state = RawAccess<MO_RELAXED>::load(&_is_unloading_state);
+  bool state_is_unloading = IsUnloadingState::is_unloading(state);
+  uint8_t state_unloading_cycle = IsUnloadingState::unloading_cycle(state);
+  if (state_is_unloading) {
     return true;
   }
-  if (state._inflated._unloading_cycle == CodeCache::unloading_cycle()) {
-    return state._inflated._is_unloading == 1;
+  if (state_unloading_cycle == CodeCache::unloading_cycle()) {
+    return false;
   }
 
   // The IsUnloadingBehaviour is responsible for checking if there are any dead
   // oops in the CompiledMethod, by calling oops_do on it.
-  bool result = IsUnloadingBehaviour::current()->is_unloading(this);
+  state_unloading_cycle = CodeCache::unloading_cycle();
+  state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this);
 
-  state._inflated._unloading_cycle = CodeCache::unloading_cycle();
-  state._inflated._is_unloading = result ? 1 : 0;
+  state = IsUnloadingState::create(state_is_unloading, state_unloading_cycle);
 
-  RawAccess<MO_RELAXED>::store(&_is_unloading_state, state._value);
+  RawAccess<MO_RELAXED>::store(&_is_unloading_state, state);
 
-  return result;
+  return state_is_unloading;
 }
 
 void CompiledMethod::clear_unloading_state() {
-  IsUnloadingUnion state;
-  state._inflated._unloading_cycle = CodeCache::unloading_cycle();
-  state._inflated._is_unloading = 0;
-  RawAccess<MO_RELAXED>::store(&_is_unloading_state, state._value);
+  uint8_t state = IsUnloadingState::create(false, CodeCache::unloading_cycle());
+  RawAccess<MO_RELAXED>::store(&_is_unloading_state, state);
 }
 
 // Called to clean up after class unloading for live nmethods and from the sweeper
--- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -30,9 +30,11 @@
 #include "gc/g1/g1ThreadLocalData.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "opto/arraycopynode.hpp"
+#include "opto/compile.hpp"
 #include "opto/graphKit.hpp"
 #include "opto/idealKit.hpp"
 #include "opto/macro.hpp"
+#include "opto/rootnode.hpp"
 #include "opto/type.hpp"
 #include "utilities/macros.hpp"
 
@@ -594,8 +596,6 @@
 
 Node* G1BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) const {
   DecoratorSet decorators = access.decorators();
-  GraphKit* kit = access.kit();
-
   Node* adr = access.addr().node();
   Node* obj = access.base();
 
@@ -606,7 +606,8 @@
   bool is_unordered = (decorators & MO_UNORDERED) != 0;
   bool need_cpu_mem_bar = !is_unordered || mismatched || !in_heap;
 
-  Node* offset = adr->is_AddP() ? adr->in(AddPNode::Offset) : kit->top();
+  Node* top = Compile::current()->top();
+  Node* offset = adr->is_AddP() ? adr->in(AddPNode::Offset) : top;
   Node* load = CardTableBarrierSetC2::load_at_resolved(access, val_type);
 
   // If we are reading the value of the referent field of a Reference
@@ -616,12 +617,16 @@
   // Also we need to add memory barrier to prevent commoning reads
   // from this field across safepoint since GC can change its value.
   bool need_read_barrier = in_heap && (on_weak ||
-                                       (unknown && offset != kit->top() && obj != kit->top()));
+                                       (unknown && offset != top && obj != top));
 
   if (!access.is_oop() || !need_read_barrier) {
     return load;
   }
 
+  assert(access.is_parse_access(), "entry not supported at optimization time");
+  C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
+  GraphKit* kit = parse_access.kit();
+
   if (on_weak) {
     // Use the pre-barrier to record the value in the referent field
     pre_barrier(kit, false /* do_load */,
@@ -770,3 +775,68 @@
   }
   return c;
 }
+
+#ifdef ASSERT
+void G1BarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase phase) const {
+  if (phase != BarrierSetC2::BeforeCodeGen) {
+    return;
+  }
+  // Verify G1 pre-barriers
+  const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
+
+  ResourceArea *area = Thread::current()->resource_area();
+  Unique_Node_List visited(area);
+  Node_List worklist(area);
+  // We're going to walk control flow backwards starting from the Root
+  worklist.push(compile->root());
+  while (worklist.size() > 0) {
+    Node* x = worklist.pop();
+    if (x == NULL || x == compile->top()) continue;
+    if (visited.member(x)) {
+      continue;
+    } else {
+      visited.push(x);
+    }
+
+    if (x->is_Region()) {
+      for (uint i = 1; i < x->req(); i++) {
+        worklist.push(x->in(i));
+      }
+    } else {
+      worklist.push(x->in(0));
+      // We are looking for the pattern:
+      //                            /->ThreadLocal
+      // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset)
+      //              \->ConI(0)
+      // We want to verify that the If and the LoadB have the same control
+      // See GraphKit::g1_write_barrier_pre()
+      if (x->is_If()) {
+        IfNode *iff = x->as_If();
+        if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) {
+          CmpNode *cmp = iff->in(1)->in(1)->as_Cmp();
+          if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0
+              && cmp->in(1)->is_Load()) {
+            LoadNode* load = cmp->in(1)->as_Load();
+            if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal
+                && load->in(2)->in(3)->is_Con()
+                && load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) {
+
+              Node* if_ctrl = iff->in(0);
+              Node* load_ctrl = load->in(0);
+
+              if (if_ctrl != load_ctrl) {
+                // Skip possible CProj->NeverBranch in infinite loops
+                if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj)
+                    && (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) {
+                  if_ctrl = if_ctrl->in(0)->in(0);
+                }
+              }
+              assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match");
+            }
+          }
+        }
+      }
+    }
+  }
+}
+#endif
--- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -88,6 +88,10 @@
   virtual bool is_gc_barrier_node(Node* node) const;
   virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const;
   virtual Node* step_over_gc_barrier(Node* c) const;
+
+#ifdef ASSERT
+  virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const;
+#endif
 };
 
 #endif // SHARE_GC_SHARED_C2_G1BARRIERSETC2_HPP
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -35,10 +35,12 @@
 // By default this is a no-op.
 void BarrierSetC2::resolve_address(C2Access& access) const { }
 
-void* C2Access::barrier_set_state() const {
+void* C2ParseAccess::barrier_set_state() const {
   return _kit->barrier_set_state();
 }
 
+PhaseGVN& C2ParseAccess::gvn() const { return _kit->gvn(); }
+
 bool C2Access::needs_cpu_membar() const {
   bool mismatched = (_decorators & C2_MISMATCHED) != 0;
   bool is_unordered = (_decorators & MO_UNORDERED) != 0;
@@ -70,7 +72,6 @@
 
 Node* BarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val) const {
   DecoratorSet decorators = access.decorators();
-  GraphKit* kit = access.kit();
 
   bool mismatched = (decorators & C2_MISMATCHED) != 0;
   bool unaligned = (decorators & C2_UNALIGNED) != 0;
@@ -79,22 +80,49 @@
   bool in_native = (decorators & IN_NATIVE) != 0;
   assert(!in_native, "not supported yet");
 
-  if (access.type() == T_DOUBLE) {
-    Node* new_val = kit->dstore_rounding(val.node());
-    val.set_node(new_val);
-  }
-
   MemNode::MemOrd mo = access.mem_node_mo();
 
-  Node* store = kit->store_to_memory(kit->control(), access.addr().node(), val.node(), access.type(),
+  Node* store;
+  if (access.is_parse_access()) {
+    C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
+
+    GraphKit* kit = parse_access.kit();
+    if (access.type() == T_DOUBLE) {
+      Node* new_val = kit->dstore_rounding(val.node());
+      val.set_node(new_val);
+    }
+
+    store = kit->store_to_memory(kit->control(), access.addr().node(), val.node(), access.type(),
                                      access.addr().type(), mo, requires_atomic_access, unaligned, mismatched);
-  access.set_raw_access(store);
+    access.set_raw_access(store);
+  } else {
+    assert(!requires_atomic_access, "not yet supported");
+    assert(access.is_opt_access(), "either parse or opt access");
+    C2OptAccess& opt_access = static_cast<C2OptAccess&>(access);
+    Node* ctl = opt_access.ctl();
+    MergeMemNode* mm = opt_access.mem();
+    PhaseGVN& gvn = opt_access.gvn();
+    const TypePtr* adr_type = access.addr().type();
+    int alias = gvn.C->get_alias_index(adr_type);
+    Node* mem = mm->memory_at(alias);
+
+    StoreNode* st = StoreNode::make(gvn, ctl, mem, access.addr().node(), adr_type, val.node(), access.type(), mo);
+    if (unaligned) {
+      st->set_unaligned_access();
+    }
+    if (mismatched) {
+      st->set_mismatched_access();
+    }
+    store = gvn.transform(st);
+    if (store == st) {
+      mm->set_memory_at(alias, st);
+    }
+  }
   return store;
 }
 
 Node* BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) const {
   DecoratorSet decorators = access.decorators();
-  GraphKit* kit = access.kit();
 
   Node* adr = access.addr().node();
   const TypePtr* adr_type = access.addr().type();
@@ -109,16 +137,31 @@
 
   MemNode::MemOrd mo = access.mem_node_mo();
   LoadNode::ControlDependency dep = pinned ? LoadNode::Pinned : LoadNode::DependsOnlyOnTest;
-  Node* control = control_dependent ? kit->control() : NULL;
 
   Node* load;
-  if (in_native) {
-    load = kit->make_load(control, adr, val_type, access.type(), mo);
+  if (access.is_parse_access()) {
+    C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
+    GraphKit* kit = parse_access.kit();
+    Node* control = control_dependent ? kit->control() : NULL;
+
+    if (in_native) {
+      load = kit->make_load(control, adr, val_type, access.type(), mo);
+    } else {
+      load = kit->make_load(control, adr, val_type, access.type(), adr_type, mo,
+                            dep, requires_atomic_access, unaligned, mismatched);
+    }
+    access.set_raw_access(load);
   } else {
-    load = kit->make_load(control, adr, val_type, access.type(), adr_type, mo,
-                          dep, requires_atomic_access, unaligned, mismatched);
+    assert(!requires_atomic_access, "not yet supported");
+    assert(access.is_opt_access(), "either parse or opt access");
+    C2OptAccess& opt_access = static_cast<C2OptAccess&>(access);
+    Node* control = control_dependent ? opt_access.ctl() : NULL;
+    MergeMemNode* mm = opt_access.mem();
+    PhaseGVN& gvn = opt_access.gvn();
+    Node* mem = mm->memory_at(gvn.C->get_alias_index(adr_type));
+    load = LoadNode::make(gvn, control, mem, adr, adr_type, val_type, access.type(), mo, dep, unaligned, mismatched);
+    load = gvn.transform(load);
   }
-  access.set_raw_access(load);
 
   return load;
 }
@@ -130,7 +173,11 @@
 public:
   C2AccessFence(C2Access& access) :
     _access(access), _leading_membar(NULL) {
-    GraphKit* kit = access.kit();
+    GraphKit* kit = NULL;
+    if (access.is_parse_access()) {
+      C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
+      kit = parse_access.kit();
+    }
     DecoratorSet decorators = access.decorators();
 
     bool is_write = (decorators & C2_WRITE_ACCESS) != 0;
@@ -141,6 +188,7 @@
     bool is_release = (decorators & MO_RELEASE) != 0;
 
     if (is_atomic) {
+      assert(kit != NULL, "unsupported at optimization time");
       // Memory-model-wise, a LoadStore acts like a little synchronized
       // block, so needs barriers on each side.  These don't translate
       // into actual barriers on most machines, but we still need rest of
@@ -159,6 +207,7 @@
       // floating down past the volatile write.  Also prevents commoning
       // another volatile read.
       if (is_volatile || is_release) {
+        assert(kit != NULL, "unsupported at optimization time");
         _leading_membar = kit->insert_mem_bar(Op_MemBarRelease);
       }
     } else {
@@ -168,11 +217,13 @@
       // so there's no problems making a strong assert about mixing users
       // of safe & unsafe memory.
       if (is_volatile && support_IRIW_for_not_multiple_copy_atomic_cpu) {
+        assert(kit != NULL, "unsupported at optimization time");
         _leading_membar = kit->insert_mem_bar(Op_MemBarVolatile);
       }
     }
 
     if (access.needs_cpu_membar()) {
+      assert(kit != NULL, "unsupported at optimization time");
       kit->insert_mem_bar(Op_MemBarCPUOrder);
     }
 
@@ -185,7 +236,11 @@
   }
 
   ~C2AccessFence() {
-    GraphKit* kit = _access.kit();
+    GraphKit* kit = NULL;
+    if (_access.is_parse_access()) {
+      C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(_access);
+      kit = parse_access.kit();
+    }
     DecoratorSet decorators = _access.decorators();
 
     bool is_write = (decorators & C2_WRITE_ACCESS) != 0;
@@ -202,6 +257,7 @@
     }
 
     if (is_atomic) {
+      assert(kit != NULL, "unsupported at optimization time");
       if (is_acquire || is_volatile) {
         Node* n = _access.raw_access();
         Node* mb = kit->insert_mem_bar(Op_MemBarAcquire, n);
@@ -212,6 +268,7 @@
     } else if (is_write) {
       // If not multiple copy atomic, we do the MemBarVolatile before the load.
       if (is_volatile && !support_IRIW_for_not_multiple_copy_atomic_cpu) {
+        assert(kit != NULL, "unsupported at optimization time");
         Node* n = _access.raw_access();
         Node* mb = kit->insert_mem_bar(Op_MemBarVolatile, n); // Use fat membar
         if (_leading_membar != NULL) {
@@ -220,6 +277,7 @@
       }
     } else {
       if (is_volatile || is_acquire) {
+        assert(kit != NULL, "unsupported at optimization time");
         Node* n = _access.raw_access();
         assert(_leading_membar == NULL || support_IRIW_for_not_multiple_copy_atomic_cpu, "no leading membar expected");
         Node* mb = kit->insert_mem_bar(Op_MemBarAcquire, n);
@@ -295,7 +353,7 @@
     if (!needs_cpu_membar() && adr_type->isa_instptr()) {
       assert(adr_type->meet(TypePtr::NULL_PTR) != adr_type->remove_speculative(), "should be not null");
       intptr_t offset = Type::OffsetBot;
-      AddPNode::Ideal_base_and_offset(adr, &_kit->gvn(), offset);
+      AddPNode::Ideal_base_and_offset(adr, &gvn(), offset);
       if (offset >= 0) {
         int s = Klass::layout_helper_size_in_bytes(adr_type->isa_instptr()->klass()->layout_helper());
         if (offset < s) {
@@ -310,26 +368,28 @@
 
 //--------------------------- atomic operations---------------------------------
 
-void BarrierSetC2::pin_atomic_op(C2AtomicAccess& access) const {
+void BarrierSetC2::pin_atomic_op(C2AtomicParseAccess& access) const {
   if (!access.needs_pinning()) {
     return;
   }
   // SCMemProjNodes represent the memory state of a LoadStore. Their
   // main role is to prevent LoadStore nodes from being optimized away
   // when their results aren't used.
-  GraphKit* kit = access.kit();
+  assert(access.is_parse_access(), "entry not supported at optimization time");
+  C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
+  GraphKit* kit = parse_access.kit();
   Node* load_store = access.raw_access();
   assert(load_store != NULL, "must pin atomic op");
   Node* proj = kit->gvn().transform(new SCMemProjNode(load_store));
   kit->set_memory(proj, access.alias_idx());
 }
 
-void C2AtomicAccess::set_memory() {
+void C2AtomicParseAccess::set_memory() {
   Node *mem = _kit->memory(_alias_idx);
   _memory = mem;
 }
 
-Node* BarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicAccess& access, Node* expected_val,
+Node* BarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                    Node* new_val, const Type* value_type) const {
   GraphKit* kit = access.kit();
   MemNode::MemOrd mo = access.mem_node_mo();
@@ -386,7 +446,7 @@
   return load_store;
 }
 
-Node* BarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val,
+Node* BarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                     Node* new_val, const Type* value_type) const {
   GraphKit* kit = access.kit();
   DecoratorSet decorators = access.decorators();
@@ -460,7 +520,7 @@
   return load_store;
 }
 
-Node* BarrierSetC2::atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const {
+Node* BarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const {
   GraphKit* kit = access.kit();
   Node* mem = access.memory();
   Node* adr = access.addr().node();
@@ -508,7 +568,7 @@
   return load_store;
 }
 
-Node* BarrierSetC2::atomic_add_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const {
+Node* BarrierSetC2::atomic_add_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const {
   Node* load_store = NULL;
   GraphKit* kit = access.kit();
   Node* adr = access.addr().node();
@@ -538,27 +598,27 @@
   return load_store;
 }
 
-Node* BarrierSetC2::atomic_cmpxchg_val_at(C2AtomicAccess& access, Node* expected_val,
+Node* BarrierSetC2::atomic_cmpxchg_val_at(C2AtomicParseAccess& access, Node* expected_val,
                                           Node* new_val, const Type* value_type) const {
   C2AccessFence fence(access);
   resolve_address(access);
   return atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, value_type);
 }
 
-Node* BarrierSetC2::atomic_cmpxchg_bool_at(C2AtomicAccess& access, Node* expected_val,
+Node* BarrierSetC2::atomic_cmpxchg_bool_at(C2AtomicParseAccess& access, Node* expected_val,
                                            Node* new_val, const Type* value_type) const {
   C2AccessFence fence(access);
   resolve_address(access);
   return atomic_cmpxchg_bool_at_resolved(access, expected_val, new_val, value_type);
 }
 
-Node* BarrierSetC2::atomic_xchg_at(C2AtomicAccess& access, Node* new_val, const Type* value_type) const {
+Node* BarrierSetC2::atomic_xchg_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const {
   C2AccessFence fence(access);
   resolve_address(access);
   return atomic_xchg_at_resolved(access, new_val, value_type);
 }
 
-Node* BarrierSetC2::atomic_add_at(C2AtomicAccess& access, Node* new_val, const Type* value_type) const {
+Node* BarrierSetC2::atomic_add_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const {
   C2AccessFence fence(access);
   resolve_address(access);
   return atomic_add_at_resolved(access, new_val, value_type);
@@ -594,7 +654,7 @@
 
   const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM;
 
-  ArrayCopyNode* ac = ArrayCopyNode::make(kit, false, src_base, NULL, dst_base, NULL, countx, false, false);
+  ArrayCopyNode* ac = ArrayCopyNode::make(kit, false, src_base, NULL, dst_base, NULL, countx, true, false);
   ac->set_clonebasic();
   Node* n = kit->gvn().transform(ac);
   if (n == ac) {
@@ -731,3 +791,8 @@
   }
   return fast_oop;
 }
+
+void BarrierSetC2::clone_barrier_at_expansion(ArrayCopyNode* ac, Node* call, PhaseIterGVN& igvn) const {
+  // no barrier
+  igvn.replace_node(ac, call);
+}
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -49,7 +49,12 @@
 const DecoratorSet C2_WRITE_ACCESS           = DECORATOR_LAST << 7;
 // This denotes that the access reads state.
 const DecoratorSet C2_READ_ACCESS            = DECORATOR_LAST << 8;
+// A nearby allocation?
+const DecoratorSet C2_TIGHLY_COUPLED_ALLOC   = DECORATOR_LAST << 9;
+// Loads and stores from an arraycopy being optimized
+const DecoratorSet C2_ARRAY_COPY             = DECORATOR_LAST << 10;
 
+class Compile;
 class GraphKit;
 class IdealKit;
 class Node;
@@ -88,7 +93,6 @@
 // BarrierSetC2 backend hierarchy, for loads and stores, to reduce boiler plate.
 class C2Access: public StackObj {
 protected:
-  GraphKit*         _kit;
   DecoratorSet      _decorators;
   BasicType         _type;
   Node*             _base;
@@ -96,22 +100,17 @@
   Node*             _raw_access;
 
   void fixup_decorators();
-  void* barrier_set_state() const;
 
 public:
-  C2Access(GraphKit* kit, DecoratorSet decorators,
+  C2Access(DecoratorSet decorators,
            BasicType type, Node* base, C2AccessValuePtr& addr) :
-    _kit(kit),
     _decorators(decorators),
     _type(type),
     _base(base),
     _addr(addr),
     _raw_access(NULL)
-  {
-    fixup_decorators();
-  }
+  {}
 
-  GraphKit* kit() const           { return _kit; }
   DecoratorSet decorators() const { return _decorators; }
   Node* base() const              { return _base; }
   C2AccessValuePtr& addr() const  { return _addr; }
@@ -126,23 +125,48 @@
   MemNode::MemOrd mem_node_mo() const;
   bool needs_cpu_membar() const;
 
+  virtual PhaseGVN& gvn() const = 0;
+  virtual bool is_parse_access() const { return false; }
+  virtual bool is_opt_access() const { return false; }
+};
+
+// C2Access for parse time calls to the BarrierSetC2 backend.
+class C2ParseAccess: public C2Access {
+protected:
+  GraphKit*         _kit;
+
+  void* barrier_set_state() const;
+
+public:
+  C2ParseAccess(GraphKit* kit, DecoratorSet decorators,
+                BasicType type, Node* base, C2AccessValuePtr& addr) :
+    C2Access(decorators, type, base, addr),
+    _kit(kit) {
+    fixup_decorators();
+  }
+
+  GraphKit* kit() const           { return _kit; }
+
   template <typename T>
   T barrier_set_state_as() const {
     return reinterpret_cast<T>(barrier_set_state());
   }
+
+  virtual PhaseGVN& gvn() const;
+  virtual bool is_parse_access() const { return true; }
 };
 
 // This class wraps a bunch of context parameters thare are passed around in the
 // BarrierSetC2 backend hierarchy, for atomic accesses, to reduce boiler plate.
-class C2AtomicAccess: public C2Access {
+class C2AtomicParseAccess: public C2ParseAccess {
   Node* _memory;
   uint  _alias_idx;
   bool  _needs_pinning;
 
 public:
-  C2AtomicAccess(GraphKit* kit, DecoratorSet decorators, BasicType type,
+  C2AtomicParseAccess(GraphKit* kit, DecoratorSet decorators, BasicType type,
                  Node* base, C2AccessValuePtr& addr, uint alias_idx) :
-    C2Access(kit, decorators, type, base, addr),
+    C2ParseAccess(kit, decorators, type, base, addr),
     _memory(NULL),
     _alias_idx(alias_idx),
     _needs_pinning(true) {}
@@ -157,6 +181,31 @@
   void set_needs_pinning(bool value)    { _needs_pinning = value; }
 };
 
+// C2Access for optimization time calls to the BarrierSetC2 backend.
+class C2OptAccess: public C2Access {
+  PhaseGVN& _gvn;
+  MergeMemNode* _mem;
+  Node* _ctl;
+
+public:
+  C2OptAccess(PhaseGVN& gvn, Node* ctl, MergeMemNode* mem, DecoratorSet decorators,
+              BasicType type, Node* base, C2AccessValuePtr& addr) :
+    C2Access(decorators, type, base, addr),
+    _gvn(gvn), _mem(mem), _ctl(ctl) {
+    fixup_decorators();
+  }
+
+
+  MergeMemNode* mem() const { return _mem; }
+  Node* ctl() const { return _ctl; }
+  // void set_mem(Node* mem) { _mem = mem; }
+  void set_ctl(Node* ctl) { _ctl = ctl; }
+
+  virtual PhaseGVN& gvn() const { return _gvn; }
+  virtual bool is_opt_access() const { return true; }
+};
+
+
 // This is the top-level class for the backend of the Access API in C2.
 // The top-level class is responsible for performing raw accesses. The
 // various GC barrier sets inherit from the BarrierSetC2 class to sprinkle
@@ -167,25 +216,25 @@
   virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const;
   virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const;
 
-  virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicAccess& access, Node* expected_val,
+  virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                Node* new_val, const Type* val_type) const;
-  virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val,
+  virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                 Node* new_val, const Type* value_type) const;
-  virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* val_type) const;
-  virtual Node* atomic_add_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* val_type) const;
-  void pin_atomic_op(C2AtomicAccess& access) const;
+  virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* val_type) const;
+  virtual Node* atomic_add_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* val_type) const;
+  void pin_atomic_op(C2AtomicParseAccess& access) const;
 
 public:
   // This is the entry-point for the backend to perform accesses through the Access API.
   virtual Node* store_at(C2Access& access, C2AccessValue& val) const;
   virtual Node* load_at(C2Access& access, const Type* val_type) const;
 
-  virtual Node* atomic_cmpxchg_val_at(C2AtomicAccess& access, Node* expected_val,
+  virtual Node* atomic_cmpxchg_val_at(C2AtomicParseAccess& access, Node* expected_val,
                                       Node* new_val, const Type* val_type) const;
-  virtual Node* atomic_cmpxchg_bool_at(C2AtomicAccess& access, Node* expected_val,
+  virtual Node* atomic_cmpxchg_bool_at(C2AtomicParseAccess& access, Node* expected_val,
                                        Node* new_val, const Type* val_type) const;
-  virtual Node* atomic_xchg_at(C2AtomicAccess& access, Node* new_val, const Type* value_type) const;
-  virtual Node* atomic_add_at(C2AtomicAccess& access, Node* new_val, const Type* value_type) const;
+  virtual Node* atomic_xchg_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
+  virtual Node* atomic_add_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
 
   virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const;
 
@@ -196,6 +245,9 @@
                              Node*& fast_oop_ctrl, Node*& fast_oop_rawmem,
                              intx prefetch_lines) const;
 
+  virtual Node* ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const { return NULL; }
+  virtual Node* identity_node(PhaseGVN* phase, Node* n) const { return n; }
+
   // These are general helper methods used by C2
   enum ArrayCopyPhase {
     Parsing,
@@ -203,6 +255,7 @@
     Expansion
   };
   virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const { return false; }
+  virtual void clone_barrier_at_expansion(ArrayCopyNode* ac, Node* call, PhaseIterGVN& igvn) const;
 
   // Support for GC barriers emitted during parsing
   virtual bool has_load_barriers() const { return false; }
@@ -223,7 +276,18 @@
   // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
   // expanded later, then now is the time to do so.
   virtual bool expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
-  virtual void verify_gc_barriers(bool post_parse) const {}
+
+  enum CompilePhase {
+    BeforeOptimize, /* post_parse = true */
+    BeforeExpand, /* post_parse = false */
+    BeforeCodeGen
+  };
+  virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
+
+  virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
+#ifdef ASSERT
+  virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
+#endif
 };
 
 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
--- a/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -32,7 +32,6 @@
 
 Node* ModRefBarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val) const {
   DecoratorSet decorators = access.decorators();
-  GraphKit* kit = access.kit();
 
   const TypePtr* adr_type = access.addr().type();
   Node* adr = access.addr().node();
@@ -41,11 +40,16 @@
   bool anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
   bool in_heap = (decorators & IN_HEAP) != 0;
   bool use_precise = is_array || anonymous;
+  bool tighly_coupled_alloc = (decorators & C2_TIGHLY_COUPLED_ALLOC) != 0;
 
-  if (!access.is_oop() || (!in_heap && !anonymous)) {
+  if (!access.is_oop() || tighly_coupled_alloc || (!in_heap && !anonymous)) {
     return BarrierSetC2::store_at_resolved(access, val);
   }
 
+  assert(access.is_parse_access(), "entry not supported at optimization time");
+  C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
+  GraphKit* kit = parse_access.kit();
+
   uint adr_idx = kit->C->get_alias_index(adr_type);
   assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
 
@@ -58,7 +62,7 @@
   return store;
 }
 
-Node* ModRefBarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicAccess& access, Node* expected_val,
+Node* ModRefBarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                          Node* new_val, const Type* value_type) const {
   GraphKit* kit = access.kit();
 
@@ -78,7 +82,7 @@
   return result;
 }
 
-Node* ModRefBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val,
+Node* ModRefBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                           Node* new_val, const Type* value_type) const {
   GraphKit* kit = access.kit();
 
@@ -114,7 +118,7 @@
   return load_store;
 }
 
-Node* ModRefBarrierSetC2::atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const {
+Node* ModRefBarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const {
   GraphKit* kit = access.kit();
 
   Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type);
--- a/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -54,11 +54,11 @@
 
   virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const;
 
-  virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicAccess& access, Node* expected_val,
+  virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                Node* new_val, const Type* value_type) const;
-  virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val,
+  virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                 Node* new_val, const Type* value_type) const;
-  virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const;
+  virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
 };
 
 #endif // SHARE_GC_SHARED_C2_MODREFBARRIERSETC2_HPP
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -580,6 +580,11 @@
 
   virtual size_t obj_size(oop obj) const;
 
+  // Cells are memory slices allocated by the allocator. Objects are initialized
+  // in cells. The cell itself may have a header, found at a negative offset of
+  // oops. Usually, the size of the cell header is 0, but it may be larger.
+  virtual ptrdiff_t cell_header_size() const { return 0; }
+
   // Non product verification and debugging.
 #ifndef PRODUCT
   // Support for PromotionFailureALot.  Return true if it's time to cause a
--- a/src/hotspot/share/gc/shared/parallelCleaning.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/shared/parallelCleaning.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -89,8 +89,6 @@
   CodeCache::verify_icholder_relocations();
 }
 
-Monitor* CodeCacheUnloadingTask::_lock = new Monitor(Mutex::leaf, "Code Cache Unload lock", false, Monitor::_safepoint_check_never);
-
 void CodeCacheUnloadingTask::claim_nmethods(CompiledMethod** claimed_nmethods, int *num_claimed_nmethods) {
   CompiledMethod* first;
   CompiledMethodIterator last;
--- a/src/hotspot/share/gc/shared/parallelCleaning.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/shared/parallelCleaning.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -56,7 +56,6 @@
 };
 
 class CodeCacheUnloadingTask {
-  static Monitor* _lock;
 
   CodeCache::UnloadingScope _unloading_scope;
   const bool                _unloading_occurred;
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -474,10 +474,10 @@
 
 // == Accesses ==
 
-Node* ZBarrierSetC2::make_cas_loadbarrier(C2AtomicAccess& access) const {
+Node* ZBarrierSetC2::make_cas_loadbarrier(C2AtomicParseAccess& access) const {
   assert(!UseCompressedOops, "Not allowed");
   CompareAndSwapNode* cas = (CompareAndSwapNode*)access.raw_access();
-  PhaseGVN& gvn = access.kit()->gvn();
+  PhaseGVN& gvn = access.gvn();
   Compile* C = Compile::current();
   GraphKit* kit = access.kit();
 
@@ -566,7 +566,7 @@
   return phi;
 }
 
-Node* ZBarrierSetC2::make_cmpx_loadbarrier(C2AtomicAccess& access) const {
+Node* ZBarrierSetC2::make_cmpx_loadbarrier(C2AtomicParseAccess& access) const {
   CompareAndExchangePNode* cmpx = (CompareAndExchangePNode*)access.raw_access();
   GraphKit* kit = access.kit();
   PhaseGVN& gvn = kit->gvn();
@@ -665,7 +665,7 @@
   }
 }
 
-static bool barrier_needed(C2Access access) {
+static bool barrier_needed(C2Access& access) {
   return ZBarrierSet::barrier_needed(access.decorators(), access.type());
 }
 
@@ -677,7 +677,9 @@
 
   bool weak = (access.decorators() & ON_WEAK_OOP_REF) != 0;
 
-  GraphKit* kit = access.kit();
+  assert(access.is_parse_access(), "entry not supported at optimization time");
+  C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
+  GraphKit* kit = parse_access.kit();
   PhaseGVN& gvn = kit->gvn();
   Node* adr = access.addr().node();
   Node* heap_base_oop = access.base();
@@ -707,11 +709,11 @@
     }
     return p;
   } else {
-    return load_barrier(access.kit(), p, access.addr().node(), weak, true, true);
+    return load_barrier(parse_access.kit(), p, access.addr().node(), weak, true, true);
   }
 }
 
-Node* ZBarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicAccess& access, Node* expected_val,
+Node* ZBarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                     Node* new_val, const Type* val_type) const {
   Node* result = BarrierSetC2::atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, val_type);
   if (!barrier_needed(access)) {
@@ -722,7 +724,7 @@
   return make_cmpx_loadbarrier(access);
 }
 
-Node* ZBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val,
+Node* ZBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
                                                      Node* new_val, const Type* value_type) const {
   Node* result = BarrierSetC2::atomic_cmpxchg_bool_at_resolved(access, expected_val, new_val, value_type);
   if (!barrier_needed(access)) {
@@ -746,7 +748,7 @@
   return load_store;
 }
 
-Node* ZBarrierSetC2::atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* val_type) const {
+Node* ZBarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* val_type) const {
   Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, new_val, val_type);
   if (!barrier_needed(access)) {
     return result;
@@ -755,7 +757,9 @@
   Node* load_store = access.raw_access();
   Node* adr = access.addr().node();
 
-  return load_barrier(access.kit(), load_store, adr, false, false, false);
+  assert(access.is_parse_access(), "entry not supported at optimization time");
+  C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
+  return load_barrier(parse_access.kit(), load_store, adr, false, false, false);
 }
 
 // == Macro Expansion ==
@@ -1460,6 +1464,12 @@
   return true;
 }
 
+void ZBarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase phase) const {
+  if (phase == BarrierSetC2::BeforeCodeGen) return;
+  bool post_parse = phase == BarrierSetC2::BeforeOptimize;
+  verify_gc_barriers(post_parse);
+}
+
 void ZBarrierSetC2::verify_gc_barriers(bool post_parse) const {
   ZBarrierSetC2State* s = state();
   Compile* C = Compile::current();
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -156,24 +156,28 @@
 class ZBarrierSetC2 : public BarrierSetC2 {
 private:
   ZBarrierSetC2State* state() const;
-  Node* make_cas_loadbarrier(C2AtomicAccess& access) const;
-  Node* make_cmpx_loadbarrier(C2AtomicAccess& access) const;
+  Node* make_cas_loadbarrier(C2AtomicParseAccess& access) const;
+  Node* make_cmpx_loadbarrier(C2AtomicParseAccess& access) const;
   void expand_loadbarrier_basic(PhaseMacroExpand* phase, LoadBarrierNode *barrier) const;
   void expand_loadbarrier_node(PhaseMacroExpand* phase, LoadBarrierNode* barrier) const;
   void expand_loadbarrier_optimized(PhaseMacroExpand* phase, LoadBarrierNode *barrier) const;
   const TypeFunc* load_barrier_Type() const;
 
+#ifdef ASSERT
+  void verify_gc_barriers(bool post_parse) const;
+#endif
+
 protected:
   virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const;
-  virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicAccess& access,
+  virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access,
                                                Node* expected_val,
                                                Node* new_val,
                                                const Type* val_type) const;
-  virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access,
+  virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access,
                                                 Node* expected_val,
                                                 Node* new_val,
                                                 const Type* value_type) const;
-  virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access,
+  virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access,
                                         Node* new_val,
                                         const Type* val_type) const;
 
@@ -204,7 +208,7 @@
   static void loop_optimize_gc_barrier(PhaseIdealLoop* phase, Node* node, bool last_round);
 
 #ifdef ASSERT
-  virtual void verify_gc_barriers(bool post_parse) const;
+  virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const;
 #endif
 };
 
--- a/src/hotspot/share/include/jvm.h	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/include/jvm.h	Thu Nov 08 19:15:42 2018 -0500
@@ -621,10 +621,6 @@
  */
 
 JNIEXPORT jobject JNICALL
-JVM_DoPrivileged(JNIEnv *env, jclass cls,
-                 jobject action, jobject context, jboolean wrapException);
-
-JNIEXPORT jobject JNICALL
 JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls);
 
 JNIEXPORT jobject JNICALL
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -34,7 +34,6 @@
 #include "oops/markOop.hpp"
 #include "oops/oop.hpp"
 #include "prims/jvmtiThreadState.hpp"
-#include "prims/privilegedStack.hpp"
 #include "runtime/frame.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/threadSMR.inline.hpp"
@@ -323,14 +322,6 @@
   ReferenceLocateClosure rcl(_callback, OldObjectRoot::_threads, OldObjectRoot::_stack_variable, jt);
 
   if (jt->has_last_Java_frame()) {
-    PrivilegedElement* const pelem = jt->privileged_stack_top();
-    if (pelem != NULL) {
-      pelem->oops_do(&rcl);
-      if (rcl.complete()) {
-        return true;
-      }
-    }
-
     // traverse the registered growable array gc_array
     // can't do this as it is not reachable from outside
 
--- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -321,7 +321,6 @@
   int _cur_index;
   const u4 _max_frames;
   volatile bool _disenrolled;
-  static Monitor* _transition_block_lock;
 
   JavaThread* next_thread(ThreadsList* t_list, JavaThread* first_sampled, JavaThread* current);
   void task_stacktrace(JfrSampleType type, JavaThread** last_thread);
@@ -339,12 +338,10 @@
 
  public:
   void run();
-  static Monitor* transition_block() { return _transition_block_lock; }
+  static Monitor* transition_block() { return JfrThreadSampler_lock; }
   static void on_javathread_suspend(JavaThread* thread);
 };
 
-Monitor* JfrThreadSampler::_transition_block_lock = new Monitor(Mutex::leaf, "Trace block", true, Monitor::_safepoint_check_never);
-
 static void clear_transition_block(JavaThread* jt) {
   jt->clear_trace_flag();
   JfrThreadLocal* const tl = jt->jfr_thread_local();
@@ -362,9 +359,6 @@
 
   bool ret = false;
   thread->set_trace_flag();
-  if (!UseMembar) {
-    os::serialize_thread_states();
-  }
   if (JAVA_SAMPLE == type) {
     if (thread_state_in_java(thread)) {
       ret = sample_thread_in_java(thread, frames, max_frames);
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -918,7 +918,7 @@
     last_pc_offset = pc_offset;
 
     JavaThread* thread = JavaThread::current();
-    if (SafepointMechanism::poll(thread)) {
+    if (SafepointMechanism::should_block(thread)) {
       // this is a hacky way to force a safepoint check but nothing else was jumping out at me.
       ThreadToNativeFromVM ttnfv(thread);
     }
--- a/src/hotspot/share/memory/universe.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/memory/universe.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -106,7 +106,6 @@
 oop Universe::_the_min_jint_string                   = NULL;
 LatestMethodCache* Universe::_finalizer_register_cache = NULL;
 LatestMethodCache* Universe::_loader_addClass_cache    = NULL;
-LatestMethodCache* Universe::_pd_implies_cache         = NULL;
 LatestMethodCache* Universe::_throw_illegal_access_error_cache = NULL;
 LatestMethodCache* Universe::_do_stack_walk_cache     = NULL;
 oop Universe::_out_of_memory_error_java_heap          = NULL;
@@ -230,7 +229,6 @@
 
   _finalizer_register_cache->metaspace_pointers_do(it);
   _loader_addClass_cache->metaspace_pointers_do(it);
-  _pd_implies_cache->metaspace_pointers_do(it);
   _throw_illegal_access_error_cache->metaspace_pointers_do(it);
   _do_stack_walk_cache->metaspace_pointers_do(it);
 }
@@ -272,7 +270,6 @@
   f->do_ptr((void**)&_the_empty_instance_klass_array);
   _finalizer_register_cache->serialize(f);
   _loader_addClass_cache->serialize(f);
-  _pd_implies_cache->serialize(f);
   _throw_illegal_access_error_cache->serialize(f);
   _do_stack_walk_cache->serialize(f);
 }
@@ -687,7 +684,6 @@
   // Metaspace::initialize_shared_spaces() tries to populate them.
   Universe::_finalizer_register_cache = new LatestMethodCache();
   Universe::_loader_addClass_cache    = new LatestMethodCache();
-  Universe::_pd_implies_cache         = new LatestMethodCache();
   Universe::_throw_illegal_access_error_cache = new LatestMethodCache();
   Universe::_do_stack_walk_cache = new LatestMethodCache();
 
@@ -941,12 +937,6 @@
                           "addClass",
                           vmSymbols::class_void_signature(), false, CHECK);
 
-  // Set up method for checking protection domain
-  initialize_known_method(_pd_implies_cache,
-                          SystemDictionary::ProtectionDomain_klass(),
-                          "impliesCreateAccessControlContext",
-                          vmSymbols::void_boolean_signature(), false, CHECK);
-
   // Set up method for stack walking
   initialize_known_method(_do_stack_walk_cache,
                           SystemDictionary::AbstractStackWalker_klass(),
--- a/src/hotspot/share/memory/universe.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/memory/universe.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -137,7 +137,6 @@
   static oop          _the_min_jint_string;          // A cache of "-2147483648" as a Java string
   static LatestMethodCache* _finalizer_register_cache; // static method for registering finalizable objects
   static LatestMethodCache* _loader_addClass_cache;    // method for registering loaded classes in class loader vector
-  static LatestMethodCache* _pd_implies_cache;         // method for checking protection domain attributes
   static LatestMethodCache* _throw_illegal_access_error_cache; // Unsafe.throwIllegalAccessError() method
   static LatestMethodCache* _do_stack_walk_cache;      // method for stack walker callback
 
@@ -322,7 +321,6 @@
   static Method*      finalizer_register_method()     { return _finalizer_register_cache->get_method(); }
   static Method*      loader_addClass_method()        { return _loader_addClass_cache->get_method(); }
 
-  static Method*      protection_domain_implies_method() { return _pd_implies_cache->get_method(); }
   static Method*      throw_illegal_access_error()    { return _throw_illegal_access_error_cache->get_method(); }
 
   static Method*      do_stack_walk_method()          { return _do_stack_walk_cache->get_method(); }
--- a/src/hotspot/share/oops/klass.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/oops/klass.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -894,9 +894,18 @@
   if (include_parent_loader &&
       !cld->is_builtin_class_loader_data()) {
     oop parent_loader = java_lang_ClassLoader::parent(class_loader());
-    ClassLoaderData *parent_cld = ClassLoaderData::class_loader_data(parent_loader);
-    assert(parent_cld != NULL, "parent's class loader data should not be null");
-    parent_loader_name_and_id = parent_cld->loader_name_and_id();
+    ClassLoaderData *parent_cld = ClassLoaderData::class_loader_data_or_null(parent_loader);
+    // The parent loader's ClassLoaderData could be null if it is
+    // a delegating class loader that has never defined a class.
+    // In this case the loader's name must be obtained via the parent loader's oop.
+    if (parent_cld == NULL) {
+      oop cl_name_and_id = java_lang_ClassLoader::nameAndId(parent_loader);
+      if (cl_name_and_id != NULL) {
+        parent_loader_name_and_id = java_lang_String::as_utf8_string(cl_name_and_id);
+      }
+    } else {
+      parent_loader_name_and_id = parent_cld->loader_name_and_id();
+    }
     parent_loader_phrase = ", parent loader ";
     len += strlen(parent_loader_phrase) + strlen(parent_loader_name_and_id);
   }
--- a/src/hotspot/share/opto/arraycopynode.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/arraycopynode.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -148,6 +148,28 @@
   return get_length_if_constant(phase);
 }
 
+Node* ArrayCopyNode::load(BarrierSetC2* bs, PhaseGVN *phase, Node*& ctl, MergeMemNode* mem, Node* adr, const TypePtr* adr_type, const Type *type, BasicType bt) {
+  DecoratorSet decorators = C2_READ_ACCESS | C2_CONTROL_DEPENDENT_LOAD | IN_HEAP | C2_ARRAY_COPY;
+  C2AccessValuePtr addr(adr, adr_type);
+  C2OptAccess access(*phase, ctl, mem, decorators, bt, adr->in(AddPNode::Base), addr);
+  Node* res = bs->load_at(access, type);
+  ctl = access.ctl();
+  return res;
+}
+
+void ArrayCopyNode::store(BarrierSetC2* bs, PhaseGVN *phase, Node*& ctl, MergeMemNode* mem, Node* adr, const TypePtr* adr_type, Node* val, const Type *type, BasicType bt) {
+  DecoratorSet decorators = C2_WRITE_ACCESS | IN_HEAP | C2_ARRAY_COPY;
+  if (is_alloc_tightly_coupled()) {
+    decorators |= C2_TIGHLY_COUPLED_ALLOC;
+  }
+  C2AccessValuePtr addr(adr, adr_type);
+  C2AccessValue value(val, type);
+  C2OptAccess access(*phase, ctl, mem, decorators, bt, adr->in(AddPNode::Base), addr);
+  bs->store_at(access, value);
+  ctl = access.ctl();
+}
+
+
 Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int count) {
   if (!is_clonebasic()) {
     return NULL;
@@ -182,6 +204,7 @@
   ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
   assert(ik->nof_nonstatic_fields() <= ArrayCopyLoadStoreMaxElem, "too many fields");
 
+  BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
   for (int i = 0; i < count; i++) {
     ciField* field = ik->nonstatic_field_at(i);
     int fieldidx = phase->C->alias_type(field)->index();
@@ -203,11 +226,8 @@
       type = Type::get_const_basic_type(bt);
     }
 
-    Node* v = LoadNode::make(*phase, ctl, mem->memory_at(fieldidx), next_src, adr_type, type, bt, MemNode::unordered);
-    v = phase->transform(v);
-    Node* s = StoreNode::make(*phase, ctl, mem->memory_at(fieldidx), next_dest, adr_type, v, bt, MemNode::unordered);
-    s = phase->transform(s);
-    mem->set_memory_at(fieldidx, s);
+    Node* v = load(bs, phase, ctl, mem, next_src, adr_type, type, bt);
+    store(bs, phase, ctl, mem, next_dest, adr_type, v, type, bt);
   }
 
   if (!finish_transform(phase, can_reshape, ctl, mem)) {
@@ -368,28 +388,18 @@
   if (!forward_ctl->is_top()) {
     // copy forward
     mm = mm->clone()->as_MergeMem();
-    uint alias_idx_src = phase->C->get_alias_index(atp_src);
-    uint alias_idx_dest = phase->C->get_alias_index(atp_dest);
-    Node *start_mem_src = mm->memory_at(alias_idx_src);
-    Node *start_mem_dest = mm->memory_at(alias_idx_dest);
-    Node* mem = start_mem_dest;
-    bool same_alias = (alias_idx_src == alias_idx_dest);
 
     if (count > 0) {
-      Node* v = LoadNode::make(*phase, forward_ctl, start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered);
-      v = phase->transform(v);
-      mem = StoreNode::make(*phase, forward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered);
-      mem = phase->transform(mem);
+      BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+      Node* v = load(bs, phase, forward_ctl, mm, adr_src, atp_src, value_type, copy_type);
+      store(bs, phase, forward_ctl, mm, adr_dest, atp_dest, v, value_type, copy_type);
       for (int i = 1; i < count; i++) {
         Node* off  = phase->MakeConX(type2aelembytes(copy_type) * i);
         Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off));
         Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off));
-        v = LoadNode::make(*phase, forward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered);
-        v = phase->transform(v);
-        mem = StoreNode::make(*phase, forward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered);
-        mem = phase->transform(mem);
+        v = load(bs, phase, forward_ctl, mm, next_src, atp_src, value_type, copy_type);
+        store(bs, phase, forward_ctl, mm, next_dest, atp_dest, v, value_type, copy_type);
       }
-      mm->set_memory_at(alias_idx_dest, mem);
     } else if(can_reshape) {
       PhaseIterGVN* igvn = phase->is_IterGVN();
       igvn->_worklist.push(adr_src);
@@ -416,31 +426,20 @@
   if (!backward_ctl->is_top()) {
     // copy backward
     mm = mm->clone()->as_MergeMem();
-    uint alias_idx_src = phase->C->get_alias_index(atp_src);
-    uint alias_idx_dest = phase->C->get_alias_index(atp_dest);
-    Node *start_mem_src = mm->memory_at(alias_idx_src);
-    Node *start_mem_dest = mm->memory_at(alias_idx_dest);
-    Node* mem = start_mem_dest;
 
     BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
     assert(copy_type != T_OBJECT || !bs->array_copy_requires_gc_barriers(false, T_OBJECT, false, BarrierSetC2::Optimization), "only tightly coupled allocations for object arrays");
-    bool same_alias = (alias_idx_src == alias_idx_dest);
 
     if (count > 0) {
       for (int i = count-1; i >= 1; i--) {
         Node* off  = phase->MakeConX(type2aelembytes(copy_type) * i);
         Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off));
         Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off));
-        Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered);
-        v = phase->transform(v);
-        mem = StoreNode::make(*phase, backward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered);
-        mem = phase->transform(mem);
+        Node* v = load(bs, phase, backward_ctl, mm, next_src, atp_src, value_type, copy_type);
+        store(bs, phase, backward_ctl, mm, next_dest, atp_dest, v, value_type, copy_type);
       }
-      Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered);
-      v = phase->transform(v);
-      mem = StoreNode::make(*phase, backward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered);
-      mem = phase->transform(mem);
-      mm->set_memory_at(alias_idx_dest, mem);
+      Node* v = load(bs, phase, backward_ctl, mm, adr_src, atp_src, value_type, copy_type);
+      store(bs, phase, backward_ctl, mm, adr_dest, atp_dest, v, value_type, copy_type);
     } else if(can_reshape) {
       PhaseIterGVN* igvn = phase->is_IterGVN();
       igvn->_worklist.push(adr_src);
--- a/src/hotspot/share/opto/arraycopynode.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/arraycopynode.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OPTO_ARRAYCOPYNODE_HPP
 #define SHARE_VM_OPTO_ARRAYCOPYNODE_HPP
 
+#include "gc/shared/c2/barrierSetC2.hpp"
 #include "opto/callnode.hpp"
 
 class GraphKit;
@@ -110,6 +111,9 @@
                         Node* ctl, Node *mem);
   static bool may_modify_helper(const TypeOopPtr *t_oop, Node* n, PhaseTransform *phase, CallNode*& call);
 
+  static Node* load(BarrierSetC2* bs, PhaseGVN *phase, Node*& ctl, MergeMemNode* mem, Node* addr, const TypePtr* adr_type, const Type *type, BasicType bt);
+  void store(BarrierSetC2* bs, PhaseGVN *phase, Node*& ctl, MergeMemNode* mem, Node* addr, const TypePtr* adr_type, Node* val, const Type *type, BasicType bt);
+
 public:
 
   enum {
--- a/src/hotspot/share/opto/callnode.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/callnode.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1623,7 +1623,10 @@
     Node *n = ctrl_proj->in(0);
     if (n != NULL && n->is_Unlock()) {
       UnlockNode *unlock = n->as_Unlock();
-      if (lock->obj_node()->eqv_uncast(unlock->obj_node()) &&
+      BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+      Node* lock_obj = bs->step_over_gc_barrier(lock->obj_node());
+      Node* unlock_obj = bs->step_over_gc_barrier(unlock->obj_node());
+      if (lock_obj->eqv_uncast(unlock_obj) &&
           BoxLockNode::same_slot(lock->box_node(), unlock->box_node()) &&
           !unlock->is_eliminated()) {
         lock_ops.append(unlock);
@@ -1668,7 +1671,10 @@
   }
   if (ctrl->is_Lock()) {
     LockNode *lock = ctrl->as_Lock();
-    if (lock->obj_node()->eqv_uncast(unlock->obj_node()) &&
+    BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+    Node* lock_obj = bs->step_over_gc_barrier(lock->obj_node());
+    Node* unlock_obj = bs->step_over_gc_barrier(unlock->obj_node());
+    if (lock_obj->eqv_uncast(unlock_obj) &&
         BoxLockNode::same_slot(lock->box_node(), unlock->box_node())) {
       lock_result = lock;
     }
@@ -1699,7 +1705,10 @@
       }
       if (lock1_node != NULL && lock1_node->is_Lock()) {
         LockNode *lock1 = lock1_node->as_Lock();
-        if (lock->obj_node()->eqv_uncast(lock1->obj_node()) &&
+        BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+        Node* lock_obj = bs->step_over_gc_barrier(lock->obj_node());
+        Node* lock1_obj = bs->step_over_gc_barrier(lock1->obj_node());
+        if (lock_obj->eqv_uncast(lock1_obj) &&
             BoxLockNode::same_slot(lock->box_node(), lock1->box_node()) &&
             !lock1->is_eliminated()) {
           lock_ops.append(lock1);
@@ -1916,6 +1925,8 @@
     return false;
   }
 
+  BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+  obj = bs->step_over_gc_barrier(obj);
   // Look for external lock for the same object.
   SafePointNode* sfn = this->as_SafePoint();
   JVMState* youngest_jvms = sfn->jvms();
@@ -1926,6 +1937,7 @@
     // Loop over monitors
     for (int idx = 0; idx < num_mon; idx++) {
       Node* obj_node = sfn->monitor_obj(jvms, idx);
+      obj_node = bs->step_over_gc_barrier(obj_node);
       BoxLockNode* box_node = sfn->monitor_box(jvms, idx)->as_BoxLock();
       if ((box_node->stack_slot() < stk_slot) && obj_node->eqv_uncast(obj)) {
         return true;
--- a/src/hotspot/share/opto/compile.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/compile.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -76,9 +76,6 @@
 #include "utilities/align.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_G1GC
-#include "gc/g1/g1ThreadLocalData.hpp"
-#endif // INCLUDE_G1GC
 #if INCLUDE_ZGC
 #include "gc/z/c2/zBarrierSetC2.hpp"
 #endif
@@ -892,7 +889,10 @@
   }
 #endif
 
-  NOT_PRODUCT( verify_barriers(); )
+#ifdef ASSERT
+  BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+  bs->verify_gc_barriers(this, BarrierSetC2::BeforeCodeGen);
+#endif
 
   // Dump compilation data to replay it.
   if (directive->DumpReplayOption) {
@@ -1465,6 +1465,8 @@
         tj = TypeInstPtr::MARK;
         ta = TypeAryPtr::RANGE; // generic ignored junk
         ptr = TypePtr::BotPTR;
+      } else if (BarrierSet::barrier_set()->barrier_set_c2()->flatten_gc_alias_type(tj)) {
+        ta = tj->isa_aryptr();
       } else {                  // Random constant offset into array body
         offset = Type::OffsetBot;   // Flatten constant access into array body
         tj = ta = TypeAryPtr::make(ptr,ta->ary(),ta->klass(),false,offset);
@@ -1529,6 +1531,8 @@
       if (!is_known_inst) { // Do it only for non-instance types
         tj = to = TypeInstPtr::make(TypePtr::BotPTR, env()->Object_klass(), false, NULL, offset);
       }
+    } else if (BarrierSet::barrier_set()->barrier_set_c2()->flatten_gc_alias_type(tj)) {
+      to = tj->is_instptr();
     } else if (offset < 0 || offset >= k->size_helper() * wordSize) {
       // Static fields are in the space above the normal instance
       // fields in the java.lang.Class instance.
@@ -1627,7 +1631,8 @@
           (offset == Type::OffsetBot && tj == TypePtr::BOTTOM) ||
           (offset == oopDesc::mark_offset_in_bytes() && tj->base() == Type::AryPtr) ||
           (offset == oopDesc::klass_offset_in_bytes() && tj->base() == Type::AryPtr) ||
-          (offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr)  ,
+          (offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr) ||
+          (BarrierSet::barrier_set()->barrier_set_c2()->verify_gc_alias_type(tj, offset)),
           "For oops, klasses, raw offset must be constant; for arrays the offset is never known" );
   assert( tj->ptr() != TypePtr::TopPTR &&
           tj->ptr() != TypePtr::AnyNull &&
@@ -2193,7 +2198,7 @@
 
 #ifdef ASSERT
   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-  bs->verify_gc_barriers(true);
+  bs->verify_gc_barriers(this, BarrierSetC2::BeforeOptimize);
 #endif
 
   ResourceMark rm;
@@ -2386,7 +2391,7 @@
 
 #ifdef ASSERT
   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-  bs->verify_gc_barriers(false);
+  bs->verify_gc_barriers(this, BarrierSetC2::BeforeExpand);
 #endif
 
   {
@@ -3831,74 +3836,6 @@
     }
   }
 }
-
-// Verify GC barriers consistency
-// Currently supported:
-// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre())
-void Compile::verify_barriers() {
-#if INCLUDE_G1GC
-  if (UseG1GC) {
-    // Verify G1 pre-barriers
-    const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
-
-    ResourceArea *area = Thread::current()->resource_area();
-    Unique_Node_List visited(area);
-    Node_List worklist(area);
-    // We're going to walk control flow backwards starting from the Root
-    worklist.push(_root);
-    while (worklist.size() > 0) {
-      Node* x = worklist.pop();
-      if (x == NULL || x == top()) continue;
-      if (visited.member(x)) {
-        continue;
-      } else {
-        visited.push(x);
-      }
-
-      if (x->is_Region()) {
-        for (uint i = 1; i < x->req(); i++) {
-          worklist.push(x->in(i));
-        }
-      } else {
-        worklist.push(x->in(0));
-        // We are looking for the pattern:
-        //                            /->ThreadLocal
-        // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset)
-        //              \->ConI(0)
-        // We want to verify that the If and the LoadB have the same control
-        // See GraphKit::g1_write_barrier_pre()
-        if (x->is_If()) {
-          IfNode *iff = x->as_If();
-          if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) {
-            CmpNode *cmp = iff->in(1)->in(1)->as_Cmp();
-            if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0
-                && cmp->in(1)->is_Load()) {
-              LoadNode* load = cmp->in(1)->as_Load();
-              if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal
-                  && load->in(2)->in(3)->is_Con()
-                  && load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) {
-
-                Node* if_ctrl = iff->in(0);
-                Node* load_ctrl = load->in(0);
-
-                if (if_ctrl != load_ctrl) {
-                  // Skip possible CProj->NeverBranch in infinite loops
-                  if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj)
-                      && (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) {
-                    if_ctrl = if_ctrl->in(0)->in(0);
-                  }
-                }
-                assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match");
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-#endif
-}
-
 #endif
 
 // The Compile object keeps track of failure reasons separately from the ciEnv.
--- a/src/hotspot/share/opto/compile.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/compile.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1329,9 +1329,6 @@
   // graph is strongly connected from root in both directions.
   void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN;
 
-  // Verify GC barrier patterns
-  void verify_barriers() PRODUCT_RETURN;
-
   // End-of-run dumps.
   static void print_statistics() PRODUCT_RETURN;
 
--- a/src/hotspot/share/opto/graphKit.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/graphKit.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1566,7 +1566,7 @@
 
   C2AccessValuePtr addr(adr, adr_type);
   C2AccessValue value(val, val_type);
-  C2Access access(this, decorators | C2_WRITE_ACCESS, bt, obj, addr);
+  C2ParseAccess access(this, decorators | C2_WRITE_ACCESS, bt, obj, addr);
   if (access.is_raw()) {
     return _barrier_set->BarrierSetC2::store_at(access, value);
   } else {
@@ -1585,7 +1585,7 @@
   }
 
   C2AccessValuePtr addr(adr, adr_type);
-  C2Access access(this, decorators | C2_READ_ACCESS, bt, obj, addr);
+  C2ParseAccess access(this, decorators | C2_READ_ACCESS, bt, obj, addr);
   if (access.is_raw()) {
     return _barrier_set->BarrierSetC2::load_at(access, val_type);
   } else {
@@ -1602,7 +1602,7 @@
   }
 
   C2AccessValuePtr addr(adr, NULL);
-  C2Access access(this, decorators | C2_READ_ACCESS, bt, NULL, addr);
+  C2ParseAccess access(this, decorators | C2_READ_ACCESS, bt, NULL, addr);
   if (access.is_raw()) {
     return _barrier_set->BarrierSetC2::load_at(access, val_type);
   } else {
@@ -1620,7 +1620,7 @@
                                              BasicType bt,
                                              DecoratorSet decorators) {
   C2AccessValuePtr addr(adr, adr_type);
-  C2AtomicAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
+  C2AtomicParseAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
                         bt, obj, addr, alias_idx);
   if (access.is_raw()) {
     return _barrier_set->BarrierSetC2::atomic_cmpxchg_val_at(access, expected_val, new_val, value_type);
@@ -1639,7 +1639,7 @@
                                               BasicType bt,
                                               DecoratorSet decorators) {
   C2AccessValuePtr addr(adr, adr_type);
-  C2AtomicAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
+  C2AtomicParseAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
                         bt, obj, addr, alias_idx);
   if (access.is_raw()) {
     return _barrier_set->BarrierSetC2::atomic_cmpxchg_bool_at(access, expected_val, new_val, value_type);
@@ -1657,7 +1657,7 @@
                                       BasicType bt,
                                       DecoratorSet decorators) {
   C2AccessValuePtr addr(adr, adr_type);
-  C2AtomicAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
+  C2AtomicParseAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
                         bt, obj, addr, alias_idx);
   if (access.is_raw()) {
     return _barrier_set->BarrierSetC2::atomic_xchg_at(access, new_val, value_type);
@@ -1675,7 +1675,7 @@
                                      BasicType bt,
                                      DecoratorSet decorators) {
   C2AccessValuePtr addr(adr, adr_type);
-  C2AtomicAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS, bt, obj, addr, alias_idx);
+  C2AtomicParseAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS, bt, obj, addr, alias_idx);
   if (access.is_raw()) {
     return _barrier_set->BarrierSetC2::atomic_add_at(access, new_val, value_type);
   } else {
--- a/src/hotspot/share/opto/loopnode.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/loopnode.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1750,7 +1750,7 @@
       // disappear it.  In JavaGrande I have a case where this useless
       // Phi is the loop limit and prevents recognizing a CountedLoop
       // which in turn prevents removing an empty loop.
-      Node *id_old_phi = old_phi->Identity( &igvn );
+      Node *id_old_phi = igvn.apply_identity(old_phi);
       if( id_old_phi != old_phi ) { // Found a simple identity?
         // Note that I cannot call 'replace_node' here, because
         // that will yank the edge from old_phi to the Region and
--- a/src/hotspot/share/opto/loopopts.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/loopopts.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -129,7 +129,7 @@
       // otherwise it will be not updated during igvn->transform since
       // igvn->type(x) is set to x->Value() already.
       x->raise_bottom_type(t);
-      Node *y = x->Identity(&_igvn);
+      Node *y = _igvn.apply_identity(x);
       if (y != x) {
         wins++;
         x = y;
--- a/src/hotspot/share/opto/macro.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/macro.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -940,6 +940,7 @@
           }
           k -= (oc2 - use->outcnt());
         }
+        _igvn.remove_dead_node(use);
       } else if (use->is_ArrayCopy()) {
         // Disconnect ArrayCopy node
         ArrayCopyNode* ac = use->as_ArrayCopy();
--- a/src/hotspot/share/opto/macroArrayCopy.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/macroArrayCopy.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -72,7 +72,6 @@
                                        Node* parm2, Node* parm3,
                                        Node* parm4, Node* parm5,
                                        Node* parm6, Node* parm7) {
-  int size = call_type->domain()->cnt();
   Node* call = new CallLeafNoFPNode(call_type, call_addr, call_name, adr_type);
   call->init_req(TypeFunc::Control, ctrl);
   call->init_req(TypeFunc::I_O    , top());
@@ -1107,7 +1106,9 @@
     Node* call = make_leaf_call(ctrl, mem, call_type, copyfunc_addr, copyfunc_name, raw_adr_type, src, dest, length XTOP);
     transform_later(call);
 
-    _igvn.replace_node(ac, call);
+    BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+    bs->clone_barrier_at_expansion(ac, call, _igvn);
+
     return;
   } else if (ac->is_copyof() || ac->is_copyofrange() || ac->is_cloneoop()) {
     Node* mem = ac->in(TypeFunc::Memory);
--- a/src/hotspot/share/opto/memnode.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/memnode.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1404,7 +1404,7 @@
 
   // Do nothing here if Identity will find a value
   // (to avoid infinite chain of value phis generation).
-  if (!phase->eqv(this, this->Identity(phase)))
+  if (!phase->eqv(this, phase->apply_identity(this)))
     return NULL;
 
   // Select Region to split through.
@@ -1494,7 +1494,7 @@
       // otherwise it will be not updated during igvn->transform since
       // igvn->type(x) is set to x->Value() already.
       x->raise_bottom_type(t);
-      Node *y = x->Identity(igvn);
+      Node *y = igvn->apply_identity(x);
       if (y != x) {
         x = y;
       } else {
@@ -1697,7 +1697,7 @@
     // as to alignment, which will therefore produce the smallest
     // possible base offset.
     const int min_base_off = arrayOopDesc::base_offset_in_bytes(T_BYTE);
-    const bool off_beyond_header = ((uint)off >= (uint)min_base_off);
+    const bool off_beyond_header = (off >= min_base_off);
 
     // Try to constant-fold a stable array element.
     if (FoldStableValues && !is_mismatched_access() && ary->is_stable()) {
@@ -1734,7 +1734,7 @@
         && Opcode() != Op_LoadKlass && Opcode() != Op_LoadNKlass) {
       // t might actually be lower than _type, if _type is a unique
       // concrete subclass of abstract class t.
-      if (off_beyond_header) {  // is the offset beyond the header?
+      if (off_beyond_header || off == Type::OffsetBot) {  // is the offset beyond the header?
         const Type* jt = t->join_speculative(_type);
         // In any case, do not allow the join, per se, to empty out the type.
         if (jt->empty() && !t->empty()) {
--- a/src/hotspot/share/opto/node.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/node.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -899,13 +899,6 @@
     return (Node*) this;
 }
 
-bool Node::eqv_uncast(const Node* n) const {
-  BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-  Node* obj1 = bs->step_over_gc_barrier(const_cast<Node*>(this));
-  Node* obj2 = bs->step_over_gc_barrier(const_cast<Node*>(n));
-  return (obj1->uncast() == obj2->uncast());
-}
-
 // Find out of current node that matches opcode.
 Node* Node::find_out_with(int opcode) {
   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
--- a/src/hotspot/share/opto/node.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/node.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -457,9 +457,10 @@
 
   // Strip away casting.  (It is depth-limited.)
   Node* uncast() const;
-  // Return whether two Nodes are equivalent, after stripping casting
-  // and GC barriers.
-  bool eqv_uncast(const Node* n) const;
+  // Return whether two Nodes are equivalent, after stripping casting.
+  bool eqv_uncast(const Node* n) const {
+    return (this->uncast() == n->uncast());
+  }
 
   // Find out of current node that matches opcode.
   Node* find_out_with(int opcode);
--- a/src/hotspot/share/opto/phaseX.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/phaseX.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -769,6 +769,22 @@
 
 
 //=============================================================================
+Node* PhaseGVN::apply_ideal(Node* k, bool can_reshape) {
+  Node* i = BarrierSet::barrier_set()->barrier_set_c2()->ideal_node(this, k, can_reshape);
+  if (i == NULL) {
+    i = k->Ideal(this, can_reshape);
+  }
+  return i;
+}
+
+Node* PhaseGVN::apply_identity(Node* k) {
+  Node* i = BarrierSet::barrier_set()->barrier_set_c2()->identity_node(this, k);
+  if (i == k) {
+    i = k->Identity(this);
+  }
+  return i;
+}
+
 //------------------------------transform--------------------------------------
 // Return a node which computes the same function as this node, but in a
 // faster or cheaper fashion.
@@ -786,7 +802,7 @@
   Node *k = n;
   NOT_PRODUCT( uint loop_count = 0; )
   while( 1 ) {
-    Node *i = k->Ideal(this, /*can_reshape=*/false);
+    Node *i = apply_ideal(k, /*can_reshape=*/false);
     if( !i ) break;
     assert( i->_idx >= k->_idx, "Idealize should return new nodes, use Identity to return old nodes" );
     k = i;
@@ -823,7 +839,7 @@
   }
 
   // Now check for Identities
-  Node *i = k->Identity(this);  // Look for a nearby replacement
+  Node *i = apply_identity(k);  // Look for a nearby replacement
   if( i != k ) {                // Found? Return replacement!
     NOT_PRODUCT( set_progress(); )
     return i;
@@ -1213,7 +1229,7 @@
   DEBUG_ONLY(dead_loop_check(k);)
   DEBUG_ONLY(bool is_new = (k->outcnt() == 0);)
   C->remove_modified_node(k);
-  Node* i = k->Ideal(this, /*can_reshape=*/true);
+  Node* i = apply_ideal(k, /*can_reshape=*/true);
   assert(i != k || is_new || i->outcnt() > 0, "don't return dead nodes");
 #ifndef PRODUCT
   verify_step(k);
@@ -1255,7 +1271,7 @@
     // Try idealizing again
     DEBUG_ONLY(is_new = (k->outcnt() == 0);)
     C->remove_modified_node(k);
-    i = k->Ideal(this, /*can_reshape=*/true);
+    i = apply_ideal(k, /*can_reshape=*/true);
     assert(i != k || is_new || (i->outcnt() > 0), "don't return dead nodes");
 #ifndef PRODUCT
     verify_step(k);
@@ -1297,7 +1313,7 @@
   }
 
   // Now check for Identities
-  i = k->Identity(this);      // Look for a nearby replacement
+  i = apply_identity(k);      // Look for a nearby replacement
   if (i != k) {                // Found? Return replacement!
     NOT_PRODUCT(set_progress();)
     add_users_to_worklist(k);
--- a/src/hotspot/share/opto/phaseX.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/phaseX.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -425,6 +425,12 @@
 
   bool is_dominator(Node *d, Node *n) { return is_dominator_helper(d, n, true); }
 
+  // Helper to call Node::Ideal() and BarrierSetC2::ideal_node().
+  Node* apply_ideal(Node* i, bool can_reshape);
+
+  // Helper to call Node::Identity() and BarrierSetC2::identity_node().
+  Node* apply_identity(Node* n);
+
   // Check for a simple dead loop when a data node references itself.
   DEBUG_ONLY(void dead_loop_check(Node *n);)
 };
--- a/src/hotspot/share/opto/type.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/opto/type.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -2960,7 +2960,7 @@
     _is_ptr_to_boxed_value = k->as_instance_klass()->is_boxed_value_offset(offset);
   }
 #ifdef _LP64
-  if (_offset != 0) {
+  if (_offset > 0 || _offset == Type::OffsetTop || _offset == Type::OffsetBot) {
     if (_offset == oopDesc::klass_offset_in_bytes()) {
       _is_ptr_to_narrowklass = UseCompressedClassPointers;
     } else if (klass() == NULL) {
--- a/src/hotspot/share/prims/jvm.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/prims/jvm.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -55,7 +55,6 @@
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "prims/nativeLookup.hpp"
-#include "prims/privilegedStack.hpp"
 #include "prims/stackwalk.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.hpp"
@@ -1166,155 +1165,6 @@
 JVM_END
 
 
-static bool is_authorized(Handle context, InstanceKlass* klass, TRAPS) {
-  // If there is a security manager and protection domain, check the access
-  // in the protection domain, otherwise it is authorized.
-  if (java_lang_System::has_security_manager()) {
-
-    // For bootstrapping, if pd implies method isn't in the JDK, allow
-    // this context to revert to older behavior.
-    // In this case the isAuthorized field in AccessControlContext is also not
-    // present.
-    if (Universe::protection_domain_implies_method() == NULL) {
-      return true;
-    }
-
-    // Whitelist certain access control contexts
-    if (java_security_AccessControlContext::is_authorized(context)) {
-      return true;
-    }
-
-    oop prot = klass->protection_domain();
-    if (prot != NULL) {
-      // Call pd.implies(new SecurityPermission("createAccessControlContext"))
-      // in the new wrapper.
-      methodHandle m(THREAD, Universe::protection_domain_implies_method());
-      Handle h_prot(THREAD, prot);
-      JavaValue result(T_BOOLEAN);
-      JavaCallArguments args(h_prot);
-      JavaCalls::call(&result, m, &args, CHECK_false);
-      return (result.get_jboolean() != 0);
-    }
-  }
-  return true;
-}
-
-// Create an AccessControlContext with a protection domain with null codesource
-// and null permissions - which gives no permissions.
-oop create_dummy_access_control_context(TRAPS) {
-  InstanceKlass* pd_klass = SystemDictionary::ProtectionDomain_klass();
-  // Call constructor ProtectionDomain(null, null);
-  Handle obj = JavaCalls::construct_new_instance(pd_klass,
-                          vmSymbols::codesource_permissioncollection_signature(),
-                          Handle(), Handle(), CHECK_NULL);
-
-  // new ProtectionDomain[] {pd};
-  objArrayOop context = oopFactory::new_objArray(pd_klass, 1, CHECK_NULL);
-  context->obj_at_put(0, obj());
-
-  // new AccessControlContext(new ProtectionDomain[] {pd})
-  objArrayHandle h_context(THREAD, context);
-  oop acc = java_security_AccessControlContext::create(h_context, false, Handle(), CHECK_NULL);
-  return acc;
-}
-
-JVM_ENTRY(jobject, JVM_DoPrivileged(JNIEnv *env, jclass cls, jobject action, jobject context, jboolean wrapException))
-  JVMWrapper("JVM_DoPrivileged");
-
-  if (action == NULL) {
-    THROW_MSG_0(vmSymbols::java_lang_NullPointerException(), "Null action");
-  }
-
-  // Compute the frame initiating the do privileged operation and setup the privileged stack
-  vframeStream vfst(thread);
-  vfst.security_get_caller_frame(1);
-
-  if (vfst.at_end()) {
-    THROW_MSG_0(vmSymbols::java_lang_InternalError(), "no caller?");
-  }
-
-  Method* method        = vfst.method();
-  InstanceKlass* klass  = method->method_holder();
-
-  // Check that action object understands "Object run()"
-  Handle h_context;
-  if (context != NULL) {
-    h_context = Handle(THREAD, JNIHandles::resolve(context));
-    bool authorized = is_authorized(h_context, klass, CHECK_NULL);
-    if (!authorized) {
-      // Create an unprivileged access control object and call it's run function
-      // instead.
-      oop noprivs = create_dummy_access_control_context(CHECK_NULL);
-      h_context = Handle(THREAD, noprivs);
-    }
-  }
-
-  // Check that action object understands "Object run()"
-  Handle object (THREAD, JNIHandles::resolve(action));
-
-  // get run() method
-  Method* m_oop = object->klass()->uncached_lookup_method(
-                                           vmSymbols::run_method_name(),
-                                           vmSymbols::void_object_signature(),
-                                           Klass::find_overpass);
-
-  // See if there is a default method for "Object run()".
-  if (m_oop == NULL && object->klass()->is_instance_klass()) {
-    InstanceKlass* iklass = InstanceKlass::cast(object->klass());
-    m_oop = iklass->lookup_method_in_ordered_interfaces(
-                                           vmSymbols::run_method_name(),
-                                           vmSymbols::void_object_signature());
-  }
-
-  methodHandle m (THREAD, m_oop);
-  if (m.is_null() || !m->is_method() || !m()->is_public() || m()->is_static() || m()->is_abstract()) {
-    THROW_MSG_0(vmSymbols::java_lang_InternalError(), "No run method");
-  }
-
-  // Stack allocated list of privileged stack elements
-  PrivilegedElement pi;
-  if (!vfst.at_end()) {
-    pi.initialize(&vfst, h_context(), thread->privileged_stack_top(), CHECK_NULL);
-    thread->set_privileged_stack_top(&pi);
-  }
-
-
-  // invoke the Object run() in the action object. We cannot use call_interface here, since the static type
-  // is not really known - it is either java.security.PrivilegedAction or java.security.PrivilegedExceptionAction
-  Handle pending_exception;
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args(object);
-  JavaCalls::call(&result, m, &args, THREAD);
-
-  // done with action, remove ourselves from the list
-  if (!vfst.at_end()) {
-    assert(thread->privileged_stack_top() != NULL && thread->privileged_stack_top() == &pi, "wrong top element");
-    thread->set_privileged_stack_top(thread->privileged_stack_top()->next());
-  }
-
-  if (HAS_PENDING_EXCEPTION) {
-    pending_exception = Handle(THREAD, PENDING_EXCEPTION);
-    CLEAR_PENDING_EXCEPTION;
-    // JVMTI has already reported the pending exception
-    // JVMTI internal flag reset is needed in order to report PrivilegedActionException
-    if (THREAD->is_Java_thread()) {
-      JvmtiExport::clear_detected_exception((JavaThread*) THREAD);
-    }
-    if ( pending_exception->is_a(SystemDictionary::Exception_klass()) &&
-        !pending_exception->is_a(SystemDictionary::RuntimeException_klass())) {
-      // Throw a java.security.PrivilegedActionException(Exception e) exception
-      JavaCallArguments args(pending_exception);
-      THROW_ARG_0(vmSymbols::java_security_PrivilegedActionException(),
-                  vmSymbols::exception_void_signature(),
-                  &args);
-    }
-  }
-
-  if (pending_exception.not_null()) THROW_OOP_0(pending_exception());
-  return JNIHandles::make_local(env, (oop) result.get_jobject());
-JVM_END
-
-
 // Returns the inherited_access_control_context field of the running thread.
 JVM_ENTRY(jobject, JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls))
   JVMWrapper("JVM_GetInheritedAccessControlContext");
@@ -1349,25 +1199,35 @@
   // duplicate consecutive protection domains into a single one, as
   // well as stopping when we hit a privileged frame.
 
-  // Use vframeStream to iterate through Java frames
-  vframeStream vfst(thread);
-
   oop previous_protection_domain = NULL;
   Handle privileged_context(thread, NULL);
   bool is_privileged = false;
   oop protection_domain = NULL;
 
-  for(; !vfst.at_end(); vfst.next()) {
+  // Iterate through Java frames
+  RegisterMap reg_map(thread);
+  javaVFrame *vf = thread->last_java_vframe(&reg_map);
+  for (; vf != NULL; vf = vf->java_sender()) {
     // get method of frame
-    Method* method = vfst.method();
-    intptr_t* frame_id   = vfst.frame_id();
-
-    // check the privileged frames to see if we have a match
-    if (thread->privileged_stack_top() && thread->privileged_stack_top()->frame_id() == frame_id) {
+    Method* method = vf->method();
+
+    // stop at the first privileged frame
+    if (method->method_holder() == SystemDictionary::AccessController_klass() &&
+      method->name() == vmSymbols::executePrivileged_name())
+    {
       // this frame is privileged
       is_privileged = true;
-      privileged_context = Handle(thread, thread->privileged_stack_top()->privileged_context());
-      protection_domain  = thread->privileged_stack_top()->protection_domain();
+
+      javaVFrame *priv = vf;                        // executePrivileged
+      javaVFrame *caller_fr = priv->java_sender();  // doPrivileged
+      caller_fr = caller_fr->java_sender();         // caller
+
+      StackValueCollection* locals = priv->locals();
+      privileged_context = locals->obj_at(1);
+      Handle caller      = locals->obj_at(2);
+
+      Klass *caller_klass = java_lang_Class::as_Klass(caller());
+      protection_domain  = caller_klass->protection_domain();
     } else {
       protection_domain = method->method_holder()->protection_domain();
     }
--- a/src/hotspot/share/prims/jvmtiImpl.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/prims/jvmtiImpl.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -635,18 +635,8 @@
 //   JVMTI_ERROR_TYPE_MISMATCH
 // Returns: 'true' - everything is Ok, 'false' - error code
 
-bool VM_GetOrSetLocal::check_slot_type(javaVFrame* jvf) {
+bool VM_GetOrSetLocal::check_slot_type_lvt(javaVFrame* jvf) {
   Method* method_oop = jvf->method();
-  if (!method_oop->has_localvariable_table()) {
-    // Just to check index boundaries
-    jint extra_slot = (_type == T_LONG || _type == T_DOUBLE) ? 1 : 0;
-    if (_index < 0 || _index + extra_slot >= method_oop->max_locals()) {
-      _result = JVMTI_ERROR_INVALID_SLOT;
-      return false;
-    }
-    return true;
-  }
-
   jint num_entries = method_oop->localvariable_table_length();
   if (num_entries == 0) {
     _result = JVMTI_ERROR_INVALID_SLOT;
@@ -711,6 +701,35 @@
   return true;
 }
 
+bool VM_GetOrSetLocal::check_slot_type_no_lvt(javaVFrame* jvf) {
+  Method* method_oop = jvf->method();
+  jint extra_slot = (_type == T_LONG || _type == T_DOUBLE) ? 1 : 0;
+
+  if (_index < 0 || _index + extra_slot >= method_oop->max_locals()) {
+    _result = JVMTI_ERROR_INVALID_SLOT;
+    return false;
+  }
+  StackValueCollection *locals = _jvf->locals();
+  BasicType slot_type = locals->at(_index)->type();
+
+  if (slot_type == T_CONFLICT) {
+    _result = JVMTI_ERROR_INVALID_SLOT;
+    return false;
+  }
+  if (extra_slot) {
+    BasicType extra_slot_type = locals->at(_index + 1)->type();
+    if (extra_slot_type != T_INT) {
+      _result = JVMTI_ERROR_INVALID_SLOT;
+      return false;
+    }
+  }
+  if (_type != slot_type && (_type == T_OBJECT || slot_type != T_INT)) {
+    _result = JVMTI_ERROR_TYPE_MISMATCH;
+    return false;
+  }
+  return true;
+}
+
 static bool can_be_deoptimized(vframe* vf) {
   return (vf->is_compiled_frame() && vf->fr().can_be_deoptimized());
 }
@@ -719,8 +738,9 @@
   _jvf = get_java_vframe();
   NULL_CHECK(_jvf, false);
 
-  if (_jvf->method()->is_native()) {
-    if (getting_receiver() && !_jvf->method()->is_static()) {
+  Method* method_oop = _jvf->method();
+  if (method_oop->is_native()) {
+    if (getting_receiver() && !method_oop->is_static()) {
       return true;
     } else {
       _result = JVMTI_ERROR_OPAQUE_FRAME;
@@ -728,8 +748,10 @@
     }
   }
 
-  if (!check_slot_type(_jvf)) {
-    return false;
+  if (method_oop->has_localvariable_table()) {
+    return check_slot_type_lvt(_jvf);
+  } else {
+    return check_slot_type_no_lvt(_jvf);
   }
   return true;
 }
@@ -796,12 +818,6 @@
     } else {
       StackValueCollection *locals = _jvf->locals();
 
-      if (locals->at(_index)->type() == T_CONFLICT) {
-        memset(&_value, 0, sizeof(_value));
-        _value.l = NULL;
-        return;
-      }
-
       switch (_type) {
         case T_INT:    _value.i = locals->int_at   (_index);   break;
         case T_LONG:   _value.j = locals->long_at  (_index);   break;
--- a/src/hotspot/share/prims/jvmtiImpl.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/prims/jvmtiImpl.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -382,7 +382,8 @@
 
   vframe* get_vframe();
   javaVFrame* get_java_vframe();
-  bool check_slot_type(javaVFrame* vf);
+  bool check_slot_type_lvt(javaVFrame* vf);
+  bool check_slot_type_no_lvt(javaVFrame* vf);
 
 public:
   // Constructor for non-object getter
--- a/src/hotspot/share/prims/privilegedStack.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 1997, 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"
-#include "memory/allocation.inline.hpp"
-#include "oops/instanceKlass.hpp"
-#include "oops/method.hpp"
-#include "oops/oop.inline.hpp"
-#include "prims/privilegedStack.hpp"
-#include "runtime/thread.inline.hpp"
-#include "runtime/vframe.inline.hpp"
-
-void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) {
-  Method* method        = vfst->method();
-  _klass                = method->method_holder();
-  _privileged_context   = context;
-#ifdef CHECK_UNHANDLED_OOPS
-  THREAD->allow_unhandled_oop(&_privileged_context);
-#endif // CHECK_UNHANDLED_OOPS
-  _frame_id             = vfst->frame_id();
-  _next                 = next;
-  assert(oopDesc::is_oop_or_null(_privileged_context), "must be an oop");
-  assert(oopDesc::is_oop_or_null(protection_domain()), "must be an oop");
-}
-
-void PrivilegedElement::oops_do(OopClosure* f) {
-  PrivilegedElement *cur = this;
-  do {
-    f->do_oop((oop*) &cur->_privileged_context);
-    cur = cur->_next;
-  } while(cur != NULL);
-}
-
-//-------------------------------------------------------------------------------
-#ifndef PRODUCT
-
-void PrivilegedElement::print_on(outputStream* st) const {
-  st->print("   " PTR_FORMAT " ", p2i(_frame_id));
-  _klass->print_value_on(st);
-  if (protection_domain() != NULL) {
-    st->print("   ");
-    protection_domain()->print_value_on(st);
-  }
-  st->cr();
-}
-
-bool PrivilegedElement::contains(address addr) {
-  PrivilegedElement *e = (PrivilegedElement *)addr;
-  if (e >= this && e < this+1) return true;
-
-  if (_next != NULL) {
-    return _next->contains(addr);
-  } else {
-    return false;
-  }
-}
-
-#endif
--- a/src/hotspot/share/prims/privilegedStack.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1997, 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.
- *
- */
-
-#ifndef SHARE_VM_PRIMS_PRIVILEGEDSTACK_HPP
-#define SHARE_VM_PRIMS_PRIVILEGEDSTACK_HPP
-
-#include "oops/oopsHierarchy.hpp"
-#include "runtime/vframe.hpp"
-#include "utilities/growableArray.hpp"
-
-class PrivilegedElement {
- private:
-  Klass*    _klass;                // klass for method
-  oop       _privileged_context;   // context for operation
-  intptr_t*     _frame_id;             // location on stack
-  PrivilegedElement* _next;        // Link to next one on stack
- public:
-  void initialize(vframeStream* vf, oop context, PrivilegedElement* next, TRAPS);
-  void oops_do(OopClosure* f);
-  intptr_t* frame_id() const           { return _frame_id; }
-  oop  privileged_context() const  { return _privileged_context; }
-  oop  class_loader() const        { return InstanceKlass::cast(_klass)->class_loader(); }
-  oop  protection_domain() const   { return InstanceKlass::cast(_klass)->protection_domain(); }
-  PrivilegedElement *next() const  { return _next; }
-
-  // debugging (used for find)
-  void print_on(outputStream* st) const   PRODUCT_RETURN;
-  bool contains(address addr)             PRODUCT_RETURN0;
-};
-
-#endif // SHARE_VM_PRIMS_PRIVILEGEDSTACK_HPP
--- a/src/hotspot/share/runtime/arguments.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/arguments.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -532,7 +532,7 @@
   { "MaxRAMFraction",               JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },
   { "MinRAMFraction",               JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },
   { "InitialRAMFraction",           JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },
-  { "UseMembar",                    JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() },
+  { "UseMembar",                    JDK_Version::jdk(10), JDK_Version::jdk(12), JDK_Version::undefined() },
   { "CompilerThreadHintNoPreempt",  JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) },
   { "VMThreadHintNoPreempt",        JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) },
 
--- a/src/hotspot/share/runtime/globals.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/globals.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -247,12 +247,6 @@
           range(8, 256)                                                     \
           constraint(ObjectAlignmentInBytesConstraintFunc,AtParse)          \
                                                                             \
-  /* UseMembar is theoretically a temp flag used for memory barrier      */ \
-  /* removal testing.  It was supposed to be removed before FCS but has  */ \
-  /* been re-added (see 6401008)                                         */ \
-  product_pd(bool, UseMembar,                                               \
-          "(Unstable) Issues membars on thread state transitions")          \
-                                                                            \
   develop(bool, CleanChunkPoolAsync, true,                                  \
           "Clean the chunk pool asynchronously")                            \
                                                                             \
@@ -1264,6 +1258,10 @@
           "If an error occurs, save the error data to this file "           \
           "[default: ./hs_err_pid%p.log] (%p replaced with pid)")           \
                                                                             \
+  product(bool, ExtensiveErrorReports,                                      \
+                 PRODUCT_ONLY(false) NOT_PRODUCT(true),                     \
+                 "Error reports are more extensive.")                       \
+                                                                            \
   product(bool, DisplayVMOutputToStderr, false,                             \
           "If DisplayVMOutput is true, display all VM output to stderr")    \
                                                                             \
--- a/src/hotspot/share/runtime/handshake.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/handshake.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -126,10 +126,6 @@
       return;
     }
 
-    if (!UseMembar) {
-      os::serialize_thread_states();
-    }
-
     log_trace(handshake)("Thread signaled, begin processing by VMThtread");
     jlong start_time = os::elapsed_counter();
     do {
@@ -173,10 +169,6 @@
       return;
     }
 
-    if (!UseMembar) {
-      os::serialize_thread_states();
-    }
-
     log_debug(handshake)("Threads signaled, begin processing blocked threads by VMThtread");
     const jlong start_time = os::elapsed_counter();
     int number_of_threads_completed = 0;
--- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -79,17 +79,7 @@
  private:
   static void serialize_thread_state_internal(JavaThread* thread, bool needs_exception_handler) {
     // Make sure new state is seen by VM thread
-    if (UseMembar) {
-      // Force a fence between the write above and read below
-      OrderAccess::fence();
-    } else {
-      // store to serialize page so VM thread can do pseudo remote membar
-      if (needs_exception_handler) {
-        os::write_memory_serialize_page_with_handler(thread);
-      } else {
-        os::write_memory_serialize_page(thread);
-      }
-    }
+    OrderAccess::fence();
   }
 };
 
@@ -126,9 +116,7 @@
   // transition_and_fence must be used on any thread state transition
   // where there might not be a Java call stub on the stack, in
   // particular on Windows where the Structured Exception Handler is
-  // set up in the call stub. os::write_memory_serialize_page() can
-  // fault and we can't recover from it on Windows without a SEH in
-  // place.
+  // set up in the call stub.
   static inline void transition_and_fence(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
     assert(thread->thread_state() == from, "coming from wrong thread state");
     assert((from & 1) == 0 && (to & 1) == 0, "odd numbers are transitions states");
@@ -162,7 +150,7 @@
     // We never install asynchronous exceptions when coming (back) in
     // to the runtime from native code because the runtime is not set
     // up to handle exceptions floating around at arbitrary points.
-    if (SafepointMechanism::poll(thread) || thread->is_suspend_after_native()) {
+    if (SafepointMechanism::should_block(thread) || thread->is_suspend_after_native()) {
       JavaThread::check_safepoint_and_suspend_for_native_trans(thread);
 
       // Clear unhandled oops anywhere where we could block, even if we don't.
--- a/src/hotspot/share/runtime/mutex.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/mutex.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -383,7 +383,7 @@
       jint rv = Self->rng[0];
       for (int k = Delay; --k >= 0;) {
         rv = MarsagliaXORV(rv);
-        if (SafepointMechanism::poll(Self)) return 0;
+        if (SafepointMechanism::should_block(Self)) return 0;
       }
       Self->rng[0] = rv;
     } else {
--- a/src/hotspot/share/runtime/mutexLocker.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/mutexLocker.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -106,7 +106,7 @@
 Mutex*   ProfilePrint_lock            = NULL;
 Mutex*   ExceptionCache_lock          = NULL;
 Mutex*   OsrList_lock                 = NULL;
-
+Mutex*   NMethodSweeperStats_lock     = NULL;
 #ifndef PRODUCT
 Mutex*   FullGCALot_lock              = NULL;
 #endif
@@ -138,6 +138,7 @@
 Monitor* JfrMsg_lock                  = NULL;
 Mutex*   JfrBuffer_lock               = NULL;
 Mutex*   JfrStream_lock               = NULL;
+Monitor* JfrThreadSampler_lock        = NULL;
 #endif
 
 #ifndef SUPPORTS_NATIVE_CX8
@@ -147,6 +148,9 @@
 
 Mutex*   MetaspaceExpand_lock         = NULL;
 Mutex*   ClassLoaderDataGraph_lock    = NULL;
+Monitor* ThreadsSMRDelete_lock       = NULL;
+Mutex*   SharedDecoder_lock           = NULL;
+Mutex*   DCmdFactory_lock             = NULL;
 
 #define MAX_NUM_MUTEX 128
 static Monitor * _mutex_array[MAX_NUM_MUTEX];
@@ -243,7 +247,7 @@
   def(JmethodIdCreation_lock       , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);     // used for creating jmethodIDs.
 
   def(SystemDictionary_lock        , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_always);     // lookups done by VM thread
-  def(SharedDictionary_lock        , PaddedMutex,   leaf,        true,  Monitor::_safepoint_check_always);     // lookups done by VM thread
+  def(SharedDictionary_lock        , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);     // lookups done by VM thread
   def(Module_lock                  , PaddedMutex  , leaf+2,      true,  Monitor::_safepoint_check_always);
   def(InlineCacheBuffer_lock       , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);
   def(VMStatistic_lock             , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);
@@ -318,6 +322,7 @@
   def(JfrBuffer_lock               , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
   def(JfrStream_lock               , PaddedMutex  , leaf+1,      true,  Monitor::_safepoint_check_never);      // ensure to rank lower than 'safepoint'
   def(JfrStacktrace_lock           , PaddedMutex  , special,     true,  Monitor::_safepoint_check_sometimes);
+  def(JfrThreadSampler_lock        , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);
 #endif
 
 #ifndef SUPPORTS_NATIVE_CX8
@@ -325,6 +330,11 @@
 #endif
 
   def(CodeHeapStateAnalytics_lock  , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
+
+  def(NMethodSweeperStats_lock     , PaddedMutex  , special,     true,  Monitor::_safepoint_check_sometimes);
+  def(ThreadsSMRDelete_lock        , PaddedMonitor, special,     false, Monitor::_safepoint_check_never);
+  def(SharedDecoder_lock           , PaddedMutex  , native,      false, Monitor::_safepoint_check_never);
+  def(DCmdFactory_lock             , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 }
 
 GCMutexLocker::GCMutexLocker(Monitor * mutex) {
--- a/src/hotspot/share/runtime/mutexLocker.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/mutexLocker.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -110,6 +110,7 @@
 extern Mutex*   ProfilePrint_lock;               // a lock used to serialize the printing of profiles
 extern Mutex*   ExceptionCache_lock;             // a lock used to synchronize exception cache updates
 extern Mutex*   OsrList_lock;                    // a lock used to serialize access to OSR queues
+extern Mutex*   NMethodSweeperStats_lock;        // a lock used to serialize access to sweeper statistics
 
 #ifndef PRODUCT
 extern Mutex*   FullGCALot_lock;                 // a lock to make FullGCALot MT safe
@@ -132,12 +133,15 @@
 extern Monitor* Service_lock;                    // a lock used for service thread operation
 extern Monitor* PeriodicTask_lock;               // protects the periodic task structure
 extern Monitor* RedefineClasses_lock;            // locks classes from parallel redefinition
-
+extern Monitor* ThreadsSMRDelete_lock;           // Used by ThreadsSMRSupport to take pressure off the Threads_lock
+extern Mutex*   SharedDecoder_lock;              // serializes access to the decoder during normal (not error reporting) use
+extern Mutex*   DCmdFactory_lock;                // serialize access to DCmdFactory information
 #if INCLUDE_JFR
 extern Mutex*   JfrStacktrace_lock;              // used to guard access to the JFR stacktrace table
 extern Monitor* JfrMsg_lock;                     // protects JFR messaging
 extern Mutex*   JfrBuffer_lock;                  // protects JFR buffer operations
 extern Mutex*   JfrStream_lock;                  // protects JFR stream access
+extern Monitor* JfrThreadSampler_lock;           // used to suspend/resume JFR thread sampler
 #endif
 
 #ifndef SUPPORTS_NATIVE_CX8
--- a/src/hotspot/share/runtime/objectMonitor.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/objectMonitor.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1641,7 +1641,7 @@
     // This is in keeping with the "no loitering in runtime" rule.
     // We periodically check to see if there's a safepoint pending.
     if ((ctr & 0xFF) == 0) {
-      if (SafepointMechanism::poll(Self)) {
+      if (SafepointMechanism::should_block(Self)) {
         goto Abort;           // abrupt spin egress
       }
       SpinPause();
--- a/src/hotspot/share/runtime/os.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/os.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -44,7 +44,6 @@
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvm_misc.hpp"
-#include "prims/privilegedStack.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/frame.inline.hpp"
@@ -72,8 +71,6 @@
 
 OSThread*         os::_starting_thread    = NULL;
 address           os::_polling_page       = NULL;
-volatile int32_t* os::_mem_serialize_page = NULL;
-uintptr_t         os::_serialize_page_mask = 0;
 volatile unsigned int os::_rand_seed      = 1;
 int               os::_processor_count    = 0;
 int               os::_initial_active_processor_count = 0;
@@ -1091,14 +1088,6 @@
 
   // Check if addr belongs to a Java thread.
   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
-    // Check for privilege stack
-    if (thread->privileged_stack_top() != NULL &&
-        thread->privileged_stack_top()->contains(addr)) {
-      st->print_cr(INTPTR_FORMAT " is pointing into the privilege stack "
-                   "for thread: " INTPTR_FORMAT, p2i(addr), p2i(thread));
-      if (verbose) thread->print_on(st);
-      return;
-    }
     // If the addr is a java thread print information about that.
     if (addr == (address)thread) {
       if (verbose) {
@@ -1360,49 +1349,6 @@
   return opath;
 }
 
-void os::set_memory_serialize_page(address page) {
-  int count = log2_intptr(sizeof(class JavaThread)) - log2_intptr(64);
-  _mem_serialize_page = (volatile int32_t *)page;
-  // We initialize the serialization page shift count here
-  // We assume a cache line size of 64 bytes
-  assert(SerializePageShiftCount == count, "JavaThread size changed; "
-         "SerializePageShiftCount constant should be %d", count);
-  set_serialize_page_mask((uintptr_t)(vm_page_size() - sizeof(int32_t)));
-}
-
-static volatile intptr_t SerializePageLock = 0;
-
-// This method is called from signal handler when SIGSEGV occurs while the current
-// thread tries to store to the "read-only" memory serialize page during state
-// transition.
-void os::block_on_serialize_page_trap() {
-  log_debug(safepoint)("Block until the serialize page permission restored");
-
-  // When VMThread is holding the SerializePageLock during modifying the
-  // access permission of the memory serialize page, the following call
-  // will block until the permission of that page is restored to rw.
-  // Generally, it is unsafe to manipulate locks in signal handlers, but in
-  // this case, it's OK as the signal is synchronous and we know precisely when
-  // it can occur.
-  Thread::muxAcquire(&SerializePageLock, "set_memory_serialize_page");
-  Thread::muxRelease(&SerializePageLock);
-}
-
-// Serialize all thread state variables
-void os::serialize_thread_states() {
-  // On some platforms such as Solaris & Linux, the time duration of the page
-  // permission restoration is observed to be much longer than expected  due to
-  // scheduler starvation problem etc. To avoid the long synchronization
-  // time and expensive page trap spinning, 'SerializePageLock' is used to block
-  // the mutator thread if such case is encountered. See bug 6546278 for details.
-  Thread::muxAcquire(&SerializePageLock, "serialize_thread_states");
-  os::protect_memory((char *)os::get_memory_serialize_page(),
-                     os::vm_page_size(), MEM_PROT_READ);
-  os::protect_memory((char *)os::get_memory_serialize_page(),
-                     os::vm_page_size(), MEM_PROT_RW);
-  Thread::muxRelease(&SerializePageLock);
-}
-
 // Returns true if the current stack pointer is above the stack shadow
 // pages, false otherwise.
 bool os::stack_shadow_pages_available(Thread *thread, const methodHandle& method, address sp) {
--- a/src/hotspot/share/runtime/os.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/os.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -100,8 +100,6 @@
  private:
   static OSThread*          _starting_thread;
   static address            _polling_page;
-  static volatile int32_t * _mem_serialize_page;
-  static uintptr_t          _serialize_page_mask;
  public:
   static size_t             _page_sizes[page_sizes_max];
 
@@ -420,54 +418,6 @@
   static bool    is_readable_pointer(const void* p);
   static bool    is_readable_range(const void* from, const void* to);
 
-  // Routines used to serialize the thread state without using membars
-  static void    serialize_thread_states();
-
-  // Since we write to the serialize page from every thread, we
-  // want stores to be on unique cache lines whenever possible
-  // in order to minimize CPU cross talk.  We pre-compute the
-  // amount to shift the thread* to make this offset unique to
-  // each thread.
-  static int     get_serialize_page_shift_count() {
-    return SerializePageShiftCount;
-  }
-
-  static void     set_serialize_page_mask(uintptr_t mask) {
-    _serialize_page_mask = mask;
-  }
-
-  static unsigned int  get_serialize_page_mask() {
-    return _serialize_page_mask;
-  }
-
-  static void    set_memory_serialize_page(address page);
-
-  static address get_memory_serialize_page() {
-    return (address)_mem_serialize_page;
-  }
-
-  static inline void write_memory_serialize_page(JavaThread *thread) {
-    uintptr_t page_offset = ((uintptr_t)thread >>
-                            get_serialize_page_shift_count()) &
-                            get_serialize_page_mask();
-    *(volatile int32_t *)((uintptr_t)_mem_serialize_page+page_offset) = 1;
-  }
-
-  static bool    is_memory_serialize_page(JavaThread *thread, address addr) {
-    if (UseMembar) return false;
-    // Previously this function calculated the exact address of this
-    // thread's serialize page, and checked if the faulting address
-    // was equal.  However, some platforms mask off faulting addresses
-    // to the page size, so now we just check that the address is
-    // within the page.  This makes the thread argument unnecessary,
-    // but we retain the NULL check to preserve existing behavior.
-    if (thread == NULL) return false;
-    address page = (address) _mem_serialize_page;
-    return addr >= page && addr < (page + os::vm_page_size());
-  }
-
-  static void block_on_serialize_page_trap();
-
   // threads
 
   enum ThreadType {
--- a/src/hotspot/share/runtime/safepoint.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/safepoint.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -213,16 +213,7 @@
   //     writes and reads of both the safepoint state and the Java
   //     threads state is critical.  In order to guarantee that the
   //     memory writes are serialized with respect to each other,
-  //     the VM thread issues a memory barrier instruction
-  //     (on MP systems).  In order to avoid the overhead of issuing
-  //     a memory barrier for each Java thread making native calls, each Java
-  //     thread performs a write to a single memory page after changing
-  //     the thread state.  The VM thread performs a sequence of
-  //     mprotect OS calls which forces all previous writes from all
-  //     Java threads to be serialized.  This is done in the
-  //     os::serialize_thread_states() call.  This has proven to be
-  //     much more efficient than executing a membar instruction
-  //     on every call to native code.
+  //     the VM thread issues a memory barrier instruction.
   //  3. Running compiled Code
   //     Compiled code reads a global (Safepoint Polling) page that
   //     is set to fault if we are trying to get to a safepoint.
@@ -251,11 +242,6 @@
     }
     OrderAccess::fence(); // storestore|storeload, global state -> local state
 
-    // Flush all thread states to memory
-    if (!UseMembar) {
-      os::serialize_thread_states();
-    }
-
     if (SafepointMechanism::uses_global_page_poll()) {
       // Make interpreter safepoint aware
       Interpreter::notice_safepoints();
--- a/src/hotspot/share/runtime/safepointMechanism.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/safepointMechanism.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -87,17 +87,6 @@
   disarm_local_poll(thread);
 }
 
-void SafepointMechanism::initialize_serialize_page() {
-  if (!UseMembar) {
-    const size_t page_size = os::vm_page_size();
-    char* serialize_page = os::reserve_memory(page_size, NULL, page_size);
-    os::commit_memory_or_exit(serialize_page, page_size, false, "Unable to commit memory serialization page");
-    log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(serialize_page));
-    os::set_memory_serialize_page((address)(serialize_page));
-  }
-}
-
 void SafepointMechanism::initialize() {
   pd_initialize();
-  initialize_serialize_page();
 }
--- a/src/hotspot/share/runtime/safepointMechanism.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/safepointMechanism.hpp	Thu Nov 08 19:15:42 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
@@ -52,7 +52,6 @@
   static inline void block_if_requested_local_poll(JavaThread *thread);
 
   static void default_initialize();
-  static void initialize_serialize_page();
 
   static void pd_initialize() NOT_AIX({ default_initialize(); });
 
@@ -73,8 +72,8 @@
 #endif
   }
 
-  // Call this method to see if this thread has depending poll and appropriate action should be taken
-  static inline bool poll(Thread* thread);
+  // Call this method to see if this thread should block for a safepoint.
+  static inline bool should_block(Thread* thread);
 
   // Blocks a thread until safepoint is completed
   static inline void block_if_requested(JavaThread* thread);
--- a/src/hotspot/share/runtime/safepointMechanism.inline.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/safepointMechanism.inline.hpp	Thu Nov 08 19:15:42 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
@@ -47,7 +47,7 @@
   }
 }
 
-bool SafepointMechanism::poll(Thread* thread) {
+bool SafepointMechanism::should_block(Thread* thread) {
   if (uses_thread_local_poll()) {
     return local_poll(thread);
   } else {
--- a/src/hotspot/share/runtime/sweeper.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/sweeper.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -164,8 +164,6 @@
 Tickspan NMethodSweeper::_peak_sweep_time;                     // Peak time for a full sweep
 Tickspan NMethodSweeper::_peak_sweep_fraction_time;            // Peak time sweeping one fraction
 
-Monitor* NMethodSweeper::_stat_lock = new Monitor(Mutex::special, "Sweeper::Statistics", true, Monitor::_safepoint_check_sometimes);
-
 class MarkActivationClosure: public CodeBlobClosure {
 public:
   virtual void do_code_blob(CodeBlob* cb) {
@@ -388,7 +386,7 @@
  */
 void NMethodSweeper::handle_safepoint_request() {
   JavaThread* thread = JavaThread::current();
-  if (SafepointMechanism::poll(thread)) {
+  if (SafepointMechanism::should_block(thread)) {
     if (PrintMethodFlushing && Verbose) {
       tty->print_cr("### Sweep at %d out of %d, yielding to safepoint", _seen, CodeCache::nmethod_count());
     }
@@ -578,7 +576,7 @@
   const Ticks sweep_end_counter = Ticks::now();
   const Tickspan sweep_time = sweep_end_counter - sweep_start_counter;
   {
-    MutexLockerEx mu(_stat_lock, Mutex::_no_safepoint_check_flag);
+    MutexLockerEx mu(NMethodSweeperStats_lock, Mutex::_no_safepoint_check_flag);
     _total_time_sweeping  += sweep_time;
     _total_time_this_sweep += sweep_time;
     _peak_sweep_fraction_time = MAX2(sweep_time, _peak_sweep_fraction_time);
--- a/src/hotspot/share/runtime/sweeper.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/sweeper.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -88,8 +88,6 @@
   static Tickspan  _peak_sweep_time;              // Peak time for a full sweep
   static Tickspan  _peak_sweep_fraction_time;     // Peak time sweeping one fraction
 
-  static Monitor*  _stat_lock;
-
   static MethodStateChange process_compiled_method(CompiledMethod *nm);
   static void              release_compiled_method(CompiledMethod* nm);
 
--- a/src/hotspot/share/runtime/synchronizer.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/synchronizer.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1528,10 +1528,6 @@
 // which in turn can mean large(r) numbers of objectmonitors in circulation.
 // This is an unfortunate aspect of this design.
 
-enum ManifestConstants {
-  ClearResponsibleAtSTW = 0
-};
-
 // Deflate a single monitor if not in-use
 // Return true if deflated, false if in-use
 bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj,
@@ -1544,7 +1540,6 @@
   guarantee(mid->header()->is_neutral(), "invariant");
 
   if (mid->is_busy()) {
-    if (ClearResponsibleAtSTW) mid->_Responsible = NULL;
     deflated = false;
   } else {
     // Deflate the monitor if it is no longer being used
--- a/src/hotspot/share/runtime/thread.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/thread.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -61,7 +61,6 @@
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiThreadState.hpp"
-#include "prims/privilegedStack.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/biasedLocking.hpp"
@@ -1558,7 +1557,6 @@
   _on_thread_list = false;
   set_thread_state(_thread_new);
   _terminated = _not_terminated;
-  _privileged_stack_top = NULL;
   _array_for_gc = NULL;
   _suspend_equivalent = false;
   _in_deopt_handler = 0;
@@ -1990,7 +1988,6 @@
 
   // These things needs to be done while we are still a Java Thread. Make sure that thread
   // is in a consistent state, in case GC happens
-  assert(_privileged_stack_top == NULL, "must be NULL when we get here");
 
   if (active_handles() != NULL) {
     JNIHandleBlock* block = active_handles();
@@ -2840,11 +2837,6 @@
     // Record JavaThread to GC thread
     RememberProcessedThread rpt(this);
 
-    // Traverse the privileged stack
-    if (_privileged_stack_top != NULL) {
-      _privileged_stack_top->oops_do(f);
-    }
-
     // traverse the registered growable array
     if (_array_for_gc != NULL) {
       for (int index = 0; index < _array_for_gc->length(); index++) {
--- a/src/hotspot/share/runtime/thread.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/thread.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1882,14 +1882,9 @@
   void thread_main_inner();
 
  private:
-  // PRIVILEGED STACK
-  PrivilegedElement*  _privileged_stack_top;
   GrowableArray<oop>* _array_for_gc;
  public:
 
-  // Returns the privileged_stack information.
-  PrivilegedElement* privileged_stack_top() const       { return _privileged_stack_top; }
-  void set_privileged_stack_top(PrivilegedElement *e)   { _privileged_stack_top = e; }
   void register_array_for_gc(GrowableArray<oop>* array) { _array_for_gc = array; }
 
  public:
--- a/src/hotspot/share/runtime/threadSMR.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/threadSMR.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -36,10 +36,6 @@
 #include "utilities/resourceHash.hpp"
 #include "utilities/vmError.hpp"
 
-Monitor*              ThreadsSMRSupport::_delete_lock =
-                          new Monitor(Monitor::special, "Thread_SMR_delete_lock",
-                                      false /* allow_vm_block */,
-                                      Monitor::_safepoint_check_never);
 // The '_cnt', '_max' and '_times" fields are enabled via
 // -XX:+EnableThreadSMRStatistics:
 
@@ -74,7 +70,16 @@
 // isn't available everywhere (or is it?).
 volatile uint         ThreadsSMRSupport::_deleted_thread_times = 0;
 
-ThreadsList* volatile ThreadsSMRSupport::_java_thread_list = new ThreadsList(0);
+// The bootstrap list is empty and cannot be freed.
+ThreadsList ThreadsSMRSupport::_bootstrap_list = ThreadsList(0);
+
+// This is the VM's current "threads list" and it contains all of
+// the JavaThreads the VM considers to be alive at this moment in
+// time. The other ThreadsList objects in the VM contain past
+// snapshots of the "threads list". _java_thread_list is initially
+// set to _bootstrap_list so that we can detect when we have a very
+// early use of a ThreadsListHandle.
+ThreadsList* volatile ThreadsSMRSupport::_java_thread_list = &_bootstrap_list;
 
 // # of ThreadsLists allocated over VM lifetime.
 // Impl note: We allocate a new ThreadsList for every thread create and
@@ -139,6 +144,10 @@
   _java_thread_list_alloc_cnt++;
 }
 
+inline bool ThreadsSMRSupport::is_bootstrap_list(ThreadsList* list) {
+  return list == &_bootstrap_list;
+}
+
 inline void ThreadsSMRSupport::update_deleted_thread_time_max(uint new_value) {
   while (true) {
     uint cur_value = _deleted_thread_time_max;
@@ -163,7 +172,6 @@
   return (ThreadsList*)Atomic::xchg(new_list, &_java_thread_list);
 }
 
-
 // Hash table of pointers found by a scan. Used for collecting hazard
 // pointers (ThreadsList references). Also used for collecting JavaThreads
 // that are indirectly referenced by hazard ptrs. An instance of this
@@ -514,6 +522,11 @@
 #ifdef ASSERT
   assert(_list != NULL, "_list must not be NULL");
 
+  if (ThreadsSMRSupport::is_bootstrap_list(_list)) {
+    // We are early in VM bootstrapping so nothing to do here.
+    return;
+  }
+
   // The closure will attempt to verify that the calling thread can
   // be found by threads_do() on the specified ThreadsList. If it
   // is successful, then the specified ThreadsList was acquired as
@@ -766,6 +779,13 @@
 void ThreadsSMRSupport::free_list(ThreadsList* threads) {
   assert_locked_or_safepoint(Threads_lock);
 
+  if (is_bootstrap_list(threads)) {
+    // The bootstrap list cannot be freed and is empty so
+    // it does not need to be scanned. Nothing to do here.
+    log_debug(thread, smr)("tid=" UINTX_FORMAT ": ThreadsSMRSupport::free_list: bootstrap ThreadsList=" INTPTR_FORMAT " is no longer in use.", os::current_thread_id(), p2i(threads));
+    return;
+  }
+
   threads->set_next_list(_to_delete_list);
   _to_delete_list = threads;
   if (EnableThreadSMRStatistics) {
--- a/src/hotspot/share/runtime/threadSMR.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/threadSMR.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -91,7 +91,8 @@
   // The coordination between ThreadsSMRSupport::release_stable_list() and
   // ThreadsSMRSupport::smr_delete() uses the delete_lock in order to
   // reduce the traffic on the Threads_lock.
-  static Monitor*              _delete_lock;
+  static Monitor* delete_lock() { return ThreadsSMRDelete_lock; }
+
   // The '_cnt', '_max' and '_times" fields are enabled via
   // -XX:+EnableThreadSMRStatistics (see thread.cpp for a
   // description about each field):
@@ -104,6 +105,7 @@
   static volatile uint         _deleted_thread_cnt;
   static volatile uint         _deleted_thread_time_max;
   static volatile uint         _deleted_thread_times;
+  static ThreadsList           _bootstrap_list;
   static ThreadsList* volatile _java_thread_list;
   static uint64_t              _java_thread_list_alloc_cnt;
   static uint64_t              _java_thread_list_free_cnt;
@@ -121,7 +123,6 @@
   static void add_deleted_thread_times(uint add_value);
   static void add_tlh_times(uint add_value);
   static void clear_delete_notify();
-  static Monitor* delete_lock() { return _delete_lock; }
   static bool delete_notify();
   static void free_list(ThreadsList* threads);
   static void inc_deleted_thread_cnt();
@@ -142,6 +143,7 @@
   static void add_thread(JavaThread *thread);
   static ThreadsList* get_java_thread_list();
   static bool is_a_protected_JavaThread_with_lock(JavaThread *thread);
+  static bool is_bootstrap_list(ThreadsList* list);
   static void remove_thread(JavaThread *thread);
   static void smr_delete(JavaThread *thread);
   static void update_tlh_stats(uint millis);
--- a/src/hotspot/share/runtime/vframe_hp.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/runtime/vframe_hp.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -102,7 +102,8 @@
 }
 
 void compiledVFrame::update_deferred_value(BasicType type, int index, jvalue value) {
-  assert(fr().is_deoptimized_frame(), "frame must be scheduled for deoptimization");
+  assert(fr().is_deoptimized_frame() || thread()->must_deopt_id() == fr().id(),
+         "frame must be scheduled for deoptimization");
   GrowableArray<jvmtiDeferredLocalVariableSet*>* deferred = thread()->deferred_locals();
   jvmtiDeferredLocalVariableSet* locals = NULL;
   if (deferred != NULL ) {
--- a/src/hotspot/share/services/diagnosticFramework.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/services/diagnosticFramework.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -491,11 +491,10 @@
   }
 }
 
-Mutex* DCmdFactory::_dcmdFactory_lock = new Mutex(Mutex::leaf, "DCmdFactory", true, Monitor::_safepoint_check_never);
 bool DCmdFactory::_send_jmx_notification = false;
 
 DCmdFactory* DCmdFactory::factory(DCmdSource source, const char* name, size_t len) {
-  MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag);
+  MutexLockerEx ml(DCmdFactory_lock, Mutex::_no_safepoint_check_flag);
   DCmdFactory* factory = _DCmdFactoryList;
   while (factory != NULL) {
     if (strlen(factory->name()) == len &&
@@ -512,7 +511,7 @@
 }
 
 int DCmdFactory::register_DCmdFactory(DCmdFactory* factory) {
-  MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag);
+  MutexLockerEx ml(DCmdFactory_lock, Mutex::_no_safepoint_check_flag);
   factory->_next = _DCmdFactoryList;
   _DCmdFactoryList = factory;
   if (_send_jmx_notification && !factory->_hidden
@@ -537,7 +536,7 @@
 }
 
 GrowableArray<const char*>* DCmdFactory::DCmd_list(DCmdSource source) {
-  MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag);
+  MutexLockerEx ml(DCmdFactory_lock, Mutex::_no_safepoint_check_flag);
   GrowableArray<const char*>* array = new GrowableArray<const char*>();
   DCmdFactory* factory = _DCmdFactoryList;
   while (factory != NULL) {
@@ -550,7 +549,7 @@
 }
 
 GrowableArray<DCmdInfo*>* DCmdFactory::DCmdInfo_list(DCmdSource source ) {
-  MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag);
+  MutexLockerEx ml(DCmdFactory_lock, Mutex::_no_safepoint_check_flag);
   GrowableArray<DCmdInfo*>* array = new GrowableArray<DCmdInfo*>();
   DCmdFactory* factory = _DCmdFactoryList;
   while (factory != NULL) {
--- a/src/hotspot/share/services/diagnosticFramework.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/services/diagnosticFramework.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -344,7 +344,6 @@
 // management.cpp)
 class DCmdFactory: public CHeapObj<mtInternal> {
 private:
-  static Mutex*       _dcmdFactory_lock;
   static bool         _send_jmx_notification;
   static bool         _has_pending_jmx_notification;
   static DCmdFactory* _DCmdFactoryList;
--- a/src/hotspot/share/utilities/debug.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/utilities/debug.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -37,7 +37,6 @@
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
-#include "prims/privilegedStack.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/flags/flagSetting.hpp"
--- a/src/hotspot/share/utilities/decoder.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/utilities/decoder.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -41,14 +41,9 @@
 AbstractDecoder*  Decoder::_shared_decoder = NULL;
 AbstractDecoder*  Decoder::_error_handler_decoder = NULL;
 NullDecoder       Decoder::_do_nothing_decoder;
-Mutex*            Decoder::_shared_decoder_lock = new Mutex(Mutex::native,
-                                "SharedDecoderLock",
-                                false,
-                                Monitor::_safepoint_check_never);
 
 AbstractDecoder* Decoder::get_shared_instance() {
-  assert(_shared_decoder_lock != NULL && _shared_decoder_lock->owned_by_self(),
-    "Require DecoderLock to enter");
+  assert(shared_decoder_lock()->owned_by_self(), "Require DecoderLock to enter");
 
   if (_shared_decoder == NULL) {
     _shared_decoder = create_decoder();
@@ -89,21 +84,22 @@
 
 DecoderLocker::DecoderLocker() :
   MutexLockerEx(DecoderLocker::is_first_error_thread() ?
-                NULL : Decoder::shared_decoder_lock(), true) {
+                NULL : Decoder::shared_decoder_lock(),
+                Mutex::_no_safepoint_check_flag) {
   _decoder = is_first_error_thread() ?
     Decoder::get_error_handler_instance() : Decoder::get_shared_instance();
   assert(_decoder != NULL, "null decoder");
 }
 
 Mutex* Decoder::shared_decoder_lock() {
-  assert(_shared_decoder_lock != NULL, "Just check");
-  return _shared_decoder_lock;
+  assert(SharedDecoder_lock != NULL, "Just check");
+  return SharedDecoder_lock;
 }
 
 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath, bool demangle) {
-  assert(_shared_decoder_lock != NULL, "Just check");
   bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
-  MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true);
+  MutexLockerEx locker(error_handling_thread ? NULL : shared_decoder_lock(),
+                       Mutex::_no_safepoint_check_flag);
   AbstractDecoder* decoder = error_handling_thread ?
     get_error_handler_instance(): get_shared_instance();
   assert(decoder != NULL, "null decoder");
@@ -112,9 +108,9 @@
 }
 
 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const void* base) {
-  assert(_shared_decoder_lock != NULL, "Just check");
   bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
-  MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true);
+  MutexLockerEx locker(error_handling_thread ? NULL : shared_decoder_lock(),
+                       Mutex::_no_safepoint_check_flag);
   AbstractDecoder* decoder = error_handling_thread ?
     get_error_handler_instance(): get_shared_instance();
   assert(decoder != NULL, "null decoder");
@@ -124,9 +120,9 @@
 
 
 bool Decoder::demangle(const char* symbol, char* buf, int buflen) {
-  assert(_shared_decoder_lock != NULL, "Just check");
   bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
-  MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true);
+  MutexLockerEx locker(error_handling_thread ? NULL : shared_decoder_lock(),
+                       Mutex::_no_safepoint_check_flag);
   AbstractDecoder* decoder = error_handling_thread ?
     get_error_handler_instance(): get_shared_instance();
   assert(decoder != NULL, "null decoder");
--- a/src/hotspot/share/utilities/decoder.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/utilities/decoder.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -131,7 +131,6 @@
   static NullDecoder          _do_nothing_decoder;
 
 protected:
-  static Mutex*               _shared_decoder_lock;
   static Mutex* shared_decoder_lock();
 
   friend class DecoderLocker;
--- a/src/hotspot/share/utilities/globalCounter.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/utilities/globalCounter.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -61,11 +61,6 @@
   // Atomic::add must provide fence since we have storeload dependency.
   uintx gbl_cnt = Atomic::add(COUNTER_INCREMENT, &_global_counter._counter);
 
-  // Handle bootstrap
-  if (Threads::number_of_threads() == 0) {
-    return;
-  }
-
   // Do all RCU threads.
   CounterThreadCheck ctc(gbl_cnt);
   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
--- a/src/hotspot/share/utilities/globalDefinitions.hpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/hotspot/share/utilities/globalDefinitions.hpp	Thu Nov 08 19:15:42 2018 -0500
@@ -164,15 +164,6 @@
 // Size of a char[] needed to represent a jint as a string in decimal.
 const int jintAsStringSize = 12;
 
-// In fact this should be
-// log2_intptr(sizeof(class JavaThread)) - log2_intptr(64);
-// see os::set_memory_serialize_page()
-#ifdef _LP64
-const int SerializePageShiftCount = 4;
-#else
-const int SerializePageShiftCount = 3;
-#endif
-
 // An opaque struct of heap-word width, so that HeapWord* can be a generic
 // pointer into the heap.  We require that object sizes be measured in
 // units of heap words, so that that
@@ -925,7 +916,6 @@
 class ConstantValue;
 class IllegalValue;
 
-class PrivilegedElement;
 class MonitorArray;
 
 class MonitorInfo;
--- a/src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,7 +25,7 @@
 
 package com.sun.crypto.provider;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 import java.io.*;
 import java.security.*;
--- a/src/java.base/share/classes/java/io/Console.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/Console.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, 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,8 +27,8 @@
 
 import java.util.*;
 import java.nio.charset.Charset;
-import jdk.internal.misc.JavaIOAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.nio.cs.StreamDecoder;
 import sun.nio.cs.StreamEncoder;
 
--- a/src/java.base/share/classes/java/io/DeleteOnExitHook.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/DeleteOnExitHook.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, 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
@@ -25,8 +25,8 @@
 package java.io;
 
 import java.util.*;
-import java.io.File;
-import jdk.internal.misc.SharedSecrets;
+
+import jdk.internal.access.SharedSecrets;
 
 /**
  * This class holds a set of filenames to be deleted on VM exit through a shutdown hook.
--- a/src/java.base/share/classes/java/io/FileCleanable.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/FileCleanable.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,8 +25,8 @@
 
 package java.io;
 
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.ref.CleanerFactory;
 import jdk.internal.ref.PhantomCleanable;
 
--- a/src/java.base/share/classes/java/io/FileDescriptor.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/FileDescriptor.java	Thu Nov 08 19:15:42 2018 -0500
@@ -29,8 +29,8 @@
 import java.util.List;
 import java.util.Objects;
 
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.ref.PhantomCleanable;
 
 /**
--- a/src/java.base/share/classes/java/io/FileOutputStream.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/FileOutputStream.java	Thu Nov 08 19:15:42 2018 -0500
@@ -26,8 +26,8 @@
 package java.io;
 
 import java.nio.channels.FileChannel;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
 import sun.nio.ch.FileChannelImpl;
 
 
--- a/src/java.base/share/classes/java/io/FilePermission.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/FilePermission.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -34,8 +34,8 @@
 import java.util.Vector;
 import java.util.concurrent.ConcurrentHashMap;
 
-import jdk.internal.misc.JavaIOFilePermissionAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFilePermissionAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.nio.fs.DefaultFileSystemProvider;
 import sun.security.action.GetPropertyAction;
 import sun.security.util.FilePermCompat;
--- a/src/java.base/share/classes/java/io/ObjectInputFilter.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -34,7 +34,7 @@
 import java.util.Optional;
 import java.util.function.Function;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Filter classes, array lengths, and graph metrics during deserialization.
--- a/src/java.base/share/classes/java/io/ObjectInputStream.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -44,7 +44,7 @@
 
 import static java.io.ObjectStreamClass.processQueue;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.Unsafe;
 import sun.reflect.misc.ReflectUtil;
 
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -57,9 +57,9 @@
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 import jdk.internal.reflect.ReflectionFactory;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
 import sun.reflect.misc.ReflectUtil;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaSecurityAccess;
 import static java.io.ObjectStreamField.*;
 
 /**
--- a/src/java.base/share/classes/java/io/RandomAccessFile.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/io/RandomAccessFile.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -26,9 +26,9 @@
 package java.io;
 
 import java.nio.channels.FileChannel;
-import java.util.concurrent.atomic.AtomicBoolean;
-import jdk.internal.misc.JavaIORandomAccessFileAccess;
-import jdk.internal.misc.SharedSecrets;
+
+import jdk.internal.access.JavaIORandomAccessFileAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.nio.ch.FileChannelImpl;
 
 
--- a/src/java.base/share/classes/java/lang/Runtime.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/Runtime.java	Thu Nov 08 19:15:42 2018 -0500
@@ -27,16 +27,14 @@
 
 import java.io.*;
 import java.math.BigInteger;
-import java.util.ArrayList;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import java.util.StringTokenizer;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 
--- a/src/java.base/share/classes/java/lang/StackFrameInfo.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/StackFrameInfo.java	Thu Nov 08 19:15:42 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,10 +24,9 @@
  */
 package java.lang;
 
-import jdk.internal.misc.JavaLangInvokeAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangInvokeAccess;
+import jdk.internal.access.SharedSecrets;
 
-import static java.lang.StackWalker.Option.*;
 import java.lang.StackWalker.StackFrame;
 import java.lang.invoke.MethodType;
 
--- a/src/java.base/share/classes/java/lang/System.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/System.java	Thu Nov 08 19:15:42 2018 -0500
@@ -66,8 +66,8 @@
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 import jdk.internal.HotSpotIntrinsicCandidate;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.VM;
 import jdk.internal.logger.LoggerFinderLoader;
 import jdk.internal.logger.LazyLoggers;
--- a/src/java.base/share/classes/java/lang/Thread.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/Thread.java	Thu Nov 08 19:15:42 2018 -0500
@@ -230,7 +230,7 @@
     private volatile Interruptible blocker;
     private final Object blockerLock = new Object();
 
-    /* Set the blocker field; invoked via jdk.internal.misc.SharedSecrets
+    /* Set the blocker field; invoked via jdk.internal.access.SharedSecrets
      * from java.nio code
      */
     static void blockedOn(Interruptible b) {
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,8 +25,8 @@
 
 package java.lang.invoke;
 
-import jdk.internal.misc.JavaLangInvokeAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangInvokeAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.org.objectweb.asm.AnnotationVisitor;
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,7 +25,7 @@
 
 package java.lang.invoke;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.module.IllegalAccessLogger;
 import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.reflect.CallerSensitive;
--- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, 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
@@ -2603,8 +2603,8 @@
          * Setup the shared secret to allow code in other packages access
          * private package methods in java.lang.module.
          */
-        jdk.internal.misc.SharedSecrets
-            .setJavaLangModuleAccess(new jdk.internal.misc.JavaLangModuleAccess() {
+        jdk.internal.access.SharedSecrets
+            .setJavaLangModuleAccess(new jdk.internal.access.JavaLangModuleAccess() {
                 @Override
                 public Builder newModuleBuilder(String mn,
                                                 boolean strict,
--- a/src/java.base/share/classes/java/lang/ref/Finalizer.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/ref/Finalizer.java	Thu Nov 08 19:15:42 2018 -0500
@@ -27,8 +27,8 @@
 
 import java.security.PrivilegedAction;
 import java.security.AccessController;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.VM;
 
 final class Finalizer extends FinalReference<Object> { /* Package-private; must be in
--- a/src/java.base/share/classes/java/lang/ref/Reference.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/ref/Reference.java	Thu Nov 08 19:15:42 2018 -0500
@@ -27,8 +27,8 @@
 
 import jdk.internal.vm.annotation.ForceInline;
 import jdk.internal.HotSpotIntrinsicCandidate;
-import jdk.internal.misc.JavaLangRefAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangRefAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.ref.Cleaner;
 
 /**
--- a/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -74,7 +74,7 @@
  * exactly one annotation whose value element contains <i>A</i> and whose
  * type is the containing annotation type of <i>A</i> 's type.
  *
- * <li>An annotation <i>A</i> is present on an element <i>E</i> if either:
+ * <li>An annotation <i>A</i> is <em>present</em> on an element <i>E</i> if either:
  *
  * <ul>
  *
@@ -145,8 +145,8 @@
  * </tbody>
  * </table>
  *
- * <p>For an invocation of {@code get[Declared]AnnotationsByType( Class <
- * T >)}, the order of annotations which are directly or indirectly
+ * <p>For an invocation of {@code get[Declared]AnnotationsByType(Class <T>)},
+ * the order of annotations which are directly or indirectly
  * present on an element <i>E</i> is computed as if indirectly present
  * annotations on <i>E</i> are directly present on <i>E</i> in place
  * of their container annotation, in the order in which they appear in
--- a/src/java.base/share/classes/java/lang/reflect/Constructor.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/reflect/Constructor.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -25,7 +25,7 @@
 
 package java.lang.reflect;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.ConstructorAccessor;
 import jdk.internal.reflect.Reflection;
--- a/src/java.base/share/classes/java/lang/reflect/Executable.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/reflect/Executable.java	Thu Nov 08 19:15:42 2018 -0500
@@ -33,7 +33,7 @@
 import java.util.stream.Stream;
 import java.util.stream.Collectors;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import sun.reflect.annotation.AnnotationParser;
 import sun.reflect.annotation.AnnotationSupport;
 import sun.reflect.annotation.TypeAnnotationParser;
--- a/src/java.base/share/classes/java/lang/reflect/Field.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/reflect/Field.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -25,7 +25,7 @@
 
 package java.lang.reflect;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.FieldAccessor;
 import jdk.internal.reflect.Reflection;
--- a/src/java.base/share/classes/java/lang/reflect/Method.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/reflect/Method.java	Thu Nov 08 19:15:42 2018 -0500
@@ -26,7 +26,7 @@
 package java.lang.reflect;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.MethodAccessor;
 import jdk.internal.reflect.Reflection;
--- a/src/java.base/share/classes/java/lang/reflect/Proxy.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/reflect/Proxy.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -40,9 +40,9 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.loader.BootLoader;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
 import jdk.internal.module.Modules;
 import jdk.internal.misc.VM;
 import jdk.internal.reflect.CallerSensitive;
--- a/src/java.base/share/classes/java/lang/reflect/UndeclaredThrowableException.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/lang/reflect/UndeclaredThrowableException.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -29,7 +29,7 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamField;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Thrown by a method invocation on a proxy instance if its invocation
--- a/src/java.base/share/classes/java/net/HttpCookie.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/net/HttpCookie.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, 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
@@ -32,11 +32,10 @@
 import java.util.TimeZone;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
-import java.util.Date;
 import java.util.Locale;
 import java.util.Objects;
-import jdk.internal.misc.JavaNetHttpCookieAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetHttpCookieAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * An HttpCookie object represents an HTTP cookie, which carries state
--- a/src/java.base/share/classes/java/net/InetAddress.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/net/InetAddress.java	Thu Nov 08 19:15:42 2018 -0500
@@ -46,8 +46,8 @@
 import java.util.concurrent.ConcurrentSkipListSet;
 import java.util.concurrent.atomic.AtomicLong;
 
-import jdk.internal.misc.JavaNetInetAddressAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetInetAddressAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.security.action.*;
 import sun.net.InetAddressCachePolicy;
 import sun.net.util.IPAddressUtil;
--- a/src/java.base/share/classes/java/net/ServerSocket.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/net/ServerSocket.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,8 +25,8 @@
 
 package java.net;
 
-import jdk.internal.misc.JavaNetSocketAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetSocketAccess;
+import jdk.internal.access.SharedSecrets;
 
 import java.io.FileDescriptor;
 import java.io.IOException;
@@ -993,8 +993,8 @@
         return getImpl().getOption(name);
     }
 
-    private static Set<SocketOption<?>> options;
-    private static boolean optionsSet = false;
+    // cache of unmodifiable impl options. Possibly set racy, in impl we trust
+    private volatile Set<SocketOption<?>> options;
 
     /**
      * Returns a set of the socket options supported by this server socket.
@@ -1008,19 +1008,17 @@
      * @since 9
      */
     public Set<SocketOption<?>> supportedOptions() {
-        synchronized (ServerSocket.class) {
-            if (optionsSet) {
-                return options;
-            }
-            try {
-                SocketImpl impl = getImpl();
-                options = Collections.unmodifiableSet(impl.supportedOptions());
-            } catch (IOException e) {
-                options = Collections.emptySet();
-            }
-            optionsSet = true;
-            return options;
+        Set<SocketOption<?>> so = options;
+        if (so != null)
+            return so;
+
+        try {
+            SocketImpl impl = getImpl();
+            options = Collections.unmodifiableSet(impl.supportedOptions());
+        } catch (IOException e) {
+            options = Collections.emptySet();
         }
+        return options;
     }
 
     static {
--- a/src/java.base/share/classes/java/net/Socket.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/net/Socket.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -1789,8 +1789,8 @@
         return getImpl().getOption(name);
     }
 
-    private static Set<SocketOption<?>> options;
-    private static boolean optionsSet = false;
+    // cache of unmodifiable impl options. Possibly set racy, in impl we trust
+    private volatile Set<SocketOption<?>> options;
 
     /**
      * Returns a set of the socket options supported by this socket.
@@ -1804,18 +1804,16 @@
      * @since 9
      */
     public Set<SocketOption<?>> supportedOptions() {
-        synchronized (Socket.class) {
-            if (optionsSet) {
-                return options;
-            }
-            try {
-                SocketImpl impl = getImpl();
-                options = Collections.unmodifiableSet(impl.supportedOptions());
-            } catch (IOException e) {
-                options = Collections.emptySet();
-            }
-            optionsSet = true;
-            return options;
+        Set<SocketOption<?>> so = options;
+        if (so != null)
+            return so;
+
+        try {
+            SocketImpl impl = getImpl();
+            options = Collections.unmodifiableSet(impl.supportedOptions());
+        } catch (IOException e) {
+            options = Collections.emptySet();
         }
+        return options;
     }
 }
--- a/src/java.base/share/classes/java/net/SocketCleanable.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/net/SocketCleanable.java	Thu Nov 08 19:15:42 2018 -0500
@@ -24,8 +24,8 @@
  */
 package java.net;
 
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.ref.CleanerFactory;
 import jdk.internal.ref.PhantomCleanable;
 
--- a/src/java.base/share/classes/java/net/URI.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/net/URI.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, 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
@@ -37,8 +37,8 @@
 import java.nio.charset.CodingErrorAction;
 import java.nio.charset.CharacterCodingException;
 import java.text.Normalizer;
-import jdk.internal.misc.JavaNetUriAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetUriAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.nio.cs.ThreadLocalCoders;
 
 import java.lang.Character;             // for javadoc
--- a/src/java.base/share/classes/java/net/URL.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/net/URL.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -41,8 +41,8 @@
 import java.util.ServiceConfigurationError;
 import java.util.ServiceLoader;
 
-import jdk.internal.misc.JavaNetURLAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetURLAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.security.util.SecurityConstants;
 import sun.security.action.GetPropertyAction;
 
--- a/src/java.base/share/classes/java/net/URLClassLoader.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/net/URLClassLoader.java	Thu Nov 08 19:15:42 2018 -0500
@@ -52,8 +52,8 @@
 
 import jdk.internal.loader.Resource;
 import jdk.internal.loader.URLClassPath;
-import jdk.internal.misc.JavaNetURLClassLoaderAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetURLClassLoaderAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.perf.PerfCounter;
 import sun.net.www.ParseUtil;
 import sun.security.util.SecurityConstants;
--- a/src/java.base/share/classes/java/nio/Bits.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/nio/Bits.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, 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
@@ -25,9 +25,9 @@
 
 package java.nio;
 
-import jdk.internal.misc.JavaLangRefAccess;
-import jdk.internal.misc.JavaNioAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangRefAccess;
+import jdk.internal.access.JavaNioAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.Unsafe;
 import jdk.internal.misc.VM;
 
--- a/src/java.base/share/classes/java/nio/Buffer.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/nio/Buffer.java	Thu Nov 08 19:15:42 2018 -0500
@@ -26,8 +26,8 @@
 package java.nio;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
-import jdk.internal.misc.JavaNioAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNioAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.Unsafe;
 
 import java.util.Spliterator;
--- a/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java	Thu Nov 08 19:15:42 2018 -0500
@@ -30,7 +30,7 @@
 
 import java.io.IOException;
 import java.nio.channels.*;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import sun.nio.ch.Interruptible;
 
 
@@ -203,7 +203,7 @@
     }
 
 
-    // -- jdk.internal.misc.SharedSecrets --
+    // -- jdk.internal.access.SharedSecrets --
     static void blockedOn(Interruptible intr) {         // package-private
         SharedSecrets.getJavaLangAccess().blockedOn(intr);
     }
--- a/src/java.base/share/classes/java/nio/file/Files.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/nio/file/Files.java	Thu Nov 08 19:15:42 2018 -0500
@@ -91,6 +91,9 @@
  */
 
 public final class Files {
+    // buffer size used for reading and writing
+    private static final int BUFFER_SIZE = 8192;
+
     private Files() { }
 
     /**
@@ -1531,6 +1534,80 @@
     }
 
     /**
+     * Finds and returns the position of the first mismatched byte in the content
+     * of two files, or {@code -1L} if there is no mismatch. The position will be
+     * in the inclusive range of {@code 0L} up to the size (in bytes) of the
+     * smaller file.
+     *
+     * <p> Two files are considered to match if they satisfy one of the following
+     * conditions:
+     * <ul>
+     * <li> The two paths locate the {@linkplain #isSameFile(Path, Path) same file},
+     *      even if two {@linkplain Path#equals(Object) equal} paths locate a file
+     *      does not exist, or </li>
+     * <li> The two files are the same size, and every byte in the first file
+     *      is identical to the corresponding byte in the second file. </li>
+     * </ul>
+     *
+     * <p> Otherwise there is a mismatch between the two files and the value
+     * returned by this method is:
+     * <ul>
+     * <li> The position of the first mismatched byte, or </li>
+     * <li> The size of the smaller file (in bytes) when the files are different
+     *      sizes and every byte of the smaller file is identical to the
+     *      corresponding byte of the larger file. </li>
+     * </ul>
+     *
+     * <p> This method may not be atomic with respect to other file system
+     * operations. This method is always <i>reflexive</i> (for {@code Path f},
+     * {@code mismatch(f,f)} returns {@code -1L}). If the file system and files
+     * remain static, then this method is <i>symmetric</i> (for two {@code Paths f}
+     * and {@code g}, {@code mismatch(f,g)} will return the same value as
+     * {@code mismatch(g,f)}).
+     *
+     * @param   path
+     *          the path to the first file
+     * @param   path2
+     *          the path to the second file
+     *
+     * @return  the position of the first mismatch or {@code -1L} if no mismatch
+     *
+     * @throws  IOException
+     *          if an I/O error occurs
+     * @throws  SecurityException
+     *          In the case of the default provider, and a security manager is
+     *          installed, the {@link SecurityManager#checkRead(String) checkRead}
+     *          method is invoked to check read access to both files.
+     *
+     * @since 12
+     */
+    public static long mismatch(Path path, Path path2) throws IOException {
+        if (isSameFile(path, path2)) {
+            return -1;
+        }
+        byte[] buffer1 = new byte[BUFFER_SIZE];
+        byte[] buffer2 = new byte[BUFFER_SIZE];
+        try (InputStream in1 = Files.newInputStream(path);
+             InputStream in2 = Files.newInputStream(path2);) {
+            long totalRead = 0;
+            while (true) {
+                int nRead1 = in1.readNBytes(buffer1, 0, BUFFER_SIZE);
+                int nRead2 = in2.readNBytes(buffer2, 0, BUFFER_SIZE);
+
+                int i = Arrays.mismatch(buffer1, 0, nRead1, buffer2, 0, nRead2);
+                if (i > -1) {
+                    return totalRead + i;
+                }
+                if (nRead1 < BUFFER_SIZE) {
+                    // we've reached the end of the files, but found no mismatch
+                    return -1;
+                }
+                totalRead += nRead1;
+            }
+        }
+    }
+
+    /**
      * Tells whether or not a file is considered <em>hidden</em>. The exact
      * definition of hidden is platform or provider dependent. On UNIX for
      * example a file is considered to be hidden if its name begins with a
@@ -2802,8 +2879,6 @@
 
     // -- Utility methods for simple usages --
 
-    // buffer size used for reading and writing
-    private static final int BUFFER_SIZE = 8192;
 
     /**
      * Opens a file for reading, returning a {@code BufferedReader} that may be
@@ -3128,8 +3203,8 @@
      */
     private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
 
-    private static final jdk.internal.misc.JavaLangAccess JLA =
-            jdk.internal.misc.SharedSecrets.getJavaLangAccess();
+    private static final jdk.internal.access.JavaLangAccess JLA =
+            jdk.internal.access.SharedSecrets.getJavaLangAccess();
 
     /**
      * Reads all the bytes from an input stream. Uses {@code initialSize} as a hint
--- a/src/java.base/share/classes/java/security/AccessController.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/security/AccessController.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -25,9 +25,18 @@
 
 package java.security;
 
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.ref.Reference;
 import sun.security.util.Debug;
+import sun.security.util.SecurityConstants;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
+import jdk.internal.vm.annotation.DontInline;
+import jdk.internal.vm.annotation.ForceInline;
+import jdk.internal.vm.annotation.ReservedStackAccess;
 
 /**
  * <p> The AccessController class is used for access control operations
@@ -296,7 +305,10 @@
      */
 
     @CallerSensitive
-    public static native <T> T doPrivileged(PrivilegedAction<T> action);
+    public static <T> T doPrivileged(PrivilegedAction<T> action)
+    {
+        return executePrivileged(action, null, Reflection.getCallerClass());
+    }
 
     /**
      * Performs the specified {@code PrivilegedAction} with privileges
@@ -369,8 +381,13 @@
      * @see #doPrivileged(PrivilegedExceptionAction,AccessControlContext)
      */
     @CallerSensitive
-    public static native <T> T doPrivileged(PrivilegedAction<T> action,
-                                            AccessControlContext context);
+    public static <T> T doPrivileged(PrivilegedAction<T> action,
+                                     AccessControlContext context)
+    {
+        Class<?> caller = Reflection.getCallerClass();
+        context = checkContext(context, caller);
+        return executePrivileged(action, context, caller);
+    }
 
 
     /**
@@ -425,7 +442,7 @@
         if (perms == null) {
             throw new NullPointerException("null permissions parameter");
         }
-        Class <?> caller = Reflection.getCallerClass();
+        Class<?> caller = Reflection.getCallerClass();
         return AccessController.doPrivileged(action, createWrapper(null,
             caller, parent, context, perms));
     }
@@ -491,7 +508,7 @@
         if (perms == null) {
             throw new NullPointerException("null permissions parameter");
         }
-        Class <?> caller = Reflection.getCallerClass();
+        Class<?> caller = Reflection.getCallerClass();
         return AccessController.doPrivileged(action, createWrapper(dc, caller,
             parent, context, perms));
     }
@@ -524,10 +541,20 @@
      * @see java.security.DomainCombiner
      */
     @CallerSensitive
-    public static native <T> T
+    public static <T> T
         doPrivileged(PrivilegedExceptionAction<T> action)
-        throws PrivilegedActionException;
-
+        throws PrivilegedActionException
+    {
+        AccessControlContext context = null;
+        Class<?> caller = Reflection.getCallerClass();
+        try {
+            return executePrivileged(action, context, caller);
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw wrapException(e);
+        }
+    }
 
     /**
      * Performs the specified {@code PrivilegedExceptionAction} with
@@ -587,11 +614,11 @@
                       AccessControlContext parent, AccessControlContext context,
                       Permission[] perms)
     {
-        ProtectionDomain callerPD = getCallerPD(caller);
+        ProtectionDomain callerPD = getProtectionDomain(caller);
         // check if caller is authorized to create context
-        if (context != null && !context.isAuthorized() &&
-            System.getSecurityManager() != null &&
-            !callerPD.impliesCreateAccessControlContext())
+        if (System.getSecurityManager() != null &&
+            context != null && !context.isAuthorized() &&
+            !callerPD.implies(SecurityConstants.CREATE_ACC_PERMISSION))
         {
             return getInnocuousAcc();
         } else {
@@ -611,16 +638,7 @@
         return AccHolder.innocuousAcc;
     }
 
-    private static ProtectionDomain getCallerPD(final Class <?> caller) {
-        ProtectionDomain callerPd = doPrivileged
-            (new PrivilegedAction<>() {
-            public ProtectionDomain run() {
-                return caller.getProtectionDomain();
-            }
-        });
-
-        return callerPd;
-    }
+    private static native ProtectionDomain getProtectionDomain(final Class<?> caller);
 
     /**
      * Performs the specified {@code PrivilegedExceptionAction} with
@@ -659,11 +677,125 @@
      * @see #doPrivileged(PrivilegedAction,AccessControlContext)
      */
     @CallerSensitive
-    public static native <T> T
+    public static <T> T
         doPrivileged(PrivilegedExceptionAction<T> action,
                      AccessControlContext context)
-        throws PrivilegedActionException;
+        throws PrivilegedActionException
+    {
+        Class<?> caller = Reflection.getCallerClass();
+        context = checkContext(context, caller);
+        try {
+            return executePrivileged(action, context, caller);
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw wrapException(e);
+        }
+    }
+
+    private static AccessControlContext checkContext(AccessControlContext context,
+        Class<?> caller)
+    {
+        // check if caller is authorized to create context
+        if (System.getSecurityManager() != null &&
+            context != null && !context.isAuthorized() &&
+            context != getInnocuousAcc())
+        {
+            ProtectionDomain callerPD = getProtectionDomain(caller);
+            if (callerPD != null && !callerPD.implies(SecurityConstants.CREATE_ACC_PERMISSION)) {
+                return getInnocuousAcc();
+            }
+        }
+        return context;
+    }
+
+    /**
+     * Sanity check that the caller context is indeed privileged.
+     *
+     * Used by executePrivileged to make sure the frame is properly
+     * recognized by the VM.
+     */
+    private static boolean isPrivileged() {
+        AccessControlContext ctx = getStackAccessControlContext();
+        return ctx == null || ctx.isPrivileged();
+    }
+
+    /**
+     * Execute the action as privileged.
+     *
+     * The VM recognizes this method as special, so any changes to the
+     * name or signature require corresponding changes in
+     * getStackAccessControlContext().
+     */
+    @Hidden
+    @ForceInline
+    private static <T> T
+        executePrivileged(PrivilegedAction<T> action,
+                          AccessControlContext context,
+                          Class<?> caller)
+    {
+        assert isPrivileged(); // sanity check invariant
+        T result = action.run();
+        assert isPrivileged(); // sanity check invariant
 
+        // Keep these alive across the run() call so they can be
+        // retrieved by getStackAccessControlContext().
+        Reference.reachabilityFence(context);
+        Reference.reachabilityFence(caller);
+        Reference.reachabilityFence(action);
+        return result;
+    }
+
+    /**
+     * Execute the action as privileged.
+     *
+     * The VM recognizes this method as special, so any changes to the
+     * name or signature require corresponding changes in
+     * getStackAccessControlContext().
+     */
+    @Hidden
+    @ForceInline
+    private static <T> T
+        executePrivileged(PrivilegedExceptionAction<T> action,
+                          AccessControlContext context,
+                          Class<?> caller)
+        throws Exception
+    {
+        assert isPrivileged(); // sanity check invariant
+        T result = action.run();
+        assert isPrivileged(); // sanity check invariant
+
+        // Keep these alive across the run() call so they can be
+        // retrieved by getStackAccessControlContext().
+        Reference.reachabilityFence(context);
+        Reference.reachabilityFence(caller);
+        Reference.reachabilityFence(action);
+        return result;
+    }
+
+
+    /**
+     * Internal marker for hidden implementation frames.
+     */
+    /*non-public*/
+    @Target(ElementType.METHOD)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface Hidden {
+    }
+
+
+    /**
+     * Wrap an exception.  The annotations are used in a best effort to
+     * avoid StackOverflowError in the caller.  Inlining the callees as
+     * well and tail-call elimination could also help here, but are not
+     * needed for correctness, only quality of implementation.
+     */
+    @Hidden
+    @ForceInline
+    @ReservedStackAccess
+    private static PrivilegedActionException wrapException(Exception e) {
+        return new PrivilegedActionException(e);
+    }
 
     /**
      * Performs the specified {@code PrivilegedExceptionAction} with
@@ -720,7 +852,7 @@
         if (perms == null) {
             throw new NullPointerException("null permissions parameter");
         }
-        Class <?> caller = Reflection.getCallerClass();
+        Class<?> caller = Reflection.getCallerClass();
         return AccessController.doPrivileged(action, createWrapper(null, caller, parent, context, perms));
     }
 
@@ -789,7 +921,7 @@
         if (perms == null) {
             throw new NullPointerException("null permissions parameter");
         }
-        Class <?> caller = Reflection.getCallerClass();
+        Class<?> caller = Reflection.getCallerClass();
         return AccessController.doPrivileged(action, createWrapper(dc, caller,
             parent, context, perms));
     }
--- a/src/java.base/share/classes/java/security/PrivilegedActionException.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/security/PrivilegedActionException.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -29,7 +29,7 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamField;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * This exception is thrown by
--- a/src/java.base/share/classes/java/security/ProtectionDomain.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/security/ProtectionDomain.java	Thu Nov 08 19:15:42 2018 -0500
@@ -32,8 +32,8 @@
 import java.util.Map;
 import java.util.Objects;
 import java.util.WeakHashMap;
-import jdk.internal.misc.JavaSecurityAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.security.action.GetPropertyAction;
 import sun.security.provider.PolicyFile;
 import sun.security.util.Debug;
@@ -394,11 +394,6 @@
         return false;
     }
 
-    // called by the VM -- do not remove
-    boolean impliesCreateAccessControlContext() {
-        return implies(SecurityConstants.CREATE_ACC_PERMISSION);
-    }
-
     /**
      * Convert a ProtectionDomain to a String.
      */
--- a/src/java.base/share/classes/java/security/Security.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/security/Security.java	Thu Nov 08 19:15:42 2018 -0500
@@ -30,7 +30,7 @@
 import java.io.*;
 import java.net.URL;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.util.StaticProperty;
 import sun.security.util.Debug;
 import sun.security.util.PropertyExpander;
--- a/src/java.base/share/classes/java/util/ArrayDeque.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/ArrayDeque.java	Thu Nov 08 19:15:42 2018 -0500
@@ -37,8 +37,8 @@
 import java.io.Serializable;
 import java.util.function.Consumer;
 import java.util.function.Predicate;
-import java.util.function.UnaryOperator;
-import jdk.internal.misc.SharedSecrets;
+
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Resizable-array implementation of the {@link Deque} interface.  Array
--- a/src/java.base/share/classes/java/util/ArrayList.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/ArrayList.java	Thu Nov 08 19:15:42 2018 -0500
@@ -28,7 +28,7 @@
 import java.util.function.Consumer;
 import java.util.function.Predicate;
 import java.util.function.UnaryOperator;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Resizable-array implementation of the {@code List} interface.  Implements
--- a/src/java.base/share/classes/java/util/EnumMap.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/EnumMap.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,7 +25,7 @@
 
 package java.util;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * A specialized {@link Map} implementation for use with enum type keys.  All
--- a/src/java.base/share/classes/java/util/EnumSet.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/EnumSet.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,7 +25,7 @@
 
 package java.util;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * A specialized {@link Set} implementation for use with enum types.  All of
--- a/src/java.base/share/classes/java/util/HashMap.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/HashMap.java	Thu Nov 08 19:15:42 2018 -0500
@@ -34,7 +34,7 @@
 import java.util.function.BiFunction;
 import java.util.function.Consumer;
 import java.util.function.Function;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Hash table based implementation of the {@code Map} interface.  This
--- a/src/java.base/share/classes/java/util/HashSet.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/HashSet.java	Thu Nov 08 19:15:42 2018 -0500
@@ -26,7 +26,7 @@
 package java.util;
 
 import java.io.InvalidObjectException;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * This class implements the {@code Set} interface, backed by a hash table
--- a/src/java.base/share/classes/java/util/Hashtable.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/Hashtable.java	Thu Nov 08 19:15:42 2018 -0500
@@ -29,7 +29,7 @@
 import java.util.function.BiConsumer;
 import java.util.function.Function;
 import java.util.function.BiFunction;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * This class implements a hash table, which maps keys to values. Any
--- a/src/java.base/share/classes/java/util/IdentityHashMap.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/IdentityHashMap.java	Thu Nov 08 19:15:42 2018 -0500
@@ -29,7 +29,7 @@
 import java.util.function.BiConsumer;
 import java.util.function.BiFunction;
 import java.util.function.Consumer;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * This class implements the {@code Map} interface with a hash table, using
--- a/src/java.base/share/classes/java/util/ImmutableCollections.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/ImmutableCollections.java	Thu Nov 08 19:15:42 2018 -0500
@@ -35,7 +35,7 @@
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.function.UnaryOperator;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.VM;
 import jdk.internal.vm.annotation.Stable;
 
--- a/src/java.base/share/classes/java/util/PriorityQueue.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/PriorityQueue.java	Thu Nov 08 19:15:42 2018 -0500
@@ -27,7 +27,7 @@
 
 import java.util.function.Consumer;
 import java.util.function.Predicate;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * An unbounded priority {@linkplain Queue queue} based on a priority heap.
--- a/src/java.base/share/classes/java/util/Properties.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/Properties.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -46,7 +46,7 @@
 import java.util.function.BiFunction;
 import java.util.function.Function;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.Unsafe;
 import jdk.internal.util.xml.PropertiesDefaultHandler;
 
--- a/src/java.base/share/classes/java/util/ResourceBundle.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/ResourceBundle.java	Thu Nov 08 19:15:42 2018 -0500
@@ -66,8 +66,8 @@
 import java.util.stream.Stream;
 
 import jdk.internal.loader.BootLoader;
-import jdk.internal.misc.JavaUtilResourceBundleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaUtilResourceBundleAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 import sun.security.action.GetPropertyAction;
--- a/src/java.base/share/classes/java/util/ServiceLoader.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/ServiceLoader.java	Thu Nov 08 19:15:42 2018 -0500
@@ -47,8 +47,8 @@
 
 import jdk.internal.loader.BootLoader;
 import jdk.internal.loader.ClassLoaders;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.VM;
 import jdk.internal.module.ServicesCatalog;
 import jdk.internal.module.ServicesCatalog.ServiceProvider;
--- a/src/java.base/share/classes/java/util/UUID.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/UUID.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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,8 +27,8 @@
 
 import java.security.*;
 
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * A class that represents an immutable universally unique identifier (UUID).
--- a/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java	Thu Nov 08 19:15:42 2018 -0500
@@ -51,7 +51,7 @@
 import java.util.function.Consumer;
 import java.util.function.Predicate;
 import java.util.function.UnaryOperator;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * A thread-safe variant of {@link java.util.ArrayList} in which all mutative
--- a/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Thu Nov 08 19:15:42 2018 -0500
@@ -52,7 +52,7 @@
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.function.Consumer;
 import java.util.function.Predicate;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * An unbounded {@linkplain BlockingQueue blocking queue} that uses
--- a/src/java.base/share/classes/java/util/jar/JarFile.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/jar/JarFile.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,8 +25,8 @@
 
 package java.util.jar;
 
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaUtilZipFileAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaUtilZipFileAccess;
 import sun.security.action.GetPropertyAction;
 import sun.security.util.ManifestEntryVerifier;
 import sun.security.util.SignatureFileVerifier;
@@ -172,7 +172,7 @@
         // Set up JavaUtilJarAccess in SharedSecrets
         SharedSecrets.setJavaUtilJarAccess(new JavaUtilJarAccessImpl());
         // Get JavaUtilZipFileAccess from SharedSecrets
-        JUZFA = jdk.internal.misc.SharedSecrets.getJavaUtilZipFileAccess();
+        JUZFA = SharedSecrets.getJavaUtilZipFileAccess();
         // multi-release jar file versions >= 9
         BASE_VERSION = Runtime.Version.parse(Integer.toString(8));
         BASE_VERSION_FEATURE = BASE_VERSION.feature();
--- a/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -30,7 +30,7 @@
 import java.security.CodeSource;
 import java.util.Enumeration;
 import java.util.List;
-import jdk.internal.misc.JavaUtilJarAccess;
+import jdk.internal.access.JavaUtilJarAccess;
 
 class JavaUtilJarAccessImpl implements JavaUtilJarAccess {
     public boolean jarFileHasClassPathAttribute(JarFile jar) throws IOException {
--- a/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -25,8 +25,8 @@
 
 package java.util.spi;
 
-import jdk.internal.misc.JavaUtilResourceBundleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaUtilResourceBundleAccess;
+import jdk.internal.access.SharedSecrets;
 
 import java.io.IOException;
 import java.io.InputStream;
--- a/src/java.base/share/classes/java/util/zip/ZipCoder.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/zip/ZipCoder.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, 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
@@ -41,8 +41,8 @@
 
 class ZipCoder {
 
-    private static final jdk.internal.misc.JavaLangAccess JLA =
-        jdk.internal.misc.SharedSecrets.getJavaLangAccess();
+    private static final jdk.internal.access.JavaLangAccess JLA =
+        jdk.internal.access.SharedSecrets.getJavaLangAccess();
 
     static final class UTF8 extends ZipCoder {
 
--- a/src/java.base/share/classes/java/util/zip/ZipFile.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/java/util/zip/ZipFile.java	Thu Nov 08 19:15:42 2018 -0500
@@ -58,9 +58,9 @@
 import java.util.jar.JarEntry;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.JavaUtilZipFileAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.JavaUtilZipFileAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.VM;
 import jdk.internal.perf.PerfCounter;
 import jdk.internal.ref.CleanerFactory;
@@ -1071,7 +1071,7 @@
                 }
              }
         );
-        JLA = jdk.internal.misc.SharedSecrets.getJavaLangAccess();
+        JLA = SharedSecrets.getJavaLangAccess();
         isWindows = VM.getSavedProperty("os.name").contains("Windows");
     }
 
--- a/src/java.base/share/classes/javax/crypto/SealedObject.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/javax/crypto/SealedObject.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,7 +25,7 @@
 
 package javax.crypto;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 import java.io.*;
 import java.security.AlgorithmParameters;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaAWTAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011, 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.
+ *
+ * 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 jdk.internal.access;
+
+public interface JavaAWTAccess {
+
+    // Returns the AppContext used for applet logging isolation, or null if
+    // no isolation is required.
+    // If there's no applet, or if the caller is a stand alone application,
+    // or running in the main app context, returns null.
+    // Otherwise, returns the AppContext of the calling applet.
+    public Object getAppletContext();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaAWTFontAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, 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.
+ *
+ * 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.
+ */
+
+/**
+ * SharedSecrets interface used for the access from java.text.Bidi
+ */
+
+package jdk.internal.access;
+
+public interface JavaAWTFontAccess {
+
+    // java.awt.font.TextAttribute constants
+    public Object getTextAttributeConstant(String name);
+
+    // java.awt.font.NumericShaper
+    public void shape(Object shaper, char[] text, int start, int count);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaBeansAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+public interface JavaBeansAccess {
+    /**
+     * Returns the getter method for a property of the given name
+     * @param clazz The JavaBeans class
+     * @param property The property name
+     * @return The resolved property getter method
+     * @throws Exception
+     */
+    Method getReadMethod(Class<?> clazz, String property) throws Exception;
+
+    /**
+     * Return the <b>value</b> attribute of the associated
+     * <code>@ConstructorProperties</code> annotation if that is present.
+     * @param ctr The constructor to extract the annotation value from
+     * @return The {@code value} attribute of the <code>@ConstructorProperties</code>
+     *         annotation or {@code null} if the constructor is not annotated by
+     *         this annotation or the annotation is not accessible.
+     */
+    String[] getConstructorPropertiesValue(Constructor<?> ctr);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaIOAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,34 @@
+/*
+ * 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
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.Console;
+import java.nio.charset.Charset;
+
+public interface JavaIOAccess {
+    public Console console();
+    public Charset charset();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaIOFileDescriptorAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007, 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.FileDescriptor;
+import java.io.IOException;
+
+import jdk.internal.ref.PhantomCleanable;
+
+/*
+ * @author Chris Hegarty
+ */
+
+public interface JavaIOFileDescriptorAccess {
+    public void set(FileDescriptor fdo, int fd);
+    public int get(FileDescriptor fdo);
+    public void setAppend(FileDescriptor fdo, boolean append);
+    public boolean getAppend(FileDescriptor fdo);
+    public void close(FileDescriptor fdo) throws IOException;
+    public void registerCleanup(FileDescriptor fdo);
+    public void registerCleanup(FileDescriptor fdo, PhantomCleanable<FileDescriptor> cleanable);
+    public void unregisterCleanup(FileDescriptor fdo);
+
+    // Only valid on Windows
+    public void setHandle(FileDescriptor fdo, long handle);
+    public long getHandle(FileDescriptor fdo);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaIOFilePermissionAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.FilePermission;
+
+public interface JavaIOFilePermissionAccess {
+
+    /**
+     * Returns a new FilePermission plus an alternative path.
+     *
+     * @param input the input
+     * @return the new FilePermission plus the alt path (as npath2)
+     *         or the input itself if no alt path is available.
+     */
+    FilePermission newPermPlusAltPath(FilePermission input);
+
+    /**
+     * Returns a new FilePermission using an alternative path.
+     *
+     * @param input the input
+     * @return the new FilePermission using the alt path (as npath)
+     *         or null if no alt path is available
+     */
+    FilePermission newPermUsingAltPath(FilePermission input);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaIORandomAccessFileAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+
+public interface JavaIORandomAccessFileAccess {
+    public RandomAccessFile openAndDelete(File file, String mode)
+        throws IOException;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,314 @@
+/*
+ * Copyright (c) 2003, 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.lang.annotation.Annotation;
+import java.lang.module.ModuleDescriptor;
+import java.lang.reflect.Executable;
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.Charset;
+import java.security.AccessControlContext;
+import java.security.ProtectionDomain;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Stream;
+
+import jdk.internal.module.ServicesCatalog;
+import jdk.internal.reflect.ConstantPool;
+import sun.reflect.annotation.AnnotationType;
+import sun.nio.ch.Interruptible;
+
+public interface JavaLangAccess {
+
+    /**
+     * Returns the list of {@code Method} objects for the declared public
+     * methods of this class or interface that have the specified method name
+     * and parameter types.
+     */
+    List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
+
+    /**
+     * Return the constant pool for a class.
+     */
+    ConstantPool getConstantPool(Class<?> klass);
+
+    /**
+     * Compare-And-Set the AnnotationType instance corresponding to this class.
+     * (This method only applies to annotation types.)
+     */
+    boolean casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType);
+
+    /**
+     * Get the AnnotationType instance corresponding to this class.
+     * (This method only applies to annotation types.)
+     */
+    AnnotationType getAnnotationType(Class<?> klass);
+
+    /**
+     * Get the declared annotations for a given class, indexed by their types.
+     */
+    Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass);
+
+    /**
+     * Get the array of bytes that is the class-file representation
+     * of this Class' annotations.
+     */
+    byte[] getRawClassAnnotations(Class<?> klass);
+
+    /**
+     * Get the array of bytes that is the class-file representation
+     * of this Class' type annotations.
+     */
+    byte[] getRawClassTypeAnnotations(Class<?> klass);
+
+    /**
+     * Get the array of bytes that is the class-file representation
+     * of this Executable's type annotations.
+     */
+    byte[] getRawExecutableTypeAnnotations(Executable executable);
+
+    /**
+     * Returns the elements of an enum class or null if the
+     * Class object does not represent an enum type;
+     * the result is uncloned, cached, and shared by all callers.
+     */
+    <E extends Enum<E>> E[] getEnumConstantsShared(Class<E> klass);
+
+    /**
+     * Set current thread's blocker field.
+     */
+    void blockedOn(Interruptible b);
+
+    /**
+     * Registers a shutdown hook.
+     *
+     * It is expected that this method with registerShutdownInProgress=true
+     * is only used to register DeleteOnExitHook since the first file
+     * may be added to the delete on exit list by the application shutdown
+     * hooks.
+     *
+     * @param slot  the slot in the shutdown hook array, whose element
+     *              will be invoked in order during shutdown
+     * @param registerShutdownInProgress true to allow the hook
+     *        to be registered even if the shutdown is in progress.
+     * @param hook  the hook to be registered
+     *
+     * @throws IllegalStateException if shutdown is in progress and
+     *         the slot is not valid to register.
+     */
+    void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook);
+
+    /**
+     * Returns a new Thread with the given Runnable and an
+     * inherited AccessControlContext.
+     */
+    Thread newThreadWithAcc(Runnable target, AccessControlContext acc);
+
+    /**
+     * Invokes the finalize method of the given object.
+     */
+    void invokeFinalize(Object o) throws Throwable;
+
+    /**
+     * Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s)
+     * associated with the given class loader, creating it if it doesn't already exist.
+     */
+    ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl);
+
+    /**
+     * Defines a class with the given name to a class loader.
+     */
+    Class<?> defineClass(ClassLoader cl, String name, byte[] b, ProtectionDomain pd, String source);
+
+    /**
+     * Returns a class loaded by the bootstrap class loader.
+     */
+    Class<?> findBootstrapClassOrNull(ClassLoader cl, String name);
+
+    /**
+     * Define a Package of the given name and module by the given class loader.
+     */
+    Package definePackage(ClassLoader cl, String name, Module module);
+
+    /**
+     * Invokes Long.fastUUID
+     */
+    String fastUUID(long lsb, long msb);
+
+    /**
+     * Record the non-exported packages of the modules in the given layer
+     */
+    void addNonExportedPackages(ModuleLayer layer);
+
+    /**
+     * Invalidate package access cache
+     */
+    void invalidatePackageAccessCache();
+
+    /**
+     * Defines a new module to the Java virtual machine. The module
+     * is defined to the given class loader.
+     *
+     * The URI is for information purposes only, it can be {@code null}.
+     */
+    Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri);
+
+    /**
+     * Defines the unnamed module for the given class loader.
+     */
+    Module defineUnnamedModule(ClassLoader loader);
+
+    /**
+     * Updates the readability so that module m1 reads m2. The new read edge
+     * does not result in a strong reference to m2 (m2 can be GC'ed).
+     *
+     * This method is the same as m1.addReads(m2) but without a permission check.
+     */
+    void addReads(Module m1, Module m2);
+
+    /**
+     * Updates module m to read all unnamed modules.
+     */
+    void addReadsAllUnnamed(Module m);
+
+    /**
+     * Updates module m1 to export a package to module m2. The export does
+     * not result in a strong reference to m2 (m2 can be GC'ed).
+     */
+    void addExports(Module m1, String pkg, Module m2);
+
+    /**
+     * Updates a module m to export a package to all unnamed modules.
+     */
+    void addExportsToAllUnnamed(Module m, String pkg);
+
+    /**
+     * Updates module m1 to open a package to module m2. Opening the
+     * package does not result in a strong reference to m2 (m2 can be GC'ed).
+     */
+    void addOpens(Module m1, String pkg, Module m2);
+
+    /**
+     * Updates module m to open a package to all unnamed modules.
+     */
+    void addOpensToAllUnnamed(Module m, String pkg);
+
+    /**
+     * Updates module m to open all packages returned by the given iterator.
+     */
+    void addOpensToAllUnnamed(Module m, Iterator<String> packages);
+
+    /**
+     * Updates module m to use a service.
+     */
+    void addUses(Module m, Class<?> service);
+
+    /**
+     * Returns true if module m reflectively exports a package to other
+     */
+    boolean isReflectivelyExported(Module module, String pn, Module other);
+
+    /**
+     * Returns true if module m reflectively opens a package to other
+     */
+    boolean isReflectivelyOpened(Module module, String pn, Module other);
+
+    /**
+     * Returns the ServicesCatalog for the given Layer.
+     */
+    ServicesCatalog getServicesCatalog(ModuleLayer layer);
+
+    /**
+     * Returns an ordered stream of layers. The first element is the
+     * given layer, the remaining elements are its parents, in DFS order.
+     */
+    Stream<ModuleLayer> layers(ModuleLayer layer);
+
+    /**
+     * Returns a stream of the layers that have modules defined to the
+     * given class loader.
+     */
+    Stream<ModuleLayer> layers(ClassLoader loader);
+
+    /**
+     * Constructs a new {@code String} by decoding the specified subarray of
+     * bytes using the specified {@linkplain java.nio.charset.Charset charset}.
+     *
+     * The caller of this method shall relinquish and transfer the ownership of
+     * the byte array to the callee since the later will not make a copy.
+     *
+     * @param bytes the byte array source
+     * @param cs the Charset
+     * @return the newly created string
+     * @throws CharacterCodingException for malformed or unmappable bytes
+     */
+    String newStringNoRepl(byte[] bytes, Charset cs) throws CharacterCodingException;
+
+    /**
+     * Encode the given string into a sequence of bytes using the specified Charset.
+     *
+     * This method avoids copying the String's internal representation if the input
+     * is ASCII.
+     *
+     * This method throws CharacterCodingException instead of replacing when
+     * malformed input or unmappable characters are encountered.
+     *
+     * @param s the string to encode
+     * @param cs the charset
+     * @return the encoded bytes
+     * @throws CharacterCodingException for malformed input or unmappable characters
+     */
+    byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException;
+
+    /**
+     * Returns a new string by decoding from the given utf8 bytes array.
+     *
+     * @param off the index of the first byte to decode
+     * @param len the number of bytes to decode
+     * @return the newly created string
+     * @throws IllegalArgumentException for malformed or unmappable bytes.
+     */
+    String newStringUTF8NoRepl(byte[] bytes, int off, int len);
+
+    /**
+     * Encode the given string into a sequence of bytes using utf8.
+     *
+     * @param s the string to encode
+     * @return the encoded bytes in utf8
+     * @throws IllegalArgumentException for malformed surrogates
+     */
+    byte[] getBytesUTF8NoRepl(String s);
+
+    /**
+     * Set the cause of Throwable
+     * @param cause set t's cause to new value
+     */
+    void setCause(Throwable t, Throwable cause);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.lang.invoke.MethodType;
+import java.util.Map;
+
+public interface JavaLangInvokeAccess {
+    /**
+     * Create a new MemberName instance. Used by {@code StackFrameInfo}.
+     */
+    Object newMemberName();
+
+    /**
+     * Returns the name for the given MemberName. Used by {@code StackFrameInfo}.
+     */
+    String getName(Object mname);
+
+    /**
+     * Returns the {@code MethodType} for the given MemberName.
+     * Used by {@code StackFrameInfo}.
+     */
+    MethodType getMethodType(Object mname);
+
+    /**
+     * Returns the descriptor for the given MemberName.
+     * Used by {@code StackFrameInfo}.
+     */
+    String getMethodDescriptor(Object mname);
+
+    /**
+     * Returns {@code true} if the given MemberName is a native method.
+     * Used by {@code StackFrameInfo}.
+     */
+    boolean isNative(Object mname);
+
+    /**
+     * Returns the declaring class for the given MemberName.
+     * Used by {@code StackFrameInfo}.
+     */
+    Class<?> getDeclaringClass(Object mname);
+
+    /**
+     * Returns a {@code byte[]} representation of a class implementing
+     * DirectMethodHandle of each pairwise combination of {@code MethodType} and
+     * an {@code int} representing method type.  Used by
+     * GenerateJLIClassesPlugin to generate such a class during the jlink phase.
+     */
+    byte[] generateDirectMethodHandleHolderClassBytes(String className,
+            MethodType[] methodTypes, int[] types);
+
+    /**
+     * Returns a {@code byte[]} representation of a class implementing
+     * DelegatingMethodHandles of each {@code MethodType} kind in the
+     * {@code methodTypes} argument.  Used by GenerateJLIClassesPlugin to
+     * generate such a class during the jlink phase.
+     */
+    byte[] generateDelegatingMethodHandleHolderClassBytes(String className,
+            MethodType[] methodTypes);
+
+    /**
+     * Returns a {@code byte[]} representation of {@code BoundMethodHandle}
+     * species class implementing the signature defined by {@code types}. Used
+     * by GenerateJLIClassesPlugin to enable generation of such classes during
+     * the jlink phase. Should do some added validation since this string may be
+     * user provided.
+     */
+    Map.Entry<String, byte[]> generateConcreteBMHClassBytes(
+            final String types);
+
+    /**
+     * Returns a {@code byte[]} representation of a class implementing
+     * the zero and identity forms of all {@code LambdaForm.BasicType}s.
+     */
+    byte[] generateBasicFormsClassBytes(final String className);
+
+    /**
+     * Returns a {@code byte[]} representation of a class implementing
+     * the invoker forms for the set of supplied {@code invokerMethodTypes}
+     * and {@code callSiteMethodTypes}.
+     */
+    byte[] generateInvokersHolderClassBytes(String className,
+            MethodType[] invokerMethodTypes,
+            MethodType[] callSiteMethodTypes);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaLangModuleAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,140 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.PrintStream;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Exports;
+import java.lang.module.ModuleDescriptor.Opens;
+import java.lang.module.ModuleDescriptor.Requires;
+import java.lang.module.ModuleDescriptor.Provides;
+import java.lang.module.ModuleDescriptor.Version;
+import java.lang.module.ModuleFinder;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Provides access to non-public methods in java.lang.module.
+ */
+
+public interface JavaLangModuleAccess {
+
+    /**
+     * Creates a builder for building a module with the given module name.
+     *
+     * @param strict
+     *        Indicates whether module names are checked or not
+     */
+    ModuleDescriptor.Builder newModuleBuilder(String mn,
+                                              boolean strict,
+                                              Set<ModuleDescriptor.Modifier> ms);
+
+    /**
+     * Returns a snapshot of the packages in the module.
+     */
+    Set<String> packages(ModuleDescriptor.Builder builder);
+
+    /**
+     * Adds a dependence on a module with the given (possibly un-parsable)
+     * version string.
+     */
+    void requires(ModuleDescriptor.Builder builder,
+                  Set<Requires.Modifier> ms,
+                  String mn,
+                  String rawCompiledVersion);
+
+    /**
+     * Returns a {@code ModuleDescriptor.Requires} of the given modifiers
+     * and module name.
+     */
+    Requires newRequires(Set<Requires.Modifier> ms, String mn, Version v);
+
+    /**
+     * Returns an unqualified {@code ModuleDescriptor.Exports}
+     * of the given modifiers and package name source.
+     */
+    Exports newExports(Set<Exports.Modifier> ms,
+                       String source);
+
+    /**
+     * Returns a qualified {@code ModuleDescriptor.Exports}
+     * of the given modifiers, package name source and targets.
+     */
+    Exports newExports(Set<Exports.Modifier> ms,
+                       String source,
+                       Set<String> targets);
+
+    /**
+     * Returns an unqualified {@code ModuleDescriptor.Opens}
+     * of the given modifiers and package name source.
+     */
+    Opens newOpens(Set<Opens.Modifier> ms, String source);
+
+    /**
+     * Returns a qualified {@code ModuleDescriptor.Opens}
+     * of the given modifiers, package name source and targets.
+     */
+    Opens newOpens(Set<Opens.Modifier> ms, String source, Set<String> targets);
+
+    /**
+     * Returns a {@code ModuleDescriptor.Provides}
+     * of the given service name and providers.
+     */
+    Provides newProvides(String service, List<String> providers);
+
+    /**
+     * Returns a new {@code ModuleDescriptor} instance.
+     */
+    ModuleDescriptor newModuleDescriptor(String name,
+                                         Version version,
+                                         Set<ModuleDescriptor.Modifier> ms,
+                                         Set<Requires> requires,
+                                         Set<Exports> exports,
+                                         Set<Opens> opens,
+                                         Set<String> uses,
+                                         Set<Provides> provides,
+                                         Set<String> packages,
+                                         String mainClass,
+                                         int hashCode);
+
+    /**
+     * Resolves a collection of root modules, with service binding
+     * and the empty configuration as the parent.
+     */
+    Configuration resolveAndBind(ModuleFinder finder,
+                                 Collection<String> roots,
+                                 PrintStream traceOutput);
+
+    /**
+     * Creates a configuration from a pre-generated readability graph.
+     */
+    Configuration newConfiguration(ModuleFinder finder,
+                                   Map<String, Set<String>> graph);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaLangRefAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, 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.
+ *
+ * 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 jdk.internal.access;
+
+public interface JavaLangRefAccess {
+
+    /**
+     * Wait for progress in {@link java.lang.ref.Reference}
+     * processing.  If there aren't any pending {@link
+     * java.lang.ref.Reference}s, return immediately.
+     *
+     * @return {@code true} if there were any pending
+     * {@link java.lang.ref.Reference}s, {@code false} otherwise.
+     */
+    boolean waitForReferenceProcessing() throws InterruptedException;
+
+    /**
+     * Runs the finalization methods of any objects pending finalization.
+     *
+     * Invoked by Runtime.runFinalization()
+     */
+    void runFinalization();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaNetHttpCookieAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011, 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.net.HttpCookie;
+import java.util.List;
+
+public interface JavaNetHttpCookieAccess {
+    /*
+     * Constructs cookies from Set-Cookie or Set-Cookie2 header string,
+     * retaining the original header String in the cookie itself.
+     */
+    public List<HttpCookie> parse(String header);
+
+    /*
+     * Returns the original header this cookie was constructed from, if it was
+     * constructed by parsing a header, otherwise null.
+     */
+    public String header(HttpCookie cookie);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaNetInetAddressAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+public interface JavaNetInetAddressAccess {
+    /**
+     * Return the original application specified hostname of
+     * the given InetAddress object.
+     */
+    String getOriginalHostName(InetAddress ia);
+
+    /**
+     * Get the InetAddress of the provided host. If an InetAddress is provided
+     * then it will be the default address returned for all calls to either
+     * form of getByName. This is required to maintain consistency when
+     * caching addresses and hostnames.
+     */
+    InetAddress getByName(String hostName, InetAddress hostAddress)
+            throws UnknownHostException;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaNetSocketAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.net.ServerSocket;
+import java.net.SocketImpl;
+
+public interface JavaNetSocketAccess {
+    /**
+     * Creates a ServerSocket associated with the given SocketImpl.
+     */
+    ServerSocket newServerSocket(SocketImpl impl);
+
+    /*
+     * Constructs a SocketImpl instance of the given class.
+     */
+    SocketImpl newSocketImpl(Class<? extends SocketImpl> implClass);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaNetURLAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,32 @@
+/*
+ * 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
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.net.URL;
+import java.net.URLStreamHandler;
+
+public interface JavaNetURLAccess {
+    URLStreamHandler getHandler(URL u);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaNetURLClassLoaderAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.net.URLClassLoader;
+import java.security.AccessControlContext;
+
+public interface JavaNetURLClassLoaderAccess {
+    AccessControlContext getAccessControlContext(URLClassLoader u);;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaNetUriAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2006, 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.net.URI;
+
+public interface JavaNetUriAccess {
+    /**
+     * Create a URI of pre-validated scheme and path.
+     */
+    URI create(String scheme, String path);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007, 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
+public interface JavaNioAccess {
+    /**
+     * Provides access to information on buffer usage.
+     */
+    interface BufferPool {
+        String getName();
+        long getCount();
+        long getTotalCapacity();
+        long getMemoryUsed();
+    }
+    BufferPool getDirectBufferPool();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaObjectInputFilterAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,38 @@
+/*
+ * 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
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.ObjectInputFilter;
+
+/**
+ * Access to the alternative ObjectInputFilter.Config.createFilter2 for RMI.
+ */
+public interface JavaObjectInputFilterAccess {
+    /**
+     * Creates a filter from the pattern.
+     */
+    ObjectInputFilter createFilter2(String pattern);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaObjectInputStreamAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,38 @@
+/*
+ * 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
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.InvalidClassException;
+import java.io.ObjectInputStream;
+
+/**
+ * Interface to specify methods for accessing {@code ObjectInputStream}.
+ */
+@FunctionalInterface
+public interface JavaObjectInputStreamAccess {
+    void checkArray(ObjectInputStream ois, Class<?> arrayType, int arrayLength)
+        throws InvalidClassException;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaSecurityAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.security.AccessControlContext;
+import java.security.PermissionCollection;
+import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
+
+public interface JavaSecurityAccess {
+
+    <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
+                                  AccessControlContext stack,
+                                  AccessControlContext context);
+
+    <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
+                                  AccessControlContext context);
+
+    ProtectionDomain[] getProtectDomains(AccessControlContext context);
+
+    interface ProtectionDomainCache {
+        void put(ProtectionDomain pd, PermissionCollection pc);
+        PermissionCollection get(ProtectionDomain pd);
+    }
+
+    /**
+     * Returns the ProtectionDomainCache.
+     */
+    ProtectionDomainCache getProtectionDomainCache();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaUtilJarAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2002, 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.IOException;
+import java.net.URL;
+import java.security.CodeSource;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+public interface JavaUtilJarAccess {
+    public boolean jarFileHasClassPathAttribute(JarFile jar) throws IOException;
+    public CodeSource[] getCodeSources(JarFile jar, URL url);
+    public CodeSource getCodeSource(JarFile jar, URL url, String name);
+    public Enumeration<String> entryNames(JarFile jar, CodeSource[] cs);
+    public Enumeration<JarEntry> entries2(JarFile jar);
+    public void setEagerValidation(JarFile jar, boolean eager);
+    public List<Object> getManifestDigests(JarFile jar);
+    public Attributes getTrustedAttributes(Manifest man, String name);
+    public void ensureInitialization(JarFile jar);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaUtilResourceBundleAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * Provides access to non-public methods in java.util.ResourceBundle.
+ */
+public interface JavaUtilResourceBundleAccess {
+    /**
+     * Sets the bundle's parent to the given parent.
+     */
+    void setParent(ResourceBundle bundle, ResourceBundle parent);
+
+    /**
+     * Returns the parent of the given bundle or null if the bundle has no parent.
+     */
+    ResourceBundle getParent(ResourceBundle bundle);
+
+    /**
+     * Sets the bundle's locale to the given locale.
+     */
+    void setLocale(ResourceBundle bundle, Locale locale);
+
+    /**
+     * Sets the bundle's base name to the given name.
+     */
+    void setName(ResourceBundle bundle, String name);
+
+    /**
+     * Returns a {@code ResourceBundle} of the given baseName and locale
+     * loaded on behalf of the given module with no caller module
+     * access check.
+     */
+    ResourceBundle getBundle(String baseName, Locale locale, Module module);
+
+    /**
+     * Instantiates a {@code ResourceBundle} of the given bundle class.
+     */
+    ResourceBundle newResourceBundle(Class<? extends ResourceBundle> bundleClass);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaUtilZipFileAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013, 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.
+ *
+ * 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 jdk.internal.access;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.function.Function;
+import java.util.jar.JarEntry;
+import java.util.stream.Stream;
+import java.util.zip.ZipFile;
+
+public interface JavaUtilZipFileAccess {
+    public boolean startsWithLocHeader(ZipFile zip);
+    public String[] getMetaInfEntryNames(ZipFile zip);
+    public JarEntry getEntry(ZipFile zip, String name, Function<String, JarEntry> func);
+    public Enumeration<JarEntry> entries(ZipFile zip, Function<String, JarEntry> func);
+    public Stream<JarEntry> stream(ZipFile zip, Function<String, JarEntry> func);
+    public Stream<String> entryNameStream(ZipFile zip);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/JavaxCryptoSealedObjectAccess.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,38 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 jdk.internal.access;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.SealedObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+
+public interface JavaxCryptoSealedObjectAccess {
+    ObjectInputStream getExtObjectInputStream(
+            SealedObject sealed, Cipher cipher)
+            throws BadPaddingException, IllegalBlockSizeException, IOException;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,340 @@
+/*
+ * Copyright (c) 2002, 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.
+ *
+ * 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 jdk.internal.access;
+
+import javax.crypto.SealedObject;
+import java.io.ObjectInputFilter;
+import java.lang.module.ModuleDescriptor;
+import java.util.ResourceBundle;
+import java.util.jar.JarFile;
+import java.io.Console;
+import java.io.FileDescriptor;
+import java.io.FilePermission;
+import java.io.ObjectInputStream;
+import java.io.RandomAccessFile;
+import java.security.ProtectionDomain;
+import jdk.internal.misc.Unsafe;
+
+/** A repository of "shared secrets", which are a mechanism for
+    calling implementation-private methods in another package without
+    using reflection. A package-private class implements a public
+    interface and provides the ability to call package-private methods
+    within that package; the object implementing that interface is
+    provided through a third package to which access is restricted.
+    This framework avoids the primary disadvantage of using reflection
+    for this purpose, namely the loss of compile-time checking. */
+
+public class SharedSecrets {
+    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private static JavaUtilJarAccess javaUtilJarAccess;
+    private static JavaLangAccess javaLangAccess;
+    private static JavaLangModuleAccess javaLangModuleAccess;
+    private static JavaLangInvokeAccess javaLangInvokeAccess;
+    private static JavaLangRefAccess javaLangRefAccess;
+    private static JavaIOAccess javaIOAccess;
+    private static JavaNetInetAddressAccess javaNetInetAddressAccess;
+    private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
+    private static JavaNetSocketAccess javaNetSocketAccess;
+    private static JavaNetUriAccess javaNetUriAccess;
+    private static JavaNetURLAccess javaNetURLAccess;
+    private static JavaNetURLClassLoaderAccess javaNetURLClassLoaderAccess;
+    private static JavaNioAccess javaNioAccess;
+    private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
+    private static JavaIOFilePermissionAccess javaIOFilePermissionAccess;
+    private static JavaSecurityAccess javaSecurityAccess;
+    private static JavaUtilZipFileAccess javaUtilZipFileAccess;
+    private static JavaUtilResourceBundleAccess javaUtilResourceBundleAccess;
+    private static JavaAWTAccess javaAWTAccess;
+    private static JavaAWTFontAccess javaAWTFontAccess;
+    private static JavaBeansAccess javaBeansAccess;
+    private static JavaObjectInputStreamAccess javaObjectInputStreamAccess;
+    private static JavaObjectInputFilterAccess javaObjectInputFilterAccess;
+    private static JavaIORandomAccessFileAccess javaIORandomAccessFileAccess;
+    private static JavaxCryptoSealedObjectAccess javaxCryptoSealedObjectAccess;
+
+    public static JavaUtilJarAccess javaUtilJarAccess() {
+        if (javaUtilJarAccess == null) {
+            // Ensure JarFile is initialized; we know that that class
+            // provides the shared secret
+            unsafe.ensureClassInitialized(JarFile.class);
+        }
+        return javaUtilJarAccess;
+    }
+
+    public static void setJavaUtilJarAccess(JavaUtilJarAccess access) {
+        javaUtilJarAccess = access;
+    }
+
+    public static void setJavaLangAccess(JavaLangAccess jla) {
+        javaLangAccess = jla;
+    }
+
+    public static JavaLangAccess getJavaLangAccess() {
+        return javaLangAccess;
+    }
+
+    public static void setJavaLangInvokeAccess(JavaLangInvokeAccess jlia) {
+        javaLangInvokeAccess = jlia;
+    }
+
+    public static JavaLangInvokeAccess getJavaLangInvokeAccess() {
+        if (javaLangInvokeAccess == null) {
+            try {
+                Class<?> c = Class.forName("java.lang.invoke.MethodHandleImpl");
+                unsafe.ensureClassInitialized(c);
+            } catch (ClassNotFoundException e) {};
+        }
+        return javaLangInvokeAccess;
+    }
+
+    public static void setJavaLangModuleAccess(JavaLangModuleAccess jlrma) {
+        javaLangModuleAccess = jlrma;
+    }
+
+    public static JavaLangModuleAccess getJavaLangModuleAccess() {
+        if (javaLangModuleAccess == null) {
+            unsafe.ensureClassInitialized(ModuleDescriptor.class);
+        }
+        return javaLangModuleAccess;
+    }
+
+    public static void setJavaLangRefAccess(JavaLangRefAccess jlra) {
+        javaLangRefAccess = jlra;
+    }
+
+    public static JavaLangRefAccess getJavaLangRefAccess() {
+        return javaLangRefAccess;
+    }
+
+    public static void setJavaNetUriAccess(JavaNetUriAccess jnua) {
+        javaNetUriAccess = jnua;
+    }
+
+    public static JavaNetUriAccess getJavaNetUriAccess() {
+        if (javaNetUriAccess == null)
+            unsafe.ensureClassInitialized(java.net.URI.class);
+        return javaNetUriAccess;
+    }
+
+    public static void setJavaNetURLAccess(JavaNetURLAccess jnua) {
+        javaNetURLAccess = jnua;
+    }
+
+    public static JavaNetURLAccess getJavaNetURLAccess() {
+        if (javaNetURLAccess == null)
+            unsafe.ensureClassInitialized(java.net.URL.class);
+        return javaNetURLAccess;
+    }
+
+    public static void setJavaNetURLClassLoaderAccess(JavaNetURLClassLoaderAccess jnua) {
+        javaNetURLClassLoaderAccess = jnua;
+    }
+
+    public static JavaNetURLClassLoaderAccess getJavaNetURLClassLoaderAccess() {
+        if (javaNetURLClassLoaderAccess == null)
+            unsafe.ensureClassInitialized(java.net.URLClassLoader.class);
+        return javaNetURLClassLoaderAccess;
+    }
+
+    public static void setJavaNetInetAddressAccess(JavaNetInetAddressAccess jna) {
+        javaNetInetAddressAccess = jna;
+    }
+
+    public static JavaNetInetAddressAccess getJavaNetInetAddressAccess() {
+        if (javaNetInetAddressAccess == null)
+            unsafe.ensureClassInitialized(java.net.InetAddress.class);
+        return javaNetInetAddressAccess;
+    }
+
+    public static void setJavaNetHttpCookieAccess(JavaNetHttpCookieAccess a) {
+        javaNetHttpCookieAccess = a;
+    }
+
+    public static JavaNetHttpCookieAccess getJavaNetHttpCookieAccess() {
+        if (javaNetHttpCookieAccess == null)
+            unsafe.ensureClassInitialized(java.net.HttpCookie.class);
+        return javaNetHttpCookieAccess;
+    }
+
+    public static void setJavaNetSocketAccess(JavaNetSocketAccess jnsa) {
+        javaNetSocketAccess = jnsa;
+    }
+
+    public static JavaNetSocketAccess getJavaNetSocketAccess() {
+        if (javaNetSocketAccess == null)
+            unsafe.ensureClassInitialized(java.net.ServerSocket.class);
+        return javaNetSocketAccess;
+    }
+
+    public static void setJavaNioAccess(JavaNioAccess jna) {
+        javaNioAccess = jna;
+    }
+
+    public static JavaNioAccess getJavaNioAccess() {
+        if (javaNioAccess == null) {
+            // Ensure java.nio.Buffer is initialized, which provides the
+            // shared secret.
+            unsafe.ensureClassInitialized(java.nio.Buffer.class);
+        }
+        return javaNioAccess;
+    }
+
+    public static void setJavaIOAccess(JavaIOAccess jia) {
+        javaIOAccess = jia;
+    }
+
+    public static JavaIOAccess getJavaIOAccess() {
+        if (javaIOAccess == null) {
+            unsafe.ensureClassInitialized(Console.class);
+        }
+        return javaIOAccess;
+    }
+
+    public static void setJavaIOFileDescriptorAccess(JavaIOFileDescriptorAccess jiofda) {
+        javaIOFileDescriptorAccess = jiofda;
+    }
+
+    public static JavaIOFilePermissionAccess getJavaIOFilePermissionAccess() {
+        if (javaIOFilePermissionAccess == null)
+            unsafe.ensureClassInitialized(FilePermission.class);
+
+        return javaIOFilePermissionAccess;
+    }
+
+    public static void setJavaIOFilePermissionAccess(JavaIOFilePermissionAccess jiofpa) {
+        javaIOFilePermissionAccess = jiofpa;
+    }
+
+    public static JavaIOFileDescriptorAccess getJavaIOFileDescriptorAccess() {
+        if (javaIOFileDescriptorAccess == null)
+            unsafe.ensureClassInitialized(FileDescriptor.class);
+
+        return javaIOFileDescriptorAccess;
+    }
+
+    public static void setJavaSecurityAccess(JavaSecurityAccess jsa) {
+        javaSecurityAccess = jsa;
+    }
+
+    public static JavaSecurityAccess getJavaSecurityAccess() {
+        if (javaSecurityAccess == null) {
+            unsafe.ensureClassInitialized(ProtectionDomain.class);
+        }
+        return javaSecurityAccess;
+    }
+
+    public static JavaUtilZipFileAccess getJavaUtilZipFileAccess() {
+        if (javaUtilZipFileAccess == null)
+            unsafe.ensureClassInitialized(java.util.zip.ZipFile.class);
+        return javaUtilZipFileAccess;
+    }
+
+    public static void setJavaUtilZipFileAccess(JavaUtilZipFileAccess access) {
+        javaUtilZipFileAccess = access;
+    }
+
+    public static void setJavaAWTAccess(JavaAWTAccess jaa) {
+        javaAWTAccess = jaa;
+    }
+
+    public static JavaAWTAccess getJavaAWTAccess() {
+        // this may return null in which case calling code needs to
+        // provision for.
+        return javaAWTAccess;
+    }
+
+    public static void setJavaAWTFontAccess(JavaAWTFontAccess jafa) {
+        javaAWTFontAccess = jafa;
+    }
+
+    public static JavaAWTFontAccess getJavaAWTFontAccess() {
+        // this may return null in which case calling code needs to
+        // provision for.
+        return javaAWTFontAccess;
+    }
+
+    public static JavaBeansAccess getJavaBeansAccess() {
+        return javaBeansAccess;
+    }
+
+    public static void setJavaBeansAccess(JavaBeansAccess access) {
+        javaBeansAccess = access;
+    }
+
+    public static JavaUtilResourceBundleAccess getJavaUtilResourceBundleAccess() {
+        if (javaUtilResourceBundleAccess == null)
+            unsafe.ensureClassInitialized(ResourceBundle.class);
+        return javaUtilResourceBundleAccess;
+    }
+
+    public static void setJavaUtilResourceBundleAccess(JavaUtilResourceBundleAccess access) {
+        javaUtilResourceBundleAccess = access;
+    }
+
+    public static JavaObjectInputStreamAccess getJavaObjectInputStreamAccess() {
+        if (javaObjectInputStreamAccess == null) {
+            unsafe.ensureClassInitialized(ObjectInputStream.class);
+        }
+        return javaObjectInputStreamAccess;
+    }
+
+    public static void setJavaObjectInputStreamAccess(JavaObjectInputStreamAccess access) {
+        javaObjectInputStreamAccess = access;
+    }
+
+    public static JavaObjectInputFilterAccess getJavaObjectInputFilterAccess() {
+        if (javaObjectInputFilterAccess == null) {
+            unsafe.ensureClassInitialized(ObjectInputFilter.Config.class);
+        }
+        return javaObjectInputFilterAccess;
+    }
+
+    public static void setJavaObjectInputFilterAccess(JavaObjectInputFilterAccess access) {
+        javaObjectInputFilterAccess = access;
+    }
+
+    public static void setJavaIORandomAccessFileAccess(JavaIORandomAccessFileAccess jirafa) {
+        javaIORandomAccessFileAccess = jirafa;
+    }
+
+    public static JavaIORandomAccessFileAccess getJavaIORandomAccessFileAccess() {
+        if (javaIORandomAccessFileAccess == null) {
+            unsafe.ensureClassInitialized(RandomAccessFile.class);
+        }
+        return javaIORandomAccessFileAccess;
+    }
+
+    public static void setJavaxCryptoSealedObjectAccess(JavaxCryptoSealedObjectAccess jcsoa) {
+        javaxCryptoSealedObjectAccess = jcsoa;
+    }
+
+    public static JavaxCryptoSealedObjectAccess getJavaxCryptoSealedObjectAccess() {
+        if (javaxCryptoSealedObjectAccess == null) {
+            unsafe.ensureClassInitialized(SealedObject.class);
+        }
+        return javaxCryptoSealedObjectAccess;
+    }
+}
--- a/src/java.base/share/classes/jdk/internal/loader/AbstractClassLoaderValue.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/loader/AbstractClassLoaderValue.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -25,8 +25,8 @@
 
 package jdk.internal.loader;
 
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 
 import java.lang.reflect.UndeclaredThrowableException;
 import java.util.Iterator;
--- a/src/java.base/share/classes/jdk/internal/loader/BootLoader.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/loader/BootLoader.java	Thu Nov 08 19:15:42 2018 -0500
@@ -36,14 +36,13 @@
 import java.security.PrivilegedAction;
 import java.util.Arrays;
 import java.util.Enumeration;
-import java.util.Optional;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.jar.JarInputStream;
 import java.util.jar.Manifest;
 import java.util.stream.Stream;
 
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.module.Modules;
 import jdk.internal.module.ServicesCatalog;
 import jdk.internal.util.StaticProperty;
--- a/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java	Thu Nov 08 19:15:42 2018 -0500
@@ -60,7 +60,7 @@
 import java.util.jar.Manifest;
 import java.util.stream.Stream;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.VM;
 import jdk.internal.module.ModulePatcher.PatchedModuleReader;
 import jdk.internal.module.Resources;
--- a/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java	Thu Nov 08 19:15:42 2018 -0500
@@ -33,8 +33,8 @@
 import java.security.PermissionCollection;
 import java.util.jar.Manifest;
 
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.VM;
 
 /**
--- a/src/java.base/share/classes/jdk/internal/loader/Loader.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/loader/Loader.java	Thu Nov 08 19:15:42 2018 -0500
@@ -60,7 +60,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Stream;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.module.Resources;
 
 /**
--- a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java	Thu Nov 08 19:15:42 2018 -0500
@@ -68,9 +68,9 @@
 import java.util.jar.Attributes.Name;
 import java.util.zip.ZipFile;
 
-import jdk.internal.misc.JavaNetURLAccess;
-import jdk.internal.misc.JavaUtilZipFileAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetURLAccess;
+import jdk.internal.access.JavaUtilZipFileAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.util.jar.InvalidJarIndexError;
 import jdk.internal.util.jar.JarIndex;
 import sun.net.util.URLUtil;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/FileSystemOption.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,90 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 jdk.internal.misc;
+
+import sun.nio.fs.ExtendedOptions;
+
+import java.nio.file.CopyOption;
+import java.nio.file.OpenOption;
+import java.nio.file.WatchEvent;
+
+/**
+ * Internal file system options for jdk.unsupported com.sun.nio.file API use.
+ */
+public final class FileSystemOption<T> {
+    public static final FileSystemOption<Void> INTERRUPTIBLE =
+        new FileSystemOption<>(ExtendedOptions.INTERRUPTIBLE);
+    public static final FileSystemOption<Void> NOSHARE_READ =
+        new FileSystemOption<>(ExtendedOptions.NOSHARE_READ);
+    public static final FileSystemOption<Void> NOSHARE_WRITE =
+        new FileSystemOption<>(ExtendedOptions.NOSHARE_WRITE);
+    public static final FileSystemOption<Void> NOSHARE_DELETE =
+        new FileSystemOption<>(ExtendedOptions.NOSHARE_DELETE);
+    public static final FileSystemOption<Void> FILE_TREE =
+        new FileSystemOption<>(ExtendedOptions.FILE_TREE);
+    public static final FileSystemOption<Void> DIRECT =
+        new FileSystemOption<>(ExtendedOptions.DIRECT);
+    public static final FileSystemOption<Integer> SENSITIVITY_HIGH =
+        new FileSystemOption<>(ExtendedOptions.SENSITIVITY_HIGH);
+    public static final FileSystemOption<Integer> SENSITIVITY_MEDIUM =
+        new FileSystemOption<>(ExtendedOptions.SENSITIVITY_MEDIUM);
+    public static final FileSystemOption<Integer> SENSITIVITY_LOW =
+        new FileSystemOption<>(ExtendedOptions.SENSITIVITY_LOW);
+
+    private final ExtendedOptions.InternalOption<T> internalOption;
+    private FileSystemOption(ExtendedOptions.InternalOption<T> option) {
+        this.internalOption = option;
+    }
+
+    /**
+     * Register this internal option as an OpenOption.
+     */
+    public void register(OpenOption option) {
+        internalOption.register(option);
+    }
+
+    /**
+     * Register this internal option as a CopyOption.
+     */
+    public void register(CopyOption option) {
+        internalOption.register(option);
+    }
+
+    /**
+     * Register this internal option as a WatchEvent.Modifier.
+     */
+    public void register(WatchEvent.Modifier option) {
+        internalOption.register(option);
+    }
+
+    /**
+     * Register this internal option as a WatchEvent.Modifier with the
+     * given parameter.
+     */
+    public void register(WatchEvent.Modifier option, T param) {
+        internalOption.register(option, param);
+    }
+}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaAWTAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-public interface JavaAWTAccess {
-
-    // Returns the AppContext used for applet logging isolation, or null if
-    // no isolation is required.
-    // If there's no applet, or if the caller is a stand alone application,
-    // or running in the main app context, returns null.
-    // Otherwise, returns the AppContext of the calling applet.
-    public Object getAppletContext();
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaAWTFontAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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.
- */
-
-/**
- * SharedSecrets interface used for the access from java.text.Bidi
- */
-
-package jdk.internal.misc;
-
-public interface JavaAWTFontAccess {
-
-    // java.awt.font.TextAttribute constants
-    public Object getTextAttributeConstant(String name);
-
-    // java.awt.font.NumericShaper
-    public void shape(Object shaper, char[] text, int start, int count);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaBeansAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
-public interface JavaBeansAccess {
-    /**
-     * Returns the getter method for a property of the given name
-     * @param clazz The JavaBeans class
-     * @param property The property name
-     * @return The resolved property getter method
-     * @throws Exception
-     */
-    Method getReadMethod(Class<?> clazz, String property) throws Exception;
-
-    /**
-     * Return the <b>value</b> attribute of the associated
-     * <code>@ConstructorProperties</code> annotation if that is present.
-     * @param ctr The constructor to extract the annotation value from
-     * @return The {@code value} attribute of the <code>@ConstructorProperties</code>
-     *         annotation or {@code null} if the constructor is not annotated by
-     *         this annotation or the annotation is not accessible.
-     */
-    String[] getConstructorPropertiesValue(Constructor<?> ctr);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaIOAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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 jdk.internal.misc;
-
-import java.io.Console;
-import java.nio.charset.Charset;
-
-public interface JavaIOAccess {
-    public Console console();
-    public Charset charset();
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaIOFileDescriptorAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- *
- * 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 jdk.internal.misc;
-
-import java.io.FileDescriptor;
-import java.io.IOException;
-
-import jdk.internal.ref.PhantomCleanable;
-
-/*
- * @author Chris Hegarty
- */
-
-public interface JavaIOFileDescriptorAccess {
-    public void set(FileDescriptor fdo, int fd);
-    public int get(FileDescriptor fdo);
-    public void setAppend(FileDescriptor fdo, boolean append);
-    public boolean getAppend(FileDescriptor fdo);
-    public void close(FileDescriptor fdo) throws IOException;
-    public void registerCleanup(FileDescriptor fdo);
-    public void registerCleanup(FileDescriptor fdo, PhantomCleanable<FileDescriptor> cleanable);
-    public void unregisterCleanup(FileDescriptor fdo);
-
-    // Only valid on Windows
-    public void setHandle(FileDescriptor fdo, long handle);
-    public long getHandle(FileDescriptor fdo);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaIOFilePermissionAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.io.FilePermission;
-
-public interface JavaIOFilePermissionAccess {
-
-    /**
-     * Returns a new FilePermission plus an alternative path.
-     *
-     * @param input the input
-     * @return the new FilePermission plus the alt path (as npath2)
-     *         or the input itself if no alt path is available.
-     */
-    FilePermission newPermPlusAltPath(FilePermission input);
-
-    /**
-     * Returns a new FilePermission using an alternative path.
-     *
-     * @param input the input
-     * @return the new FilePermission using the alt path (as npath)
-     *         or null if no alt path is available
-     */
-    FilePermission newPermUsingAltPath(FilePermission input);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaIORandomAccessFileAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-
-public interface JavaIORandomAccessFileAccess {
-    public RandomAccessFile openAndDelete(File file, String mode)
-        throws IOException;
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- *
- * 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 jdk.internal.misc;
-
-import java.lang.annotation.Annotation;
-import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Executable;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
-import java.security.AccessControlContext;
-import java.security.ProtectionDomain;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Stream;
-
-import jdk.internal.module.ServicesCatalog;
-import jdk.internal.reflect.ConstantPool;
-import sun.reflect.annotation.AnnotationType;
-import sun.nio.ch.Interruptible;
-
-public interface JavaLangAccess {
-
-    /**
-     * Returns the list of {@code Method} objects for the declared public
-     * methods of this class or interface that have the specified method name
-     * and parameter types.
-     */
-    List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
-
-    /**
-     * Return the constant pool for a class.
-     */
-    ConstantPool getConstantPool(Class<?> klass);
-
-    /**
-     * Compare-And-Set the AnnotationType instance corresponding to this class.
-     * (This method only applies to annotation types.)
-     */
-    boolean casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType);
-
-    /**
-     * Get the AnnotationType instance corresponding to this class.
-     * (This method only applies to annotation types.)
-     */
-    AnnotationType getAnnotationType(Class<?> klass);
-
-    /**
-     * Get the declared annotations for a given class, indexed by their types.
-     */
-    Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass);
-
-    /**
-     * Get the array of bytes that is the class-file representation
-     * of this Class' annotations.
-     */
-    byte[] getRawClassAnnotations(Class<?> klass);
-
-    /**
-     * Get the array of bytes that is the class-file representation
-     * of this Class' type annotations.
-     */
-    byte[] getRawClassTypeAnnotations(Class<?> klass);
-
-    /**
-     * Get the array of bytes that is the class-file representation
-     * of this Executable's type annotations.
-     */
-    byte[] getRawExecutableTypeAnnotations(Executable executable);
-
-    /**
-     * Returns the elements of an enum class or null if the
-     * Class object does not represent an enum type;
-     * the result is uncloned, cached, and shared by all callers.
-     */
-    <E extends Enum<E>> E[] getEnumConstantsShared(Class<E> klass);
-
-    /**
-     * Set current thread's blocker field.
-     */
-    void blockedOn(Interruptible b);
-
-    /**
-     * Registers a shutdown hook.
-     *
-     * It is expected that this method with registerShutdownInProgress=true
-     * is only used to register DeleteOnExitHook since the first file
-     * may be added to the delete on exit list by the application shutdown
-     * hooks.
-     *
-     * @param slot  the slot in the shutdown hook array, whose element
-     *              will be invoked in order during shutdown
-     * @param registerShutdownInProgress true to allow the hook
-     *        to be registered even if the shutdown is in progress.
-     * @param hook  the hook to be registered
-     *
-     * @throws IllegalStateException if shutdown is in progress and
-     *         the slot is not valid to register.
-     */
-    void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook);
-
-    /**
-     * Returns a new Thread with the given Runnable and an
-     * inherited AccessControlContext.
-     */
-    Thread newThreadWithAcc(Runnable target, AccessControlContext acc);
-
-    /**
-     * Invokes the finalize method of the given object.
-     */
-    void invokeFinalize(Object o) throws Throwable;
-
-    /**
-     * Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s)
-     * associated with the given class loader, creating it if it doesn't already exist.
-     */
-    ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl);
-
-    /**
-     * Defines a class with the given name to a class loader.
-     */
-    Class<?> defineClass(ClassLoader cl, String name, byte[] b, ProtectionDomain pd, String source);
-
-    /**
-     * Returns a class loaded by the bootstrap class loader.
-     */
-    Class<?> findBootstrapClassOrNull(ClassLoader cl, String name);
-
-    /**
-     * Define a Package of the given name and module by the given class loader.
-     */
-    Package definePackage(ClassLoader cl, String name, Module module);
-
-    /**
-     * Invokes Long.fastUUID
-     */
-    String fastUUID(long lsb, long msb);
-
-    /**
-     * Record the non-exported packages of the modules in the given layer
-     */
-    void addNonExportedPackages(ModuleLayer layer);
-
-    /**
-     * Invalidate package access cache
-     */
-    void invalidatePackageAccessCache();
-
-    /**
-     * Defines a new module to the Java virtual machine. The module
-     * is defined to the given class loader.
-     *
-     * The URI is for information purposes only, it can be {@code null}.
-     */
-    Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri);
-
-    /**
-     * Defines the unnamed module for the given class loader.
-     */
-    Module defineUnnamedModule(ClassLoader loader);
-
-    /**
-     * Updates the readability so that module m1 reads m2. The new read edge
-     * does not result in a strong reference to m2 (m2 can be GC'ed).
-     *
-     * This method is the same as m1.addReads(m2) but without a permission check.
-     */
-    void addReads(Module m1, Module m2);
-
-    /**
-     * Updates module m to read all unnamed modules.
-     */
-    void addReadsAllUnnamed(Module m);
-
-    /**
-     * Updates module m1 to export a package to module m2. The export does
-     * not result in a strong reference to m2 (m2 can be GC'ed).
-     */
-    void addExports(Module m1, String pkg, Module m2);
-
-    /**
-     * Updates a module m to export a package to all unnamed modules.
-     */
-    void addExportsToAllUnnamed(Module m, String pkg);
-
-    /**
-     * Updates module m1 to open a package to module m2. Opening the
-     * package does not result in a strong reference to m2 (m2 can be GC'ed).
-     */
-    void addOpens(Module m1, String pkg, Module m2);
-
-    /**
-     * Updates module m to open a package to all unnamed modules.
-     */
-    void addOpensToAllUnnamed(Module m, String pkg);
-
-    /**
-     * Updates module m to open all packages returned by the given iterator.
-     */
-    void addOpensToAllUnnamed(Module m, Iterator<String> packages);
-
-    /**
-     * Updates module m to use a service.
-     */
-    void addUses(Module m, Class<?> service);
-
-    /**
-     * Returns true if module m reflectively exports a package to other
-     */
-    boolean isReflectivelyExported(Module module, String pn, Module other);
-
-    /**
-     * Returns true if module m reflectively opens a package to other
-     */
-    boolean isReflectivelyOpened(Module module, String pn, Module other);
-
-    /**
-     * Returns the ServicesCatalog for the given Layer.
-     */
-    ServicesCatalog getServicesCatalog(ModuleLayer layer);
-
-    /**
-     * Returns an ordered stream of layers. The first element is the
-     * given layer, the remaining elements are its parents, in DFS order.
-     */
-    Stream<ModuleLayer> layers(ModuleLayer layer);
-
-    /**
-     * Returns a stream of the layers that have modules defined to the
-     * given class loader.
-     */
-    Stream<ModuleLayer> layers(ClassLoader loader);
-
-    /**
-     * Constructs a new {@code String} by decoding the specified subarray of
-     * bytes using the specified {@linkplain java.nio.charset.Charset charset}.
-     *
-     * The caller of this method shall relinquish and transfer the ownership of
-     * the byte array to the callee since the later will not make a copy.
-     *
-     * @param bytes the byte array source
-     * @param cs the Charset
-     * @return the newly created string
-     * @throws CharacterCodingException for malformed or unmappable bytes
-     */
-    String newStringNoRepl(byte[] bytes, Charset cs) throws CharacterCodingException;
-
-    /**
-     * Encode the given string into a sequence of bytes using the specified Charset.
-     *
-     * This method avoids copying the String's internal representation if the input
-     * is ASCII.
-     *
-     * This method throws CharacterCodingException instead of replacing when
-     * malformed input or unmappable characters are encountered.
-     *
-     * @param s the string to encode
-     * @param cs the charset
-     * @return the encoded bytes
-     * @throws CharacterCodingException for malformed input or unmappable characters
-     */
-    byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException;
-
-    /**
-     * Returns a new string by decoding from the given utf8 bytes array.
-     *
-     * @param off the index of the first byte to decode
-     * @param len the number of bytes to decode
-     * @return the newly created string
-     * @throws IllegalArgumentException for malformed or unmappable bytes.
-     */
-    String newStringUTF8NoRepl(byte[] bytes, int off, int len);
-
-    /**
-     * Encode the given string into a sequence of bytes using utf8.
-     *
-     * @param s the string to encode
-     * @return the encoded bytes in utf8
-     * @throws IllegalArgumentException for malformed surrogates
-     */
-    byte[] getBytesUTF8NoRepl(String s);
-
-    /**
-     * Set the cause of Throwable
-     * @param cause set t's cause to new value
-     */
-    void setCause(Throwable t, Throwable cause);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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 jdk.internal.misc;
-
-import java.lang.invoke.MethodType;
-import java.util.Map;
-
-public interface JavaLangInvokeAccess {
-    /**
-     * Create a new MemberName instance. Used by {@code StackFrameInfo}.
-     */
-    Object newMemberName();
-
-    /**
-     * Returns the name for the given MemberName. Used by {@code StackFrameInfo}.
-     */
-    String getName(Object mname);
-
-    /**
-     * Returns the {@code MethodType} for the given MemberName.
-     * Used by {@code StackFrameInfo}.
-     */
-    MethodType getMethodType(Object mname);
-
-    /**
-     * Returns the descriptor for the given MemberName.
-     * Used by {@code StackFrameInfo}.
-     */
-    String getMethodDescriptor(Object mname);
-
-    /**
-     * Returns {@code true} if the given MemberName is a native method.
-     * Used by {@code StackFrameInfo}.
-     */
-    boolean isNative(Object mname);
-
-    /**
-     * Returns the declaring class for the given MemberName.
-     * Used by {@code StackFrameInfo}.
-     */
-    Class<?> getDeclaringClass(Object mname);
-
-    /**
-     * Returns a {@code byte[]} representation of a class implementing
-     * DirectMethodHandle of each pairwise combination of {@code MethodType} and
-     * an {@code int} representing method type.  Used by
-     * GenerateJLIClassesPlugin to generate such a class during the jlink phase.
-     */
-    byte[] generateDirectMethodHandleHolderClassBytes(String className,
-            MethodType[] methodTypes, int[] types);
-
-    /**
-     * Returns a {@code byte[]} representation of a class implementing
-     * DelegatingMethodHandles of each {@code MethodType} kind in the
-     * {@code methodTypes} argument.  Used by GenerateJLIClassesPlugin to
-     * generate such a class during the jlink phase.
-     */
-    byte[] generateDelegatingMethodHandleHolderClassBytes(String className,
-            MethodType[] methodTypes);
-
-    /**
-     * Returns a {@code byte[]} representation of {@code BoundMethodHandle}
-     * species class implementing the signature defined by {@code types}. Used
-     * by GenerateJLIClassesPlugin to enable generation of such classes during
-     * the jlink phase. Should do some added validation since this string may be
-     * user provided.
-     */
-    Map.Entry<String, byte[]> generateConcreteBMHClassBytes(
-            final String types);
-
-    /**
-     * Returns a {@code byte[]} representation of a class implementing
-     * the zero and identity forms of all {@code LambdaForm.BasicType}s.
-     */
-    byte[] generateBasicFormsClassBytes(final String className);
-
-    /**
-     * Returns a {@code byte[]} representation of a class implementing
-     * the invoker forms for the set of supplied {@code invokerMethodTypes}
-     * and {@code callSiteMethodTypes}.
-     */
-    byte[] generateInvokersHolderClassBytes(String className,
-            MethodType[] invokerMethodTypes,
-            MethodType[] callSiteMethodTypes);
-
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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 jdk.internal.misc;
-
-import java.io.PrintStream;
-import java.lang.module.Configuration;
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Exports;
-import java.lang.module.ModuleDescriptor.Opens;
-import java.lang.module.ModuleDescriptor.Requires;
-import java.lang.module.ModuleDescriptor.Provides;
-import java.lang.module.ModuleDescriptor.Version;
-import java.lang.module.ModuleFinder;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Provides access to non-public methods in java.lang.module.
- */
-
-public interface JavaLangModuleAccess {
-
-    /**
-     * Creates a builder for building a module with the given module name.
-     *
-     * @param strict
-     *        Indicates whether module names are checked or not
-     */
-    ModuleDescriptor.Builder newModuleBuilder(String mn,
-                                              boolean strict,
-                                              Set<ModuleDescriptor.Modifier> ms);
-
-    /**
-     * Returns a snapshot of the packages in the module.
-     */
-    Set<String> packages(ModuleDescriptor.Builder builder);
-
-    /**
-     * Adds a dependence on a module with the given (possibly un-parsable)
-     * version string.
-     */
-    void requires(ModuleDescriptor.Builder builder,
-                  Set<Requires.Modifier> ms,
-                  String mn,
-                  String rawCompiledVersion);
-
-    /**
-     * Returns a {@code ModuleDescriptor.Requires} of the given modifiers
-     * and module name.
-     */
-    Requires newRequires(Set<Requires.Modifier> ms, String mn, Version v);
-
-    /**
-     * Returns an unqualified {@code ModuleDescriptor.Exports}
-     * of the given modifiers and package name source.
-     */
-    Exports newExports(Set<Exports.Modifier> ms,
-                       String source);
-
-    /**
-     * Returns a qualified {@code ModuleDescriptor.Exports}
-     * of the given modifiers, package name source and targets.
-     */
-    Exports newExports(Set<Exports.Modifier> ms,
-                       String source,
-                       Set<String> targets);
-
-    /**
-     * Returns an unqualified {@code ModuleDescriptor.Opens}
-     * of the given modifiers and package name source.
-     */
-    Opens newOpens(Set<Opens.Modifier> ms, String source);
-
-    /**
-     * Returns a qualified {@code ModuleDescriptor.Opens}
-     * of the given modifiers, package name source and targets.
-     */
-    Opens newOpens(Set<Opens.Modifier> ms, String source, Set<String> targets);
-
-    /**
-     * Returns a {@code ModuleDescriptor.Provides}
-     * of the given service name and providers.
-     */
-    Provides newProvides(String service, List<String> providers);
-
-    /**
-     * Returns a new {@code ModuleDescriptor} instance.
-     */
-    ModuleDescriptor newModuleDescriptor(String name,
-                                         Version version,
-                                         Set<ModuleDescriptor.Modifier> ms,
-                                         Set<Requires> requires,
-                                         Set<Exports> exports,
-                                         Set<Opens> opens,
-                                         Set<String> uses,
-                                         Set<Provides> provides,
-                                         Set<String> packages,
-                                         String mainClass,
-                                         int hashCode);
-
-    /**
-     * Resolves a collection of root modules, with service binding
-     * and the empty configuration as the parent.
-     */
-    Configuration resolveAndBind(ModuleFinder finder,
-                                 Collection<String> roots,
-                                 PrintStream traceOutput);
-
-    /**
-     * Creates a configuration from a pre-generated readability graph.
-     */
-    Configuration newConfiguration(ModuleFinder finder,
-                                   Map<String, Set<String>> graph);
-
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- *
- * 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 jdk.internal.misc;
-
-public interface JavaLangRefAccess {
-
-    /**
-     * Wait for progress in {@link java.lang.ref.Reference}
-     * processing.  If there aren't any pending {@link
-     * java.lang.ref.Reference}s, return immediately.
-     *
-     * @return {@code true} if there were any pending
-     * {@link java.lang.ref.Reference}s, {@code false} otherwise.
-     */
-    boolean waitForReferenceProcessing() throws InterruptedException;
-
-    /**
-     * Runs the finalization methods of any objects pending finalization.
-     *
-     * Invoked by Runtime.runFinalization()
-     */
-    void runFinalization();
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNetHttpCookieAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.net.HttpCookie;
-import java.util.List;
-
-public interface JavaNetHttpCookieAccess {
-    /*
-     * Constructs cookies from Set-Cookie or Set-Cookie2 header string,
-     * retaining the original header String in the cookie itself.
-     */
-    public List<HttpCookie> parse(String header);
-
-    /*
-     * Returns the original header this cookie was constructed from, if it was
-     * constructed by parsing a header, otherwise null.
-     */
-    public String header(HttpCookie cookie);
-}
-
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNetInetAddressAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-public interface JavaNetInetAddressAccess {
-    /**
-     * Return the original application specified hostname of
-     * the given InetAddress object.
-     */
-    String getOriginalHostName(InetAddress ia);
-
-    /**
-     * Get the InetAddress of the provided host. If an InetAddress is provided
-     * then it will be the default address returned for all calls to either
-     * form of getByName. This is required to maintain consistency when
-     * caching addresses and hostnames.
-     */
-    InetAddress getByName(String hostName, InetAddress hostAddress)
-            throws UnknownHostException;
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNetSocketAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.net.ServerSocket;
-import java.net.SocketImpl;
-
-public interface JavaNetSocketAccess {
-    /**
-     * Creates a ServerSocket associated with the given SocketImpl.
-     */
-    ServerSocket newServerSocket(SocketImpl impl);
-
-    /*
-     * Constructs a SocketImpl instance of the given class.
-     */
-    SocketImpl newSocketImpl(Class<? extends SocketImpl> implClass);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNetURLAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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 jdk.internal.misc;
-
-import java.net.URL;
-import java.net.URLStreamHandler;
-
-public interface JavaNetURLAccess {
-    URLStreamHandler getHandler(URL u);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNetURLClassLoaderAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.net.URLClassLoader;
-import java.security.AccessControlContext;
-
-public interface JavaNetURLClassLoaderAccess {
-    AccessControlContext getAccessControlContext(URLClassLoader u);;
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNetUriAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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.
- *
- * 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 jdk.internal.misc;
-
-import java.net.URI;
-
-public interface JavaNetUriAccess {
-    /**
-     * Create a URI of pre-validated scheme and path.
-     */
-    URI create(String scheme, String path);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007, 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.
- *
- * 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 jdk.internal.misc;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-
-public interface JavaNioAccess {
-    /**
-     * Provides access to information on buffer usage.
-     */
-    interface BufferPool {
-        String getName();
-        long getCount();
-        long getTotalCapacity();
-        long getMemoryUsed();
-    }
-    BufferPool getDirectBufferPool();
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaObjectInputFilterAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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 jdk.internal.misc;
-
-import java.io.ObjectInputFilter;
-
-/**
- * Access to the alternative ObjectInputFilter.Config.createFilter2 for RMI.
- */
-public interface JavaObjectInputFilterAccess {
-    /**
-     * Creates a filter from the pattern.
-     */
-    ObjectInputFilter createFilter2(String pattern);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaObjectInputStreamAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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 jdk.internal.misc;
-
-import java.io.InvalidClassException;
-import java.io.ObjectInputStream;
-
-/**
- * Interface to specify methods for accessing {@code ObjectInputStream}.
- */
-@FunctionalInterface
-public interface JavaObjectInputStreamAccess {
-    void checkArray(ObjectInputStream ois, Class<?> arrayType, int arrayLength)
-        throws InvalidClassException;
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaSecurityAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * 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.
- *
- * 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 jdk.internal.misc;
-
-import java.security.AccessControlContext;
-import java.security.PermissionCollection;
-import java.security.PrivilegedAction;
-import java.security.ProtectionDomain;
-
-public interface JavaSecurityAccess {
-
-    <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
-                                  AccessControlContext stack,
-                                  AccessControlContext context);
-
-    <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
-                                  AccessControlContext context);
-
-    ProtectionDomain[] getProtectDomains(AccessControlContext context);
-
-    interface ProtectionDomainCache {
-        void put(ProtectionDomain pd, PermissionCollection pc);
-        PermissionCollection get(ProtectionDomain pd);
-    }
-
-    /**
-     * Returns the ProtectionDomainCache.
-     */
-    ProtectionDomainCache getProtectionDomainCache();
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- * 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 jdk.internal.misc;
-
-import java.io.IOException;
-import java.net.URL;
-import java.security.CodeSource;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.jar.Attributes;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-public interface JavaUtilJarAccess {
-    public boolean jarFileHasClassPathAttribute(JarFile jar) throws IOException;
-    public CodeSource[] getCodeSources(JarFile jar, URL url);
-    public CodeSource getCodeSource(JarFile jar, URL url, String name);
-    public Enumeration<String> entryNames(JarFile jar, CodeSource[] cs);
-    public Enumeration<JarEntry> entries2(JarFile jar);
-    public void setEagerValidation(JarFile jar, boolean eager);
-    public List<Object> getManifestDigests(JarFile jar);
-    public Attributes getTrustedAttributes(Manifest man, String name);
-    public void ensureInitialization(JarFile jar);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-/**
- * Provides access to non-public methods in java.util.ResourceBundle.
- */
-public interface JavaUtilResourceBundleAccess {
-    /**
-     * Sets the bundle's parent to the given parent.
-     */
-    void setParent(ResourceBundle bundle, ResourceBundle parent);
-
-    /**
-     * Returns the parent of the given bundle or null if the bundle has no parent.
-     */
-    ResourceBundle getParent(ResourceBundle bundle);
-
-    /**
-     * Sets the bundle's locale to the given locale.
-     */
-    void setLocale(ResourceBundle bundle, Locale locale);
-
-    /**
-     * Sets the bundle's base name to the given name.
-     */
-    void setName(ResourceBundle bundle, String name);
-
-    /**
-     * Returns a {@code ResourceBundle} of the given baseName and locale
-     * loaded on behalf of the given module with no caller module
-     * access check.
-     */
-    ResourceBundle getBundle(String baseName, Locale locale, Module module);
-
-    /**
-     * Instantiates a {@code ResourceBundle} of the given bundle class.
-     */
-    ResourceBundle newResourceBundle(Class<? extends ResourceBundle> bundleClass);
-}
--- a/src/java.base/share/classes/jdk/internal/misc/JavaUtilZipFileAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.function.Function;
-import java.util.jar.JarEntry;
-import java.util.stream.Stream;
-import java.util.zip.ZipFile;
-
-public interface JavaUtilZipFileAccess {
-    public boolean startsWithLocHeader(ZipFile zip);
-    public String[] getMetaInfEntryNames(ZipFile zip);
-    public JarEntry getEntry(ZipFile zip, String name, Function<String, JarEntry> func);
-    public Enumeration<JarEntry> entries(ZipFile zip, Function<String, JarEntry> func);
-    public Stream<JarEntry> stream(ZipFile zip, Function<String, JarEntry> func);
-    public Stream<String> entryNameStream(ZipFile zip);
-}
-
--- a/src/java.base/share/classes/jdk/internal/misc/JavaxCryptoSealedObjectAccess.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.internal.misc;
-
-import javax.crypto.BadPaddingException;
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.SealedObject;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-public interface JavaxCryptoSealedObjectAccess {
-    ObjectInputStream getExtObjectInputStream(
-            SealedObject sealed, Cipher cipher)
-            throws BadPaddingException, IllegalBlockSizeException, IOException;
-}
--- a/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- * 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 jdk.internal.misc;
-
-import javax.crypto.SealedObject;
-import java.io.ObjectInputFilter;
-import java.lang.module.ModuleDescriptor;
-import java.util.ResourceBundle;
-import java.util.jar.JarFile;
-import java.io.Console;
-import java.io.FileDescriptor;
-import java.io.FilePermission;
-import java.io.ObjectInputStream;
-import java.io.RandomAccessFile;
-import java.security.ProtectionDomain;
-
-/** A repository of "shared secrets", which are a mechanism for
-    calling implementation-private methods in another package without
-    using reflection. A package-private class implements a public
-    interface and provides the ability to call package-private methods
-    within that package; the object implementing that interface is
-    provided through a third package to which access is restricted.
-    This framework avoids the primary disadvantage of using reflection
-    for this purpose, namely the loss of compile-time checking. */
-
-public class SharedSecrets {
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static JavaUtilJarAccess javaUtilJarAccess;
-    private static JavaLangAccess javaLangAccess;
-    private static JavaLangModuleAccess javaLangModuleAccess;
-    private static JavaLangInvokeAccess javaLangInvokeAccess;
-    private static JavaLangRefAccess javaLangRefAccess;
-    private static JavaIOAccess javaIOAccess;
-    private static JavaNetInetAddressAccess javaNetInetAddressAccess;
-    private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
-    private static JavaNetSocketAccess javaNetSocketAccess;
-    private static JavaNetUriAccess javaNetUriAccess;
-    private static JavaNetURLAccess javaNetURLAccess;
-    private static JavaNetURLClassLoaderAccess javaNetURLClassLoaderAccess;
-    private static JavaNioAccess javaNioAccess;
-    private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
-    private static JavaIOFilePermissionAccess javaIOFilePermissionAccess;
-    private static JavaSecurityAccess javaSecurityAccess;
-    private static JavaUtilZipFileAccess javaUtilZipFileAccess;
-    private static JavaUtilResourceBundleAccess javaUtilResourceBundleAccess;
-    private static JavaAWTAccess javaAWTAccess;
-    private static JavaAWTFontAccess javaAWTFontAccess;
-    private static JavaBeansAccess javaBeansAccess;
-    private static JavaObjectInputStreamAccess javaObjectInputStreamAccess;
-    private static JavaObjectInputFilterAccess javaObjectInputFilterAccess;
-    private static JavaIORandomAccessFileAccess javaIORandomAccessFileAccess;
-    private static JavaxCryptoSealedObjectAccess javaxCryptoSealedObjectAccess;
-
-    public static JavaUtilJarAccess javaUtilJarAccess() {
-        if (javaUtilJarAccess == null) {
-            // Ensure JarFile is initialized; we know that that class
-            // provides the shared secret
-            unsafe.ensureClassInitialized(JarFile.class);
-        }
-        return javaUtilJarAccess;
-    }
-
-    public static void setJavaUtilJarAccess(JavaUtilJarAccess access) {
-        javaUtilJarAccess = access;
-    }
-
-    public static void setJavaLangAccess(JavaLangAccess jla) {
-        javaLangAccess = jla;
-    }
-
-    public static JavaLangAccess getJavaLangAccess() {
-        return javaLangAccess;
-    }
-
-    public static void setJavaLangInvokeAccess(JavaLangInvokeAccess jlia) {
-        javaLangInvokeAccess = jlia;
-    }
-
-    public static JavaLangInvokeAccess getJavaLangInvokeAccess() {
-        if (javaLangInvokeAccess == null) {
-            try {
-                Class<?> c = Class.forName("java.lang.invoke.MethodHandleImpl");
-                unsafe.ensureClassInitialized(c);
-            } catch (ClassNotFoundException e) {};
-        }
-        return javaLangInvokeAccess;
-    }
-
-    public static void setJavaLangModuleAccess(JavaLangModuleAccess jlrma) {
-        javaLangModuleAccess = jlrma;
-    }
-
-    public static JavaLangModuleAccess getJavaLangModuleAccess() {
-        if (javaLangModuleAccess == null) {
-            unsafe.ensureClassInitialized(ModuleDescriptor.class);
-        }
-        return javaLangModuleAccess;
-    }
-
-    public static void setJavaLangRefAccess(JavaLangRefAccess jlra) {
-        javaLangRefAccess = jlra;
-    }
-
-    public static JavaLangRefAccess getJavaLangRefAccess() {
-        return javaLangRefAccess;
-    }
-
-    public static void setJavaNetUriAccess(JavaNetUriAccess jnua) {
-        javaNetUriAccess = jnua;
-    }
-
-    public static JavaNetUriAccess getJavaNetUriAccess() {
-        if (javaNetUriAccess == null)
-            unsafe.ensureClassInitialized(java.net.URI.class);
-        return javaNetUriAccess;
-    }
-
-    public static void setJavaNetURLAccess(JavaNetURLAccess jnua) {
-        javaNetURLAccess = jnua;
-    }
-
-    public static JavaNetURLAccess getJavaNetURLAccess() {
-        if (javaNetURLAccess == null)
-            unsafe.ensureClassInitialized(java.net.URL.class);
-        return javaNetURLAccess;
-    }
-
-    public static void setJavaNetURLClassLoaderAccess(JavaNetURLClassLoaderAccess jnua) {
-        javaNetURLClassLoaderAccess = jnua;
-    }
-
-    public static JavaNetURLClassLoaderAccess getJavaNetURLClassLoaderAccess() {
-        if (javaNetURLClassLoaderAccess == null)
-            unsafe.ensureClassInitialized(java.net.URLClassLoader.class);
-        return javaNetURLClassLoaderAccess;
-    }
-
-    public static void setJavaNetInetAddressAccess(JavaNetInetAddressAccess jna) {
-        javaNetInetAddressAccess = jna;
-    }
-
-    public static JavaNetInetAddressAccess getJavaNetInetAddressAccess() {
-        if (javaNetInetAddressAccess == null)
-            unsafe.ensureClassInitialized(java.net.InetAddress.class);
-        return javaNetInetAddressAccess;
-    }
-
-    public static void setJavaNetHttpCookieAccess(JavaNetHttpCookieAccess a) {
-        javaNetHttpCookieAccess = a;
-    }
-
-    public static JavaNetHttpCookieAccess getJavaNetHttpCookieAccess() {
-        if (javaNetHttpCookieAccess == null)
-            unsafe.ensureClassInitialized(java.net.HttpCookie.class);
-        return javaNetHttpCookieAccess;
-    }
-
-    public static void setJavaNetSocketAccess(JavaNetSocketAccess jnsa) {
-        javaNetSocketAccess = jnsa;
-    }
-
-    public static JavaNetSocketAccess getJavaNetSocketAccess() {
-        if (javaNetSocketAccess == null)
-            unsafe.ensureClassInitialized(java.net.ServerSocket.class);
-        return javaNetSocketAccess;
-    }
-
-    public static void setJavaNioAccess(JavaNioAccess jna) {
-        javaNioAccess = jna;
-    }
-
-    public static JavaNioAccess getJavaNioAccess() {
-        if (javaNioAccess == null) {
-            // Ensure java.nio.Buffer is initialized, which provides the
-            // shared secret.
-            unsafe.ensureClassInitialized(java.nio.Buffer.class);
-        }
-        return javaNioAccess;
-    }
-
-    public static void setJavaIOAccess(JavaIOAccess jia) {
-        javaIOAccess = jia;
-    }
-
-    public static JavaIOAccess getJavaIOAccess() {
-        if (javaIOAccess == null) {
-            unsafe.ensureClassInitialized(Console.class);
-        }
-        return javaIOAccess;
-    }
-
-    public static void setJavaIOFileDescriptorAccess(JavaIOFileDescriptorAccess jiofda) {
-        javaIOFileDescriptorAccess = jiofda;
-    }
-
-    public static JavaIOFilePermissionAccess getJavaIOFilePermissionAccess() {
-        if (javaIOFilePermissionAccess == null)
-            unsafe.ensureClassInitialized(FilePermission.class);
-
-        return javaIOFilePermissionAccess;
-    }
-
-    public static void setJavaIOFilePermissionAccess(JavaIOFilePermissionAccess jiofpa) {
-        javaIOFilePermissionAccess = jiofpa;
-    }
-
-    public static JavaIOFileDescriptorAccess getJavaIOFileDescriptorAccess() {
-        if (javaIOFileDescriptorAccess == null)
-            unsafe.ensureClassInitialized(FileDescriptor.class);
-
-        return javaIOFileDescriptorAccess;
-    }
-
-    public static void setJavaSecurityAccess(JavaSecurityAccess jsa) {
-        javaSecurityAccess = jsa;
-    }
-
-    public static JavaSecurityAccess getJavaSecurityAccess() {
-        if (javaSecurityAccess == null) {
-            unsafe.ensureClassInitialized(ProtectionDomain.class);
-        }
-        return javaSecurityAccess;
-    }
-
-    public static JavaUtilZipFileAccess getJavaUtilZipFileAccess() {
-        if (javaUtilZipFileAccess == null)
-            unsafe.ensureClassInitialized(java.util.zip.ZipFile.class);
-        return javaUtilZipFileAccess;
-    }
-
-    public static void setJavaUtilZipFileAccess(JavaUtilZipFileAccess access) {
-        javaUtilZipFileAccess = access;
-    }
-
-    public static void setJavaAWTAccess(JavaAWTAccess jaa) {
-        javaAWTAccess = jaa;
-    }
-
-    public static JavaAWTAccess getJavaAWTAccess() {
-        // this may return null in which case calling code needs to
-        // provision for.
-        return javaAWTAccess;
-    }
-
-    public static void setJavaAWTFontAccess(JavaAWTFontAccess jafa) {
-        javaAWTFontAccess = jafa;
-    }
-
-    public static JavaAWTFontAccess getJavaAWTFontAccess() {
-        // this may return null in which case calling code needs to
-        // provision for.
-        return javaAWTFontAccess;
-    }
-
-    public static JavaBeansAccess getJavaBeansAccess() {
-        return javaBeansAccess;
-    }
-
-    public static void setJavaBeansAccess(JavaBeansAccess access) {
-        javaBeansAccess = access;
-    }
-
-    public static JavaUtilResourceBundleAccess getJavaUtilResourceBundleAccess() {
-        if (javaUtilResourceBundleAccess == null)
-            unsafe.ensureClassInitialized(ResourceBundle.class);
-        return javaUtilResourceBundleAccess;
-    }
-
-    public static void setJavaUtilResourceBundleAccess(JavaUtilResourceBundleAccess access) {
-        javaUtilResourceBundleAccess = access;
-    }
-
-    public static JavaObjectInputStreamAccess getJavaObjectInputStreamAccess() {
-        if (javaObjectInputStreamAccess == null) {
-            unsafe.ensureClassInitialized(ObjectInputStream.class);
-        }
-        return javaObjectInputStreamAccess;
-    }
-
-    public static void setJavaObjectInputStreamAccess(JavaObjectInputStreamAccess access) {
-        javaObjectInputStreamAccess = access;
-    }
-
-    public static JavaObjectInputFilterAccess getJavaObjectInputFilterAccess() {
-        if (javaObjectInputFilterAccess == null) {
-            unsafe.ensureClassInitialized(ObjectInputFilter.Config.class);
-        }
-        return javaObjectInputFilterAccess;
-    }
-
-    public static void setJavaObjectInputFilterAccess(JavaObjectInputFilterAccess access) {
-        javaObjectInputFilterAccess = access;
-    }
-
-    public static void setJavaIORandomAccessFileAccess(JavaIORandomAccessFileAccess jirafa) {
-        javaIORandomAccessFileAccess = jirafa;
-    }
-
-    public static JavaIORandomAccessFileAccess getJavaIORandomAccessFileAccess() {
-        if (javaIORandomAccessFileAccess == null) {
-            unsafe.ensureClassInitialized(RandomAccessFile.class);
-        }
-        return javaIORandomAccessFileAccess;
-    }
-
-    public static void setJavaxCryptoSealedObjectAccess(JavaxCryptoSealedObjectAccess jcsoa) {
-        javaxCryptoSealedObjectAccess = jcsoa;
-    }
-
-    public static JavaxCryptoSealedObjectAccess getJavaxCryptoSealedObjectAccess() {
-        if (javaxCryptoSealedObjectAccess == null) {
-            unsafe.ensureClassInitialized(SealedObject.class);
-        }
-        return javaxCryptoSealedObjectAccess;
-    }
-}
--- a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, 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
@@ -26,7 +26,9 @@
 package jdk.internal.misc;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.ref.Cleaner;
 import jdk.internal.vm.annotation.ForceInline;
+import sun.nio.ch.DirectBuffer;
 
 import java.lang.reflect.Field;
 import java.security.ProtectionDomain;
@@ -3718,6 +3720,29 @@
     private native boolean isBigEndian0();
 
 
+    /**
+     * Invokes the given direct byte buffer's cleaner, if any.
+     *
+     * @param directBuffer a direct byte buffer
+     * @throws NullPointerException     if {@code directBuffer} is null
+     * @throws IllegalArgumentException if {@code directBuffer} is non-direct,
+     *                                  or is a {@link java.nio.Buffer#slice slice}, or is a
+     *                                  {@link java.nio.Buffer#duplicate duplicate}
+     */
+    public void invokeCleaner(java.nio.ByteBuffer directBuffer) {
+        if (!directBuffer.isDirect())
+            throw new IllegalArgumentException("buffer is non-direct");
+
+        DirectBuffer db = (DirectBuffer) directBuffer;
+        if (db.attachment() != null)
+            throw new IllegalArgumentException("duplicate or slice");
+
+        Cleaner cleaner = db.cleaner();
+        if (cleaner != null) {
+            cleaner.clean();
+        }
+    }
+
     // The following deprecated methods are used by JSR 166.
 
     @Deprecated(since="12", forRemoval=true)
--- a/src/java.base/share/classes/jdk/internal/module/Builder.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/module/Builder.java	Thu Nov 08 19:15:42 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
@@ -33,8 +33,8 @@
 import java.util.List;
 import java.util.Set;
 
-import jdk.internal.misc.JavaLangModuleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangModuleAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * This builder is optimized for reconstituting the {@code ModuleDescriptor}s
--- a/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java	Thu Nov 08 19:15:42 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
@@ -44,8 +44,8 @@
 import java.util.stream.Collectors;
 import static java.util.Collections.*;
 
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Supports logging of access to members of exported and concealed packages
--- a/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java	Thu Nov 08 19:15:42 2018 -0500
@@ -51,10 +51,9 @@
 
 import jdk.internal.loader.BootLoader;
 import jdk.internal.loader.BuiltinClassLoader;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.JavaLangModuleAccess;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.VM;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.JavaLangModuleAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.perf.PerfCounter;
 
 /**
--- a/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java	Thu Nov 08 19:15:42 2018 -0500
@@ -47,8 +47,8 @@
 import java.util.Set;
 import java.util.function.Supplier;
 
-import jdk.internal.misc.JavaLangModuleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangModuleAccess;
+import jdk.internal.access.SharedSecrets;
 
 import static jdk.internal.module.ClassFileConstants.*;
 
--- a/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java	Thu Nov 08 19:15:42 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
@@ -54,8 +54,8 @@
 import java.util.stream.Stream;
 
 import jdk.internal.loader.Resource;
-import jdk.internal.misc.JavaLangModuleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangModuleAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.net.www.ParseUtil;
 
 
--- a/src/java.base/share/classes/jdk/internal/module/Modules.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/module/Modules.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -43,8 +43,8 @@
 import jdk.internal.loader.BootLoader;
 import jdk.internal.loader.BuiltinClassLoader;
 import jdk.internal.loader.ClassLoaders;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * A helper class for creating and updating modules. This class is intended to
--- a/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java	Thu Nov 08 19:15:42 2018 -0500
@@ -59,8 +59,8 @@
 import jdk.internal.jimage.ImageLocation;
 import jdk.internal.jimage.ImageReader;
 import jdk.internal.jimage.ImageReaderFactory;
-import jdk.internal.misc.JavaNetUriAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetUriAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.util.StaticProperty;
 import jdk.internal.module.ModuleHashes.HashSupplier;
 
--- a/src/java.base/share/classes/jdk/internal/reflect/ClassDefiner.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/reflect/ClassDefiner.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, 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
@@ -28,8 +28,8 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 
 /** Utility class which assists in calling defineClass() by
     creating a new class loader which delegates to the one needed in
--- a/src/java.base/share/classes/module-info.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/module-info.java	Thu Nov 08 19:15:42 2018 -0500
@@ -136,6 +136,14 @@
         java.security.sasl;
     exports jdk.internal to
         jdk.jfr;
+    exports jdk.internal.access to
+        java.desktop,
+        java.logging,
+        java.management,
+        java.naming,
+        java.rmi,
+        jdk.jlink,
+        jdk.net;
     exports jdk.internal.event to
         jdk.jfr;
     exports jdk.internal.jimage to
@@ -175,18 +183,15 @@
         java.logging,
         java.management,
         java.naming,
+        java.net.http,
         java.rmi,
         java.security.jgss,
-        java.sql,
         java.xml,
         jdk.attach,
         jdk.charsets,
         jdk.compiler,
-        java.net.http,
         jdk.jfr,
-        jdk.jlink,
         jdk.jshell,
-        jdk.net,
         jdk.scripting.nashorn,
         jdk.scripting.nashorn.shell,
         jdk.unsupported,
@@ -202,8 +207,7 @@
         jdk.management.agent,
         jdk.internal.jvmstat;
     exports jdk.internal.ref to
-        java.desktop,
-        jdk.unsupported;
+        java.desktop;
     exports jdk.internal.reflect to
         java.logging,
         java.sql,
@@ -244,12 +248,9 @@
         java.management,
         jdk.crypto.cryptoki,
         jdk.net,
-        jdk.sctp,
-        jdk.unsupported;
+        jdk.sctp;
     exports sun.nio.cs to
         jdk.charsets;
-    exports sun.nio.fs to
-        jdk.unsupported;
     exports sun.reflect.annotation to
         jdk.compiler;
     exports sun.reflect.generics.reflectiveObjects to
--- a/src/java.base/share/classes/sun/net/sdp/SdpSupport.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/net/sdp/SdpSupport.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, 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
@@ -29,8 +29,8 @@
 import java.io.FileDescriptor;
 import java.security.AccessController;
 
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
 import sun.security.action.GetPropertyAction;
 
 
--- a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Thu Nov 08 19:15:42 2018 -0500
@@ -65,8 +65,8 @@
 import java.util.HashMap;
 import java.util.Set;
 import java.util.StringJoiner;
-import jdk.internal.misc.JavaNetHttpCookieAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetHttpCookieAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.net.*;
 import sun.net.www.*;
 import sun.net.www.http.HttpClient;
--- a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -43,9 +43,9 @@
 import java.nio.channels.SelectableChannel;
 import java.nio.channels.WritableByteChannel;
 
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.JavaNioAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.JavaNioAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.ref.Cleaner;
 import jdk.internal.ref.CleanerFactory;
 
--- a/src/java.base/share/classes/sun/reflect/annotation/AnnotationSupport.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/reflect/annotation/AnnotationSupport.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, 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
@@ -35,8 +35,8 @@
 import java.util.Map;
 import java.util.Objects;
 
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
 import jdk.internal.reflect.ReflectionFactory;
 
 public final class AnnotationSupport {
--- a/src/java.base/share/classes/sun/reflect/annotation/AnnotationType.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/reflect/annotation/AnnotationType.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -30,8 +30,8 @@
 import java.util.*;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
 
 /**
  * Represents an annotation type at run time.  Used to type-check annotations
--- a/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -34,8 +34,8 @@
 import java.util.List;
 import java.util.LinkedHashMap;
 import java.util.Map;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaLangAccess;
 import jdk.internal.reflect.ConstantPool;
 import static sun.reflect.annotation.TypeAnnotation.*;
 
--- a/src/java.base/share/classes/sun/security/provider/PolicyFile.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/security/provider/PolicyFile.java	Thu Nov 08 19:15:42 2018 -0500
@@ -41,9 +41,9 @@
 import java.net.SocketPermission;
 import java.net.NetPermission;
 import java.util.concurrent.ConcurrentHashMap;
-import jdk.internal.misc.JavaSecurityAccess;
-import static jdk.internal.misc.JavaSecurityAccess.ProtectionDomainCache;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
+import static jdk.internal.access.JavaSecurityAccess.ProtectionDomainCache;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.util.StaticProperty;
 import sun.security.util.*;
 import sun.net.www.ParseUtil;
--- a/src/java.base/share/classes/sun/security/rsa/RSAKeyPairGenerator.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/security/rsa/RSAKeyPairGenerator.java	Thu Nov 08 19:15:42 2018 -0500
@@ -70,7 +70,7 @@
     public void initialize(int keySize, SecureRandom random) {
         try {
             initialize(new RSAKeyGenParameterSpec(keySize,
-                    RSAKeyGenParameterSpec.F4), null);
+                    RSAKeyGenParameterSpec.F4), random);
         } catch (InvalidAlgorithmParameterException iape) {
             throw new InvalidParameterException(iape.getMessage());
         }
--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -47,8 +47,8 @@
 import javax.net.ssl.SSLServerSocket;
 import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSocket;
-import jdk.internal.misc.JavaNetInetAddressAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetInetAddressAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Implementation of an SSL socket.
@@ -1229,7 +1229,7 @@
         // identification.  Use the application original specified
         // hostname or IP address instead.
 
-        // Get the original hostname via jdk.internal.misc.SharedSecrets
+        // Get the original hostname via jdk.internal.access.SharedSecrets
         InetAddress inetAddress = getInetAddress();
         if (inetAddress == null) {      // not connected
             return;
--- a/src/java.base/share/classes/sun/security/util/FilePermCompat.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/security/util/FilePermCompat.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -29,7 +29,7 @@
 
 import java.io.FilePermission;
 import java.security.Permission;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Take care of FilePermission compatibility after JDK-8164705.
--- a/src/java.base/share/classes/sun/security/util/HostnameChecker.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/security/util/HostnameChecker.java	Thu Nov 08 19:15:42 2018 -0500
@@ -92,6 +92,10 @@
      */
     public void match(String expectedName, X509Certificate cert,
                       boolean chainsToPublicCA) throws CertificateException {
+        if (expectedName == null) {
+            throw new CertificateException("Hostname or IP address is " +
+                    "undefined.");
+        }
         if (isIpAddress(expectedName)) {
            matchIP(expectedName, cert);
         } else {
--- a/src/java.base/share/classes/sun/security/util/Password.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/security/util/Password.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -29,7 +29,7 @@
 import java.nio.*;
 import java.nio.charset.*;
 import java.util.Arrays;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * A utility class for reading passwords
--- a/src/java.base/share/classes/sun/text/bidi/BidiBase.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/text/bidi/BidiBase.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, 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
@@ -52,8 +52,8 @@
 import java.text.AttributedCharacterIterator;
 import java.text.Bidi;
 import java.util.Arrays;
-import jdk.internal.misc.JavaAWTFontAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTFontAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.text.normalizer.UBiDiProps;
 import sun.text.normalizer.UCharacter;
 import sun.text.normalizer.UTF16;
--- a/src/java.base/share/classes/sun/util/resources/Bundles.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/classes/sun/util/resources/Bundles.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -56,8 +56,8 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.spi.ResourceBundleProvider;
-import jdk.internal.misc.JavaUtilResourceBundleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaUtilResourceBundleAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  */
--- a/src/java.base/share/native/libjava/AccessController.c	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/share/native/libjava/AccessController.c	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -34,48 +34,13 @@
 #include "jvm.h"
 #include "java_security_AccessController.h"
 
-/*
- * Class:     java_security_AccessController
- * Method:    doPrivileged
- * Signature: (Ljava/security/PrivilegedAction;)Ljava/lang/Object;
- */
-JNIEXPORT jobject JNICALL Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2
-  (JNIEnv *env, jclass cls, jobject action)
-{
-    return JVM_DoPrivileged(env, cls, action, NULL, JNI_FALSE);
-}
-
-/*
- * Class:     java_security_AccessController
- * Method:    doPrivileged
- * Signature: (Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;
- */
-JNIEXPORT jobject JNICALL Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2
-  (JNIEnv *env, jclass cls, jobject action, jobject context)
+JNIEXPORT jobject JNICALL
+Java_java_security_AccessController_getProtectionDomain(
+                                                              JNIEnv *env,
+                                                              jclass cls,
+                                                              jclass caller)
 {
-    return JVM_DoPrivileged(env, cls, action, context, JNI_FALSE);
-}
-
-/*
- * Class:     java_security_AccessController
- * Method:    doPrivileged
- * Signature: (Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;
- */
-JNIEXPORT jobject JNICALL Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2
-  (JNIEnv *env, jclass cls, jobject action)
-{
-    return JVM_DoPrivileged(env, cls, action, NULL, JNI_TRUE);
-}
-
-/*
- * Class:     java_security_AccessController
- * Method:    doPrivileged
- * Signature: (Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;
- */
-JNIEXPORT jobject JNICALL Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2
-  (JNIEnv *env, jclass cls, jobject action, jobject context)
-{
-    return JVM_DoPrivileged(env, cls, action, context, JNI_TRUE);
+    return JVM_GetProtectionDomain(env, caller);
 }
 
 JNIEXPORT jobject JNICALL
--- a/src/java.base/unix/classes/java/lang/ProcessImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/unix/classes/java/lang/ProcessImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -47,8 +47,8 @@
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 import java.util.Properties;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.util.StaticProperty;
 import sun.security.action.GetPropertyAction;
 
--- a/src/java.base/unix/classes/sun/nio/ch/FileDispatcherImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/unix/classes/sun/nio/ch/FileDispatcherImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -28,8 +28,8 @@
 import java.io.FileDescriptor;
 import java.io.IOException;
 
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
 
 class FileDispatcherImpl extends FileDispatcher {
 
--- a/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, 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
@@ -30,8 +30,8 @@
 import java.io.FileDescriptor;
 import java.util.Set;
 
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
 import sun.nio.ch.FileChannelImpl;
 import sun.nio.ch.ThreadPool;
 import sun.nio.ch.SimpleAsynchronousFileChannelImpl;
--- a/src/java.base/windows/classes/java/lang/ProcessImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/windows/classes/java/lang/ProcessImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -43,8 +43,8 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.ref.CleanerFactory;
 
 /* This class is for the exclusive use of ProcessBuilder.start() to
--- a/src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,8 +25,8 @@
 package java.net;
 
 import java.io.IOException;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
 
 /**
  * This class defines the plain DatagramSocketImpl that is used on
--- a/src/java.base/windows/classes/java/net/PlainSocketImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/windows/classes/java/net/PlainSocketImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -27,10 +27,10 @@
 import java.io.IOException;
 import java.io.FileDescriptor;
 import java.security.AccessController;
-import java.security.PrivilegedAction;
+
 import sun.security.action.GetPropertyAction;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
 
 /**
  * On Windows system we simply delegate to native methods.
--- a/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -27,8 +27,8 @@
 
 import java.io.FileDescriptor;
 import java.io.IOException;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
 import sun.security.action.GetPropertyAction;
 import java.io.File;
 import java.nio.CharBuffer;
--- a/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -31,8 +31,8 @@
 import java.nio.BufferOverflowException;
 import java.io.IOException;
 import java.io.FileDescriptor;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
 
 /**
  * Windows implementation of AsynchronousFileChannel using overlapped I/O.
--- a/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, 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
@@ -34,8 +34,8 @@
 import java.nio.file.StandardOpenOption;
 import java.util.Set;
 
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.nio.ch.FileChannelImpl;
 import sun.nio.ch.ThreadPool;
 import sun.nio.ch.WindowsAsynchronousFileChannelImpl;
--- a/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c	Thu Nov 08 19:15:42 2018 -0500
@@ -311,8 +311,10 @@
     HANDLE handle = FindFirstFileW(lpFileName, &data);
     if (handle != INVALID_HANDLE_VALUE) {
         jstring name = (*env)->NewString(env, data.cFileName, (jsize)wcslen(data.cFileName));
-        if (name == NULL)
+        if (name == NULL) {
+            FindClose(handle);
             return;
+        }
         (*env)->SetLongField(env, obj, findFirst_handle, ptr_to_jlong(handle));
         (*env)->SetObjectField(env, obj, findFirst_name, name);
         (*env)->SetIntField(env, obj, findFirst_attributes, data.dwFileAttributes);
@@ -362,8 +364,10 @@
     handle = FindFirstStreamW(lpFileName, FindStreamInfoStandard, &data, 0);
     if (handle != INVALID_HANDLE_VALUE) {
         jstring name = (*env)->NewString(env, data.cStreamName, (jsize)wcslen(data.cStreamName));
-        if (name == NULL)
+        if (name == NULL) {
+            FindClose(handle);
             return;
+        }
         (*env)->SetLongField(env, obj, findStream_handle, ptr_to_jlong(handle));
         (*env)->SetObjectField(env, obj, findStream_name, name);
     } else {
--- a/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, 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
@@ -50,7 +50,7 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * The main class to parse JavaBeans XML archive.
--- a/src/java.desktop/share/classes/java/awt/EventQueue.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/java/awt/EventQueue.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -47,8 +47,8 @@
 
 import java.security.AccessControlContext;
 
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaSecurityAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
 
 /**
  * {@code EventQueue} is a platform-independent class
--- a/src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -25,7 +25,7 @@
 
 package java.awt.font;
 
-import jdk.internal.misc.JavaAWTFontAccess;
+import jdk.internal.access.JavaAWTFontAccess;
 
 class JavaAWTFontAccessImpl implements JavaAWTFontAccess {
 
--- a/src/java.desktop/share/classes/java/awt/font/NumericShaper.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/java/awt/font/NumericShaper.java	Thu Nov 08 19:15:42 2018 -0500
@@ -31,7 +31,7 @@
 import java.util.Comparator;
 import java.util.EnumSet;
 import java.util.Set;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * The {@code NumericShaper} class is used to convert Latin-1 (European)
--- a/src/java.desktop/share/classes/java/awt/font/TextAttribute.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/java/awt/font/TextAttribute.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -44,7 +44,7 @@
 import java.text.AttributedCharacterIterator.Attribute;
 import java.util.Map;
 import java.util.HashMap;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * The {@code TextAttribute} class defines attribute keys and
--- a/src/java.desktop/share/classes/java/beans/Introspector.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/java/beans/Introspector.java	Thu Nov 08 19:15:42 2018 -0500
@@ -42,15 +42,14 @@
 
 import java.util.Map;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.EventObject;
 import java.util.List;
 import java.util.TreeMap;
 
-import jdk.internal.misc.JavaBeansAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaBeansAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.reflect.misc.ReflectUtil;
 
 /**
--- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Thu Nov 08 19:15:42 2018 -0500
@@ -35,8 +35,8 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.applet.*;
 
-import jdk.internal.misc.JavaSecurityAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.awt.AWTAccessor;
 import sun.awt.AppContext;
 import sun.awt.DisplayChangedListener;
--- a/src/java.desktop/share/classes/javax/swing/TransferHandler.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/javax/swing/TransferHandler.java	Thu Nov 08 19:15:42 2018 -0500
@@ -46,9 +46,9 @@
 import java.security.PrivilegedAction;
 
 import java.security.AccessControlContext;
-import java.security.ProtectionDomain;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaSecurityAccess;
+
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
 
 import sun.awt.AWTAccessor;
 
--- a/src/java.desktop/share/classes/sun/awt/AppContext.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.desktop/share/classes/sun/awt/AppContext.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -44,8 +44,8 @@
 import java.beans.PropertyChangeListener;
 import java.lang.ref.SoftReference;
 
-import jdk.internal.misc.JavaAWTAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.util.logging.PlatformLogger;
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.Lock;
--- a/src/java.logging/share/classes/java/util/logging/Level.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.logging/share/classes/java/util/logging/Level.java	Thu Nov 08 19:15:42 2018 -0500
@@ -40,8 +40,8 @@
 import java.util.ResourceBundle;
 import java.util.function.Function;
 import jdk.internal.loader.ClassLoaderValue;
-import jdk.internal.misc.JavaUtilResourceBundleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaUtilResourceBundleAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * The Level class defines a set of standard logging levels that
--- a/src/java.logging/share/classes/java/util/logging/LogManager.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.logging/share/classes/java/util/logging/LogManager.java	Thu Nov 08 19:15:42 2018 -0500
@@ -39,8 +39,8 @@
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
-import jdk.internal.misc.JavaAWTAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTAccess;
+import jdk.internal.access.SharedSecrets;
 import sun.util.logging.internal.LoggingProviderImpl;
 import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
 
--- a/src/java.logging/share/classes/java/util/logging/Logger.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.logging/share/classes/java/util/logging/Logger.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, 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
@@ -37,8 +37,8 @@
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.function.Supplier;
 
-import jdk.internal.misc.JavaUtilResourceBundleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaUtilResourceBundleAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
--- a/src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -26,8 +26,8 @@
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
-import jdk.internal.misc.JavaBeansAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaBeansAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * A centralized place for gaining access to java.beans related functionality -
--- a/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, 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
@@ -80,8 +80,8 @@
 import javax.management.RuntimeOperationsException;
 import javax.management.ServiceNotFoundException;
 import javax.management.loading.ClassLoaderRepository;
-import jdk.internal.misc.JavaSecurityAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
+import jdk.internal.access.SharedSecrets;
 
 import sun.reflect.misc.MethodUtil;
 import sun.reflect.misc.ReflectUtil;
--- a/src/java.management/share/classes/javax/management/openmbean/TabularDataSupport.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.management/share/classes/javax/management/openmbean/TabularDataSupport.java	Thu Nov 08 19:15:42 2018 -0500
@@ -45,7 +45,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 // jmx import
 //
--- a/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java	Thu Nov 08 19:15:42 2018 -0500
@@ -39,8 +39,8 @@
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 
-import jdk.internal.misc.JavaNioAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNioAccess;
+import jdk.internal.access.SharedSecrets;
 
 import java.util.ArrayList;
 import java.util.List;
--- a/src/java.naming/share/classes/com/sun/jndi/ldap/VersionHelper.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.naming/share/classes/com/sun/jndi/ldap/VersionHelper.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -25,7 +25,7 @@
 
 package com.sun.jndi.ldap;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 import java.net.MalformedURLException;
 import java.net.URL;
--- a/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -57,7 +57,7 @@
 import java.security.ProtectionDomain;
 import java.text.MessageFormat;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import sun.rmi.runtime.Log;
 import sun.rmi.server.UnicastRef;
 import sun.rmi.server.UnicastServerRef;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -2020,6 +2020,7 @@
             for (IncorporationAction action : incorporationActions) {
                 uv2.incorporationActions.add(action.dup(uv2));
             }
+            uv2.kind = kind;
         }
 
         @Override
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Nov 08 19:15:42 2018 -0500
@@ -2419,7 +2419,7 @@
                                                clazztype.getMetadata());
 
                 Env<AttrContext> diamondEnv = localEnv.dup(tree);
-                diamondEnv.info.selectSuper = cdef != null;
+                diamondEnv.info.selectSuper = cdef != null || tree.classDeclRemoved();
                 diamondEnv.info.pendingResolutionPhase = null;
 
                 //if the type of the instance creation expression is a class type
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu Nov 08 19:15:42 2018 -0500
@@ -151,7 +151,7 @@
                         JCExpression clazz = copy(t.clazz, p);
                         List<JCExpression> args = copy(t.args, p);
                         JCClassDecl def = null;
-                        return make.at(t.pos).NewClass(encl, typeargs, clazz, args, def);
+                        return make.at(t.pos).SpeculativeNewClass(encl, typeargs, clazz, args, def, t.def != null);
                     } else {
                         return super.visitNewClass(node, p);
                     }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1787,6 +1787,10 @@
         public Tag getTag() {
             return NEWCLASS;
         }
+
+        public boolean classDeclRemoved() {
+            return false;
+        }
     }
 
     /**
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Thu Nov 08 19:15:42 2018 -0500
@@ -378,7 +378,24 @@
                              List<JCExpression> args,
                              JCClassDecl def)
     {
-        JCNewClass tree = new JCNewClass(encl, typeargs, clazz, args, def);
+        return SpeculativeNewClass(encl, typeargs, clazz, args, def, false);
+    }
+
+    public JCNewClass SpeculativeNewClass(JCExpression encl,
+                             List<JCExpression> typeargs,
+                             JCExpression clazz,
+                             List<JCExpression> args,
+                             JCClassDecl def,
+                             boolean classDefRemoved)
+    {
+        JCNewClass tree = classDefRemoved ?
+                new JCNewClass(encl, typeargs, clazz, args, def) {
+                    @Override
+                    public boolean classDeclRemoved() {
+                        return true;
+                    }
+                } :
+                new JCNewClass(encl, typeargs, clazz, args, def);
         tree.pos = pos;
         return tree;
     }
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_TLS12_KEY_MAT_PARAMS.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_TLS12_KEY_MAT_PARAMS.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,11 +1,12 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates.
- *
+ * Copyright (c) 2018, Red Hat, Inc.
  * 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.
+ * 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.
  *
  * 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/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_TLS12_MASTER_KEY_DERIVE_PARAMS.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_TLS12_MASTER_KEY_DERIVE_PARAMS.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,11 +1,12 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates.
- *
+ * Copyright (c) 2018, Red Hat, Inc.
  * 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.
+ * 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.
  *
  * 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/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_TLS_MAC_PARAMS.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_TLS_MAC_PARAMS.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,11 +1,12 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates.
- *
+ * Copyright (c) 2018, Red Hat, Inc.
  * 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.
+ * 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.
  *
  * 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/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -58,6 +58,7 @@
     /*
      * These flags are set if the corresponding support is in the hardware.
      */
+    // Checkstyle: stop
     final long aarch64FP = getConstant("VM_Version::CPU_FP", Long.class);
     final long aarch64ASIMD = getConstant("VM_Version::CPU_ASIMD", Long.class);
     final long aarch64EVTSTRM = getConstant("VM_Version::CPU_EVTSTRM", Long.class);
@@ -70,4 +71,5 @@
     final long aarch64STXR_PREFETCH = getConstant("VM_Version::CPU_STXR_PREFETCH", Long.class);
     final long aarch64A53MAC = getConstant("VM_Version::CPU_A53MAC", Long.class);
     final long aarch64DMB_ATOMICS = getConstant("VM_Version::CPU_DMB_ATOMICS", Long.class);
+    // Checkstyle: resume
 }
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -38,12 +38,14 @@
 
     final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
 
+    // @formatter:off
     // CPU capabilities:
     //
     // FIXME: Using a 64-bit value is insufficient to support future capability
     //        sets (including co-processor capabilities such as DAX).
     final long vmVersionFeatures = getFieldValue("Abstract_VM_Version::_features", Long.class, "uint64_t");
 
+    //
     // SPARC specific values:
     //
     // NOTE: Values changed into an enumeration (that do indeed fit within a
@@ -97,4 +99,5 @@
 
     final boolean useBlockZeroing = getFlag("UseBlockZeroing", Boolean.class);
     final int blockZeroingLowLimit = getFlag("BlockZeroingLowLimit", Integer.class);
+    // @formatter:on
 }
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -22,6 +22,8 @@
  */
 package jdk.vm.ci.hotspot;
 
+import java.util.Set;
+
 import jdk.vm.ci.code.CompilationRequest;
 import jdk.vm.ci.common.JVMCIError;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option;
@@ -30,7 +32,6 @@
 import jdk.vm.ci.runtime.JVMCIRuntime;
 import jdk.vm.ci.services.JVMCIPermission;
 import jdk.vm.ci.services.JVMCIServiceLocator;
-import jdk.vm.ci.services.internal.ReflectionAccessJDK;
 
 final class HotSpotJVMCICompilerConfig {
 
@@ -90,7 +91,7 @@
                 // Auto select a single available compiler
                 for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
                     if (factory == null) {
-                        ReflectionAccessJDK.openJVMCITo(f.getClass());
+                        openJVMCITo(f.getClass().getModule());
                         factory = f;
                     } else {
                         // Multiple factories seen - cancel auto selection
@@ -107,4 +108,20 @@
         }
         return compilerFactory;
     }
+
+    /**
+     * Opens all JVMCI packages to {@code otherModule}.
+     */
+    private static void openJVMCITo(Module otherModule) {
+        Module jvmci = HotSpotJVMCICompilerConfig.class.getModule();
+        if (jvmci != otherModule) {
+            Set<String> packages = jvmci.getPackages();
+            for (String pkg : packages) {
+                boolean opened = jvmci.isOpen(pkg, otherModule);
+                if (!opened) {
+                    jvmci.addOpens(pkg, otherModule);
+                }
+            }
+        }
+    }
 }
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java	Thu Nov 08 19:15:42 2018 -0500
@@ -147,9 +147,9 @@
     }
 
     /**
-     * Checks if this field has the {@link Stable} annotation.
+     * Checks if this field has the {@code Stable} annotation.
      *
-     * @return true if field has {@link Stable} annotation, false otherwise
+     * @return true if field has {@code Stable} annotation, false otherwise
      */
     @Override
     public boolean isStable() {
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -98,7 +98,7 @@
     }
 
     /**
-     * An assumption that a given class has no subclasses implementing {@link Object#finalize()}).
+     * An assumption that a given class has no subclasses implementing {@code Object#finalize()}).
      */
     public static final class NoFinalizableSubclass extends Assumption {
 
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml	Thu Nov 08 19:15:42 2018 -0500
@@ -191,6 +191,16 @@
       <property name="onCommentFormat" value="CheckStyle: stop generated"/>
       <property name="checkFormat" value=".*Name|.*LineLength|.*Header"/>
     </module>
+    <module name="SuppressionCommentFilter">
+      <property name="offCommentFormat" value="Checkstyle: stop"/>
+      <property name="onCommentFormat" value="Checkstyle: resume"/>
+      <property name="checkFormat" value=".*"/>
+    </module>
+    <module name="SuppressionCommentFilter">
+      <property name="offCommentFormat" value="@formatter:off"/>
+      <property name="onCommentFormat" value="@formatter:on"/>
+      <property name="checkFormat" value=".*"/>
+    </module>
   </module>
   <module name="RegexpHeader">
     <property name="header" value="/\*\n \* Copyright \(c\) (20[0-9][0-9], )?20[0-9][0-9], Oracle and/or its affiliates. All rights reserved.\n \* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n \*\n \* This code is free software; you can redistribute it and/or modify it\n \* under the terms of the GNU General Public License version 2 only, as\n \* published by the Free Software Foundation.\n \*\n \* This code is distributed in the hope that it will be useful, but WITHOUT\n \* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n \* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\n \* version 2 for more details \(a copy is included in the LICENSE file that\n \* accompanied this code\).\n \*\n \* You should have received a copy of the GNU General Public License version\n \* 2 along with this work; if not, write to the Free Software Foundation,\n \* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n \*\n \* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n \* or visit www.oracle.com if you need additional information or have any\n \* questions.\n \*/\n"/>
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -26,8 +26,6 @@
 import java.util.List;
 import java.util.ServiceLoader;
 
-import jdk.vm.ci.services.internal.ReflectionAccessJDK;
-
 /**
  * Service-provider class for the runtime to locate providers of JVMCI services where the latter are
  * not in packages exported by the JVMCI module. As part of instantiating a
@@ -61,7 +59,7 @@
     protected JVMCIServiceLocator() {
         this(checkPermission());
         Services.checkJVMCIEnabled();
-        ReflectionAccessJDK.openJVMCITo(getClass());
+        Services.openJVMCITo(getClass().getModule());
     }
 
     /**
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,8 +22,10 @@
  */
 package jdk.vm.ci.services;
 
-import java.lang.reflect.Method;
 import java.util.Map;
+import java.util.Set;
+
+import jdk.internal.misc.VM;
 
 /**
  * Provides utilities needed by JVMCI clients.
@@ -61,18 +63,7 @@
     private Services() {
     }
 
-    @SuppressWarnings("unchecked")
-    private static Map<String, String> initSavedProperties() throws InternalError {
-        try {
-            Class<?> vmClass = Class.forName("jdk.internal.misc.VM");
-            Method m = vmClass.getMethod("getSavedProperties");
-            return (Map<String, String>) m.invoke(null);
-        } catch (Exception e) {
-            throw new InternalError(e);
-        }
-    }
-
-    static final Map<String, String> SAVED_PROPERTIES = initSavedProperties();
+    static final Map<String, String> SAVED_PROPERTIES = VM.getSavedProperties();
     static final boolean JVMCI_ENABLED = Boolean.parseBoolean(SAVED_PROPERTIES.get("jdk.internal.vm.ci.enabled"));
 
     /**
@@ -107,4 +98,20 @@
             throw new InternalError(e);
         }
     }
+
+    /**
+     * Opens all JVMCI packages to {@code otherModule}.
+     */
+    static void openJVMCITo(Module otherModule) {
+        Module jvmci = Services.class.getModule();
+        if (jvmci != otherModule) {
+            Set<String> packages = jvmci.getPackages();
+            for (String pkg : packages) {
+                boolean opened = jvmci.isOpen(pkg, otherModule);
+                if (!opened) {
+                    jvmci.addOpens(pkg, otherModule);
+                }
+            }
+        }
+    }
 }
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/internal/ReflectionAccessJDK.java	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * 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 jdk.vm.ci.services.internal;
-
-import java.lang.reflect.Method;
-import java.util.Set;
-
-import jdk.vm.ci.services.Services;
-
-/**
- * Reflection based access to API introduced in JDK 9. This allows the API to be used in code that
- * must be compiled (but not executed) on JDK 8.
- */
-public final class ReflectionAccessJDK {
-
-    /**
-     * {@code Class.getModule()}.
-     */
-    private static final Method getModule;
-
-    /**
-     * {@code java.lang.Module.addOpens(String, Module)}.
-     */
-    private static final Method addOpens;
-
-    /**
-     * {@code java.lang.Module.getPackages(Module, String, Module)}.
-     */
-    private static final Method getPackages;
-
-    /**
-     * {@code java.lang.Module.isOpen(String, Module)}.
-     */
-    private static final Method isOpenTo;
-
-    /**
-     * Opens all JVMCI packages to the module of a given class.
-     *
-     * @param other all JVMCI packages will be opened to the module of this class
-     */
-    @SuppressWarnings("unchecked")
-    public static void openJVMCITo(Class<?> other) {
-        try {
-            Object jvmci = getModule.invoke(Services.class);
-            Object otherModule = getModule.invoke(other);
-            if (jvmci != otherModule) {
-                Set<String> packages = (Set<String>) getPackages.invoke(jvmci);
-                for (String pkg : packages) {
-                    boolean opened = (Boolean) isOpenTo.invoke(jvmci, pkg, otherModule);
-                    if (!opened) {
-                        addOpens.invoke(jvmci, pkg, otherModule);
-                    }
-                }
-            }
-        } catch (Exception e) {
-            throw new InternalError(e);
-        }
-    }
-
-    static {
-        try {
-            getModule = Class.class.getMethod("getModule");
-            Class<?> moduleClass = getModule.getReturnType();
-            getPackages = moduleClass.getMethod("getPackages");
-            isOpenTo = moduleClass.getMethod("isOpen", String.class, moduleClass);
-            addOpens = moduleClass.getDeclaredMethod("addOpens", String.class, moduleClass);
-        } catch (NoSuchMethodException | SecurityException e) {
-            throw new InternalError(e);
-        }
-    }
-}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -75,7 +75,8 @@
     }
 
     private static Object getConstantPoolForObject() {
-        String miscPackage = Java8OrEarlier ? "sun.misc" : "jdk.internal.misc";
+        String miscPackage = Java8OrEarlier ? "sun.misc"
+            : (Java11OrEarlier ? "jdk.internal.misc" : "jdk.internal.access");
         try {
             Class<?> sharedSecretsClass = Class.forName(miscPackage + ".SharedSecrets");
             Class<?> javaLangAccessClass = Class.forName(miscPackage + ".JavaLangAccess");
@@ -114,7 +115,10 @@
             Object javaBaseModule = JLModule.fromClass(String.class);
             Object cModule = JLModule.fromClass(c);
             uncheckedAddExports(javaBaseModule, "jdk.internal.reflect", cModule);
-            uncheckedAddExports(javaBaseModule, "jdk.internal.misc", cModule);
+            if (Java11OrEarlier)
+                uncheckedAddExports(javaBaseModule, "jdk.internal.misc", cModule);
+            else
+                uncheckedAddExports(javaBaseModule, "jdk.internal.access", cModule);
         }
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -72,6 +72,7 @@
     }
 
     public static final boolean Java8OrEarlier = GraalServices.Java8OrEarlier;
+    public static final boolean Java11OrEarlier = GraalServices.Java11OrEarlier;
 
     protected Method getMethod(String methodName) {
         return getMethod(getClass(), methodName);
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -30,18 +30,16 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.lang.invoke.MethodType;
-import java.lang.module.ModuleDescriptor;
 import java.nio.file.Files;
 import java.util.EnumSet;
 import java.util.Map;
-import java.util.Optional;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaLangInvokeAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaLangInvokeAccess;
 import jdk.tools.jlink.plugin.ResourcePoolEntry;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.plugin.ResourcePool;
--- a/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java	Thu Nov 08 19:15:42 2018 -0500
@@ -33,8 +33,8 @@
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * Defines extended socket options, beyond those defined in
--- a/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedCopyOption.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedCopyOption.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -26,7 +26,7 @@
 package com.sun.nio.file;
 
 import java.nio.file.CopyOption;
-import sun.nio.fs.ExtendedOptions;
+import jdk.internal.misc.FileSystemOption;
 
 /**
  * Defines <em>extended</em> copy options supported on some platforms
@@ -40,9 +40,9 @@
      * The copy may be interrupted by the {@link Thread#interrupt interrupt}
      * method.
      */
-    INTERRUPTIBLE(ExtendedOptions.INTERRUPTIBLE);
+    INTERRUPTIBLE(FileSystemOption.INTERRUPTIBLE);
 
-    ExtendedCopyOption(ExtendedOptions.InternalOption<Void> option) {
+    ExtendedCopyOption(FileSystemOption<Void> option) {
         option.register(this);
     }
 }
--- a/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedOpenOption.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedOpenOption.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -26,7 +26,7 @@
 package com.sun.nio.file;
 
 import java.nio.file.OpenOption;
-import sun.nio.fs.ExtendedOptions;
+import jdk.internal.misc.FileSystemOption;
 
 /**
  * Defines <em>extended</em> open options supported on some platforms
@@ -39,15 +39,15 @@
     /**
      * Prevent operations on the file that request read access.
      */
-    NOSHARE_READ(ExtendedOptions.NOSHARE_READ),
+    NOSHARE_READ(FileSystemOption.NOSHARE_READ),
     /**
      * Prevent operations on the file that request write access.
      */
-    NOSHARE_WRITE(ExtendedOptions.NOSHARE_WRITE),
+    NOSHARE_WRITE(FileSystemOption.NOSHARE_WRITE),
     /**
      * Prevent operations on the file that request delete access.
      */
-    NOSHARE_DELETE(ExtendedOptions.NOSHARE_DELETE),
+    NOSHARE_DELETE(FileSystemOption.NOSHARE_DELETE),
 
     /**
      * Requires that direct I/O be used for read or write access.
@@ -69,9 +69,9 @@
      *
      * @since 10
      */
-    DIRECT(ExtendedOptions.DIRECT);
+    DIRECT(FileSystemOption.DIRECT);
 
-    ExtendedOpenOption(ExtendedOptions.InternalOption<Void> option) {
+    ExtendedOpenOption(FileSystemOption<Void> option) {
         option.register(this);
     }
 }
--- a/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedWatchEventModifier.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedWatchEventModifier.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -26,7 +26,7 @@
 package com.sun.nio.file;
 
 import java.nio.file.WatchEvent.Modifier;
-import sun.nio.fs.ExtendedOptions;
+import jdk.internal.misc.FileSystemOption;
 
 /**
  * Defines <em>extended</em> watch event modifiers supported on some platforms
@@ -40,9 +40,9 @@
     /**
      * Register a file tree instead of a single directory.
      */
-    FILE_TREE(ExtendedOptions.FILE_TREE);
+    FILE_TREE(FileSystemOption.FILE_TREE);
 
-    ExtendedWatchEventModifier(ExtendedOptions.InternalOption<Void> option) {
+    ExtendedWatchEventModifier(FileSystemOption<Void> option) {
         option.register(this);
     }
 }
--- a/src/jdk.unsupported/share/classes/com/sun/nio/file/SensitivityWatchEventModifier.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.unsupported/share/classes/com/sun/nio/file/SensitivityWatchEventModifier.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -26,7 +26,7 @@
 package com.sun.nio.file;
 
 import java.nio.file.WatchEvent.Modifier;
-import sun.nio.fs.ExtendedOptions;
+import jdk.internal.misc.FileSystemOption;
 
 /**
  * Defines the <em>sensitivity levels</em> when registering objects with a
@@ -39,15 +39,15 @@
     /**
      * High sensitivity.
      */
-    HIGH(ExtendedOptions.SENSITIVITY_HIGH, 2),
+    HIGH(FileSystemOption.SENSITIVITY_HIGH, 2),
     /**
      * Medium sensitivity.
      */
-    MEDIUM(ExtendedOptions.SENSITIVITY_MEDIUM, 10),
+    MEDIUM(FileSystemOption.SENSITIVITY_MEDIUM, 10),
     /**
      * Low sensitivity.
      */
-    LOW(ExtendedOptions.SENSITIVITY_LOW, 30);
+    LOW(FileSystemOption.SENSITIVITY_LOW, 30);
 
     /**
      * Returns the sensitivity in seconds.
@@ -57,7 +57,7 @@
     }
 
     private final int sensitivity;
-    private SensitivityWatchEventModifier(ExtendedOptions.InternalOption<Integer> option,
+    private SensitivityWatchEventModifier(FileSystemOption<Integer> option,
                                           int sensitivity) {
         this.sensitivity = sensitivity;
         option.register(this, sensitivity);
--- a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Thu Nov 08 19:15:42 2018 -0500
@@ -27,10 +27,8 @@
 
 import jdk.internal.vm.annotation.ForceInline;
 import jdk.internal.misc.VM;
-import jdk.internal.ref.Cleaner;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
-import sun.nio.ch.DirectBuffer;
 
 import java.lang.reflect.Field;
 import java.util.Set;
@@ -1234,13 +1232,6 @@
         if (!directBuffer.isDirect())
             throw new IllegalArgumentException("buffer is non-direct");
 
-        DirectBuffer db = (DirectBuffer)directBuffer;
-        if (db.attachment() != null)
-            throw new IllegalArgumentException("duplicate or slice");
-
-        Cleaner cleaner = db.cleaner();
-        if (cleaner != null) {
-            cleaner.clean();
-        }
+        theInternalUnsafe.invokeCleaner(directBuffer);
     }
 }
--- a/test/hotspot/jtreg/ProblemList-graal.txt	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/ProblemList-graal.txt	Thu Nov 08 19:15:42 2018 -0500
@@ -43,8 +43,6 @@
 
 compiler/jvmci/SecurityRestrictionsTest.java                    8181837   generic-all
 
-compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java  8204521   windows-all
-
 compiler/unsafe/UnsafeGetConstantField.java                     8181833   generic-all
 compiler/unsafe/UnsafeGetStableArrayElement.java                8181833   generic-all
 compiler/unsafe/UnsafeOffHeapBooleanTest.java                   8181833   generic-all
--- a/test/hotspot/jtreg/ProblemList.txt	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/ProblemList.txt	Thu Nov 08 19:15:42 2018 -0500
@@ -185,8 +185,6 @@
 vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted004/TestDescription.java 7013634,6606767 generic-all
 vmTestbase/nsk/jvmti/ThreadStart/threadstart001/TestDescription.java 8016181 generic-all
 vmTestbase/nsk/jvmti/scenarios/extension/EX03/ex03t001/TestDescription.java 8173658 generic-all
-vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t002/TestDescription.java 8204506,8203350 generic-all
-vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t001/hs204t001.java 6813266 generic-all
 vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t003/TestDescription.java 8051349 generic-all
 vmTestbase/nsk/jvmti/AttachOnDemand/attach034/TestDescription.java 8042145 generic-all
 vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 generic-all
--- a/test/hotspot/jtreg/applications/ctw/modules/generate.bash	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/generate.bash	Thu Nov 08 19:15:42 2018 -0500
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-#  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
@@ -30,7 +30,7 @@
     echo creating $file for $module...
     cat > $file <<EOF
 /*
- * 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
@@ -57,7 +57,8 @@
  * @summary run CTW for all classes from $module module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules $module
--- a/test/hotspot/jtreg/applications/ctw/modules/java_base.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_base.java	Thu Nov 08 19:15:42 2018 -0500
@@ -26,7 +26,8 @@
  * @summary run CTW for some classes from java.base module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.base
--- a/test/hotspot/jtreg/applications/ctw/modules/java_base_2.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_base_2.java	Thu Nov 08 19:15:42 2018 -0500
@@ -26,7 +26,8 @@
  * @summary run CTW for some classes from java.base module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.base
--- a/test/hotspot/jtreg/applications/ctw/modules/java_compiler.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_compiler.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.compiler module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.compiler
--- a/test/hotspot/jtreg/applications/ctw/modules/java_datatransfer.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_datatransfer.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.datatransfer module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.datatransfer
--- a/test/hotspot/jtreg/applications/ctw/modules/java_desktop.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_desktop.java	Thu Nov 08 19:15:42 2018 -0500
@@ -26,7 +26,8 @@
  * @summary run CTW for some classes from java.desktop module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.desktop
--- a/test/hotspot/jtreg/applications/ctw/modules/java_desktop_2.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_desktop_2.java	Thu Nov 08 19:15:42 2018 -0500
@@ -26,7 +26,8 @@
  * @summary run CTW for some classes from java.desktop module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.desktop
--- a/test/hotspot/jtreg/applications/ctw/modules/java_instrument.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_instrument.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.instrument module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.instrument
--- a/test/hotspot/jtreg/applications/ctw/modules/java_logging.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_logging.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.logging module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.logging
--- a/test/hotspot/jtreg/applications/ctw/modules/java_management.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_management.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.management module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.management
--- a/test/hotspot/jtreg/applications/ctw/modules/java_management_rmi.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_management_rmi.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.management.rmi module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.management.rmi
--- a/test/hotspot/jtreg/applications/ctw/modules/java_naming.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_naming.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.naming module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.naming
--- a/test/hotspot/jtreg/applications/ctw/modules/java_prefs.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_prefs.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.prefs module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.prefs
--- a/test/hotspot/jtreg/applications/ctw/modules/java_rmi.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_rmi.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.rmi module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.rmi
--- a/test/hotspot/jtreg/applications/ctw/modules/java_scripting.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_scripting.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.scripting module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.scripting
--- a/test/hotspot/jtreg/applications/ctw/modules/java_security_jgss.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_security_jgss.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.security.jgss module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.security.jgss
--- a/test/hotspot/jtreg/applications/ctw/modules/java_security_sasl.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_security_sasl.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.security.sasl module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.security.sasl
--- a/test/hotspot/jtreg/applications/ctw/modules/java_smartcardio.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_smartcardio.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.smartcardio module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.smartcardio
--- a/test/hotspot/jtreg/applications/ctw/modules/java_sql.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_sql.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.sql module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.sql
--- a/test/hotspot/jtreg/applications/ctw/modules/java_sql_rowset.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_sql_rowset.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.sql.rowset module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.sql.rowset
--- a/test/hotspot/jtreg/applications/ctw/modules/java_xml.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_xml.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.xml module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.xml
--- a/test/hotspot/jtreg/applications/ctw/modules/java_xml_crypto.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_xml_crypto.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from java.xml.crypto module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules java.xml.crypto
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_accessibility.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_accessibility.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.accessibility module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.accessibility
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_aot.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_aot.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.aot module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.aot
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_attach.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_attach.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.attach module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.attach
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_charsets.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_charsets.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.charsets module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.charsets
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_compiler.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_compiler.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.compiler module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.compiler
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_cryptoki.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_cryptoki.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.crypto.cryptoki module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.crypto.cryptoki
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.crypto.ec module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.crypto.ec
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_mscapi.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_mscapi.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.crypto.mscapi module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.crypto.mscapi
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ucrypto.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ucrypto.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.crypto.ucrypto module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.crypto.ucrypto
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_dynalink.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_dynalink.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.dynalink module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.dynalink
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_editpad.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_editpad.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.editpad module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.editpad
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_hotspot_agent.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_hotspot_agent.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.hotspot.agent module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.hotspot.agent
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_httpserver.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_httpserver.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.httpserver module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.httpserver
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_incubator_httpclient.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_incubator_httpclient.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.incubator.httpclient module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.incubator.httpclient
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_ed.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_ed.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.internal.ed module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.internal.ed
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_jvmstat.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_jvmstat.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.internal.jvmstat module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.internal.jvmstat
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_le.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_le.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.internal.le module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.internal.le
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_opt.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_opt.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.internal.opt module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.internal.opt
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_ci.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_ci.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.internal.vm.ci module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.internal.vm.ci
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.internal.vm.compiler module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.internal.vm.compiler
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler_management.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler_management.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.internal.vm.compiler.management module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.internal.vm.compiler.management
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jartool.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jartool.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jartool module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jartool
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_javadoc.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_javadoc.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.javadoc module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.javadoc
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jcmd.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jcmd.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jcmd module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jcmd
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jconsole.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jconsole.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jconsole module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jconsole
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jdeps.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jdeps.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jdeps module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jdeps
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jdi.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jdi.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jdi module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jdi
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jlink.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jlink.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jlink module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jlink
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jshell.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jshell.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jshell module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jshell
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jsobject module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jsobject
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jstatd.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jstatd.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.jstatd module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.jstatd
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.localedata module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.localedata
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_management.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_management.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.management module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.management
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_management_agent.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_management_agent.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.management.agent module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.management.agent
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_dns.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_dns.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.naming.dns module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.naming.dns
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_rmi.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_rmi.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.naming.rmi module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.naming.rmi
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_net.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_net.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.net module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.net
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_packager.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_packager.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.packager module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.packager
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_packager_services.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_packager_services.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.packager.services module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.packager.services
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_rmic.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_rmic.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.rmic module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.rmic
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.scripting.nashorn module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.scripting.nashorn
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn_shell.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn_shell.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.scripting.nashorn.shell module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.scripting.nashorn.shell
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_sctp.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_sctp.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.sctp module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.sctp
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_security_auth.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_security_auth.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.security.auth module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.security.auth
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_security_jgss.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_security_jgss.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.security.jgss module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.security.jgss
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_unsupported.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_unsupported.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.unsupported module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.unsupported
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_xml_dom.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_xml_dom.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.xml.dom module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.xml.dom
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_zipfs.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_zipfs.java	Thu Nov 08 19:15:42 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
@@ -26,7 +26,8 @@
  * @summary run CTW for all classes from jdk.zipfs module
  *
  * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  * @modules jdk.zipfs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/c2/Test8bitLogicalOperators.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,53 @@
+/*
+ * 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 8213479
+ * @summary Missing x86_64.ad patterns for 8-bit logical operators with destination in memory
+ *
+ * @run main/othervm -Xcomp -XX:-Inline -XX:CompileOnly=compiler.c2.Test8bitLogicalOperators::test
+ *      compiler.c2.Test8bitLogicalOperators
+ */
+
+package compiler.c2;
+
+public class Test8bitLogicalOperators {
+    private static byte and = 0b0011, or = 0b0011, xor = 0b0011;
+    private static byte mask = 0b0101;
+
+    public static void main(String... args) {
+        test();
+
+        if (and != 0b0001 || or != 0b0111 || xor != 0b0110)
+            throw new AssertionError("8-bit logical operator failure");
+    }
+
+    public static void test() {
+        and &= mask;
+
+        or |= mask;
+
+        xor ^= mask;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/gcbarriers/EqvUncastStepOverBarrier.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,81 @@
+/*
+ * 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 8212673
+ * @summary Node::eqv_uncast() shouldn't step over load barriers unconditionally
+ * @library /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseOnStackReplacement -XX:-TieredCompilation -XX:-BackgroundCompilation EqvUncastStepOverBarrier
+ */
+
+import sun.hotspot.WhiteBox;
+import java.lang.reflect.Method;
+
+public class EqvUncastStepOverBarrier {
+    static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+
+    private static Object field = new A();
+
+    public static void main(String[] args) throws Exception {
+        for (int i = 0; i < 20_000; i++) {
+            test();
+            test();
+            test_helper(null, 0);
+        }
+        Method m = EqvUncastStepOverBarrier.class.getDeclaredMethod("test");
+        WHITE_BOX.enqueueMethodForCompilation(m, 4);
+        if (!WHITE_BOX.isMethodCompiled(m, false)) {
+            throw new RuntimeException("Method compilation failed");
+        }
+    }
+
+    private static Object test() {
+        Object o = field;
+        if (o == null) {}
+        for (int i = 1; i < 100; i *= 2) {
+            int j = 0;
+            for (; j < 4; j++) ;
+            o = test_helper(o, j);
+        }
+        return o;
+    }
+
+    private static Object test_helper(Object o, int j) {
+        if (j == 4) {
+            A a = (A) o;
+            o = a;
+        } else {
+            o = new Object();
+        }
+        return o;
+    }
+
+    private static class A {
+    }
+}
--- a/test/hotspot/jtreg/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -115,16 +115,15 @@
         mainAttrs.putValue("Can-Redefine-Classes", "true");
         mainAttrs.putValue("Can-Retransform-Classes", "true");
 
-        Path jar = Files.createTempFile("myagent", ".jar");
-        try {
-            JarOutputStream jarStream = new JarOutputStream(new FileOutputStream(jar.toFile()), manifest);
-            add(jarStream, FooAgent.class);
-            add(jarStream, FooTransformer.class);
-            jarStream.close();
-            runAgent(jar);
-        } finally {
-            Files.deleteIfExists(jar);
-        }
+        // The jar file will be added to the system classloader search path.  It is not safe
+        // to delete it while the JVM is running, so make sure to create it in the test
+        // directory so it will be cleaned up by the test harness.
+        Path jar = Files.createTempFile(Path.of(""), "myagent", ".jar");
+        JarOutputStream jarStream = new JarOutputStream(new FileOutputStream(jar.toFile()), manifest);
+        add(jarStream, FooAgent.class);
+        add(jarStream, FooTransformer.class);
+        jarStream.close();
+        runAgent(jar);
     }
 
     public static void runAgent(Path agent) throws Exception {
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -28,7 +28,7 @@
 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.org.objectweb.asm.Opcodes;
 import jdk.internal.reflect.ConstantPool;
 import jdk.internal.reflect.ConstantPool.Tag;
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -28,7 +28,7 @@
  * @summary Testing compiler.jvmci.CompilerToVM.lookupKlassInPool method
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupTypeTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupTypeTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library / /test/lib
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -27,7 +27,8 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -28,7 +28,7 @@
  * @summary Testing compiler.jvmci.CompilerToVM.resolveTypeInPool method
  * @library /test/lib /
  * @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
--- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java	Thu Nov 08 19:15:42 2018 -0500
@@ -44,7 +44,6 @@
         {"MaxRAMFraction",            "8"},
         {"MinRAMFraction",            "2"},
         {"InitialRAMFraction",        "64"},
-        {"UseMembar",                 "true"},
         {"TLABStats",                 "false"},
 
         // deprecated alias flags (see also aliased_jvm_flags):
--- a/test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivRunAbstract.jasm	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivRunAbstract.jasm	Thu Nov 08 19:15:42 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @summary Test that JVM_DoPrivilege throws java.lang.InternalError for an
+ * @summary Test that AccessController.doPrivileged throws java.lang.AbstractMethodError for an
  *          abstract run() method.
  * @bug 8183962
  * @compile DoPrivRunAbstract.jasm
@@ -56,8 +56,8 @@
 //    public static void main(String[] args) throws Exception {
 //        try {
 //            doPrivileged(() -> System.out.println(System.getProperty("java.home")));
-//            throw new RuntimeException("Expected InternalError not throw");
-//        } catch (java.lang.InternalError e) { }
+//            throw new RuntimeException("Expected AbstractMethodError not throw");
+//        } catch (java.lang.AbstractMethodError e) { }
 //    }
 //}
 
@@ -82,13 +82,13 @@
         invokestatic    Method doPrivileged:"(LDoPrivRunAbstract$VoidPrivActRunAbstract;)V";
         new    class java/lang/RuntimeException;
         dup;
-        ldc    String "Expected InternalError not throw";
+        ldc    String "Expected AbstractMethodError not throw";
         invokespecial    Method java/lang/RuntimeException."<init>":"(Ljava/lang/String;)V";
         athrow;
         endtry t0;
-        catch t0 java/lang/InternalError;
+        catch t0 java/lang/AbstractMethodError;
         stack_frame_type stack1;
-        stack_map class java/lang/InternalError;
+        stack_map class java/lang/AbstractMethodError;
         astore_1;
         return;
     }
--- a/test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivileged.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivileged.java	Thu Nov 08 19:15:42 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @summary Test that JVM_DoPrivilege() searches default methods when looking
+ * @summary Test that AccessController.doPrivileged() searches default methods when looking
  *          for the run() method.
  * @bug 8183962
  * @run main DoPrivileged
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/ParentClassLoader.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+import java.util.*;
+import java.io.*;
+
+// Delegating class loader which never defines a class.
+public class ParentClassLoader extends ClassLoader {
+    public ParentClassLoader() { super(); }
+    public ParentClassLoader(String name, ClassLoader l) { super(name, l); }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/PreemptingChildClassLoader.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+import java.util.*;
+import java.io.*;
+
+public class PreemptingChildClassLoader extends ParentClassLoader {
+
+    private static ClassLoader p = new ParentClassLoader();
+    private final Set<String> names = new HashSet<>();
+    boolean checkLoaded = true;
+
+    public PreemptingChildClassLoader(String... names) {
+        for (String n : names) this.names.add(n);
+    }
+
+    public PreemptingChildClassLoader(String name, String[] names) {
+        super(name, p);
+        for (String n : names) this.names.add(n);
+    }
+
+    public PreemptingChildClassLoader(String name, String[] names, boolean cL) {
+        super(name, p);
+        for (String n : names) this.names.add(n);
+        checkLoaded = cL;
+    }
+
+    protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+        if (!names.contains(name)) return super.loadClass(name, resolve);
+        Class<?> result = checkLoaded ? findLoadedClass(name) : null;
+        if (result == null) {
+            String filename = name.replace('.', '/') + ".class";
+            try (InputStream data = getResourceAsStream(filename)) {
+                if (data == null) throw new ClassNotFoundException();
+                try (ByteArrayOutputStream buffer = new ByteArrayOutputStream()) {
+                    int b;
+                    do {
+                        b = data.read();
+                        if (b >= 0) buffer.write(b);
+                    } while (b >= 0);
+                    byte[] bytes = buffer.toByteArray();
+                    result = defineClass(name, bytes, 0, bytes.length);
+                }
+            } catch (IOException e) {
+                throw new ClassNotFoundException("Error reading class file", e);
+            }
+        }
+        if (resolve) resolveClass(result);
+        return result;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/Test.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,83 @@
+/*
+ * 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 8199852
+ * @summary Test exception messages of LinkageError with a parent class loader
+ *          that is not known to the VM. A class loader loads
+ *          twice the same class. Should trigger exception in
+ *          SystemDictionary::check_constraints().
+ * @compile ../common/Foo.java
+ * @compile ../common/J.java
+ * @compile ParentClassLoader.java
+ *          PreemptingChildClassLoader.java
+ * @run main/othervm Test
+ */
+
+public class Test {
+
+    // Check that all names have external formatting ('.' and not '/' in package names).
+    // Check for parent of class loader.
+    // Break expectedErrorMessage into 2 parts due to the class loader name containing
+    // the unique @<id> identity hash which cannot be compared against.
+
+    // Check that all names have external formatting ('.' and not '/' in package names).
+    // Check for name and parent of class loader. Type should be mentioned as 'class'.
+    static String expectedErrorMessage_part1 = "loader 'DuplicateParentLE_Test_Loader' @";
+    static String expectedErrorMessage_part2 = " attempted duplicate class definition for test.Foo. (test.Foo is in unnamed module of loader 'DuplicateParentLE_Test_Loader' @";
+    static String expectedErrorMessage_part3 = ", parent loader ParentClassLoader @";
+
+
+    // Test that the error message is correct when a loader constraint error is
+    // detected during vtable creation.
+    //
+    // In this test, during vtable creation for class Task, method "Task.m()LFoo;"
+    // overrides "J.m()LFoo;".  But, Task's class Foo and super type J's class Foo
+    // are different.  So, a LinkageError exception should be thrown because the
+    // loader constraint check will fail.
+    public static void test(String loaderName,
+                            String testType) throws Exception {
+        String[] classNames = {testType};
+        ClassLoader l = new PreemptingChildClassLoader(loaderName, classNames, false);
+        l.loadClass(testType);
+        try {
+            l.loadClass(testType).newInstance();
+            throw new RuntimeException("Expected LinkageError exception not thrown");
+        } catch (LinkageError e) {
+            String errorMsg = e.getMessage();
+            if (!errorMsg.contains(expectedErrorMessage_part1) ||
+                !errorMsg.contains(expectedErrorMessage_part2) ||
+                !errorMsg.contains(expectedErrorMessage_part3)) {
+                System.out.println("Expected: " + expectedErrorMessage_part1 + "<id>" + expectedErrorMessage_part2 + "\n" +
+                                   "but got:  " + errorMsg);
+                throw new RuntimeException("Wrong LinkageError exception thrown: " + errorMsg);
+            }
+            System.out.println("Passed with message: " + errorMsg);
+        }
+    }
+
+    public static void main(String args[]) throws Exception {
+        test("DuplicateParentLE_Test_Loader", "test.Foo");
+    }
+}
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java	Thu Nov 08 19:15:42 2018 -0500
@@ -31,7 +31,7 @@
  *        "--limit-modules java.base" option is specified
  * @requires vm.cds & !vm.graal.enabled
  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.management
  *          jdk.jartool/sun.tools.jar
  *          jdk.internal.jvmstat/sun.jvmstat.monitor
@@ -66,7 +66,7 @@
         List<String> argsList = new ArrayList<String>();
         argsList.add(classPath);
         argsList.add(bootclasspath);
-        argsList.add("--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED");
+        argsList.add("--add-exports=java.base/jdk.internal.access=ALL-UNNAMED");
         argsList.add("EmptyClassHelper");
 
         // case 1: load class in bootclasspath using app loader
--- a/test/hotspot/jtreg/runtime/appcds/test-classes/EmptyClassHelper.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/test-classes/EmptyClassHelper.java	Thu Nov 08 19:15:42 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
@@ -23,9 +23,10 @@
  */
 
 import java.lang.*;
-import java.lang.reflect.*;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.SharedSecrets;
+
+import java.lang.reflect.Method;
+import jdk.internal.access.JavaLangAccess;
+import jdk.internal.access.SharedSecrets;
 
 class EmptyClassHelper {
     static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/serviceability/jvmti/GetLocalVariable/GetLocalVars.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,75 @@
+/*
+ * 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 8080406
+ * @summary VM_GetOrSetLocal doesn't check local slot type against requested type
+ *
+ * @compile GetLocalVars.java
+ * @run main/othervm/native -Xcomp -agentlib:GetLocalVars GetLocalVars
+ */
+
+
+public class GetLocalVars {
+    private static final String agentLib = "GetLocalVars";
+
+    static native void testLocals(Thread thread);
+    static native int getStatus();
+
+    public static
+    void main(String[] args) throws Exception {
+        try {
+            System.loadLibrary(agentLib);
+        } catch (UnsatisfiedLinkError ex) {
+            System.err.println("Failed to load " + agentLib + " lib");
+            System.err.println("java.library.path: " + System.getProperty("java.library.path"));
+            throw ex;
+        }
+        run(args);
+        int status = getStatus();
+        if (status != 0) {
+            throw new RuntimeException("Test GetLocalVars failed with a bad status: " + status);
+        }
+    }
+
+    public static
+    void run(String argv[]) {
+        GetLocalVars testedObj = new GetLocalVars();
+        double pi = 3.14d;
+        byte sym = 'X';
+        int year = 2018;
+
+        staticMeth(sym, testedObj, pi, year);
+    }
+
+    public static synchronized
+    int staticMeth(byte byteArg, Object objArg, double dblArg, int intArg) {
+        testLocals(Thread.currentThread());
+        {
+            int intLoc = 9999;
+            intArg = intLoc;
+        }
+        return intArg;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/serviceability/jvmti/GetLocalVariable/libGetLocalVars.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2003, 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 <stdio.h>
+#include <string.h>
+#include "jvmti.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define STATUS_PASSED 0
+#define STATUS_FAILED 2
+#define TranslateError(err) "JVMTI error"
+
+static jint result = STATUS_PASSED;
+static jvmtiEnv *jvmti = NULL;
+
+#define DECL_TEST_FUNC(type, Type) \
+static void \
+test_##type(jthread thr, int depth, int slot, const char* exp_type) { \
+  j##type val; \
+  jvmtiError err = jvmti->GetLocal##Type(thr, depth, slot, &val); \
+  \
+  printf(" GetLocal%s: %s (%d)\n", #Type, TranslateError(err), err); \
+  if (err != JVMTI_ERROR_NONE) { \
+    printf(" FAIL: GetLocal%s failed to get value from a local %s\n", #Type, exp_type); \
+    result = STATUS_FAILED; \
+  } else { \
+    printf(" GetLocal%s got value from a local %s as expected\n", #Type, exp_type); \
+  } \
+}
+
+#define DECL_TEST_INV_SLOT_FUNC(type, Type) \
+static void \
+test_##type##_inv_slot(jthread thr, int depth, int slot, const char* exp_type) { \
+  j##type val; \
+  jvmtiError err = jvmti->GetLocal##Type(thr, depth, slot, &val); \
+  \
+  printf(" GetLocal%s: %s (%d)\n", #Type, TranslateError(err), err); \
+  if (err != JVMTI_ERROR_INVALID_SLOT) { \
+    printf(" FAIL: GetLocal%s failed to return JVMTI_ERROR_INVALID_SLOT for local %s\n", #Type, exp_type); \
+    result = STATUS_FAILED; \
+  } else { \
+    printf(" GetLocal%s returned JVMTI_ERROR_INVALID_SLOT for local %s as expected\n", #Type, exp_type); \
+  } \
+}
+
+#define DECL_TEST_TYPE_MISMATCH_FUNC(type, Type) \
+static void \
+test_##type##_type_mismatch(jthread thr, int depth, int slot, const char* exp_type) { \
+  j##type val; \
+  jvmtiError err = jvmti->GetLocal##Type(thr, depth, slot, &val); \
+  \
+  printf(" GetLocal%s: %s (%d)\n", #Type, TranslateError(err), err); \
+  if (err != JVMTI_ERROR_TYPE_MISMATCH) { \
+    printf(" FAIL: GetLocal%s failed to return JVMTI_ERROR_TYPE_MISMATCH for local %s\n", #Type, exp_type); \
+    result = STATUS_FAILED; \
+  } else { \
+    printf(" GetLocal%s returned JVMTI_ERROR_TYPE_MISMATCH for local %s as expected\n", #Type, exp_type); \
+  } \
+}
+
+DECL_TEST_FUNC(int, Int);
+DECL_TEST_FUNC(float, Float);
+DECL_TEST_FUNC(long, Long);
+DECL_TEST_FUNC(double, Double);
+DECL_TEST_FUNC(object, Object);
+
+DECL_TEST_INV_SLOT_FUNC(int, Int);
+DECL_TEST_INV_SLOT_FUNC(float, Float);
+DECL_TEST_INV_SLOT_FUNC(long, Long);
+DECL_TEST_INV_SLOT_FUNC(double, Double);
+DECL_TEST_INV_SLOT_FUNC(object, Object);
+
+DECL_TEST_TYPE_MISMATCH_FUNC(int, Int);
+DECL_TEST_TYPE_MISMATCH_FUNC(float, Float);
+DECL_TEST_TYPE_MISMATCH_FUNC(long, Long);
+DECL_TEST_TYPE_MISMATCH_FUNC(double, Double);
+DECL_TEST_TYPE_MISMATCH_FUNC(object, Object);
+
+static void
+test_local_byte(jthread thr, int depth, int slot) {
+  printf("\n test_local_byte: BEGIN\n\n");
+
+  test_int(thr, depth, slot, "byte");
+  test_long_inv_slot(thr, depth, slot, "byte");
+  test_float(thr, depth, slot, "byte");
+  test_double_inv_slot(thr, depth, slot, "byte");
+  test_object_type_mismatch(thr, depth, slot, "byte");
+
+  printf("\n test_local_byte: END\n\n");
+}
+
+static void
+test_local_object(jthread thr, int depth, int slot) {
+  printf("\n test_local_object: BEGIN\n\n");
+
+  test_int_type_mismatch(thr, depth, slot, "object");
+  test_long_type_mismatch(thr, depth, slot, "object");
+  test_float_type_mismatch(thr, depth, slot, "object");
+  test_double_type_mismatch(thr, depth, slot, "object");
+  test_object(thr, depth, slot, "object");
+
+  printf("\n test_local_object: END\n\n");
+}
+
+static void
+test_local_double(jthread thr, int depth, int slot) {
+  printf("\n test_local_double: BEGIN\n\n");
+
+  test_int(thr, depth, slot, "double");
+  test_long(thr, depth, slot, "double");
+  test_float(thr, depth, slot, "double");
+  test_double(thr, depth, slot, "double");
+  test_object_type_mismatch(thr, depth, slot, "double");
+
+  printf("\n test_local_double: END\n\n");
+}
+
+static void
+test_local_integer(jthread thr, int depth, int slot) {
+  printf("\n test_local_integer: BEGIN\n\n");
+
+  test_int(thr, depth, slot, "int");
+  test_long_inv_slot(thr, depth, slot, "int");
+  test_float(thr, depth, slot, "int");
+  test_double_inv_slot(thr, depth, slot, "int");
+  test_object_type_mismatch(thr, depth, slot, "double");
+
+  printf("\n test_local_integer: END\n\n");
+}
+
+static void
+test_local_invalid(jthread thr, int depth, int slot) {
+  printf("\n test_local_invalid: BEGIN\n\n");
+
+  test_int_inv_slot(thr, depth, slot, "invalid");
+  test_long_inv_slot(thr, depth, slot, "invalid");
+  test_float_inv_slot(thr, depth, slot, "invalid");
+  test_double_inv_slot(thr, depth, slot, "invalid");
+  test_object_inv_slot(thr, depth, slot, "invalid");
+
+  printf("\n test_local_invalid: END\n\n");
+}
+
+jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
+  jint res;
+  jvmtiError err;
+  static jvmtiCapabilities caps;
+
+  res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_9);
+  if (res != JNI_OK || jvmti == NULL) {
+    printf("Wrong result of a valid call to GetEnv!\n");
+    return JNI_ERR;
+  }
+  caps.can_access_local_variables = 1;
+
+  err = jvmti->AddCapabilities(&caps);
+  if (err != JVMTI_ERROR_NONE) {
+    printf("AddCapabilities: unexpected error: %s (%d)\n", TranslateError(err), err);
+    return JNI_ERR;
+  }
+  err = jvmti->GetCapabilities(&caps);
+  if (err != JVMTI_ERROR_NONE) {
+    printf("GetCapabilities: unexpected error: %s (%d)\n", TranslateError(err), err);
+    return JNI_ERR;
+  }
+  if (!caps.can_access_local_variables) {
+    printf("Warning: Access to local variables is not implemented\n");
+    return JNI_ERR;
+  }
+  return JNI_OK;
+}
+
+JNIEXPORT jint JNICALL
+Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
+  return Agent_Initialize(jvm, options, reserved);
+}
+
+JNIEXPORT jint JNICALL
+Agent_OnAttach(JavaVM *jvm, char *options, void *reserved) {
+  return Agent_Initialize(jvm, options, reserved);
+}
+
+JNIEXPORT void JNICALL
+Java_GetLocalVars_testLocals(JNIEnv *env, jclass cls, jobject thread) {
+  static const char* METHOD_NAME = "staticMeth";
+  static const char* METHOD_SIGN = "(BLjava/lang/Object;DI)I";
+  static const int Depth = 1;
+  static const int ByteSlot = 0;
+  static const int ObjSlot = 1;
+  static const int DblSlot = 2;
+  static const int IntSlot = 4;
+  static const int InvalidSlot = 5;
+
+  jmethodID mid = NULL;
+
+  if (jvmti == NULL) {
+    printf("JVMTI client was not properly loaded!\n");
+    result = STATUS_FAILED;
+    return;
+  }
+
+  mid = env->GetStaticMethodID(cls, METHOD_NAME, METHOD_SIGN);
+  if (mid == NULL) {
+    printf("Cannot find Method ID for %s%s\n", METHOD_NAME, METHOD_SIGN);
+    result = STATUS_FAILED;
+    return;
+  }
+
+  test_local_byte(thread, Depth, ByteSlot);
+  test_local_object(thread, Depth, ObjSlot);
+  test_local_double(thread, Depth, DblSlot);
+  test_local_integer(thread, Depth, IntSlot);
+  test_local_invalid(thread, Depth, InvalidSlot);
+}
+
+JNIEXPORT jint JNICALL
+Java_GetLocalVars_getStatus(JNIEnv *env, jclass cls) {
+    return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
--- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -23,7 +23,7 @@
 
 package sun.hotspot.tools.ctw;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.misc.Unsafe;
 import jdk.internal.reflect.ConstantPool;
 import sun.hotspot.WhiteBox;
--- a/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesDirTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesDirTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,7 +25,8 @@
  * @test
  * @bug 8012447
  * @library /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.management
--- a/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesListTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesListTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,7 +25,8 @@
  * @test
  * @bug 8012447
  * @library /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.management
--- a/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -49,6 +49,7 @@
         "-XX:+UnlockDiagnosticVMOptions",
         "-XX:+WhiteBoxAPI",
         "-Dsun.hotspot.tools.ctw.logfile=" + LOG_FILE,
+        "--add-exports", "java.base/jdk.internal.access=ALL-UNNAMED",
         "--add-exports", "java.base/jdk.internal.jimage=ALL-UNNAMED",
         "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
         "--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED",
--- a/test/hotspot/jtreg/testlibrary_tests/ctw/JarDirTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/testlibrary_tests/ctw/JarDirTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,7 +25,8 @@
  * @test
  * @bug 8012447
  * @library /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.compiler
--- a/test/hotspot/jtreg/testlibrary_tests/ctw/JarsTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/testlibrary_tests/ctw/JarsTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -25,7 +25,8 @@
  * @test
  * @bug 8012447
  * @library /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.jimage
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
  *          java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.compiler
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t001/hs204t001.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t001/hs204t001.java	Thu Nov 08 19:15:42 2018 -0500
@@ -46,7 +46,8 @@
  * @library /vmTestbase
  *          /test/lib
  * @run driver jdk.test.lib.FileInstaller . .
- * @build nsk.jvmti.scenarios.hotswap.HS204.hs204t001.hs204t001
+ * @build ExecDriver
+ *      nsk.jvmti.scenarios.hotswap.HS204.hs204t001.hs204t001
  *
  * @comment compile newclassXX to bin/newclassXX
  * @run driver nsk.share.ExtraClassesBuilder
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal003/getlocal003.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal003/getlocal003.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -21,9 +21,6 @@
  * questions.
  */
 
-/*
- */
-
 #include <stdio.h>
 #include <string.h>
 #include "jvmti.h"
@@ -34,13 +31,12 @@
 extern "C" {
 
 
-#define PASSED 0
+#define STATUS_PASSED 0
 #define STATUS_FAILED 2
 
 static jvmtiEnv *jvmti = NULL;
-static jvmtiCapabilities caps;
 static jvmtiEventCallbacks callbacks;
-static jint result = PASSED;
+static jint result = STATUS_PASSED;
 static jboolean printdump = JNI_FALSE;
 static jmethodID mid = NULL;
 static jvmtiLocalVariableEntry *table = NULL;
@@ -54,69 +50,112 @@
   printf(", signature: %s\n", lvt_elem->signature);
 }
 
-void JNICALL MethodExit(jvmtiEnv *jvmti_env, JNIEnv *env,
-        jthread thr, jmethodID method,
-        jboolean was_poped_by_exception, jvalue return_value) {
+static void
+test_locals(jvmtiEnv *jvmti, jthread thr, jlocation location) {
     jvmtiError err;
-    jint i;
-    jmethodID frame_method;
-    jlocation location;
     jint intVal;
+    jlong longVal;
     jfloat floatVal;
     jdouble doubleVal;
     jobject obj;
+    jint i;
 
-    if (mid == method) {
+    for (i = 0; i < entryCount; i++) {
+        if (table[i].start_location > location ||
+            table[i].start_location + table[i].length < location) {
+            continue;  /* The local variable is not visible */
+        }
+        print_LocalVariableEntry(&table[i]);
+        char sig = table[i].signature[0];
 
-        err = jvmti_env->GetFrameLocation(thr, 0,
-                                             &frame_method, &location);
-        if (err != JVMTI_ERROR_NONE) {
-            printf("\t failure: %s (%d)\n", TranslateError(err), err);
+        if (sig == 'Z' || sig == 'B' || sig == 'C' || sig == 'S') {
+            sig = 'I'; // covered by GetLocalInt
+        }
+        err = jvmti->GetLocalInt(thr, 0, table[i].slot, &intVal);
+        printf(" GetLocalInt:     %s (%d)\n", TranslateError(err), err);
+        if (err != JVMTI_ERROR_NONE && sig == 'I') {
+            printf("FAIL: GetLocalInt failed to get value of int\n");
+            result = STATUS_FAILED;
+        } else if (err != JVMTI_ERROR_TYPE_MISMATCH && sig != 'I') {
+            printf("FAIL: GetLocalInt did not return JVMTI_ERROR_TYPE_MISMATCH for non-int\n");
             result = STATUS_FAILED;
-            return;
         }
-        if (frame_method != method) {
-            printf("\t failure: GetFrameLocation returned wrong jmethodID\n");
+
+        err = jvmti->GetLocalLong(thr, 0, table[i].slot, &longVal);
+        printf(" GetLocalLong:    %s (%d)\n", TranslateError(err), err);
+        if (err != JVMTI_ERROR_NONE && sig == 'J') {
+            printf("FAIL: GetLocalLong failed to get value of long\n");
+            result = STATUS_FAILED;
+        } else if (err != JVMTI_ERROR_TYPE_MISMATCH && sig != 'J') {
+            printf("FAIL: GetLocalLong did not return JVMTI_ERROR_TYPE_MISMATCH for non-long\n");
             result = STATUS_FAILED;
-            return;
+        }
+
+        err = jvmti->GetLocalFloat(thr, 0, table[i].slot, &floatVal);
+        printf(" GetLocalFloat:   %s (%d)\n", TranslateError(err), err);
+        if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'F') {
+            printf("FAIL: GetLocalFloat failed to get value of float\n");
+            result = STATUS_FAILED;
+        } else if (err != JVMTI_ERROR_TYPE_MISMATCH && table[i].signature[0] != 'F') {
+            printf("FAIL: GetLocalFloat did not return JVMTI_ERROR_TYPE_MISMATCH for non-float\n");
+            result = STATUS_FAILED;
         }
 
-        printf("\n MethodExit: BEGIN %d, Current frame bci: %" LL "d\n\n",
-                ++methodExitCnt, location);
-        for (i = 0; i < entryCount; i++) {
-            if (table[i].start_location > location ||
-                table[i].start_location + table[i].length < location) {
-                continue;  /* The local variable is not visible */
-            }
-            print_LocalVariableEntry(&table[i]);
+        err = jvmti->GetLocalDouble(thr, 0, table[i].slot, &doubleVal);
+        printf(" GetLocalDouble:  %s (%d)\n", TranslateError(err), err);
+        if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'D') {
+            printf("FAIL: GetLocalDouble failed to get value of double\n");
+            result = STATUS_FAILED;
+        } else if (err != JVMTI_ERROR_TYPE_MISMATCH && table[i].signature[0] != 'D') {
+            printf("FAIL: GetLocalDouble did not return JVMTI_ERROR_TYPE_MISMATCH for non-double\n");
+            result = STATUS_FAILED;
+        }
 
-            err = jvmti->GetLocalInt(thr, 0, table[i].slot, &intVal);
-            printf(" GetLocalInt:     %s (%d)\n", TranslateError(err), err);
-            if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'I') {
-                result = STATUS_FAILED;
-            }
+        err = jvmti->GetLocalObject(thr, 0, table[i].slot, &obj);
+        printf(" GetLocalObject:  %s (%d)\n", TranslateError(err), err);
+        if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'L') {
+            printf("FAIL: GetLocalObject failed to get value of object\n");
+            result = STATUS_FAILED;
+        } else if (err != JVMTI_ERROR_TYPE_MISMATCH && table[i].signature[0] != 'L') {
+            printf("FAIL: GetLocalObject did not return JVMTI_ERROR_TYPE_MISMATCH for non-object\n");
+            result = STATUS_FAILED;
+        }
+    }
+}
 
-            err = jvmti->GetLocalFloat(thr, 0, table[i].slot, &floatVal);
-            printf(" GetLocalFloat:   %s (%d)\n", TranslateError(err), err);
-            if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'F') {
-                result = STATUS_FAILED;
-            }
+static void JNICALL
+MethodExit(jvmtiEnv *jvmti_env,
+           JNIEnv *env,
+           jthread thr,
+           jmethodID method,
+           jboolean was_poped_by_exception,
+           jvalue return_value) {
+
+    jvmtiError err;
+    jlocation location;
+    jmethodID frame_method = NULL;
 
-            err = jvmti->GetLocalDouble(thr, 0, table[i].slot, &doubleVal);
-            printf(" GetLocalDouble:  %s (%d)\n", TranslateError(err), err);
-            if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'D') {
-                result = STATUS_FAILED;
-            }
+    if (mid != method) {
+        return;
+    }
+    err = jvmti->GetFrameLocation(thr, 0, &frame_method, &location);
+    if (err != JVMTI_ERROR_NONE) {
+        printf("\t failure: %s (%d)\n", TranslateError(err), err);
+        result = STATUS_FAILED;
+        return;
+    }
+    if (frame_method != method) {
+        printf("\t failure: GetFrameLocation returned wrong jmethodID\n");
+        result = STATUS_FAILED;
+        return;
+    }
 
-            err = jvmti->GetLocalObject(thr, 0, table[i].slot, &obj);
-            printf(" GetLocalObject:  %s (%d)\n", TranslateError(err), err);
-            if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'L') {
-                result = STATUS_FAILED;
-            }
-        }
-        printf("\n MethodExit: END %d\n\n", methodExitCnt);
-        fflush(stdout);
-    }
+    printf("\n MethodExit: BEGIN %d\n",  ++methodExitCnt);
+
+    test_locals(jvmti, thr, location);
+
+    printf("\n MethodExit: END %d\n\n", methodExitCnt);
+    fflush(stdout);
 }
 
 #ifdef STATIC_BUILD
@@ -133,6 +172,7 @@
 jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
     jint res;
     jvmtiError err;
+    static jvmtiCapabilities caps;
 
     if (options != NULL && strcmp(options, "printdump") == 0) {
         printdump = JNI_TRUE;
@@ -167,18 +207,19 @@
 
     if (!caps.can_access_local_variables) {
         printf("Warning: Access to local variables is not implemented\n");
-    } else if (caps.can_generate_method_exit_events) {
-        callbacks.MethodExit = &MethodExit;
-        err = jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks));
-        if (err != JVMTI_ERROR_NONE) {
-            printf("(SetEventCallbacks) unexpected error: %s (%d)\n",
-                   TranslateError(err), err);
-            return JNI_ERR;
-        }
-    } else {
+        return JNI_ERR;
+    }
+    if (!caps.can_generate_method_exit_events) {
         printf("Warning: MethodExit event is not implemented\n");
+        return JNI_ERR;
     }
-
+    callbacks.MethodExit = &MethodExit;
+    err = jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks));
+    if (err != JVMTI_ERROR_NONE) {
+        printf("(SetEventCallbacks) unexpected error: %s (%d)\n",
+               TranslateError(err), err);
+        return JNI_ERR;
+    }
     return JNI_OK;
 }
 
@@ -192,9 +233,6 @@
         return;
     }
 
-    if (!caps.can_access_local_variables ||
-        !caps.can_generate_method_exit_events) return;
-
     mid = env->GetStaticMethodID(cls, "staticMeth", "(I)I");
     if (mid == NULL) {
         printf("Cannot find Method ID for staticMeth\n");
@@ -204,14 +242,13 @@
 
     err = jvmti->GetLocalVariableTable(mid, &entryCount, &table);
     if (err != JVMTI_ERROR_NONE) {
-            printf("(GetLocalVariableTable) unexpected error: %s (%d)\n",
-                   TranslateError(err), err);
-            result = STATUS_FAILED;
-            return;
+        printf("(GetLocalVariableTable) unexpected error: %s (%d)\n",
+               TranslateError(err), err);
+        result = STATUS_FAILED;
+        return;
     }
 
-    err = jvmti->SetEventNotificationMode(JVMTI_ENABLE,
-        JVMTI_EVENT_METHOD_EXIT, NULL);
+    err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_EXIT, NULL);
     if (err != JVMTI_ERROR_NONE) {
         printf("Failed to enable metod exit event: %s (%d)\n",
                TranslateError(err), err);
@@ -232,8 +269,11 @@
     int  overlap = 0;
 
     if (jvmti == NULL) {
+        printf("JVMTI client was not properly loaded!\n");
+        result = STATUS_FAILED;
         return;
     }
+    printf("\n checkLoc: START\n");
 
     mid = env->GetStaticMethodID(cls, "staticMeth", "(I)I");
     if (mid == NULL) {
@@ -255,20 +295,22 @@
 
         err = jvmti->GetLocalInt(thr, 1, table[i].slot, &locVar);
 
-        printf(" GetLocalInt: %s (%d)\n", TranslateError(err), err);
         if (strcmp(table[i].name, "intArg") == 0) {
             if (err != JVMTI_ERROR_NONE) {
-               printf(" failure: JVMTI_ERROR_NONE is expected\n");
-               result = STATUS_FAILED;
+                printf(" GetLocalInt: %s (%d)\n", TranslateError(err), err);
+                printf(" failure: JVMTI_ERROR_NONE is expected\n");
+                result = STATUS_FAILED;
             }
         }
         else if (strcmp(table[i].name, "pi") == 0) {
             if (err != JVMTI_ERROR_TYPE_MISMATCH) {
-               printf(" failure: JVMTI_ERROR_TYPE_MISMATCH is expected\n");
-               result = STATUS_FAILED;
+                printf(" GetLocalInt: %s (%d)\n", TranslateError(err), err);
+                printf(" failure: JVMTI_ERROR_TYPE_MISMATCH is expected\n");
+                result = STATUS_FAILED;
             }
         } else {
             if (err != JVMTI_ERROR_INVALID_SLOT) {
+                printf(" GetLocalInt: %s (%d)\n", TranslateError(err), err);
                 printf(" failure: JVMTI_ERROR_INVALID_SLOT is expected\n");
                 result = STATUS_FAILED;
             }
@@ -290,7 +332,7 @@
                continue; /* Everything is Ok */
            }
 
-           printf(" failure: locations of vars with slot #2 are overlaped:\n");
+           printf(" failure: locations of vars with slot #2 are overlapped:\n");
            print_LocalVariableEntry(&table[i]);
            print_LocalVariableEntry(&table[j]);
            overlap++;
@@ -298,8 +340,9 @@
         }
     }
     if (!overlap) {
-        printf("\n Succes: locations of vars with slot #2 are NOT overlaped\n\n");
+        printf("\n Success: locations of vars with slot #2 are NOT overlapped\n");
     }
+    printf("\n checkLoc: END\n\n");
     fflush(stdout);
 }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal004/getlocal004.cpp	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal004/getlocal004.cpp	Thu Nov 08 19:15:42 2018 -0500
@@ -21,9 +21,6 @@
  * questions.
  */
 
-/*
- */
-
 #include <stdio.h>
 #include <string.h>
 #include "jvmti.h"
@@ -34,14 +31,12 @@
 extern "C" {
 
 
-#define PASSED 0
+#define STATUS_PASSED 0
 #define STATUS_FAILED 2
 
 static jvmtiEnv *jvmti = NULL;
-static jvmtiCapabilities caps;
-static jint result = PASSED;
+static jint result = STATUS_PASSED;
 static jboolean printdump = JNI_FALSE;
-static jmethodID mid = NULL;
 
 void print_LocalVariableEntry(jvmtiLocalVariableEntry *lvt_elem) {
   printf("\n Var name: %s, slot: %d", lvt_elem->name, lvt_elem->slot);
@@ -64,6 +59,7 @@
 jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
     jint res;
     jvmtiError err;
+    static jvmtiCapabilities caps;
 
     if (options != NULL && strcmp(options, "printdump") == 0) {
         printdump = JNI_TRUE;
@@ -98,29 +94,31 @@
 
     if (!caps.can_access_local_variables) {
         printf("Warning: Access to local variables is not implemented\n");
+        return JNI_ERR;
     }
-
+    if (!caps.can_access_local_variables) {
+        printf("Warning: Access to local variables is not implemented\n");
+        return JNI_ERR;
+    }
     return JNI_OK;
 }
 
 JNIEXPORT void JNICALL
 Java_nsk_jvmti_unit_GetLocalVariable_getlocal004_getMeth(JNIEnv *env, jclass cls) {
+    jmethodID mid = NULL;
+
     if (jvmti == NULL) {
         printf("JVMTI client was not properly loaded!\n");
         result = STATUS_FAILED;
         return;
     }
 
-    if (!caps.can_access_local_variables ||
-        !caps.can_generate_method_exit_events) return;
-
     mid = env->GetStaticMethodID(cls, "staticMeth", "(I)I");
     if (mid == NULL) {
         printf("Cannot find Method ID for staticMeth\n");
         result = STATUS_FAILED;
         return;
     }
-
     fflush(stdout);
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/SetLocalWhileThreadInNative.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2018 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8212928
+ * @summary With NeedsDeoptSuspend == true the assertion in compiledVFrame::update_deferred_value() fails, because the frame is not deoptimized.
+ * @author Richard Reingruber richard DOT reingruber AT sap DOT com
+ *
+ * @library /test/lib
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run main jdk.test.lib.FileInstaller compilerDirectives.json compilerDirectives.json
+ * @run compile -g SetLocalWhileThreadInNative.java
+ * @run driver SetLocalWhileThreadInNative -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+UnlockDiagnosticVMOptions -XX:CompilerDirectivesFile=compilerDirectives.json -XX:+PrintCompilation -XX:+PrintInlining
+ */
+
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+import com.sun.jdi.*;
+import com.sun.jdi.event.*;
+
+import jdk.test.lib.Asserts;
+
+/********** target program **********/
+
+class SetLocalWhileThreadInNativeTarget {
+
+    public static final String name = SetLocalWhileThreadInNativeTarget.class.getName();
+    public static FileInputStream fis;
+    public static int count;
+    public static int bytesRead;
+
+
+    // Let D (debugger) be a JVMTI agent that updates a local of a compiled frame F owned by
+    // thread T. In this test F corresponds to dontinline_testMethod.
+    //
+    // Issue: The VM thread executes an VM op on behalf of D to set the local in F. Doing so it
+    // requests the deoptimization of F and then calls compiledVFrame::update_deferred_value(),
+    // where frame::is_deoptimized_frame() returns false causing an assertion failure on SPARC where
+    // NeedsDeoptSuspend is true.
+    //
+    // Analysis: The deoptimization of F is requested, while T is in the native method
+    // java.io.FileInputStream::read0() and F is the direct caller of read0(). This is a special
+    // case with NeedsDeoptSuspend in frame::deoptimize(). Effectively the deoptimization is not
+    // done synchronously, instead T deoptimizes F at a later point upon return from the native
+    // method.
+    public static int dontinline_testMethod() {
+        int zero = 0;
+        int val = 0;
+        try {
+            val = fis.read(); // Will be inlined. Calls native method java.io.FileInputStream::read0()
+            count++;
+        } catch (IOException e) { /* ignored */ }
+        return val + zero;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(name + " is up and running.");
+        fis = new FileInputStream(FileDescriptor.in);
+        bytesRead=0;
+        while (true) {
+            int val = dontinline_testMethod();
+            if (val == SetLocalWhileThreadInNative.STOP) {
+                System.out.println("Debuggee: received STOP message");
+                System.exit(0);
+            }
+            bytesRead++;
+            if ((bytesRead & ((1L << 14)-1)) == 0) {
+                System.out.println("Called test method " + bytesRead + " times");
+            }
+        }
+    }
+}
+
+ /********** test program **********/
+
+public class SetLocalWhileThreadInNative extends TestScaffold {
+    public static final int MESSAGE_COUNT = 10000;
+    public static final String MESSAGE    = "0123456789";
+    public static final int MESSAGE_SIZE  = MESSAGE.length();
+    public static final int TOTAL_BYTES   = MESSAGE_COUNT * MESSAGE_SIZE;
+    public static final int STOP = 255;
+
+    ReferenceType mainClass;
+    ThreadReference mainThread;
+
+    SetLocalWhileThreadInNative (String args[]) {
+        super(args);
+    }
+
+    public static void main(String[] args)
+        throws Exception
+    {
+        new SetLocalWhileThreadInNative (args).startTests();
+    }
+
+    /********** test core **********/
+
+    protected void runTests()
+        throws Exception
+    {
+        String targetProgName = SetLocalWhileThreadInNativeTarget.class.getName();
+        String testName = getClass().getSimpleName();
+
+        // Start debuggee and obtain reference to main thread an main class
+        BreakpointEvent bpe = startToMain(targetProgName);
+        mainClass = bpe.location().declaringType();
+        mainThread = bpe.thread();
+
+        // Resume debuggee send some bytes
+        vm().resume();
+        OutputStream os = vm().process().getOutputStream();
+        byte[] ba = MESSAGE.getBytes();
+        for (int i = 0; i < MESSAGE_COUNT; i++) {
+            os.write(ba);
+        }
+        os.flush();
+
+        // Wait for the debugee to read all the bytes.
+        int bytesRead = 0;
+        Field bytesReadField = mainClass.fieldByName("bytesRead");
+        do {
+            bytesRead = ((PrimitiveValue)mainClass.getValue(bytesReadField)).intValue();
+            System.out.println("debugee has read " + bytesRead + " of " + TOTAL_BYTES);
+            Thread.sleep(500);
+        } while (bytesRead < TOTAL_BYTES);
+
+        // By now  dontinline_testMethod() will be compiled. The debugee will be blocked in java.io.FileInputStream::read0().
+        // Now set local variable in dontinline_testMethod().
+        vm().suspend();
+        System.out.println("Debuggee Stack:");
+        List<StackFrame> stack_frames = mainThread.frames();
+        int i = 0;
+        for (StackFrame ff : stack_frames) {
+            System.out.println("frame[" + i++ +"]: " + ff.location().method());
+        }
+        StackFrame frame = mainThread.frame(2);
+        Asserts.assertEQ(frame.location().method().toString(), "SetLocalWhileThreadInNativeTarget.dontinline_testMethod()");
+        List<LocalVariable> localVars = frame.visibleVariables();
+        boolean changedLocal = false;
+        for (LocalVariable lv : localVars) {
+            if (lv.name().equals("zero")) {
+                frame.setValue(lv, vm().mirrorOf(0)); // triggers deoptimization!
+                changedLocal = true;
+            }
+        }
+        Asserts.assertTrue(changedLocal);
+
+        // signal stop
+        os.write(STOP);
+        os.flush();
+
+
+        // resume the target listening for events
+        listenUntilVMDisconnect();
+
+
+        // deal with results of test if anything has called failure("foo")
+        // testFailed will be true
+        if (!testFailed) {
+            println(testName + ": passed");
+        } else {
+            throw new Exception(testName + ": failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/compilerDirectives.json	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+[   
+   {   
+         match: "*.*",
+ 
+         c1: {
+           // control inlining of method
+           // + force inline, - dont inline
+           inline : "-*.dontinline_*",
+         },
+
+         c2: {
+           // control inlining of method
+           // + force inline, - dont inline
+           inline : "-*.dontinline_*",
+         }
+   },
+]
--- a/test/jdk/java/io/Serializable/serialFilter/CheckArrayTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/io/Serializable/serialFilter/CheckArrayTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -28,11 +28,8 @@
 import java.io.ObjectInputStream;
 import java.io.InvalidClassException;
 
-import java.util.Hashtable;
+import jdk.internal.access.SharedSecrets;
 
-import jdk.internal.misc.SharedSecrets;
-
-import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import org.testng.Assert;
@@ -40,7 +37,7 @@
 /* @test
  * @build CheckArrayTest SerialFilterTest
  * @bug 8203368
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  * @run testng CheckArrayTest
  *
  * @summary Test the SharedSecret access to ObjectInputStream.checkArray works
--- a/test/jdk/java/lang/ModuleLayer/BasicLayerTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/lang/ModuleLayer/BasicLayerTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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,7 +24,7 @@
 /**
  * @test
  * @library /test/lib
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  * @build BasicLayerTest
  *        jdk.test.lib.util.ModuleUtils
  * @compile layertest/Test.java
@@ -38,13 +38,12 @@
 import java.lang.module.ModuleFinder;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
 import jdk.test.lib.util.ModuleUtils;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
--- a/test/jdk/java/lang/StackWalker/VerifyStackTrace.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/lang/StackWalker/VerifyStackTrace.java	Thu Nov 08 19:15:42 2018 -0500
@@ -71,7 +71,7 @@
             "3: VerifyStackTrace$Handle.run(VerifyStackTrace.java:158)\n" +
             "4: VerifyStackTrace.invoke(VerifyStackTrace.java:188)\n" +
             "5: VerifyStackTrace$1.run(VerifyStackTrace.java:218)\n" +
-            "6: java.base/java.security.AccessController.doPrivileged(Native Method)\n" +
+            "6: java.base/java.security.AccessController.doPrivileged(AccessController.java:310)\n" +
             "7: VerifyStackTrace.test(VerifyStackTrace.java:227)\n" +
             "8: VerifyStackTrace.main(VerifyStackTrace.java:182)\n";
 
@@ -105,7 +105,7 @@
             "7: java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" +
             "8: java.base/java.lang.reflect.Method.invoke(Method.java:520)\n" +
             "9: VerifyStackTrace$1.run(VerifyStackTrace.java:220)\n" +
-            "10: java.base/java.security.AccessController.doPrivileged(Native Method)\n" +
+            "10: java.base/java.security.AccessController.doPrivileged(AccessController.java:310)\n" +
             "11: VerifyStackTrace.test(VerifyStackTrace.java:229)\n" +
             "12: VerifyStackTrace.main(VerifyStackTrace.java:185)\n";
 
@@ -142,9 +142,10 @@
             "10: java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" +
             "11: java.base/java.lang.reflect.Method.invoke(Method.java:520)\n" +
             "12: VerifyStackTrace$1.run(VerifyStackTrace.java:222)\n" +
-            "13: java.base/java.security.AccessController.doPrivileged(Native Method)\n" +
-            "14: VerifyStackTrace.test(VerifyStackTrace.java:231)\n" +
-            "15: VerifyStackTrace.main(VerifyStackTrace.java:188)\n";
+            "13: java.base/java.security.AccessController.executePrivileged(AccessController.java:759)\n" +
+            "14: java.base/java.security.AccessController.doPrivileged(AccessController.java:310)\n" +
+            "15: VerifyStackTrace.test(VerifyStackTrace.java:231)\n" +
+            "16: VerifyStackTrace.main(VerifyStackTrace.java:188)\n";
 
         @Override public StackWalker walker() { return walker;}
         @Override public String description() { return description;}
--- a/test/jdk/java/lang/module/ConfigurationTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/lang/module/ConfigurationTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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,7 +24,7 @@
 /**
  * @test
  * @library /test/lib
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.module
  * @build ConfigurationTest
  *        jdk.test.lib.util.ModuleUtils
@@ -45,12 +45,11 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.List;
-import java.util.Optional;
 import java.util.Set;
 
 import jdk.test.lib.util.ModuleUtils;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.module.ModuleInfoWriter;
 import jdk.internal.module.ModuleTarget;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/lang/module/ModuleDescriptorTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/lang/module/ModuleDescriptorTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -23,8 +23,8 @@
 
 /**
  * @test
- * @modules java.base/jdk.internal.module
- *          java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.module
  * @run testng ModuleDescriptorTest
  * @summary Basic test for java.lang.module.ModuleDescriptor and its builder
  */
@@ -49,14 +49,13 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
-import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
 import static java.lang.module.ModuleDescriptor.Requires.Modifier.*;
 
-import jdk.internal.misc.JavaLangModuleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangModuleAccess;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.module.ModuleInfoWriter;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
--- a/test/jdk/java/lang/module/ModuleNamesTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/lang/module/ModuleNamesTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.module
  * @run testng ModuleNamesTest
  * @summary Basic test of reading a module-info.class with module names that
@@ -41,7 +41,7 @@
 import java.util.Optional;
 import java.util.Set;
 
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 import jdk.internal.module.ModuleInfoWriter;
 
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/InetAddress/getOriginalHostName.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/net/InetAddress/getOriginalHostName.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -25,14 +25,13 @@
  * @test
  * @bug 8133196
  * @summary test functionality of getOriginalHostName(InetAddress)
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  */
 
-import java.io.*;
 import java.net.InetAddress;
 
-import jdk.internal.misc.JavaNetInetAddressAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaNetInetAddressAccess;
+import jdk.internal.access.SharedSecrets;
 
 public class getOriginalHostName {
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/net/SocketImpl/ImplSupportedOptions.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,189 @@
+/*
+ * 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 8213418
+ * @summary Ensure correct impl supported socket options
+ * @run testng ImplSupportedOptions
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.net.SocketImpl;
+import java.net.SocketOption;
+import java.net.StandardSocketOptions;
+import java.util.Set;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+public class ImplSupportedOptions {
+
+    @Test
+    public void socketSupportedOptions() throws Exception {
+        Socket s = new Socket();
+        Set<?> standardOptions = s.supportedOptions();
+        assertTrue(standardOptions.contains(StandardSocketOptions.SO_LINGER),
+                   "Expected SO_LINGER, in:" + standardOptions);
+        assertEquals(standardOptions, s.supportedOptions());
+        assertEquals(standardOptions, s.supportedOptions());
+
+        s = new DummySocket();
+        Set<?> dummyOptions = s.supportedOptions();
+        assertEquals(dummyOptions.size(), 1);
+        assertTrue(dummyOptions.contains(DummySocketImpl.SOCKET_OPT));
+        assertEquals(dummyOptions, s.supportedOptions());
+        assertEquals(dummyOptions, s.supportedOptions());
+
+        s = new Socket();
+        standardOptions = s.supportedOptions();
+        assertTrue(standardOptions.contains(StandardSocketOptions.SO_LINGER),
+                   "Expected SO_LINGER, in:" + standardOptions);
+        assertEquals(standardOptions, s.supportedOptions());
+        assertEquals(standardOptions, s.supportedOptions());
+
+        s = new DummySocket();
+        dummyOptions = s.supportedOptions();
+        assertEquals(dummyOptions.size(), 1);
+        assertTrue(dummyOptions.contains(DummySocketImpl.SOCKET_OPT));
+        assertEquals(dummyOptions, s.supportedOptions());
+        assertEquals(dummyOptions, s.supportedOptions());
+    }
+
+    @Test
+    public void serverSocketSupportedOptions() throws Exception {
+        ServerSocket s = new ServerSocket();
+        Set<?> standardOptions = s.supportedOptions();
+        assertTrue(standardOptions.contains(StandardSocketOptions.SO_REUSEADDR),
+                   "Expected SO_REUSEADDR, in:" + standardOptions);
+        assertEquals(standardOptions, s.supportedOptions());
+        assertEquals(standardOptions, s.supportedOptions());
+
+        s = new DummyServerSocket();
+        Set<?> dummyOptions = s.supportedOptions();
+        assertEquals(dummyOptions.size(), 1);
+        assertTrue(dummyOptions.contains(DummySocketImpl.SOCKET_OPT));
+        assertEquals(dummyOptions, s.supportedOptions());
+        assertEquals(dummyOptions, s.supportedOptions());
+
+        s = new ServerSocket();
+        standardOptions = s.supportedOptions();
+        assertTrue(standardOptions.contains(StandardSocketOptions.SO_REUSEADDR),
+                   "Expected SO_REUSEADDR, in:" + standardOptions);
+        assertEquals(standardOptions, s.supportedOptions());
+        assertEquals(standardOptions, s.supportedOptions());
+
+        s = new DummyServerSocket();
+        dummyOptions = s.supportedOptions();
+        assertEquals(dummyOptions.size(), 1);
+        assertTrue(dummyOptions.contains(DummySocketImpl.SOCKET_OPT));
+        assertEquals(dummyOptions, s.supportedOptions());
+        assertEquals(dummyOptions, s.supportedOptions());
+    }
+
+    static class DummySocket extends Socket {
+        DummySocket() throws IOException  {
+            super(new DummySocketImpl());
+        }
+    }
+
+    static class DummyServerSocket extends ServerSocket {
+        DummyServerSocket() throws IOException  {
+            super(new DummySocketImpl());
+        }
+    }
+
+    static class DummySocketImpl extends SocketImpl {
+
+        public static final SocketOption<String> SOCKET_OPT =
+                new ImplSocketOption<>("SOCKET_OPT", String.class);
+
+        private static class ImplSocketOption<T> implements SocketOption<T> {
+            private final String name;
+            private final Class<T> type;
+            ImplSocketOption(String name, Class<T> type) {
+                this.name = name;
+                this.type = type;
+            }
+            @Override public String name() { return name; }
+            @Override public Class<T> type() { return type; }
+            @Override public String toString() { return name; }
+        }
+
+        private final Set<SocketOption<?>> SO = Set.of(SOCKET_OPT);
+
+        @Override
+        public Set<SocketOption<?>> supportedOptions() { return SO; }
+
+        // ---
+
+        @Override
+        protected void create(boolean stream) throws IOException { }
+
+        @Override
+        protected void connect(String host, int port) throws IOException { }
+
+        @Override
+        protected void connect(InetAddress address, int port) throws IOException { }
+
+        @Override
+        protected void connect(SocketAddress address, int timeout) throws IOException { }
+
+        @Override
+        protected void bind(InetAddress host, int port) throws IOException { }
+
+        @Override
+        protected void listen(int backlog) throws IOException { }
+
+        @Override
+        protected void accept(SocketImpl s) throws IOException { }
+
+        @Override
+        protected InputStream getInputStream() throws IOException { return null; }
+
+        @Override
+        protected OutputStream getOutputStream() throws IOException { return null; }
+
+        @Override
+        protected int available() throws IOException { return 0; }
+
+        @Override
+        protected void close() throws IOException { }
+
+        @Override
+        protected void sendUrgentData(int data) throws IOException { }
+
+        @Override
+        public void setOption(int optID, Object value) throws SocketException { }
+
+        @Override
+        public Object getOption(int optID) throws SocketException { return null; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/nio/file/Files/Mismatch.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,414 @@
+/*
+ * 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.
+ */
+
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.FileSystem;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.spi.FileSystemProvider;
+import java.util.Map;
+
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+
+/* @test
+ * @bug 8202285
+ * @build Mismatch
+ * @run testng Mismatch
+ * @summary Unit test for the Files.mismatch method.
+ */
+public class Mismatch {
+    // the standard buffer size
+    final static int BUFFER_SIZE = 8192;
+
+    private static final int MISMATCH_NO = -1;
+
+    // Map to be used for creating a ZIP archive
+    private static final Map<String, String> ZIPFS_MAP = Map.of("create", "true");
+
+    // temporary test directory where all test files will be created
+    Path testDir;
+
+    @BeforeClass
+    void setup() throws IOException {
+        testDir = Files.createTempDirectory("testMismatch");
+    }
+
+    @AfterClass
+    void cleanup() throws IOException {
+        // clean up files created under the test directory
+        Files.walk(testDir).map(Path::toFile).forEach(File::delete);
+        Files.deleteIfExists(testDir);
+    }
+
+    /*
+     * DataProvider for mismatch test. Provides the following fields:
+     * path1 -- the path to a file
+     * path2 -- the path to another file
+     * expected -- expected result of the mismatch method
+     * note -- a note about the test
+     */
+    @DataProvider(name = "testMismatch")
+    public Object[][] getDataForMismatch() throws IOException {
+        // an non-existent file
+        Path foo = Paths.get("nonexistentfile");
+
+        /**
+         * File path naming convention:
+         * "test" + file size + [abm] [+ position of a modified char] + [ab]
+         * where:
+         * a or b -- is used to differentiate two files of the same size.
+         * m -- indicates the file is modified at the position specified after it
+         */
+
+        // create empty files
+        int size = 0;
+        Path test0a = createASCIIFile(testDir, "test0a", 0, -1, ' ');
+        Path test0b = createASCIIFile(testDir, "test0b", 0, -1, ' ');
+
+        /**
+         * Since the Impl uses a standard buffer of 8192, the test files are created
+         * with sizes <= and > 8192, either multiples of the buffer size, or random.
+         * The files are then altered at the begining (0), end (size), and a random
+         * position.
+         */
+        size = 147;
+        Path test147a = createASCIIFile(testDir, "test147a", size, -1, ' ');
+        Path test147b = createASCIIFile(testDir, "test147b", size, -1, ' ');
+        Path test147m0 = createASCIIFile(testDir, "test147m0", size, 0, '!');
+        Path test147m70 = createASCIIFile(testDir, "test147m70", size, 70, '@');
+        Path test147m146 = createASCIIFile(testDir, "test147m146", size, size - 1, '$');
+
+        size = 1024;
+        Path test1024a = createASCIIFile(testDir, "test1024a", size, -1, ' ');
+        Path test1024b = createASCIIFile(testDir, "test1024b", size, -1, ' ');
+        Path test1024m512 = createASCIIFile(testDir, "test1024m512", size, size >> 1, '@');
+        Path test1024m1023 = createASCIIFile(testDir, "test1024m1023", size, size - 1, '$');
+
+        size = BUFFER_SIZE;
+        Path test8192a = createASCIIFile(testDir, "test8192a", size, -1, ' ');
+        Path test8192b = createASCIIFile(testDir, "test8192b", size, -1, ' ');
+        Path test8192m4096 = createASCIIFile(testDir, "test8192m4096", size, size >> 1, '%');
+        Path test8192m8191 = createASCIIFile(testDir, "test8192m8191", size, size - 1, '$');
+
+
+        // create files with size several times > BUFFER_SIZE to be used for tests that verify
+        // the situations where they are read into full buffers a few times
+        size = BUFFER_SIZE << 3;
+        Path test65536a = createASCIIFile(testDir, "test65536a", size, -1, ' ');
+        Path test65536b = createASCIIFile(testDir, "test65536b", size, -1, ' ');
+        Path test65536m0 = createASCIIFile(testDir, "test65536m0", size, 0, '!');
+        Path test65536m32768 = createASCIIFile(testDir, "test65536m32768", size, size >> 1, '%');
+        Path test65536m65535 = createASCIIFile(testDir, "test65536m65535", size, size - 1, '$');
+
+        // create files with sizes that will be iterated several times with full buffers, and
+        // then a partial one at the last
+        size = 70025;
+        Path test70025a = createASCIIFile(testDir, "test70025a", size, -1, ' ');
+        Path test70025b = createASCIIFile(testDir, "test70025b", size, -1, ' ');
+        Path test70025m8400 = createASCIIFile(testDir, "test70025m8400", size, 8400, '@');
+        Path test70025m35000 = createASCIIFile(testDir, "test70025m35000", size, 35000, '%');
+        Path test70025m70024 = createASCIIFile(testDir, "test70025m70024", size, 70024, '$');
+
+        // create larger files with >= 1048576. The mismatching will be similar. These are just
+        // tests to exercise the process with larger files
+        size = 1048576;
+        Path test1048576a = createASCIIFile(testDir, "test1048576a", size, -1, ' ');
+
+        size = 1065000;
+        Path test1065000m532500 = createASCIIFile(testDir, "test1065000m532500", size, size >> 1, '%');
+        Path test1065000m1064999 = createASCIIFile(testDir, "test1065000m1064999", size, 1064999, '$');
+
+        return new Object[][]{
+            // Spec Case 1: the two paths locate the same file , even if one does not exist
+            {foo, foo, MISMATCH_NO, "Same file, no mismatch"},
+            {test1024a, test1024a, MISMATCH_NO, "Same file, no mismatch"},
+
+            // Spec Case 2:  The two files are the same size, and every byte in the first file
+            // is identical to the corresponding byte in the second file.
+            {test0a, test0b, MISMATCH_NO, "Sizes == 0, no mismatch"},
+            {test147a, test147b, MISMATCH_NO, "size = 147 < buffer = 8192, no mismatch"},
+            {test1024a, test1024b, MISMATCH_NO, "size = 1024 < buffer = 8192, no mismatch"},
+            {test8192a, test8192b, MISMATCH_NO, "size = 8192 = buffer = 8192, no mismatch"},
+            {test65536a, test65536b, MISMATCH_NO, "read 8 * full buffer, no mismatch"},
+            {test70025a, test70025b, MISMATCH_NO, "read 8 * full buffer plus a partial buffer, no mismatch"},
+
+
+            /**
+             * Spec Case 3: the value returned is the position of the first mismatched byte
+             * Impl: the impl uses a buffer 8192. The testcases below covers a range of files
+             * with sizes <= and > the buffer size. The last buffer is either full or partially full.
+            */
+
+            // edge case, one of the file sizes is zero
+            // also covers Spec Case 4 and 6
+            {test147a, test147m0, 0, "mismatch = 0 (at the beginning)"},
+            {test65536m0, test65536a, 0, "mismatch = 0 (at the beginning)"},
+
+            /**
+             * Compares files of equal sizes
+            */
+            // small files
+            {test147a, test147m70, 70, "read one partial buffer, mismatch = 70"},
+            {test147a, test147m146, 146, "read one partial buffer, mismatch = 146 (end)"},
+            {test1024a, test1024m512, 512, "read one partial buffer, mismatch = 512"},
+            {test1024a, test1024m1023, 1023, "read one partial buffer, mismatch = 1023 (end)"},
+
+            // file size >= Impl's Buffer Size
+            {test8192a, test8192m4096, 4096, "read one buffer, mismatch = 4096 "},
+            {test8192a, test8192m8191, 8191, "read one buffer, mismatch = 8191 (at the end)"},
+
+            // file size = n * Impl's Buffer Size
+            {test65536a, test65536m32768, 32768, "read through half of the file, mismatch = 32768"},
+            {test65536a, test65536m65535, 65535, "read through the whole file, mismatch = 65535 (at the end)"},
+
+            // file size = n * Impl's Buffer Size + x
+            {test70025a, test70025m8400, 8400, "mismatch in the 2nd buffer, mismatch = 8400"},
+            {test70025a, test70025m35000, 35000, "read about half of the file, mismatch = 35000"},
+            {test70025a, test70025m70024, 70024, "read through the whole file, mismatch = 70024 (at the end)"},
+
+            /**
+             * Compares files of unequal sizes
+            */
+            {test8192m8191, test70025m35000, 8191, "mismatch at the end of the 1st file/buffer, mismatch = 8191"},
+            {test65536m32768, test70025m8400, 8400, "mismatch in the 2nd buffer, mismatch = 8400"},
+            {test70025m70024, test1065000m532500, 70024, "mismatch at the end of the 1st file, mismatch = 70024"},
+
+            /**
+             * Spec Case 4:  returns the size of the smaller file (in bytes) when the files are
+             * different sizes and every byte of the smaller file is identical to the corresponding
+             * byte of the larger file.
+             * Impl: similar to case 3, covers a range of file sizes
+            */
+            {test147a, test1024a, 147, "mismatch is the length of the smaller file: 147"},
+            {test1024a, test8192a, 1024, "mismatch is the length of the smaller file: 1024"},
+            {test1024a, test65536a, 1024, "mismatch is the length of the smaller file: 1024"},
+            {test8192a, test65536a, 8192, "mismatch is the length of the smaller file: 8192"},
+            {test70025a, test65536a, 65536, "mismatch is the length of the smaller file: 65536"},
+            {test1048576a, test1065000m1064999, 1048576, "mismatch is the length of the smaller file: 1048576"},
+
+            // Spec Case 5: This method is always reflexive (for Path f , mismatch(f,f) returns -1L)
+            // See tests for Spec Case 1.
+
+            // Spec Case 6: If the file system and files remain static, then this method is symmetric
+            // (for two Paths f and g, mismatch(f,g) will return the same value as mismatch(g,f)).
+            // The following tests are selected from tests for Spec Case 3 with the order of
+            // file paths switched, the returned values are the same as those for Case 3:
+            {test147m70, test147a, 70, "read one partial buffer, mismatch = 70"},
+            {test147m146, test147a, 146, "read one partial buffer, mismatch = 146 (end)"},
+            {test1024m512, test1024a, 512, "read one partial buffer, mismatch = 512"},
+            {test1024m1023, test1024a, 1023, "read one partial buffer, mismatch = 1023 (end)"},
+
+            {test70025m35000, test8192m8191, 8191, "mismatch at the end of the 1st file/buffer, mismatch = 8191"},
+            {test70025m8400, test65536m32768, 8400, "mismatch in the 2nd buffer, mismatch = 8400"},
+            {test1065000m532500, test70025m70024, 70024, "mismatch at the end of the 1st file, mismatch = 70024"},
+        };
+    }
+
+    /*
+     * DataProvider for mismatch tests involving ZipFS using a few test cases selected
+     * from those of the original mismatch tests.
+     */
+    @DataProvider(name = "testMismatchZipfs")
+    public Object[][] getDataForMismatchZipfs() throws IOException {
+        Path test1200 = createASCIIFile(testDir, "test1200", 1200, -1, ' ');
+        Path test9500 = createASCIIFile(testDir, "test9500", 9500, -1, ' ');
+        Path test9500m4200 = createASCIIFile(testDir, "test9500m4200", 9500, 4200, '!');
+        Path test80025 = createASCIIFile(testDir, "test80025", 80025, -1, ' ');
+        Path test1028500 = createASCIIFile(testDir, "test1028500", 1028500, -1, ' ');
+        return new Object[][]{
+            {test1200, test1200, MISMATCH_NO, "Compares the file and its copy in zip, no mismatch"},
+            {test9500, test9500m4200, 4200,
+                "Compares a copy of test9500m4200 in zip with test9500, shall return 4200"},
+            {test80025, test1028500, 80025, "mismatch is the length of the smaller file: 80025"},
+        };
+    }
+
+    /*
+     * DataProvider for verifying null handling.
+     */
+    @DataProvider(name = "testFileNull")
+    public Object[][] getDataForNull() throws IOException {
+        Path test = createASCIIFile(testDir, "testNonNull", 2200, -1, ' ');
+        return new Object[][]{
+            {(Path)null, (Path)null},
+            {(Path)null, test},
+            {test, (Path)null},
+        };
+    }
+
+    /*
+     * DataProvider for verifying how the mismatch method handles the situation
+     * when one or both files do not exist.
+     */
+    @DataProvider(name = "testFileNotExist")
+    public Object[][] getDataForFileNotExist() throws IOException {
+        Path test = createASCIIFile(testDir, "testFileNotExist", 3200, -1, ' ');
+        return new Object[][]{
+            {Paths.get("foo"), Paths.get("bar")},
+            {Paths.get("foo"), test},
+            {test, Paths.get("bar")},
+        };
+    }
+
+    /**
+     * Tests the mismatch method. Refer to the dataProvider testMismatch for more
+     * details about the cases.
+     * @param path the path to a file
+     * @param path2 the path to another file
+     * @param expected the expected result
+     * @param msg the message about the test
+     * @throws IOException if the test fails
+     */
+    @Test(dataProvider = "testMismatch", priority = 0)
+    public void testMismatch(Path path, Path path2, long expected, String msg)
+        throws IOException {
+        Assert.assertEquals(Files.mismatch(path, path2), expected, msg);
+    }
+
+    /**
+     * Tests the mismatch method by comparing files with those in a ZIP file.
+     * @param path the path to a file
+     * @param path2 the path to another file to be added into a ZIP file
+     * @param expected the expected result
+     * @param msg the message about the test
+     * @throws IOException if the test fails
+     */
+    @Test(dataProvider = "testMismatchZipfs", priority = 1)
+    public void testMismatchZipfs(Path path, Path path2, long expected, String msg)
+        throws IOException {
+        Path zipPath = Paths.get(testDir.toString(), "TestWithFSZip.zip");
+        try (FileSystem fs = getZipFSProvider().newFileSystem(zipPath, ZIPFS_MAP)) {
+            Path copy = fs.getPath(path.getFileName().toString());
+            Files.copy(path, copy, REPLACE_EXISTING);
+
+            if (path2 == null) {
+                Assert.assertEquals(Files.mismatch(copy, path), expected, msg);
+            } else {
+                Assert.assertEquals(Files.mismatch(copy, path2), expected, msg);
+            }
+        }
+    }
+
+    /**
+     * Verifies that NullPointerException is thrown when one or both files are null.
+     * @param path the path to a file
+     * @param path2 the path to another file
+     * @throws NullPointerException as expected
+     */
+    @Test(dataProvider = "testFileNull", priority = 2, expectedExceptions = NullPointerException.class)
+    public void testMismatchNull(Path path, Path path2) throws Exception {
+        long result = Files.mismatch(path, path2);
+    }
+
+    /**
+     * Verifies that IOException is thrown when one or both files do not exist.
+     * @param path the path to a file
+     * @param path2 the path to another file
+     * @throws IOException as expected
+     */
+    @Test(dataProvider = "testFileNotExist", priority = 2, expectedExceptions = IOException.class)
+    public void testMismatchNotExist(Path path, Path path2) throws IOException {
+        long result = Files.mismatch(path, path2);
+    }
+
+    /**
+     * Creates a file with ASCII content with one character altered
+     * at the specified position.
+     *
+     * Note: Files.mismatch method does a byte-by-byte comparison. ASCII files
+     * are sufficient for verifying the feature.
+     *
+     * @param dir the directory in which the file is to be created
+     * @param purpose the purpose of the file
+     * @param size the size of the file
+     * @param pos the position where the alternative char is to be added. If it
+     *            is smaller than zero, no alternation shall be made.
+     * @param c the character
+     * @return path of the created file
+     * @throws IOException
+     */
+    private static Path createASCIIFile(Path dir, String purpose, int size, int pos,
+                                        char c) throws IOException {
+        Path path = Files.createFile(Paths.get(dir.toString(), purpose + ".txt"));
+        if (size > 0) {
+            writeASCIIFile(path, size, pos, c);
+        }
+        return path;
+    }
+
+    private static void writeASCIIFile(Path path, int size, int pos, char c)
+        throws IOException {
+        byte[] a = createASCIIArray(size);
+        if (pos >= 0) a[pos] = (byte)(c & 0xFF); // US_ASCII char only, may cast directly
+        Files.write(path, a);
+    }
+
+    private static byte[] createASCIIArray(int length) {
+        byte[] bytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 \n"
+            .getBytes(StandardCharsets.US_ASCII);
+        byte[] a = new byte[length];
+        fillArray(bytes, a);
+        return a;
+    }
+
+    private static FileSystemProvider getZipFSProvider() {
+        for (FileSystemProvider provider : FileSystemProvider.installedProviders()) {
+            if ("jar".equals(provider.getScheme())) {
+                return provider;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Fills the destination array by copying the source array repeatedly until
+     * it is completely filled.
+     *
+     * @param src the source array
+     * @param dest the destination array
+     */
+    public static void fillArray(byte[] src, byte[] dest) {
+        int bLen = src.length;
+        int space = dest.length;
+        int iteration = 0;
+
+        while (space > 0) {
+            if (space >= bLen) {
+                System.arraycopy(src, 0, dest, iteration++ * bLen, bLen);
+                space -= bLen;
+            } else {
+                System.arraycopy(src, 0, dest, iteration++ * bLen, space);
+                break;
+            }
+        }
+    }
+}
--- a/test/jdk/java/security/ProtectionDomain/PreserveCombinerTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/security/ProtectionDomain/PreserveCombinerTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -26,7 +26,7 @@
 import java.security.DomainCombiner;
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
 
 /*
  * @test
@@ -34,7 +34,7 @@
  * @summary Make sure that JavaSecurityAccess.doIntersectionPrivilege()
  *          is not dropping the information about the domain combiner of
  *          the stack ACC
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  */
 
 public class PreserveCombinerTest {
--- a/test/jdk/java/util/TimeZone/Bug8066652.sh	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-# @test
-# @bug 8066652
-# @requires os.family == "mac"
-# @summary tests thread safe native function localtime_r is accessed by multiple threads at same time and
-# zone id should not be  “GMT+00:00” if default timezone is “GMT” and user specifies a fake timezone.
-# @build Bug8066652
-# @run shell/timeout=600 Bug8066652.sh
-
-
-if [ "${TESTSRC}" = "" ]
-then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTJAVA=${TESTJAVA}"
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-echo "TESTCLASSES=${TESTCLASSES}"
-echo "CLASSPATH=${CLASSPATH}"
-
-
-# set system TimeZone to GMT using environment variable TZ
-export TZ="GMT"
-
-# Setting invalid TimeZone using VM option
-${TESTJAVA}/bin/java -Duser.timezone=Foo/Bar  ${TESTVMOPTS} -cp ${TESTCLASSES}  Bug8066652
-
-status=$?
-if [ $status -eq 0 ]
-then
-  echo "Success, Test Passed";
-else
-  echo "Test Failed";
-fi
-
-exit $status
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/TimeZone/Bug8066652Run.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8066652
+ * @requires os.family == "mac"
+ * @summary tests thread safe native function localtime_r is accessed by multiple
+ *          threads at same time and zone id should not be  "GMT+00:00"
+ *          if default timezone is "GMT" and user specifies a fake timezone.
+ * @library /test/lib
+ * @build Bug8066652
+ * @run main Bug8066652Run
+ */
+
+import java.util.Map;
+
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.Utils;
+import jdk.test.lib.process.ProcessTools;
+
+public class Bug8066652Run {
+    private static String cp = Utils.TEST_CLASSES;
+    private static ProcessBuilder pb = new ProcessBuilder();
+
+    public static void main(String[] args) throws Throwable {
+        //set system TimeZone to GMT using environment variable TZ
+        Map<String, String> env = pb.environment();
+        env.put("TZ", "GMT");
+        System.out.println("Current TimeZone:" + pb.environment().get("TZ"));
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java");
+        //Setting invalid TimeZone using VM option
+        launcher.addToolArg("-Duser.timezone=Foo/Bar")
+                .addToolArg("-cp")
+                .addToolArg(cp)
+                .addToolArg("Bug8066652");
+
+        pb.command(launcher.getCommand());
+        int exitCode = ProcessTools.executeCommand(pb)
+                .getExitValue();
+        if (exitCode != 0) {
+            throw new RuntimeException("Unexpected exit code: " + exitCode);
+        }
+    }
+}
+
--- a/test/jdk/java/util/TimeZone/OldIDMappingTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/util/TimeZone/OldIDMappingTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -22,11 +22,31 @@
  */
 
 /*
- * See OldMappingTest.sh
+ * @test
+ * @bug 6466476
+ * @summary Compatibility test for the old JDK ID mapping and Olson IDs
+ * @comment Expecting the new (Olson compatible) mapping (default)
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=null OldIDMappingTest -new
+ * @run main/othervm -Dsun.timezone.ids.oldmapping="" OldIDMappingTest -new
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=no OldIDMappingTest -new
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=No OldIDMappingTest -new
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=NO OldIDMappingTest -new
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=false OldIDMappingTest -new
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=False OldIDMappingTest -new
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=FALSE OldIDMappingTest -new
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=Hello OldIDMappingTest -new
+ * @comment Expecting the old mapping
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=true OldIDMappingTest -old
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=True OldIDMappingTest -old
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=TRUE OldIDMappingTest -old
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=yes OldIDMappingTest -old
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=Yes OldIDMappingTest -old
+ * @run main/othervm -Dsun.timezone.ids.oldmapping=YES OldIDMappingTest -old
  */
 
-import java.lang.reflect.*;
-import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TimeZone;
 
 public class OldIDMappingTest {
     private static final String MAPPING_PROPERTY_NAME = "sun.timezone.ids.oldmapping";
@@ -62,8 +82,9 @@
                 TimeZone tz = TimeZone.getTimeZone(oldmap.get(id));
                 if (useOldMapping) {
                     if (!tzAlias.hasSameRules(tz)) {
-                        throw new RuntimeException("OLDMAP: " + MAPPING_PROPERTY_NAME + "=" + prop + ": "
-                                                   + id + " isn't an alias of " + oldmap.get(id));
+                        throw new RuntimeException("OLDMAP: " + MAPPING_PROPERTY_NAME
+                                + "=" + prop + ": " + id
+                                + " isn't an alias of " + oldmap.get(id));
                     }
                     if (count == 0) {
                         System.out.println("    " + id + " => " + oldmap.get(id));
@@ -79,13 +100,15 @@
                         continue;
                     }
                     if (tzAlias.hasSameRules(tz)) {
-                        throw new RuntimeException("NEWMAP: " + MAPPING_PROPERTY_NAME + "=" + prop + ": "
-                                                   + id + " is an alias of " + oldmap.get(id));
+                        throw new RuntimeException("NEWMAP: " + MAPPING_PROPERTY_NAME
+                                + "=" + prop + ": " + id
+                                + " is an alias of " + oldmap.get(id));
                     }
                     tz = TimeZone.getTimeZone(newmap.get(id));
                     if (!tzAlias.hasSameRules(tz)) {
-                        throw new RuntimeException("NEWMAP: " + MAPPING_PROPERTY_NAME + "=" + prop + ": "
-                                                   + id + " isn't an alias of " + newmap.get(id));
+                        throw new RuntimeException("NEWMAP: " + MAPPING_PROPERTY_NAME
+                                + "=" + prop + ": " + id
+                                + " isn't an alias of " + newmap.get(id));
                     }
                     if (count == 0) {
                         System.out.println("    " + id + " => " + newmap.get(id));
--- a/test/jdk/java/util/TimeZone/OldIDMappingTest.sh	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-
-# @test
-# @bug 6466476
-# @summary Compatibility test for the old JDK ID mapping and Olson IDs
-# @build OldIDMappingTest
-# @run shell OldIDMappingTest.sh
-
-: ${TESTJAVA:=${JAVA_HOME}}
-: ${TESTCLASSES:="`pwd`"}
-
-JAVA="${TESTJAVA}/bin/java"
-
-STATUS=0
-
-# Expecting the new (Olson compatible) mapping (default)
-for I in "" " " no No NO false False FALSE Hello
-do
-    if [ x"$I" != x ]; then
-	D="-Dsun.timezone.ids.oldmapping=${I}"
-    fi
-    if ! ${JAVA} ${D} ${TESTVMOPTS} -cp ${TESTCLASSES} OldIDMappingTest -new; then
-	STATUS=1
-    fi
-done
-
-# Expecting the old mapping
-for I in true True TRUE yes Yes YES
-do
-    if [ "x$I" != x ]; then
-	D="-Dsun.timezone.ids.oldmapping=${I}"
-    fi
-    if ! ${JAVA} ${D} ${TESTVMOPTS} -cp ${TESTCLASSES} OldIDMappingTest -old; then
-	STATUS=1
-    fi
-done
-
-exit ${STATUS}
--- a/test/jdk/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Thu Nov 08 19:07:57 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-# Testcase for PR381 Stackoverflow error with security manager, signed jars
-# and -Djava.security.debug set.
-#
-# Copyright (c) 2009, Red Hat Inc.
-#
-# This code is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-# 
-# 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 for more details.
-# 
-# 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.
-#
-# @test
-# @bug 6584033
-# @summary Stackoverflow error with security manager, signed jars and debug.
-# @build TimeZoneDatePermissionCheck
-# @run shell TimeZoneDatePermissionCheck.sh
-
-# Set default if not run under jtreg from test dir itself
-if [ "${TESTCLASSES}" = "" ] ; then
-  TESTCLASSES="."
-fi
-if [ "${TESTJAVA}" = "" ] ; then
-  TESTJAVA=/usr
-fi
-if [ "${COMPILEJAVA}" = "" ]; then
-  COMPILEJAVA="${TESTJAVA}"
-fi
-
-# create a test keystore and dummy cert. Note that we use the COMPILEJAVA
-# as this test is a TimeZone test, it doesn't test keytool
-rm -f ${TESTCLASSES}/timezonedatetest.store
-${COMPILEJAVA}/bin/keytool ${TESTTOOLVMOPTS} -genkeypair -alias testcert \
-  -keystore ${TESTCLASSES}/timezonedatetest.store \
-  -storepass testpass -validity 360 \
-  -keyalg rsa \
-  -dname "cn=Mark Wildebeest, ou=FreeSoft, o=Red Hat, c=NL" \
-  -keypass testpass
-
-# create a jar file to sign with the test class in it.
-rm -f ${TESTCLASSES}/timezonedatetest.jar
-${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf \
-  ${TESTCLASSES}/timezonedatetest.jar \
-  -C ${TESTCLASSES} TimeZoneDatePermissionCheck.class
-
-# sign it
-${COMPILEJAVA}/bin/jarsigner ${TESTTOOLVMOPTS} \
-  -keystore ${TESTCLASSES}/timezonedatetest.store \
-  -storepass testpass ${TESTCLASSES}/timezonedatetest.jar testcert
-
-# run it with the security manager on, plus accesscontroller debugging
-# will go into infinite recursion trying to get enough permissions for
-# printing Date of failing certificate unless fix is applied.
-${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.security.manager \
-  -Djava.security.debug=access,failure,policy \
-  -cp ${TESTCLASSES}/timezonedatetest.jar TimeZoneDatePermissionCheck
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/TimeZone/TimeZoneDatePermissionCheckRun.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ *
+ * 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 6584033
+ * @summary Stackoverflow error with security manager, signed jars and debug.
+ * @library /test/lib
+ * @build TimeZoneDatePermissionCheck
+ * @run main TimeZoneDatePermissionCheckRun
+ */
+
+import java.io.File;
+import java.util.List;
+
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.Utils;
+import jdk.test.lib.process.ProcessTools;
+
+public class TimeZoneDatePermissionCheckRun {
+    private static String storePath = Utils.TEST_CLASSES + File.separator
+            + "timezonedatetest.store";
+    private static String jarPath = Utils.TEST_CLASSES + File.separator
+            + "timezonedatetest.jar";
+
+    public static void main(String[] args) throws Throwable {
+        try {
+            //create a test keystore and dummy cert. Note that we use the COMPILEJAVA
+            //as this test is a TimeZone test, it doesn't test keytool
+            runJavaCmd("keytool",
+                    List.of("-genkeypair", "-alias", "testcert", "-keystore",
+                            storePath, "-storepass", "testpass", "-validity",
+                            "360", "-keyalg", "rsa", "-dname",
+                            "cn=Mark Wildebeest, ou=FreeSoft, o=Red Hat, c=NL",
+                            "-keypass", "testpass"));
+
+            //create a jar file to sign with the test class in it.
+            runJavaCmd("jar", List.of("cf", jarPath, "-C", Utils.TEST_CLASSES,
+                    "TimeZoneDatePermissionCheck.class"));
+
+            //sign it
+            runJavaCmd("jarsigner",
+                    List.of("-keystore", storePath, "-storepass", "testpass",
+                            jarPath, "testcert"));
+
+            //run it with the security manager on, plus accesscontroller debugging
+            //will go into infinite recursion trying to get enough permissions for
+            //printing Date of failing certificate unless fix is applied.
+            JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java");
+            launcher.addToolArg("-Djava.security.manager")
+                    .addToolArg("-Djava.security.debug=access,failure,policy")
+                    .addToolArg("-cp")
+                    .addToolArg(jarPath)
+                    .addToolArg("TimeZoneDatePermissionCheck");
+
+            int exitCode = ProcessTools.executeCommand(launcher.getCommand())
+                    .getExitValue();
+            if (exitCode != 0) {
+                throw new RuntimeException("Unexpected exit code: " + exitCode);
+            }
+        } finally {
+            //clean up the test files
+            File storeFile = new File(storePath);
+            if (storeFile.exists()) {
+                storeFile.delete();
+            }
+            File jarFile = new File(jarPath);
+            if (jarFile.exists()) {
+                jarFile.delete();
+            }
+        }
+    }
+
+    private static void runJavaCmd(String cmd, List<String> javaParam)
+            throws Throwable{
+        JDKToolLauncher launcher = JDKToolLauncher.create(cmd);
+        for (String para: javaParam) {
+            launcher.addToolArg(para);
+        }
+
+        System.out.println(launcher.getCommand());
+        int exitCode = ProcessTools.executeCommand(launcher.getCommand())
+                .getExitValue();
+        if (exitCode != 0) {
+            throw new RuntimeException("Unexpected exit code: " + exitCode);
+        }
+    }
+}
--- a/test/jdk/java/util/logging/LogManagerAppContextDeadlock.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/util/logging/LogManagerAppContextDeadlock.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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,15 +35,15 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
-import jdk.internal.misc.JavaAWTAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * @test
  * @bug 8065991
  * @summary check that when LogManager is initialized, a deadlock similar
  *          to that described in 8065709 will not occur.
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.logging
  *          java.management
  * @run main/othervm LogManagerAppContextDeadlock UNSECURE
@@ -349,7 +349,7 @@
             // FileHandlers because we're passing invalid parameters
             // which will make the creation fail...
             permissions = new Permissions();
-            permissions.add(new RuntimePermission("accessClassInPackage.jdk.internal.misc"));
+            permissions.add(new RuntimePermission("accessClassInPackage.jdk.internal.access"));
 
             // these are used for configuring the test itself...
             allPermissions = new Permissions();
--- a/test/jdk/java/util/logging/RootLogger/RootLevelInConfigFile.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/util/logging/RootLogger/RootLevelInConfigFile.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -34,15 +34,15 @@
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
 import java.util.logging.LoggingPermission;
-import jdk.internal.misc.JavaAWTAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTAccess;
+import jdk.internal.access.SharedSecrets;
 
 /**
  * @test
  * @bug 8030850
  * @summary Tests that setting .level=FINEST for the root logger in logging
  *      configuration file does work.
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.logging
  * @run main/othervm RootLevelInConfigFile
  *
@@ -182,7 +182,7 @@
             perms.add(new PropertyPermission("java.util.logging.config.class","read"));
             perms.add(new PropertyPermission("java.util.logging.config.file","read"));
             perms.add(new FilePermission(configFile, "read"));
-            perms.add(new RuntimePermission("accessClassInPackage.jdk.internal.misc"));
+            perms.add(new RuntimePermission("accessClassInPackage.jdk.internal.access"));
         }
 
         @Override
--- a/test/jdk/java/util/logging/TestAppletLoggerContext.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/util/logging/TestAppletLoggerContext.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -33,8 +33,8 @@
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
 import java.util.logging.LoggingPermission;
-import jdk.internal.misc.JavaAWTAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTAccess;
+import jdk.internal.access.SharedSecrets;
 
 /*
  * @test
@@ -42,7 +42,7 @@
  * @summary  NPE when using Logger.getAnonymousLogger or
  *           LogManager.getLogManager().getLogger
  *
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.logging
  * @run main/othervm -Dtest.security=off TestAppletLoggerContext LoadingApplet
  * @run main/othervm -Dtest.security=on TestAppletLoggerContext  LoadingApplet
--- a/test/jdk/java/util/logging/TestGetLoggerNPE.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/java/util/logging/TestGetLoggerNPE.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -26,8 +26,8 @@
 import java.security.ProtectionDomain;
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
-import jdk.internal.misc.JavaAWTAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTAccess;
+import jdk.internal.access.SharedSecrets;
 
 /*
  * @test
@@ -35,7 +35,7 @@
  *
  * @summary NPE with logging while launching webstart
  *
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.logging
  * @build TestGetLoggerNPE
  * @run main/othervm TestGetLoggerNPE getLogger
--- a/test/jdk/jdk/internal/reflect/constantPool/ConstantPoolTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/jdk/internal/reflect/constantPool/ConstantPoolTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -25,7 +25,7 @@
  * @test
  * @bug 8141615
  * @summary Tests new public methods at ConstantPool
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  *          java.base/jdk.internal.reflect
  * @library /test/lib
  * @compile ConstantPoolTestDummy.jasm
@@ -36,9 +36,9 @@
 
 import java.util.HashMap;
 import java.util.Map;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.reflect.ConstantPool;
 import jdk.test.lib.Asserts;
-import jdk.internal.reflect.ConstantPool;
 
 public class ConstantPoolTest {
 
--- a/test/jdk/sun/security/pkcs11/fips/TestTLS12.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/sun/security/pkcs11/fips/TestTLS12.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,6 +1,5 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates.
- *
+ * Copyright (c) 2018, Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/rsa/TestKeyPairGeneratorInit.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,60 @@
+/*
+ * 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     8211049
+ * @summary make sure the supplied SecureRandom object is used
+ */
+
+import java.security.*;
+import java.security.interfaces.*;
+
+public class TestKeyPairGeneratorInit {
+
+    private static class MySecureRandom extends SecureRandom {
+        boolean isUsed = false;
+        public MySecureRandom() {
+            super();
+        }
+
+        public void nextBytes(byte[] bytes) {
+            isUsed = true;
+            super.nextBytes(bytes);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        KeyPairGenerator kpg =
+            KeyPairGenerator.getInstance("RSA", "SunRsaSign");
+        MySecureRandom rnd = new MySecureRandom();
+        kpg.initialize(2048, rnd);
+        System.out.println("Generate keypair then check");
+        KeyPair kp = kpg.generateKeyPair();
+        if (!rnd.isUsed) {
+            throw new RuntimeException("ERROR: Supplied random not used");
+        } else {
+            System.out.println("=> Test passed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/util/HostnameMatcher/NullHostnameCheck.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,282 @@
+/*
+ * 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.
+ */
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLEngineResult;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.SSLParameters;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.io.ByteArrayInputStream;
+import java.nio.ByteBuffer;
+import java.security.KeyStore;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Base64;
+
+/*
+ * @test
+ * @bug 8211339
+ * @summary Verify hostname returns an exception instead of null pointer when
+ * creating a new engine
+ * @run main NullHostnameCheck
+ */
+
+
+public final class NullHostnameCheck {
+
+    public static void main(String[] args) throws Exception {
+        KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
+        keyStore.load(
+                new ByteArrayInputStream(Base64.getDecoder().
+                        decode(keystoreB64)),
+                "123456".toCharArray());
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance(
+                KeyManagerFactory.getDefaultAlgorithm());
+        kmf.init(keyStore, "123456".toCharArray());
+        SSLContext serverCtx = SSLContext.getInstance("TLSv1.2");
+        serverCtx.init(kmf.getKeyManagers(), null, null);
+        SSLEngine serverEngine = serverCtx.createSSLEngine("localhost", -1);
+        serverEngine.setUseClientMode(false);
+
+        SSLContext clientCtx = SSLContext.getInstance("TLSv1.2");
+        clientCtx.init(null, new TrustManager[] {
+                new X509TrustManager() {
+                    @Override
+                    public void checkClientTrusted(
+                            X509Certificate[] x509Certificates, String s) {
+                    }
+
+                    @Override
+                    public void checkServerTrusted(
+                            X509Certificate[] x509Certificates, String s) {
+                    }
+
+                    @Override
+                    public X509Certificate[] getAcceptedIssuers() {
+                        return new X509Certificate[0];
+                    }
+                }
+        }, null);
+
+        SSLEngine clientEngine = clientCtx.createSSLEngine();
+        clientEngine.setUseClientMode(true);
+
+        SSLParameters sslParameters = clientEngine.getSSLParameters();
+        sslParameters.setEndpointIdentificationAlgorithm("HTTPS");
+        clientEngine.setSSLParameters(sslParameters);
+        try {
+            handshake(clientEngine, serverEngine);
+            throw new Exception("Value was not null.  Unexpected.");
+        } catch (SSLHandshakeException e) {
+            if (e.getCause() instanceof CertificateException) {
+                System.out.println("Correct Exception class thrown:\n\t" +
+                        e.getMessage());
+                return;
+            }
+            throw e;
+        }
+    }
+
+    private static void handshake(SSLEngine clientEngine,
+            SSLEngine serverEngine) throws SSLException{
+        ByteBuffer cTOs = ByteBuffer.allocate(
+                clientEngine.getSession().getPacketBufferSize());
+        ByteBuffer sTOc = ByteBuffer.allocate(
+                serverEngine.getSession().getPacketBufferSize());
+
+        ByteBuffer serverAppReadBuffer = ByteBuffer.allocate(
+                serverEngine.getSession().getApplicationBufferSize());
+        ByteBuffer clientAppReadBuffer = ByteBuffer.allocate(
+                clientEngine.getSession().getApplicationBufferSize());
+
+        clientEngine.beginHandshake();
+        serverEngine.beginHandshake();
+
+        ByteBuffer empty = ByteBuffer.allocate(0);
+
+        SSLEngineResult clientResult;
+        SSLEngineResult serverResult;
+
+        boolean clientHandshakeFinished = false;
+        boolean serverHandshakeFinished = false;
+
+        do {
+            if (!clientHandshakeFinished) {
+                clientResult = clientEngine.wrap(empty, cTOs);
+                runDelegatedTasks(clientResult, clientEngine);
+
+                if (isHandshakeFinished(clientResult)) {
+                    clientHandshakeFinished = true;
+                }
+            }
+
+            if (!serverHandshakeFinished) {
+                serverResult = serverEngine.wrap(empty, sTOc);
+                runDelegatedTasks(serverResult, serverEngine);
+
+                if (isHandshakeFinished(serverResult)) {
+                    serverHandshakeFinished = true;
+                }
+            }
+
+            cTOs.flip();
+            sTOc.flip();
+
+            if (!clientHandshakeFinished) {
+                clientResult = clientEngine.unwrap(sTOc, clientAppReadBuffer);
+
+                runDelegatedTasks(clientResult, clientEngine);
+
+                if (isHandshakeFinished(clientResult)) {
+                    clientHandshakeFinished = true;
+                }
+            }
+
+            if (!serverHandshakeFinished) {
+                serverResult = serverEngine.unwrap(cTOs, serverAppReadBuffer);
+                runDelegatedTasks(serverResult, serverEngine);
+
+                if (isHandshakeFinished(serverResult)) {
+                    serverHandshakeFinished = true;
+                }
+            }
+
+            sTOc.compact();
+            cTOs.compact();
+        } while (!clientHandshakeFinished || !serverHandshakeFinished);
+    }
+
+    private static boolean isHandshakeFinished(SSLEngineResult result) {
+        return result.getHandshakeStatus() ==
+                SSLEngineResult.HandshakeStatus.FINISHED;
+    }
+
+    private static void runDelegatedTasks(SSLEngineResult result,
+            SSLEngine engine) {
+        if (result.getHandshakeStatus() ==
+                SSLEngineResult.HandshakeStatus.NEED_TASK) {
+            for (;;) {
+                Runnable task = engine.getDelegatedTask();
+                if (task == null) {
+                    break;
+                }
+                task.run();
+            }
+        }
+    }
+
+// Base64 of PKCS12 Keystore
+static final String keystoreB64 =
+        "MIIQ6wIBAzCCEKQGCSqGSIb3DQEHAaCCEJUEghCRMIIQjTCCBgEGCSqGSIb3DQEHAa" +
+        "CCBfIEggXuMIIF6jCCAuwGCyqGSIb3DQEMCgECoIICmzCCApcwKQYKKoZIhvcNAQwB" +
+        "AzAbBBS7qnTOxJYV5At3migAiNAdPvKd7AIDAMNQBIICaMo0roH1TuZE1ARZtwCOXy" +
+        "F2sk4DmI6m1/CRdh6NeQzszJZH2701cEm0CES971IwobCNFo0+Er9tk1c+iXmMPJgM" +
+        "s1l/+7OpQCc/GRl2Nc7lQSj1Yvrq1CIQxC51hSrwNs0N9aCTavjKfJ7jk3k1+MNItU" +
+        "dMdwuIFK663NEH8Wm0D4njvIA9p3ehOLJWDi0ziFTcySyCbbWAL6HmJhzRlpakPpbp" +
+        "Ox68wfI2YgDpQwTq580TMEWz+9P1U07VmtfYlu9xjXQT/Ks1xzNrhbOyv+HLoE54qL" +
+        "RyhL36/fwCzlpCXCYokPUG2uziu8JiQyITYRpVhVcgR5m/rSMhVsj8HwUmIdlK2Irm" +
+        "kOqG2m6YPKRiq7eeCPskcf2Hh0H3pb6lxagSVQMb+qndIUhCvZoXL/oS2+1ngtMlXh" +
+        "ezjIEa5s2K+Kk8eV48Ydms5bW8Plqy20+0fgEClABF6QL4We4NaFJdl6DB0+KsxgUd" +
+        "ZHo4U7f3R6o971mAd/OACs4jzpA0/C3AKCbhBEh/nxnSPoxM0Ty3bLaK8LQnv+B2uo" +
+        "6TeypsxmGg4/kd6fymzrhWUJAFz7DjkO/32pDUXnUDa6CB+dZdUldPoOpviGl9ITfG" +
+        "apdnq8+B4y7lg/87OZbr99vyVBWtbATaNof3Y5PuNY5TTQ5y1u4gU+zO9qhRnjxSqb" +
+        "bXJYhKeOIJmXCgGerV1dFqcWfj163OtjTwwJ5VCrtgolTU+3eodARD86jkp1VRCtQ2" +
+        "M54zOND9mx9RM2ucOy41mgF2MyKIseN6+3665DtgDbN5H/pmmjR4/GSuuy4eJoGHvY" +
+        "OPy49P7o8xPjAZBgkqhkiG9w0BCRQxDB4KAG0AeQBrAGUAeTAhBgkqhkiG9w0BCRUx" +
+        "FAQSVGltZSAxNTQxMTg5MzQ5NTAxMIIC9gYLKoZIhvcNAQwKAQKgggKbMIIClzApBg" +
+        "oqhkiG9w0BDAEDMBsEFO1oLv/9BmQKRKpeUB/Q5FPzMZaPAgMAw1AEggJoxez71rvm" +
+        "pCMbF0MH3shCpy2LsHNnkyjQVTKBIqdHFmn1390gqRkUUlvaaLgpjNNFSVY/LMg+gK" +
+        "JEJW6kClerkFg1/fvMQDBr5ApGbACIWi7fN/qYjED0cY5eypnSKePUzR2uO254Qko4" +
+        "xc+Enx3+V0/O0eqwlzGq3Pmgq9vfyqPefG562tFQEmHyUMUTLg1m4rtUgG5bvtRIMl" +
+        "Vd6tgFA3JRb08USaJY3D+FQFb+zm/iIJ1KrHBgtBuJFLfaXqYo/fjjgIv0WiOIQmd1" +
+        "ygrfRp7AhCvqZu7IzKT3TWggfGHABfjgkRcVmCGsFCf1cXAJVzS1v4N2biY9tB9Q5Y" +
+        "iWZ0JglMHK+NfJu2+3UthyC3ugDeLTQTSbwfJv3ShcVFo7mVxJz2zPWJtDoXbORczm" +
+        "0tjMu8KztEpPhwH4nsoXJ60fMUDOAvYwr2t49CBRZ+b9rJB5QWWJ60ZrM5rsfNU5yJ" +
+        "RJYldqryD/T5UJEqRLK5X9N/DAszDFTDoTVFMwwuBv6yk/v9N999m4X77q75/d1y71" +
+        "sY9Aaj9gHKLSy1ZCsGoU2nt7A+Z+V9TNcmsM5aT+QpNdKvW99jI1T2XI7kHNJ+D0W3" +
+        "sD8dXlNA91na7/6HGM5dKQfZdk1zcUYg2lkDpyi3xzO2nzFvCaDfAqQqjuQtiXggWy" +
+        "RiNk+WC45GuUKP5F6fWWr871RjeVYezj5XoXWJ7x8J85SUMKiuQH3S2tRMcP2RtAS/" +
+        "D1aXdwuiVfLUMu9113dwpSwwmXcFASrt9VxXPNI8Aztu/YtqkONyQq50NChtYsykGA" +
+        "4ZUOuazkc1SLmIitNfBB9DFIMCMGCSqGSIb3DQEJFDEWHhQAcwBlAGwAZgBzAGkAZw" +
+        "BuAGUAZDAhBgkqhkiG9w0BCRUxFAQSVGltZSAxNTQxMTg5MzUzNjg4MIIKhAYJKoZI" +
+        "hvcNAQcGoIIKdTCCCnECAQAwggpqBgkqhkiG9w0BBwEwKQYKKoZIhvcNAQwBBjAbBB" +
+        "S3KnmddxJSpicU3Pxyg8+NUl6deAIDAMNQgIIKMA0HSR92DBEs74SvbSTUrLeitduz" +
+        "wzkxQ2D8jO+eP7dC7L9nVVvfHDcalUfwah7fvriDgPKg/ws7vaPO6c4Q7RdzB3epvK" +
+        "7LqJlqseW0NxRGJXF9hvDOWk6me+3NyAy791C0R8oF/llujojwoR2Tw6DzTdov9c0p" +
+        "pwCACNtgeAtz3SEFlc/F4MwZKai0jdpakINJkD5H7Za8nyKu6pIITs1roy3Oq2HA4M" +
+        "XAnlnWh+8R9mloDBTJJMJYUOsn1VaFrYNFq3kr4oOMNINJvUCZL2LZgl5rmzgWSVs0" +
+        "VSZa7JUWx49rsrBeCi/SFwW5ryleK5uEtjXjtqjQxCjvLvRYV5HmPfv/ZGCP/vitHX" +
+        "dQ9gzxO/7RVQoxgE0dSx90jiGOEsmG8N9sDnNyS+GCc7pxJeW6NKc1h5YameCsqUGz" +
+        "V9FTfz2JdDpaPsGmHtvMTs8n3ncK9FOWeWhoNKhPnoMGHmfJGZgz282aTosggSZgh7" +
+        "FSvf3KfAmhcCj9+frE90jPvB4W8tPF0YnOrNgvByw2+bj7NCkZ0WBT2WrOSOoS/o2H" +
+        "zmErCJmyt6Su5sPEeTz+dnU0std6qCjsHtjo8Is8VnVVec2nbpeT+nd3RTCV71dViW" +
+        "42L3rRYxl80UpsUs3Fh0J+01EZkWmExCSZpYTKgPhYcYSwUrIVx9ukcCdUSpvS07bq" +
+        "hLfqWOVLfLs00VBr/mFWOqDBfy+qJMXEFYyYDBa/TlrIjzEbF4qKwIJiIxRcqYy0Ta" +
+        "CnMVvn8HlMeIMPJQaqdfDspxIdSdJWWZVbk9FnEDcMuSg8saON26HwieH+AsdnsZDR" +
+        "cZ6kT+bMPibCfnKLTmJYM0dq7abhdYj7GYcfRjwCeeK/PSxklqpsJ/1T/FeVweuQXz" +
+        "bhHatL5z8UmTV3WUE1Ww23K3sR701xh/Tx3HoZPjluSHZFuQCvhkOU6Fj5o7dYjJZc" +
+        "3l3n8wD3SY04ObfCedHe56NytvbXGp79en8Q6kluThWvS5tuNgR5UhMf5oeVi8H1++" +
+        "MeuCOz9MJMwBGe0JUkxijdI1YVHvspqXcQhjAL9BBPT/Q+iaQITzqPSVj/fSUbY147" +
+        "XrAGKS8/9iOV5gTVw2TiW1MKp3ubLjqc1YmIB3TRz+SIlAXg3tD4hl/8DXs0zDFLN0" +
+        "OJLslwQJNaiV0S0mndsVQ/qXiS0gfZldQcn1NmUCJNiy04aUNWR/wKgyLAk5DNPCjx" +
+        "RlStSK7RjrgIcyUO+4cf/nfV2ymaaeDtBSwLLhAr2syXlio1fQILIrSlmT2X7i4/7X" +
+        "1vzN0h78g3+NcWpCs+WnOZ1bu/nzVY7zL8rmHJCeOD37UMgxgW5s3sBvONCpUzyOoe" +
+        "raTalqk843CE223ovLgh+KRm/JXUlDMtDSpk+02Ve7ZoyqgI8vr6UBwWk6CjUJx21M" +
+        "ldkh6QZcK+weQg0Ml9t3czrKXlfQl62VIG6aqSRehSEa52k5IWrcVY6yauRfERfi6a" +
+        "zGSmn5kXlQZSJ1mDuss22Fp12n5Kn0MAwo7XHmnzasaD3rB57A+s/3zkgC0j2t/qYC" +
+        "VpcTq/7Hh7CirbUzVBaXn9CI5MYcbtL40KEE7/DKsjR0VTUtLRi9PnEX1D4zxWl45Y" +
+        "WJ0QO4icHmUS+bvz3i/N91kI+XKDjZmktsqpF+JRaooQe2wZsasnsCSm6tEx8rN/Ya" +
+        "iE3nEUTxeUdHudzT4mldgYL9jlOoubC+DvXilRPRboNRuF9djrfq1p+j4egC4FcjeR" +
+        "kISHIuVXVwcg6Iz9q5j3IAGBfRhXuZ70qyLMtuts4RE+Xy4SmOPnw2rObNhMcTBs9T" +
+        "wYIhrzv426xid908L4v3bUunlsCoDP6LzzMdE4g1OhKzralRqoYZcsLN6Jt5f/W8UY" +
+        "RFauTV8YFV3dBUpp9xhKJlYH+OtJY1gLrT2aaX8b96ruv1JTq1fKCReiB2/0MCPvHd" +
+        "Yz8+/P7YQTysaoDlTC7prQFvDEcz11D0+SmVi2yxNQZETMaMcX5QdqfO8omTPMtuE5" +
+        "jKgtBtmjq6GeNNJBSKySWtjp0J7jKMqmk2n9+9/RCv3e4IVEcZDOo71g5omtB5592w" +
+        "XEQqydg1yH5HFD/B7bgcuFAbr36UMdp6o4M8vek9HsI9K/+Q+2clecOabzNDsS4S8y" +
+        "vr0Kna4rluHwGT0QUp0SbRQRIKzSm7xye5CTxUrZ8cizQ5hQFBUFMr8OWRm0N1GalY" +
+        "TfPaGwX0sWdvhX4rrrGXpToRbUUqeSk1suiRMT8s1iluaoCpiN1Kq4cehFdlSpWv9c" +
+        "74Dktfk+kS8X+vCdoU3voPHiGQbxql0mcdSIboOKdCdzs5krl7GbnJZoYLIYpK/y87" +
+        "YUbOb1CiivlTNe4+KiamuEg44Y0zZ/Z+yWLb7QkpjoIiDObU/0oJKqHUeYL4ZjReus" +
+        "U014itt5jBMmVCBlhUWtHTmznJotjl45H6bVAX7cimbdoWDcmzWlgHM5lFP6IH/q+Q" +
+        "Gsgw+kRfbzX0dnYF0a6d5j02ZgSjJJZpQ5Df+qB9ZKteywXxApcv3FRVuz7A5v7yXR" +
+        "xUE8TQnLwOZgvwDu/pL90drEf0KXef8G/CEHQPB4HVCDzaUnhfSIUflsjtaFfuFq1U" +
+        "DHmmt5WrrTkWo5RRMUzWYcYn2QzBvzCRDTWdVTlXAJcYJ+KHeJlyxhlrEDu3ej4WUe" +
+        "BmkbiTQStUEUpk3IcTbzVLLtfS/pe3m0EmaU6nRkmfLxMfYtnDUgdghMy0Cltc3TKn" +
+        "9qFrBtY41qf8D5LGSrrmLVC1tnQv+hJC7hwiIQZ/2a5b5Bv67tcdzlEGRNT7uv0ID0" +
+        "Ig5MyPjvJtppNQfxhPbNbJvxWtmI1NvH4359d0vR/4yzxYq+BpCLpOXw3BreGE55J7" +
+        "xIvxeRb+Pws7A0xdbKHAwSUsEyPglxAkZCzftZin+MoEw8UnhXYWOPKf+k49TVAq7S" +
+        "Yi1mJxxzwkSkSw9AdhbalYi1Y17VVfHHcb9Ioh1Jdtq8iNqtO2GG+Gd4yGKaRjnQ03" +
+        "6YRWyffrMx6Lv/aEecMR1DASDuX0vVjfafKHAp+13VKVGsB6zPbzR4njAXhJxTC9qj" +
+        "RbG2ISl4xrgAy/gBCKqN+UaVGVYe5DdA22XOOfNkgRrfoqcdgajzp4v6hqr3kPh997" +
+        "89Ayxcov6OopEUBuy6wuPO2ezXRMw8snABq6YDlf36l2jugHbqUUOiiQ4jIPgZAp/S" +
+        "r+4i6wyH+wOIjn1pBn9GgqypWCjyj/uTIMiXiMe5TDzp7U9pJ7e/hWUGzm6wWuDQWB" +
+        "zLwAJNRtaaGV0UraI4ubOJVsvGym0PJ8elxCUgKo6cePkhwrVPcNKA19HgVj/3g0pa" +
+        "ZwYt5Yw2Gdydm0zadva7K/oVgVKRDmkQbwlavySW0xqU8Pul/V/HUSd32/4cpOmmol" +
+        "OjMo1vyn/iSMylG0s2SzTjZ4LlcwhaxjoIVpXo6MwPMh/vdlgQyZ/bjO9PMr9TYW6J" +
+        "aF2PnIKsRkzYfcn6xcQwPjAhMAkGBSsOAwIaBQAEFLddLgmJBuufBBi+JoHCaLDeTK" +
+        "RvBBTQP0GN26PaNdjOaE/AzK7bbhZGNAIDAYag";
+}
--- a/test/jdk/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java	Thu Nov 08 19:15:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -32,8 +32,7 @@
 import java.util.StringJoiner;
 import java.util.HashSet;
 import java.util.Set;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaLangModuleAccess;
+
 import jdk.internal.module.ModuleHashes;
 import jdk.internal.module.ModuleReferenceImpl;
 import jdk.test.bar.internal.Message;
--- a/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java	Thu Nov 08 19:07:57 2018 -0500
+++ b/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -34,15 +34,15 @@
 import java.util.Map;
 import java.util.Set;
 
-import jdk.internal.misc.JavaLangModuleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaLangModuleAccess;
+import jdk.internal.access.SharedSecrets;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
 /**
  * @test
  * @bug 8142968 8173381
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
  * @modules java.base/jdk.internal.module
  * @modules java.base/jdk.internal.org.objectweb.asm
  * @build ModuleTargetHelper
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/T8210197/DiamondWithAnonymousInnerClassTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,64 @@
+/*
+ * 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 8210197
+ * @summary javac can't tell during speculative attribution if a diamond expression is creating an anonymous inner class or not
+ * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+            jdk.compiler/com.sun.tools.javac.main
+ * @build toolbox.ToolBox toolbox.JavacTask
+ * @run main DiamondWithAnonymousInnerClassTest
+ */
+
+import toolbox.JavacTask;
+import toolbox.ToolBox;
+
+public class DiamondWithAnonymousInnerClassTest {
+    private static final String Class1Src =
+            "package pkg1;\n" +
+            "public class MyClass<T> {\n" +
+            "    protected MyClass() {}\n" +
+            "    protected MyClass(String s) {}\n" +
+            "}";
+    private static final String Class2Src =
+            "package pkg2;\n" +
+            "import pkg1.*;\n" +
+            "class Client {\n" +
+            "    <T> void foo(MyClass<T> m) {}\n" +
+            "    void bar() {\n" +
+            "        foo(new MyClass<>(){});\n" +
+            "    }\n" +
+            "}";
+
+    public static void main(String args[]) throws Exception {
+        new DiamondWithAnonymousInnerClassTest().run();
+    }
+
+    private final ToolBox tb = new ToolBox();
+
+    void run() {
+        new JavacTask(tb).sources(Class1Src, Class2Src).run();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/T8211450/ThrownTypeVarTest.java	Thu Nov 08 19:15:42 2018 -0500
@@ -0,0 +1,49 @@
+/*
+ * 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 8211450
+ * @summary UndetVar::dup is not copying the kind field to the duplicated instance
+ * @compile ThrownTypeVarTest.java
+ */
+
+import java.io.*;
+
+public class ThrownTypeVarTest {
+    void repro() throws IOException {
+        when(f(any()));
+    }
+
+    interface MyInt<T1, E1 extends Exception> {}
+
+    <T2, E2 extends Exception> T2 f(MyInt<T2, E2> g) throws IOException, E2 {
+        return null;
+    }
+
+    static <T3> T3 any() {
+        return null;
+    }
+
+    static <T4> void when(T4 methodCall) {}
+}