Merge JDK-8200758-branch
authorherrick
Fri, 05 Oct 2018 11:10:27 -0400
branchJDK-8200758-branch
changeset 56934 ee544d03fb22
parent 56933 9f59eeb3cc0f (current diff)
parent 52025 e75f6076d391 (diff)
child 56935 344eb87a55fb
Merge
make/Jprt.gmk
make/jprt.properties
test/hotspot/jtreg/jprt.config
test/jaxp/javax/xml/jaxp/libs/jaxp/library/JarUtils.java
test/jdk/com/sun/jdi/CatchPatternTest.sh
test/jdk/com/sun/jdi/ImmutableResourceTest.sh
test/jdk/com/sun/jdi/JITDebug.sh
test/jdk/com/sun/jdi/PrivateTransportTest.sh
test/jdk/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh
test/jdk/com/sun/jdi/redefine/RedefineSetUp.sh
test/jdk/com/sun/jdi/redefineMethod/RedefineSetUp.sh
test/jdk/jprt.config
test/jdk/lib/testlibrary/JarUtils.java
--- a/.hgtags	Mon Oct 01 09:04:49 2018 -0400
+++ b/.hgtags	Fri Oct 05 11:10:27 2018 -0400
@@ -514,3 +514,6 @@
 f0f5d23449d31f1b3580c8a73313918cafeaefd7 jdk-12+11
 15094d12a632f452a2064318a4e416d0c7a9ce0c jdk-12+12
 511a9946f83e3e3c7b9dbe1840367063fb39b4e1 jdk-12+13
+8897e41b327c0a5601c6ba2bba5d07f15a3ffc91 jdk-12+14
+8897e41b327c0a5601c6ba2bba5d07f15a3ffc91 jdk-12+14
+6f04692c7d5137ee34a6bd94c0c8a6c9219cb127 jdk-12+14
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/CompileCommands.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -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.  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
+
+# When FIXPATH is set, let it process the file to make sure all paths are usable
+# by system native tools. The FIXPATH tool assumes arguments preceeded by an @
+# character points to a text file containing further arguments (similar to a
+# linker). It replaces any such arguments with a different temporary filename,
+# whose contents has been processed to make any paths native. To obtain a
+# properly processed compile_commands.json, FIXPATH is then made to invoke an
+# AWK script with the unprocessed json file as the only argument, prepended with
+# an @ character. The AWK script simply copies the contents of this processed
+# file.
+#
+# The sed command encloses the fragments inside brackets and removes the final
+# trailing comma.
+$(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-commands/*.json)
+	$(call LogWarn, Updating compile_commands.json)
+	$(RM) $@
+	$(FIND) $(MAKESUPPORT_OUTPUTDIR)/compile-commands/ -name \*.json | \
+	    $(SORT) | $(XARGS) $(CAT) >> $@.tmp
+	$(if $(FIXPATH),$(FIXPATH) $(AWK) 'BEGIN { \
+	    tmpfile = substr(ARGV[2],2); \
+	    cmd = "$(CP) " "\047" tmpfile "\047" " $@.tmp"; \
+	    system(cmd); \
+	}' -- @$@.tmp)
+	$(SED) -e '1s/^/[\$(NEWLINE)/' -e '$(DOLLAR)s/,\s\{0,\}$(DOLLAR)/\$(NEWLINE)]/' $@.tmp > $@
+	$(RM) $@.tmp
+
+TARGETS += $(OUTPUTDIR)/compile_commands.json
+
+all: $(TARGETS)
+
+.PHONY: all
--- a/make/Jprt.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-#
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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.
-#
-
-# This file contains targets and utilities needed by JPRT.
-
-# Cygpath is only defined when running on Cygwin
-ifneq ($(CYGPATH), )
-  # If we get JPRT_ARCHIVE_*BUNDLE externally, make sure they have /cygdrive
-  # style paths
-  ifdef JPRT_ARCHIVE_BUNDLE
-    override JPRT_ARCHIVE_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_BUNDLE))
-  endif
-  ifdef JPRT_ARCHIVE_TEST_BUNDLE
-    override JPRT_ARCHIVE_TEST_BUNDLE := \
-        $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_TEST_BUNDLE))
-  endif
-  ifdef JPRT_ARCHIVE_SYMBOLS_BUNDLE
-    override JPRT_ARCHIVE_SYMBOLS_BUNDLE := \
-        $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_SYMBOLS_BUNDLE))
-  endif
-endif
-
-# When running in JPRT these will be provided. Need defaults so that this makefile
-# is valid anyway.
-ifndef JPRT_ARCHIVE_BUNDLE
-  JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/jdk-image.zip
-endif
-ifndef JPRT_ARCHIVE_TEST_BUNDLE
-  JPRT_ARCHIVE_TEST_BUNDLE=/tmp/jprt_bundles/test-image.zip
-endif
-ifndef JPRT_ARCHIVE_SYMBOLS_BUNDLE
-  JPRT_ARCHIVE_SYMBOLS_BUNDLE=/tmp/jprt_bundles/symbols-image.zip
-endif
-
-ifeq ($(SKIP_BOOT_CYCLE), false)
-  jprt_bundle: bootcycle-images
-endif
-
-################################################################################
-# JPRT specific bundling targets
-JPRT_TARGET ?= $(DEFAULT_MAKE_TARGET)
-ifeq ($(JPRT_TARGET), $(DEFAULT_MAKE_TARGET))
-  jprt_bundle: $(DEFAULT_MAKE_TARGET) $(JPRT_ARCHIVE_BUNDLE) \
-      $(JPRT_ARCHIVE_TEST_BUNDLE)
-
-  SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
-  SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
-
-  # This target must be called in the context of a SPEC file
-  $(JPRT_ARCHIVE_BUNDLE): product-images
-	$(call MakeDir, $(@D))
-	$(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIPEXE) -y -q -r $@ .
-
-  $(JPRT_ARCHIVE_TEST_BUNDLE): test-image
-	$(call MakeDir, $(@D))
-	$(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIPEXE) -y -q -r $@ .
-
-  ##############################################################################
-  # Optional symbols bundle
-  ifeq ($(GCOV_ENABLED), true)
-    jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
-
-    $(JPRT_ARCHIVE_SYMBOLS_BUNDLE): product-images
-	$(call MakeDir, $(@D))
-	$(CD) $(SYMBOLS_IMAGE_DIR) && $(ZIPEXE) -y -q -r $@ .
-
-  endif
-
-  ##############################################################################
-
-else
-  # Just fake the main bundle to satisfy JPRT
-  jprt_bundle: $(JPRT_TARGET)
-	@$(call TargetEnter)
-	$(MKDIR) -p $(OUTPUTDIR)/bundles
-	$(CD) $(TOPDIR) && $(TAR) cf - README | $(GZIP) > \
-	    $(JPRT_ARCHIVE_BUNDLE)
-	@$(call TargetExit)
-endif
-
-ALL_TARGETS += jprt_bundle
-
-################################################################################
-
-$(eval $(call IncludeCustomExtension, Jprt.gmk))
--- a/make/Main.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/Main.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -263,6 +263,31 @@
     $(HOTSPOT_VARIANT_LIBS_TARGETS) hotspot-ide-project
 
 ################################################################################
+# Generate libs and launcher targets for creating compile_commands.json fragments
+define DeclareCompileCommandsRecipe
+  $1-compile-commands:
+	$$(call LogInfo, Generating compile_commands.json fragments for $1)
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk $1-only \
+	    GENERATE_COMPILE_COMMANDS_ONLY=true)
+
+  COMPILE_COMMANDS_TARGETS_$2 += $1-compile-commands
+endef
+
+$(foreach t, $(HOTSPOT_VARIANT_LIBS_TARGETS), \
+  $(eval $(call DeclareCompileCommandsRecipe,$t,HOTSPOT)) \
+)
+
+$(foreach t, $(LIBS_TARGETS) $(LAUNCHER_TARGETS), \
+  $(eval $(call DeclareCompileCommandsRecipe,$t,JDK)) \
+)
+
+compile-commands compile-commands-hotspot:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCommands.gmk)
+
+ALL_TARGETS += $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
+ALL_TARGETS += compile-commands compile-commands-hotspot
+
+################################################################################
 # Build demos targets
 
 demos-jdk:
@@ -559,8 +584,12 @@
 test-make:
 	($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
 
+test-compile-commands:
+	($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk test-compile-commands)
+
 ALL_TARGETS += test test-hotspot-jtreg test-hotspot-jtreg-native \
-    test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make
+    test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make \
+    test-compile-commands
 
 ################################################################################
 # Bundles
@@ -735,6 +764,20 @@
   $(foreach m, $(ALL_MODULES), $(eval $m-jmod: $($(m)_JMOD_DEPS)))
   $(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $m-interim-jmod: $($(m)_JMOD_DEPS)))
 
+  # Setup the minimal set of generated native source dependencies for hotspot
+  $(foreach v, $(JVM_VARIANTS), \
+    $(eval hotspot-$v-libs-compile-commands: hotspot-$v-gensrc) \
+    $(foreach m, $(filter java.desktop jdk.hotspot.agent, $(GENSRC_MODULES)), \
+      $(eval hotspot-$v-libs-compile-commands: $m-gensrc)) \
+  )
+
+  # For the full JDK compile commands, create all possible generated sources
+  $(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc))
+  $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java))
+
+  compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT)
+  compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
+
   # Jmods cannot be created until we have the jmod tool ready to run. During
   # a normal build we run it from the exploded image, but when cross compiling
   # it's run from the buildjdk, which is either created at build time or user
@@ -849,6 +892,8 @@
 
   test-make: clean-test-make
 
+  test-compile-commands: compile-commands
+
   build-test-lib: exploded-image-optimize
 
   build-test-failure-handler: interim-langtools
@@ -1071,7 +1116,7 @@
 
 # Remove everything, except the output from configure.
 clean: $(CLEAN_DIR_TARGETS)
-	($(CD) $(OUTPUTDIR) && $(RM) -r build*.log*)
+	($(CD) $(OUTPUTDIR) && $(RM) -r build*.log* compile_commands.json)
 	$(ECHO) Cleaned all build artifacts.
 
 clean-docs:
@@ -1131,11 +1176,6 @@
 
 ################################################################################
 
-# Include JPRT targets
-include $(TOPDIR)/make/Jprt.gmk
-
-################################################################################
-
 # The following targets are intentionally not added to ALL_TARGETS since they
 # are internal only, to support Init.gmk.
 
--- a/make/ModuleWrapper.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/ModuleWrapper.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -100,5 +100,9 @@
         $(TARGETS)), \
 ))
 
-all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
-    $(COPY_INCLUDE) $(COPY_CMDS) $(COPY_CONF) $(LINK_LIBS_TO_LIB)
+ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
+  all: $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
+else
+  all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
+      $(COPY_INCLUDE) $(COPY_CMDS) $(COPY_CONF) $(LINK_LIBS_TO_LIB)
+endif
--- a/make/common/JavaCompilation.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/common/JavaCompilation.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -76,8 +76,8 @@
     $1_COPY_$$($2_TARGET) := 1
     # Now we can setup the dependency that will trigger the copying.
     $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2
-	$(MKDIR) -p $$(@D)
-	$(CP) $$< $$@
+	$$(call LogInfo, Copying $$(patsubst $(OUTPUTDIR)/%,%, $$@))
+	$$(install-file)
 	$(CHMOD) -f ug+w $$@
 
     # And do not forget this target
@@ -120,7 +120,8 @@
   ifneq ($$($1_CLEAN_$$($2_TARGET)), 1)
     $1_CLEAN_$$($2_TARGET) := 1
     $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2
-	$(MKDIR) -p $$(@D)
+	$$(call LogInfo, Cleaning $$(patsubst $(OUTPUTDIR)/%,%, $$@))
+	$$(call MakeTargetDir)
 	export LC_ALL=C ; ( $(CAT) $$< && $(ECHO) "" ) \
 	    | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
 	        -e 's/\([^\\]\)!/\1\\!/g' -e 's/^[ 	]*#.*/#/g' \
--- a/make/common/JdkNativeCompilation.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/common/JdkNativeCompilation.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -47,6 +47,29 @@
       $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/$(strip $2) \
       $(TOPDIR)/src/$(strip $1)/share/native/$(strip $2)))
 
+# Find a library
+# Param 1 - module name
+# Param 2 - library name
+# Param 3 - optional subdir for library
+FindLib = \
+    $(call FindLibDirForModule, \
+        $(strip $1))$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(SHARED_LIBRARY_SUFFIX)
+
+# Find a static library
+# Param 1 - module name
+# Param 2 - library name
+# Param 3 - optional subdir for library
+FindStaticLib = \
+    $(addprefix $(SUPPORT_OUTPUTDIR)/native/, \
+        $(strip $1)$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(STATIC_LIBRARY_SUFFIX))
+
+# If only generating compile_commands.json, make these return empty to avoid
+# declaring dependencies.
+ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
+  FindLib =
+  FindStaticLib =
+endif
+
 GetJavaHeaderDir = \
   $(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1))
 
--- a/make/common/NativeCompilation.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/common/NativeCompilation.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -60,6 +60,29 @@
 endef
 
 ################################################################################
+# Creates a recipe that creates a compile_commands.json fragment. Remove any
+# occurences of FIXPATH programs from the command to show the actual invocation.
+#
+# Param 1: Name of file to create
+# Param 2: Working directory
+# Param 3: Source file
+# Param 4: Compile command
+# Param 5: Object name
+################################################################################
+define WriteCompileCommandsFragment
+  $(call LogInfo, Creating compile commands fragment for $(notdir $3))
+  $(call MakeDir, $(dir $1))
+  $(call WriteFile,{ \
+      "directory": "$(strip $2)"$(COMMA) \
+      "file": "$(strip $3)"$(COMMA) \
+      "command": "$(strip $(subst $(DQUOTE),\$(DQUOTE),$(subst \,\\,\
+        $(subst $(FIXPATH),,$4))))"$(COMMA) \
+      "output": "$(strip $5)" \
+    }$(COMMA), \
+    $1)
+endef
+
+################################################################################
 # Define a native toolchain configuration that can be used by
 # SetupNativeCompilation calls
 #
@@ -203,6 +226,11 @@
   $1_OBJ := $$($$($1_BASE)_OBJECT_DIR)/$$(call replace_with_obj_extension, \
       $$($1_FILENAME))
 
+  # Generate the corresponding compile_commands.json fragment.
+  $1_OBJ_JSON = $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$(subst /,_,$$(subst \
+      $$(OUTPUTDIR)/,,$$($1_OBJ))).json
+  $$($1_BASE)_ALL_OBJS_JSON += $$($1_OBJ_JSON)
+
   # Only continue if this object file hasn't been processed already. This lets
   # the first found source file override any other with the same name.
   ifeq ($$(findstring $$($1_OBJ), $$($$($1_BASE)_OBJS_SO_FAR)), )
@@ -297,8 +325,15 @@
       $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_OBJ).vardeps)
     endif
 
-    $$($1_OBJ): $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
-        $$($$($1_BASE)_EXTRA_DEPS) $$($1_VARDEPS_FILE) | $$($$($1_BASE)_BUILD_INFO)
+    $1_OBJ_DEPS := $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
+        $$($$($1_BASE)_EXTRA_DEPS) $$($1_VARDEPS_FILE)
+    $1_COMPILE_OPTIONS := $$($1_FLAGS) $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)
+
+    $$($1_OBJ_JSON): $$($1_OBJ_DEPS)
+	$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$($1_SRC_FILE), \
+	    $$($1_COMPILER) $$($1_COMPILE_OPTIONS), $$($1_OBJ))
+
+    $$($1_OBJ): $$($1_OBJ_DEPS) | $$($$($1_BASE)_BUILD_INFO)
 	$$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME)))
 	$$(call MakeDir, $$(@D))
         ifneq ($(TOOLCHAIN_TYPE), microsoft)
@@ -307,13 +342,11 @@
             # object file in the generated deps files. Fixing it with sed. If
             # compiling assembly, don't try this.
 	    $$(call ExecuteWithLog, $$@, \
-	        $$($1_COMPILER) $$($1_FLAGS) $$($1_DEP_FLAG) $$($1_DEP).tmp \
-	            $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE))
+	        $$($1_COMPILER) $$($1_DEP_FLAG) $$($1_DEP).tmp $$($1_COMPILE_OPTIONS))
 	    $(SED) 's|^$$(@F):|$$@:|' $$($1_DEP).tmp > $$($1_DEP)
           else
 	    $$(call ExecuteWithLog, $$@, \
-	        $$($1_COMPILER) $$($1_FLAGS) $$($1_DEP_FLAG) $$($1_DEP) \
-	            $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE))
+	        $$($1_COMPILER) $$($1_DEP_FLAG) $$($1_DEP) $$($1_COMPILE_OPTIONS))
           endif
           # Create a dependency target file from the dependency file.
           # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
@@ -329,8 +362,7 @@
           # on Windows. No need to save exit code from compilation since
           # pipefail is always active on Windows.
 	  $$(call ExecuteWithLog, $$@, \
-	      $$($1_COMPILER) $$($1_FLAGS) -showIncludes \
-	          $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)) \
+	      $$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS)) \
 	      | $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
 	          -e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \
 	  $(ECHO) $$@: \\ > $$($1_DEP) ; \
@@ -694,17 +726,25 @@
         -include $$($1_PCH_DEP)
         -include $$($1_PCH_DEP_TARGETS)
 
+        $1_PCH_COMMAND := $$($1_CC) $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS) \
+            $$($1_OPT_CFLAGS) -x c++-header -c $(C_FLAG_DEPS) $$($1_PCH_DEP)
+
         $$($1_PCH_FILE): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
 		$$(call LogInfo, Generating precompiled header)
 		$$(call MakeDir, $$(@D))
-		$$(call ExecuteWithLog, $$@, \
-		    $$($1_CC) $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS) \
-		    $$($1_OPT_CFLAGS) \
-		    -x c++-header -c $(C_FLAG_DEPS) $$($1_PCH_DEP) $$< -o $$@)
+		$$(call ExecuteWithLog, $$@, $$($1_PCH_COMMAND) $$< -o $$@)
 		$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_PCH_DEP) > $$($1_PCH_DEP_TARGETS)
 
         $$($1_ALL_OBJS): $$($1_PCH_FILE)
 
+        # Generate the corresponding compile_commands.json fragment.
+        $1_PCH_FILE_JSON := $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$(subst /,_,$$(subst \
+            $$(OUTPUTDIR)/,,$$($1_PCH_FILE))).json
+        $1_ALL_OBJS_JSON += $$($1_PCH_FILE_JSON)
+
+        $$($1_PCH_FILE_JSON): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
+		$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$<, \
+		    $$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE), $$($1_PCH_FILE))
       endif
     endif
   endif
@@ -1025,6 +1065,10 @@
                   endif
                 endif
   endif
+
+  ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
+    $1 := $$($1_ALL_OBJS_JSON)
+  endif
 endef
 
 endif # _NATIVE_COMPILATION_GMK
--- a/make/conf/jib-profiles.js	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/conf/jib-profiles.js	Fri Oct 05 11:10:27 2018 -0400
@@ -522,11 +522,10 @@
         .forEach(function (name) {
             var maketestName = name + "-testmake";
             profiles[maketestName] = concatObjects(profiles[name], testmakeBase);
-            profiles[maketestName].default_make_targets = [ "test-make" ];
+            profiles[maketestName].default_make_targets = [ "test-make", "test-compile-commands" ];
         });
 
-    // Profiles for building the zero jvm variant. These are used for verification
-    // in JPRT.
+    // Profiles for building the zero jvm variant. These are used for verification.
     var zeroProfiles = {
         "linux-x64-zero": {
             target_os: "linux",
@@ -733,18 +732,8 @@
         });
     });
 
-    // Profiles used to run tests. Used in JPRT and Mach 5.
+    // Profiles used to run tests.
     var testOnlyProfiles = {
-        "run-test-jprt": {
-            target_os: input.build_os,
-            target_cpu: input.build_cpu,
-            dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ],
-            labels: "test",
-            environment: {
-                "JT_JAVA": common.boot_jdk_home
-            }
-        },
-
         "run-test": {
             target_os: input.build_os,
             target_cpu: input.build_cpu,
@@ -806,7 +795,6 @@
                 + "/Xcode.app/Contents/Developer/usr/bin"
         };
         profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
-        profiles["run-test-jprt"] = concatObjects(profiles["run-test-jprt"], macosxRunTestExtra);
         profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
     }
     // On windows we want the debug symbols available at test time
--- a/make/data/unicodedata/UnicodeData.txt	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/data/unicodedata/UnicodeData.txt	Fri Oct 05 11:10:27 2018 -0400
@@ -11729,6 +11729,7 @@
 32FC;CIRCLED KATAKANA WI;So;0;L;<circle> 30F0;;;;N;;;;;
 32FD;CIRCLED KATAKANA WE;So;0;L;<circle> 30F1;;;;N;;;;;
 32FE;CIRCLED KATAKANA WO;So;0;L;<circle> 30F2;;;;N;;;;;
+32FF;SQUARE ERA NAME NEWERA;So;0;L;<square> 5143 53F7;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME NEWERA;;;;
 3300;SQUARE APAATO;So;0;L;<square> 30A2 30D1 30FC 30C8;;;;N;SQUARED APAATO;;;;
 3301;SQUARE ARUHUA;So;0;L;<square> 30A2 30EB 30D5 30A1;;;;N;SQUARED ARUHUA;;;;
 3302;SQUARE ANPEA;So;0;L;<square> 30A2 30F3 30DA 30A2;;;;N;SQUARED ANPEA;;;;
--- a/make/hotspot/lib/CompileJvm.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/hotspot/lib/CompileJvm.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -214,15 +214,17 @@
 $(VM_VERSION_OBJ): $(filter-out $(VM_VERSION_OBJ) $(JVM_MAPFILE), \
     $(BUILD_LIBJVM_TARGET_DEPS))
 
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  # It doesn't matter which jvm.lib file gets exported, but we need
-  # to pick just one.
-  ifeq ($(JVM_VARIANT), $(JVM_VARIANT_MAIN))
-    $(eval $(call SetupCopyFiles, COPY_JVM_LIB, \
-        DEST := $(LIB_OUTPUTDIR), \
-        FILES :=$(BUILD_LIBJVM_IMPORT_LIBRARY), \
-    ))
-    TARGETS += $(COPY_JVM_LIB)
+ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
+  ifeq ($(OPENJDK_TARGET_OS), windows)
+    # It doesn't matter which jvm.lib file gets exported, but we need
+    # to pick just one.
+    ifeq ($(JVM_VARIANT), $(JVM_VARIANT_MAIN))
+      $(eval $(call SetupCopyFiles, COPY_JVM_LIB, \
+          DEST := $(LIB_OUTPUTDIR), \
+          FILES :=$(BUILD_LIBJVM_IMPORT_LIBRARY), \
+      ))
+      TARGETS += $(COPY_JVM_LIB)
+    endif
   endif
 endif
 
@@ -261,44 +263,46 @@
 # Search the output for the operator(s) of interest, to see where they are
 # referenced.
 
-ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang solstudio), )
+ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
+  ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang solstudio), )
 
-  DEMANGLED_REGEXP := [^:]operator (new|delete)
+    DEMANGLED_REGEXP := [^:]operator (new|delete)
 
-  # Running c++filt to find offending symbols in all files is too expensive,
-  # especially on Solaris, so use mangled names when looking for symbols.
-  # Save the demangling for when something is actually found.
-  ifeq ($(TOOLCHAIN_TYPE), solstudio)
-    MANGLED_SYMS := \
-        __1c2n6FL_pv_ \
-        __1c2N6FL_pv_ \
-        __1c2k6Fpv_v_ \
-        __1c2K6Fpv_v_ \
-        #
-    UNDEF_PATTERN := UNDEF
-  else
-    MANGLED_SYMS := \
-        _ZdaPv \
-        _ZdlPv \
-        _Znam \
-        _Znwm \
-        #
-    UNDEF_PATTERN := ' U '
+    # Running c++filt to find offending symbols in all files is too expensive,
+    # especially on Solaris, so use mangled names when looking for symbols.
+    # Save the demangling for when something is actually found.
+    ifeq ($(TOOLCHAIN_TYPE), solstudio)
+      MANGLED_SYMS := \
+          __1c2n6FL_pv_ \
+          __1c2N6FL_pv_ \
+          __1c2k6Fpv_v_ \
+          __1c2K6Fpv_v_ \
+          #
+      UNDEF_PATTERN := UNDEF
+    else
+      MANGLED_SYMS := \
+          _ZdaPv \
+          _ZdlPv \
+          _Znam \
+          _Znwm \
+          #
+      UNDEF_PATTERN := ' U '
+    endif
+
+    define SetupOperatorNewDeleteCheck
+        $1.op_check: $1
+	  if [ -n "`$(NM) $$< | $(GREP) $(addprefix -e , $(MANGLED_SYMS)) \
+	      | $(GREP) $(UNDEF_PATTERN)`" ]; then \
+	    $(ECHO) "$$<: Error: Use of global operators new and delete is not allowed in Hotspot:"; \
+	    $(NM) $$< | $(CXXFILT) | $(EGREP) '$(DEMANGLED_REGEXP)' | $(GREP) $(UNDEF_PATTERN); \
+	    $(ECHO) "See: $(TOPDIR)/make/hotspot/lib/CompileJvm.gmk"; \
+	    exit 1; \
+	  fi
+	  $(TOUCH) $$@
+
+      TARGETS += $1.op_check
+    endef
+
+    $(foreach o, $(BUILD_LIBJVM_ALL_OBJS), $(eval $(call SetupOperatorNewDeleteCheck,$o)))
   endif
-
-  define SetupOperatorNewDeleteCheck
-    $1.op_check: $1
-	if [ -n "`$(NM) $$< | $(GREP) $(addprefix -e , $(MANGLED_SYMS)) \
-	    | $(GREP) $(UNDEF_PATTERN)`" ]; then \
-	  $(ECHO) "$$<: Error: Use of global operators new and delete is not allowed in Hotspot:"; \
-	  $(NM) $$< | $(CXXFILT) | $(EGREP) '$(DEMANGLED_REGEXP)' | $(GREP) $(UNDEF_PATTERN); \
-	  $(ECHO) "See: $(TOPDIR)/make/hotspot/lib/CompileJvm.gmk"; \
-	  exit 1; \
-	fi
-	$(TOUCH) $$@
-
-    TARGETS += $1.op_check
-  endef
-
-  $(foreach o, $(BUILD_LIBJVM_ALL_OBJS), $(eval $(call SetupOperatorNewDeleteCheck,$o)))
 endif
--- a/make/jprt.properties	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,503 +0,0 @@
-#
-# 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.
-#
-
-##############
-#
-# Global settings
-#
-
-# Install test bundle for targets in jprt.test.bundle.targets set
-jprt.selective.test.bundle.installation=true
-
-# The current release name
-jprt.tools.default.release=jdk9
-
-# Allow concurrent changes to be merged in prior to pushing
-jprt.sync.push=true
-
-# Directories to be excluded from the source bundles
-jprt.bundle.exclude.src.dirs=build dist webrev ${jprt.bundle.exclude.src.dirs.extra}
-
-# Use configure when building
-jprt.build.use.configure=true
-jprt.build.use.jib=true
-jprt.test.use.jib=true
-jprt.jib.launcher=bin/jib.sh
-jprt.build.use.jib.publish=true
-
-# Clear out all the build needs as JIB handles this
-jprt.jdk9.build.needs=
-jprt.macosx.jdk9.build.needs=
-jprt.windows_i586.jdk9.build.needs=
-jprt.windows_x64.jdk9.build.needs=
-jprt.solaris.jdk9.build.needs=
-jprt.linux_i586.jdk9.build.needs=
-jprt.linux_x64.jdk9.build.needs=
-jprt.linux_armv6.jdk9.build.needs=
-jprt.linux_armvh.jdk9.build.needs=
-jprt.linux_arm64.jdk9.build.needs=
-jprt.linux_armsflt.jdk9.build.needs=
-jprt.linux_armvfpsflt.jdk9.build.needs=
-jprt.linux_armvfphflt.jdk9.build.needs=
-jprt.linux_armv6vfphflt.jdk9.build.needs=
-jprt.solaris.client.build.needs=
-jprt.linux.client.build.needs=
-jprt.solaris.jdk9.compiler=
-jprt.linux.jdk9.compiler=
-jprt.jdk9.test.needs=
-
-# Disable the need for preinstalled Visual Studio and Xcode
-jprt.windows.jdk9.compiler=
-jprt.windows.6.2.jdk9.compiler=
-jprt.windows.6.3.jdk9.compiler=
-jprt.windows.jdk9.target.attribute.compilerVS2013.appliesTo.builds=none
-jprt.macosx.jdk9.target.attribute.compilerXcode511.appliesTo.builds=none
-
-# Set up the run flavors (jvm variants)
-jprt.run.flavors=c2,default,${my.additional.run.flavors}
-
-# Setup jib profiles
-jprt.linux_i586.product.build.jib.profile=linux-x86
-jprt.linux_x64.product.build.jib.profile=linux-x64
-jprt.macosx_x64.product.build.jib.profile=macosx-x64
-jprt.solaris_sparcv9.product.build.jib.profile=solaris-sparcv9
-jprt.solaris_x64.product.build.jib.profile=solaris-x64
-jprt.windows_i586.product.build.jib.profile=windows-x86
-jprt.windows_x64.product.build.jib.profile=windows-x64
-
-jprt.linux_i586.fastdebug.build.jib.profile=linux-x86-debug
-jprt.linux_x64.fastdebug.build.jib.profile=linux-x64-debug
-jprt.macosx_x64.fastdebug.build.jib.profile=macosx-x64-debug
-jprt.solaris_sparcv9.fastdebug.build.jib.profile=solaris-sparcv9-debug
-jprt.solaris_x64.fastdebug.build.jib.profile=solaris-x64-debug
-jprt.windows_i586.fastdebug.build.jib.profile=windows-x86-debug
-jprt.windows_x64.fastdebug.build.jib.profile=windows-x64-debug
-
-jprt.linux_i586.slowdebug.build.jib.profile=linux-x86-slowdebug
-jprt.linux_x64.slowdebug.build.jib.profile=linux-x64-slowdebug
-jprt.macosx_x64.slowdebug.build.jib.profile=macosx-x64-slowdebug
-jprt.solaris_sparcv9.slowdebug.build.jib.profile=solaris-sparcv9-slowdebug
-jprt.solaris_x64.slowdebug.build.jib.profile=solaris-x64-slowdebug
-jprt.windows_i586.slowdebug.build.jib.profile=windows-x86-slowdebug
-jprt.windows_x64.slowdebug.build.jib.profile=windows-x64-slowdebug
-
-jprt.linux_i586.productOpen.build.jib.profile=linux-x86-open
-jprt.linux_x64.productOpen.build.jib.profile=linux-x64-open
-jprt.macosx_x64.productOpen.build.jib.profile=macosx-x64-open
-jprt.solaris_sparcv9.productOpen.build.jib.profile=solaris-sparcv9-open
-jprt.solaris_x64.productOpen.build.jib.profile=solaris-x64-open
-jprt.windows_i586.productOpen.build.jib.profile=windows-x86-open
-jprt.windows_x64.productOpen.build.jib.profile=windows-x64-open
-
-jprt.linux_i586.fastdebugOpen.build.jib.profile=linux-x86-open-debug
-jprt.linux_x64.fastdebugOpen.build.jib.profile=linux-x64-open-debug
-jprt.macosx_x64.fastdebugOpen.build.jib.profile=macosx-x64-open-debug
-jprt.solaris_sparcv9.fastdebugOpen.build.jib.profile=solaris-sparcv9-open-debug
-jprt.solaris_x64.fastdebugOpen.build.jib.profile=solaris-x64-open-debug
-jprt.windows_i586.fastdebugOpen.build.jib.profile=windows-x86-open-debug
-jprt.windows_x64.fastdebugOpen.build.jib.profile=windows-x64-open-debug
-
-jprt.linux_i586.productZero.build.jib.profile=linux-x86-zero
-jprt.linux_x64.productZero.build.jib.profile=linux-x64-zero
-
-jprt.linux_i586.fastdebugZero.build.jib.profile=linux-x86-zero-debug
-jprt.linux_x64.fastdebugZero.build.jib.profile=linux-x64-zero-debug
-
-jprt.test.jib.profile=run-test-jprt
-
-# Set make target to use for different build flavors
-jprt.build.flavor.fastdebugOpen.target=jprt_bundle
-jprt.build.flavor.fastdebug.target=jprt_bundle
-jprt.build.flavor.product.target=jprt_bundle
-jprt.build.flavor.productOpen.target=jprt_bundle
-jprt.build.flavor.optimized.target=jprt_bundle
-jprt.build.flavor.optimizedOpen.target=jprt_bundle
-jprt.build.flavor.slowdebug.target=jprt_bundle
-jprt.build.flavor.productZero.target=jprt_bundle
-jprt.build.flavor.fastdebugZero.target=jprt_bundle
-
-# Use these configure args to define debug level or provide specific
-# configuration details not covered by Jib profiles.
-jprt.slowdebug.build.configure.args=
-jprt.fastdebug.build.configure.args=--disable-precompiled-headers
-# Don't disable precompiled headers on windows. It's simply too slow.
-jprt.windows_i586.fastdebug.build.configure.args=
-jprt.windows_x64.fastdebug.build.configure.args=
-jprt.windows_i586.fastdebugOpen.build.configure.args=
-jprt.windows_x64.fastdebugOpen.build.configure.args=
-jprt.product.build.configure.args=
-jprt.optimized.build.configure.args=--with-debug-level=optimized
-jprt.slowdebugOpen.build.configure.args=${jprt.slowdebug.build.configure.args}
-jprt.fastdebugOpen.build.configure.args=${jprt.fastdebug.build.configure.args}
-jprt.productOpen.build.configure.args=${jprt.product.build.configure.args}
-jprt.optimizedOpen.build.configure.args=${jprt.product.build.configure.args}
-
-
-# hotspot testset has custom build flavors and build targets
-my.jprt.testsetHasCustomBuildFlavors.hotspot=true
-my.jprt.testsetHasCustomBuildTargets.hotspot=true
-my.jprt.testsetHasCustomBuildFlavors.buildinfra=true
-my.jprt.testsetHasCustomBuildTargets.buildinfra=true
-
-# determine if the specified testset has custom build flavors or build targets
-my.jprt.testsetHasCustomBuildFlavors=${my.jprt.testsetHasCustomBuildFlavors.${jprt.test.set}}
-my.jprt.testsetHasCustomBuildTargets=${my.jprt.testsetHasCustomBuildTargets.${jprt.test.set}}
-
-# Select build flavors and build targets based on the specified testset
-jprt.build.flavors=${my.jprt.testsetHasCustomBuildFlavors ? \
-    ${my.build.flavors.${jprt.test.set}} : ${my.build.flavors.default}}
-jprt.build.targets=${my.jprt.testsetHasCustomBuildTargets ? \
-    ${my.build.targets.${jprt.test.set}} : ${my.build.targets.default}}
-
-# Select test targets - jprt default for jprt.test.set is "default"
-jprt.test.targets=${my.test.targets.${jprt.test.set}}
-jprt.make.rule.test.targets=${my.make.rule.test.targets.${jprt.test.set}}
-
-# Not all test targets need the test image
-jprt.test.bundle.targets=\
-  ${my.make.rule.test.targets.svc}, \
-  ${my.make.rule.test.targets.hotspot.reg}, \
-  ${my.make.rule.test.targets.hotspot.gtest} \
-  ${my.make.rule.test.targets.nativesanity} \
-  ${my.test.target.set:TESTNAME=jdk_lang} \
-  ${my.test.target.set:TESTNAME=jdk_nio}
-
-# 7155453: Work-around to prevent popups on OSX from blocking test completion
-# but the work-around is added to all platforms to be consistent
-jprt.jbb.options=-Djava.awt.headless=true
-
-########
-#
-# Build options (generic)
-#
-
-# Configure args common to all builds
-# Also allows for additional, testset specific configure arguments to be set
-jprt.build.configure.args=						\
-    --with-output-sync=recurse						\
-    --with-jobs=$ALT_PARALLEL_COMPILE_JOBS				\
-    --with-version-opt=$JPRT_JOB_ID				 	\
-    ${my.additional.build.configure.args.${jprt.test.set}}		\
-    ${my.custom.build.configure.args}
-
-########
-#
-# Build targets and options (default/jdk)
-#
-
-# The default build flavors
-my.build.flavors.default=fastdebug,product
-
-# Standard list of jprt build targets for this source tree
-my.build.targets.default= \
-    solaris_sparcv9_5.11-{product|fastdebug}, \
-    solaris_x64_5.11-{product|fastdebug}, \
-    linux_i586_3.8-{product|fastdebug}, \
-    linux_x64_3.8-{product|fastdebug}, \
-    macosx_x64_10.9-{product|fastdebug}, \
-    windows_i586_6.3-{product|fastdebug}, \
-    windows_x64_6.3-{product|fastdebug}, \
-    ${my.additional.build.targets.default}
-
-# Test target list (no fastdebug & limited c2 testing)
-my.test.target.set=							\
-    solaris_sparcv9_5.11-product-c2-TESTNAME,				\
-    solaris_x64_5.11-product-c2-TESTNAME,				\
-    linux_i586_3.8-product-c2-TESTNAME, 				\
-    linux_x64_3.8-product-c2-TESTNAME,					\
-    macosx_x64_10.9-product-c2-TESTNAME,				\
-    windows_i586_6.3-product-c2-TESTNAME,				\
-    windows_x64_6.3-product-c2-TESTNAME
-
-# Default vm test targets (testset=default)
-my.test.targets.default=						\
-    ${my.test.target.set:TESTNAME=jvm98},				\
-    ${my.test.target.set:TESTNAME=scimark}
-
-# Default jdk test targets (testset=default)
-my.make.rule.test.targets.default=					\
-    ${my.test.target.set:TESTNAME=langtools_jtreg},			\
-    ${my.test.target.set:TESTNAME=jdk_lang},				\
-    ${my.test.target.set:TESTNAME=jdk_math},				\
-    ${my.test.target.set:TESTNAME=jdk_util}
-
-# Default vm test targets (testset=core)
-my.test.targets.core=
-
-# Core jdk test targets (testset=core)
-my.make.rule.test.targets.core=						\
-    ${my.test.target.set:TESTNAME=jdk_lang},				\
-    ${my.test.target.set:TESTNAME=jdk_math},				\
-    ${my.test.target.set:TESTNAME=jdk_util},				\
-    ${my.test.target.set:TESTNAME=jdk_io},				\
-    ${my.test.target.set:TESTNAME=jdk_net},				\
-    ${my.test.target.set:TESTNAME=jdk_nio},				\
-    ${my.test.target.set:TESTNAME=jdk_security1},			\
-    ${my.test.target.set:TESTNAME=jdk_security2},			\
-    ${my.test.target.set:TESTNAME=jdk_security3},			\
-    ${my.test.target.set:TESTNAME=jdk_security4},			\
-    ${my.test.target.set:TESTNAME=jdk_rmi},				\
-    ${my.test.target.set:TESTNAME=jdk_text},				\
-    ${my.test.target.set:TESTNAME=jdk_time},				\
-    ${my.test.target.set:TESTNAME=jdk_other},				\
-    ${my.test.target.set:TESTNAME=core_tools}
-
-# Svc vm test targets (testset=svc)
-my.test.targets.svc=
-
-# Core jdk test targets (testset=svc)
-my.make.rule.test.targets.svc=						\
-    ${my.test.target.set:TESTNAME=jdk_management},			\
-    ${my.test.target.set:TESTNAME=jdk_instrument},			\
-    ${my.test.target.set:TESTNAME=jdk_jmx},				\
-    ${my.test.target.set:TESTNAME=jdk_jdi},				\
-    ${my.test.target.set:TESTNAME=jdk_jfr},                             \
-    ${my.test.target.set:TESTNAME=svc_tools},                           \
-    ${my.make.rule.test.targets.svc.extra}
-
-# JAXP vm test targets (testset=jaxp)
-my.test.targets.jaxp=
-
-# JAXP test targets (testset=jaxp)
-my.make.rule.test.targets.jaxp=						\
-    ${my.test.target.set:TESTNAME=jaxp_all}
-
-# All vm test targets (testset=all)
-my.test.targets.all=							\
-    ${my.test.targets.default},						\
-    ${my.test.target.set:TESTNAME=runThese},				\
-    ${my.test.target.set:TESTNAME=jbb_default}
-
-# All jdk test targets (testset=all)
-my.make.rule.test.targets.all=						\
-    ${my.make.rule.test.targets.core},					\
-    ${my.make.rule.test.targets.svc},					\
-    ${my.test.target.set:TESTNAME=jdk_awt},				\
-    ${my.test.target.set:TESTNAME=jdk_beans},				\
-    ${my.test.target.set:TESTNAME=jdk_sound},				\
-    ${my.test.target.set:TESTNAME=jdk_swing}
-
-# PIT vm test targets (testset=pit)
-my.test.targets.pit=							\
-   ${my.test.targets.all}
-
-# PIT jdk test targets (testset=pit)
-my.make.rule.test.targets.pit=						\
-    ${my.test.target.set:TESTNAME=langtools_jtreg},			\
-    ${my.make.rule.test.targets.core},					\
-    ${my.make.rule.test.targets.svc}                                    \
-    ${my.make.rule.test.targets.jaxp}
-
-# JCK test targets in test/Makefile (no windows)
-my.test.target.set.jck=							\
-    solaris_sparcv9_5.11-product-c2-JCK7TESTRULE,			\
-    solaris_x64_5.11-product-c2-JCK7TESTRULE,				\
-    linux_i586_3.8-product-c2-JCK7TESTRULE,				\
-    linux_x64_3.8-product-c2-JCK7TESTRULE
-
-# JCK testset targets
-my.make.rule.test.targets.jck=						\
-    ${my.test.target.set.jck:JCK7TESTRULE=jck7devtools},		\
-    ${my.test.target.set.jck:JCK7TESTRULE=jck7runtime},			\
-    ${my.test.target.set.jck:JCK7TESTRULE=jck7compiler}
-
-
-#############
-#
-# Hotspot related settings (testset=hotspot)
-#
-
-# The hotspot build flavors
-my.build.flavors.hotspot=						\
-    fastdebugOpen,fastdebug,product,productOpen,optimized,optimizedOpen \
-    ${my.additional.build.flavors.hotspot}
-
-# Platforms built for hotspot push jobs
-my.build.targets.hotspot=						\
-    solaris_sparcv9_5.11-{product|fastdebug},				\
-    solaris_x64_5.11-{product|fastdebug},				\
-    linux_i586_3.8-{product|fastdebug},					\
-    linux_x64_3.8-{product|fastdebug},					\
-    macosx_x64_10.9-{product|fastdebug},				\
-    windows_i586_6.3-{product|fastdebug},				\
-    windows_x64_6.3-{product|fastdebug},				\
-    solaris_x64_5.11-{fastdebugOpen},					\
-    linux_x64_3.8-{productOpen},					\
-    ${my.additional.build.targets.hotspot}
-
-# Tests to run on the various platforms for hotspot push jobs
-my.test.targets.hotspot.solaris.sparcv9=				\
-    solaris_sparcv9_5.11-{product|fastdebug}-c2-jvm98,			\
-    solaris_sparcv9_5.11-{product|fastdebug}-c2-jvm98_nontiered,	\
-    solaris_sparcv9_5.11-{product|fastdebug}-c2-scimark,		\
-    solaris_sparcv9_5.11-product-c2-runThese8,
-
-my.test.targets.hotspot.solaris.x64=					\
-    solaris_x64_5.11-{product|fastdebug}-c2-jvm98,			\
-    solaris_x64_5.11-{product|fastdebug}-c2-jvm98_nontiered,		\
-    solaris_x64_5.11-{product|fastdebug}-c2-scimark,			\
-    solaris_x64_5.11-product-c2-runThese8,				\
-    solaris_x64_5.11-product-c2-runThese8_Xcomp_lang,			\
-    solaris_x64_5.11-product-c2-runThese8_Xcomp_vm,
-
-my.test.targets.hotspot.linux.i586=					\
-    linux_i586_3.8-{product|fastdebug}-c2-jvm98,			\
-    linux_i586_3.8-{product|fastdebug}-c2-jvm98_nontiered,		\
-    linux_i586_3.8-{product|fastdebug}-c2-scimark,			\
-    linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_lang,			\
-    linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_vm
-
-my.test.targets.hotspot.linux.x64=					\
-    linux_x64_3.8-{product|fastdebug}-c2-jvm98,				\
-    linux_x64_3.8-{product|fastdebug}-c2-jvm98_nontiered,		\
-    linux_x64_3.8-{product|fastdebug}-c2-scimark
-
-my.test.targets.hotspot.macosx.x64=					\
-    macosx_x64_10.9-{product|fastdebug}-c2-jvm98,			\
-    macosx_x64_10.9-{product|fastdebug}-c2-jvm98_nontiered,		\
-    macosx_x64_10.9-{product|fastdebug}-c2-scimark
-
-my.test.targets.hotspot.windows.i586=					\
-    windows_i586_6.3-{product|fastdebug}-c2-jvm98,			\
-    windows_i586_6.3-{product|fastdebug}-c2-jvm98_nontiered,		\
-    windows_i586_6.3-{product|fastdebug}-c2-scimark,			\
-    windows_i586_6.3-product-c2-runThese8,				\
-    windows_i586_6.3-product-c2-runThese8_Xcomp_lang,			\
-    windows_i586_6.3-product-c2-runThese8_Xcomp_vm,
-
-my.test.targets.hotspot.windows.x64=					\
-    windows_x64_6.3-{product|fastdebug}-c2-jvm98,			\
-    windows_x64_6.3-{product|fastdebug}-c2-jvm98_nontiered,		\
-    windows_x64_6.3-{product|fastdebug}-c2-scimark,			\
-    windows_x64_6.3-product-c2-runThese8,				\
-    windows_x64_6.3-product-c2-runThese8_Xcomp_lang,			\
-    windows_x64_6.3-product-c2-runThese8_Xcomp_vm,
-
-# Some basic "smoke" tests for OpenJDK builds
-my.test.targets.hotspot.open=						\
-    solaris_x64_5.11-{productOpen|fastdebugOpen}-c2-jvm98,		\
-    linux_x64_3.8-{productOpen|fastdebugOpen}-c2-jvm98
-
-# The complete list of test targets for jprt
-my.test.targets.hotspot=						\
-  ${my.test.targets.hotspot.open},					\
-  ${my.test.targets.hotspot.solaris.sparcv9},				\
-  ${my.test.targets.hotspot.solaris.x64},				\
-  ${my.test.targets.hotspot.linux.i586},				\
-  ${my.test.targets.hotspot.linux.x64},					\
-  ${my.test.targets.hotspot.macosx.x64},				\
-  ${my.test.targets.hotspot.windows.i586},				\
-  ${my.test.targets.hotspot.windows.x64},				\
-  ${my.test.targets.hotspot.solaris.sparcv9},				\
-  ${my.test.targets.hotspot.solaris.x64},				\
-  ${my.test.targets.hotspot.linux.x64},					\
-  ${my.test.targets.hotspot.windows.i586},				\
-  ${my.test.targets.hotspot.windows.x64},				\
-  ${my.additional.test.targets.hotspot}
-
-
-# Make file based test targets
-
-my.make.rule.test.targets.hotspot.gtest= \
-  linux_i586_3.8-*-default-hotspot_gtest, \
-  linux_x64_3.8-*-default-hotspot_gtest, \
-  macosx_x64_10.9-*-default-hotspot_gtest, \
-  solaris_sparcv9_5.11-*-default-hotspot_gtest, \
-  solaris_x64_5.11-*-default-hotspot_gtest, \
-  windows_i586_6.3-*-default-hotspot_gtest, \
-  windows_x64_6.3-*-default-hotspot_gtest, \
-  ${my.additional.make.rule.test.targets.hotspot.gtest}
-
-my.make.rule.test.targets.hotspot.reg.group=				\
-  solaris_sparcv9_5.11-fastdebug-c2-GROUP,				\
-  solaris_x64_5.11-fastdebug-c2-GROUP,					\
-  linux_i586_3.8-fastdebug-c2-GROUP,					\
-  linux_x64_3.8-fastdebug-c2-GROUP,					\
-  macosx_x64_10.9-fastdebug-c2-GROUP,					\
-  windows_i586_6.3-fastdebug-c2-GROUP,					\
-  windows_x64_6.3-fastdebug-c2-GROUP
-
-# Hotspot jtreg tests
-my.make.rule.test.targets.hotspot.reg=							\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_compiler_1},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_compiler_2},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_compiler_3},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_compiler_closed},	\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_1},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_2},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_closed},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_gcold},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_gcbasher},	\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_runtime},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_serviceability},	\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity},			\
-  solaris_sparcv9_5.11-product-c2-hotspot_tier1_gc_gcbasher,				\
-  solaris_x64_5.11-product-c2-hotspot_tier1_gc_gcbasher,					\
-  linux_i586_3.8-product-c2-hotspot_tier1_gc_gcbasher,					\
-  linux_x64_3.8-product-c2-hotspot_tier1_gc_gcbasher,					\
-  macosx_x64_10.9-product-c2-hotspot_tier1_gc_gcbasher,					\
-  windows_i586_6.3-product-c2-hotspot_tier1_gc_gcbasher,					\
-  windows_x64_6.3-product-c2-hotspot_tier1_gc_gcbasher,                                  \
-  ${my.additional.make.rule.test.targets.hotspot.reg}
-
-# Other Makefile based Hotspot tests
-my.make.rule.test.targets.hotspot.other=                                \
-  ${my.make.rule.test.targets.hotspot.gtest},                           \
-  ${my.additional.make.rule.test.targets.hotspot.other}
-
-# All the makefile based tests to run
-my.make.rule.test.targets.hotspot=                                      \
-  ${my.make.rule.test.targets.hotspot.reg}                              \
-  ${my.make.rule.test.targets.hotspot.other}
-
-# Native jdk and hotspot test targets (testset=nativesanity)
-my.make.rule.test.targets.nativesanity=					\
-    ${my.test.target.set:TESTNAME=jdk_native_sanity},			\
-    ${my.test.target.set:TESTNAME=hotspot_native_sanity}
-
-################################################################################
-# Testset buildinfra
-my.build.flavors.buildinfra = \
-    product,fastdebug,slowdebug,productZero,fastdebugZero \
-    ${my.additional.build.flavors.buildinfra}
-
-# Platforms built for hotspot push jobs
-my.build.targets.buildinfra = \
-    solaris_sparcv9_5.11-{product|fastdebug|slowdebug}, \
-    solaris_x64_5.11-{product|fastdebug|slowdebug}, \
-    linux_i586_3.8-{product|fastdebug|slowdebug|productZero|fastdebugZero}, \
-    linux_x64_3.8-{product|fastdebug|slowdebug|productZero|fastdebugZero}, \
-    macosx_x64_10.9-{product|fastdebug|slowdebug}, \
-    windows_i586_6.3-{product|fastdebug|slowdebug}, \
-    windows_x64_6.3-{product|fastdebug|slowdebug}, \
-    ${my.additional.build.targets.buildinfra}
-
-my.test.targets.buildinfra = \
-    ${my.test.targets.default}, \
-    ${my.test.targets.hotspot}
-
-my.make.rule.test.targets.buildinfra = \
-    ${my.make.rule.test.targets.default}, \
-    ${my.make.rule.test.targets.hotspot}
--- a/make/langtools/tools/propertiesparser/gen/ClassGenerator.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/langtools/tools/propertiesparser/gen/ClassGenerator.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,6 +25,8 @@
 
 package propertiesparser.gen;
 
+import static java.util.stream.Collectors.toList;
+
 import propertiesparser.parser.Message;
 import propertiesparser.parser.MessageFile;
 import propertiesparser.parser.MessageInfo;
@@ -44,11 +46,12 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.TreeSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
-import java.util.Properties;
+import java.util.TreeMap;
+import java.util.TreeSet;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -150,7 +153,11 @@
     public void generateFactory(MessageFile messageFile, File outDir) {
         Map<FactoryKind, List<Map.Entry<String, Message>>> groupedEntries =
                 messageFile.messages.entrySet().stream()
-                        .collect(Collectors.groupingBy(e -> FactoryKind.parseFrom(e.getKey().split("\\.")[1])));
+                        .collect(
+                                Collectors.groupingBy(
+                                        e -> FactoryKind.parseFrom(e.getKey().split("\\.")[1]),
+                                        TreeMap::new,
+                                        toList()));
         //generate nested classes
         List<String> nestedDecls = new ArrayList<>();
         Set<String> importedTypes = new TreeSet<>();
--- a/make/launcher/Launcher-jdk.pack.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/launcher/Launcher-jdk.pack.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -91,21 +91,15 @@
     CFLAGS_solaris := -KPIC, \
     CFLAGS_macosx := -fPIC, \
     DISABLED_WARNINGS_clang := format-nonliteral, \
-    LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
-        $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
+    LDFLAGS := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe, \
     MANIFEST := $(TOPDIR)/src/jdk.pack/windows/native/unpack200/unpack200_proto.exe.manifest, \
     MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
+    EXTRA_OBJECT_FILES := $(UNPACKEXE_ZIPOBJS) \
 ))
 
-ifneq ($(USE_EXTERNAL_LIBZ), true)
-
-  $(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS)
-
-endif
-
 TARGETS += $(BUILD_UNPACKEXE)
 
 ################################################################################
--- a/make/launcher/LauncherCommon.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/launcher/LauncherCommon.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -135,7 +135,7 @@
     $1_LIBS += -lz
   endif
 
-  $1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
+  $1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)
 
   $$(eval $$(call SetupJdkExecutable, BUILD_LAUNCHER_$1, \
       NAME := $1, \
@@ -181,11 +181,11 @@
   TARGETS += $$($1)
 
   ifeq ($(OPENJDK_TARGET_OS), aix)
-    $$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a
+    $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    $$(BUILD_LAUNCHER_$1): $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib \
+    $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
         $$($1_WINDOWS_JLI_LIB)
   endif
 endef
--- a/make/lib/Awt2dLibraries.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/lib/Awt2dLibraries.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -739,11 +739,11 @@
   ifeq ($(ENABLE_HEADLESS_ONLY), false)
     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
   else
-    $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
+    $(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_headless)
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
-    $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
+   $(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_lwawt)
   endif
 
 endif # OPENJDK_TARGET_OS
--- a/make/lib/Lib-jdk.accessibility.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/lib/Lib-jdk.accessibility.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -55,7 +55,7 @@
         VERSIONINFO_RESOURCE := $(ROOT_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
     )
 
-    $$(BUILD_JAVAACCESSBRIDGE$1): $(SUPPORT_OUTPUTDIR)/native/java.desktop/libjawt/jawt.lib
+    $$(BUILD_JAVAACCESSBRIDGE$1): $(call FindStaticLib, java.desktop, jawt, /libjawt)
 
     TARGETS += $$(BUILD_JAVAACCESSBRIDGE$1)
   endef
--- a/make/lib/LibCommon.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/lib/LibCommon.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -61,24 +61,6 @@
   endif
 endif
 
-################################################################################
-# Find a library
-# Param 1 - module name
-# Param 2 - library name
-# Param 3 - optional subdir for library
-FindLib = \
-    $(call FindLibDirForModule, \
-        $(strip $1))$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(SHARED_LIBRARY_SUFFIX)
-
-################################################################################
-# Find a static library
-# Param 1 - module name
-# Param 2 - library name
-# Param 3 - optional subdir for library
-FindStaticLib = \
-    $(addprefix $(SUPPORT_OUTPUTDIR)/native/, \
-        $(strip $1)$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(STATIC_LIBRARY_SUFFIX))
-
 # Put the libraries here.
 INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
 
--- a/make/src/classes/build/tools/jfr/GenerateJfrFiles.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/make/src/classes/build/tools/jfr/GenerateJfrFiles.java	Fri Oct 05 11:10:27 2018 -0400
@@ -477,6 +477,7 @@
             out.write("");
             out.write("#else // !INCLUDE_JFR");
             out.write("");
+            out.write("template <typename T>");
             out.write("class JfrEvent {");
             out.write(" public:");
             out.write("  JfrEvent() {}");
@@ -497,103 +498,83 @@
 
     private static void printTypes(Printer out, Metadata metadata, boolean empty) {
         for (TypeElement t : metadata.getStructs()) {
-            if (empty) {
-                out.write("");
-                printEmptyType(out, t);
-            } else {
-                printType(out, t);
-            }
+            printType(out, t, empty);
             out.write("");
         }
         for (EventElement e : metadata.getEvents()) {
-            if (empty) {
-                printEmptyEvent(out, e);
-            } else {
-                printEvent(out, e);
-            }
+            printEvent(out, e, empty);
             out.write("");
         }
     }
 
-    private static void printEmptyEvent(Printer out, EventElement event) {
-        out.write("class Event" + event.name + " : public JfrEvent");
-        out.write("{");
-        out.write(" public:");
-        out.write("  Event" + event.name + "(EventStartTime ignore=TIMED) {}");
-        if (event.startTime) {
-            StringJoiner sj = new StringJoiner(",\n    ");
-            for (FieldElement f : event.fields) {
-                sj.add(f.getParameterType());
-            }
-            out.write("  Event" + event.name + "(");
-            out.write("    " + sj.toString() + ") { }");
-        }
-        for (FieldElement f : event.fields) {
-            out.write("  void set_" + f.name + "(" + f.getParameterType() + ") { }");
-        }
-        out.write("};");
-    }
-
-    private static void printEmptyType(Printer out, TypeElement t) {
+    private static void printType(Printer out, TypeElement t, boolean empty) {
         out.write("struct JfrStruct" + t.name);
         out.write("{");
+        if (!empty) {
+          out.write(" private:");
+          for (FieldElement f : t.fields) {
+              printField(out, f);
+          }
+          out.write("");
+        }
         out.write(" public:");
         for (FieldElement f : t.fields) {
-            out.write("  void set_" + f.name + "(" + f.getParameterType() + ") { }");
-        }
-        out.write("};");
-    }
-
-    private static void printType(Printer out, TypeElement t) {
-        out.write("struct JfrStruct" + t.name);
-        out.write("{");
-        out.write(" private:");
-        for (FieldElement f : t.fields) {
-            printField(out, f);
+           printTypeSetter(out, f, empty);
         }
         out.write("");
-        out.write(" public:");
-        for (FieldElement f : t.fields) {
-            printTypeSetter(out, f);
+        if (!empty) {
+          printWriteData(out, t.fields);
         }
-        out.write("");
-        printWriteData(out, t.fields);
         out.write("};");
         out.write("");
     }
 
-    private static void printEvent(Printer out, EventElement event) {
+    private static void printEvent(Printer out, EventElement event, boolean empty) {
         out.write("class Event" + event.name + " : public JfrEvent<Event" + event.name + ">");
         out.write("{");
-        out.write(" private:");
-        for (FieldElement f : event.fields) {
-            printField(out, f);
+        if (!empty) {
+          out.write(" private:");
+          for (FieldElement f : event.fields) {
+              printField(out, f);
+          }
+          out.write("");
         }
-        out.write("");
         out.write(" public:");
-        out.write("  static const bool hasThread = " + event.thread + ";");
-        out.write("  static const bool hasStackTrace = " + event.stackTrace + ";");
-        out.write("  static const bool isInstant = " + !event.startTime + ";");
-        out.write("  static const bool hasCutoff = " + event.cutoff + ";");
-        out.write("  static const bool isRequestable = " + event.periodic + ";");
-        out.write("  static const JfrEventId eventId = Jfr" + event.name + "Event;");
-        out.write("");
-        out.write("  Event" + event.name + "(EventStartTime timing=TIMED) : JfrEvent<Event" + event.name + ">(timing) {}");
+        if (!empty) {
+          out.write("  static const bool hasThread = " + event.thread + ";");
+          out.write("  static const bool hasStackTrace = " + event.stackTrace + ";");
+          out.write("  static const bool isInstant = " + !event.startTime + ";");
+          out.write("  static const bool hasCutoff = " + event.cutoff + ";");
+          out.write("  static const bool isRequestable = " + event.periodic + ";");
+          out.write("  static const JfrEventId eventId = Jfr" + event.name + "Event;");
+          out.write("");
+        }
+        if (!empty) {
+          out.write("  Event" + event.name + "(EventStartTime timing=TIMED) : JfrEvent<Event" + event.name + ">(timing) {}");
+        } else {
+          out.write("  Event" + event.name + "(EventStartTime timing=TIMED) {}");
+        }
         out.write("");
         int index = 0;
         for (FieldElement f : event.fields) {
             out.write("  void set_" + f.name + "(" + f.getParameterType() + " " + f.getParameterName() + ") {");
-            out.write("    this->_" + f.name + " = " + f.getParameterName() + ";");
-            out.write("    DEBUG_ONLY(set_field_bit(" + index++ + "));");
+            if (!empty) {
+              out.write("    this->_" + f.name + " = " + f.getParameterName() + ";");
+              out.write("    DEBUG_ONLY(set_field_bit(" + index++ + "));");
+            }
             out.write("  }");
         }
         out.write("");
-        printWriteData(out, event.fields);
-        out.write("");
+        if (!empty) {
+          printWriteData(out, event.fields);
+          out.write("");
+        }
         out.write("  using JfrEvent<Event" + event.name + ">::commit; // else commit() is hidden by overloaded versions in this class");
-        printConstructor2(out, event);
-        printCommitMethod(out, event);
-        printVerify(out, event.fields);
+        printConstructor2(out, event, empty);
+        printCommitMethod(out, event, empty);
+        if (!empty) {
+          printVerify(out, event.fields);
+        }
         out.write("};");
     }
 
@@ -610,8 +591,12 @@
         out.write("  }");
     }
 
-    private static void printTypeSetter(Printer out, FieldElement field) {
-        out.write("  void set_" + field.name + "(" + field.getParameterType() + " new_value) { this->_" + field.name + " = new_value; }");
+    private static void printTypeSetter(Printer out, FieldElement field, boolean empty) {
+        if (!empty) {
+          out.write("  void set_" + field.name + "(" + field.getParameterType() + " new_value) { this->_" + field.name + " = new_value; }");
+        } else {
+          out.write("  void set_" + field.name + "(" + field.getParameterType() + " new_value) { }");
+        }
     }
 
     private static void printVerify(Printer out, List<FieldElement> fields) {
@@ -626,7 +611,7 @@
         out.write("#endif");
     }
 
-    private static void printCommitMethod(Printer out, EventElement event) {
+    private static void printCommitMethod(Printer out, EventElement event, boolean empty) {
         if (event.startTime) {
             StringJoiner sj = new StringJoiner(",\n              ");
             for (FieldElement f : event.fields) {
@@ -634,12 +619,14 @@
             }
             out.write("");
             out.write("  void commit(" + sj.toString() + ") {");
-            out.write("    if (should_commit()) {");
-            for (FieldElement f : event.fields) {
-                out.write("      set_" + f.name + "(" + f.name + ");");
+            if (!empty) {
+              out.write("    if (should_commit()) {");
+              for (FieldElement f : event.fields) {
+                  out.write("      set_" + f.name + "(" + f.name + ");");
+              }
+              out.write("      commit();");
+              out.write("    }");
             }
-            out.write("      commit();");
-            out.write("    }");
             out.write("  }");
         }
         out.write("");
@@ -652,22 +639,24 @@
             sj.add(f.getParameterType() + " " + f.name);
         }
         out.write("  static void commit(" + sj.toString() + ") {");
-        out.write("    Event" + event.name + " me(UNTIMED);");
-        out.write("");
-        out.write("    if (me.should_commit()) {");
-        if (event.startTime) {
-            out.write("      me.set_starttime(startTicks);");
-            out.write("      me.set_endtime(endTicks);");
+        if (!empty) {
+          out.write("    Event" + event.name + " me(UNTIMED);");
+          out.write("");
+          out.write("    if (me.should_commit()) {");
+          if (event.startTime) {
+              out.write("      me.set_starttime(startTicks);");
+              out.write("      me.set_endtime(endTicks);");
+          }
+          for (FieldElement f : event.fields) {
+              out.write("      me.set_" + f.name + "(" + f.name + ");");
+          }
+          out.write("      me.commit();");
+          out.write("    }");
         }
-        for (FieldElement f : event.fields) {
-            out.write("      me.set_" + f.name + "(" + f.name + ");");
-        }
-        out.write("      me.commit();");
-        out.write("    }");
         out.write("  }");
     }
 
-    private static void printConstructor2(Printer out, EventElement event) {
+    private static void printConstructor2(Printer out, EventElement event, boolean empty) {
         if (!event.startTime) {
             out.write("");
             out.write("");
@@ -679,12 +668,16 @@
             for (FieldElement f : event.fields) {
                 sj.add(f.getParameterType() + " " + f.name);
             }
-            out.write("    " + sj.toString() + ") : JfrEvent<Event" + event.name + ">(TIMED) {");
-            out.write("    if (should_commit()) {");
-            for (FieldElement f : event.fields) {
-                out.write("      set_" + f.name + "(" + f.name + ");");
+            if (!empty) {
+              out.write("    " + sj.toString() + ") : JfrEvent<Event" + event.name + ">(TIMED) {");
+              out.write("    if (should_commit()) {");
+              for (FieldElement f : event.fields) {
+                  out.write("      set_" + f.name + "(" + f.name + ");");
+              }
+              out.write("    }");
+            } else {
+              out.write("    " + sj.toString() + ") {");
             }
-            out.write("    }");
             out.write("  }");
         }
     }
--- a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -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) 2014, 2018, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -195,9 +195,7 @@
 void CompiledDirectStaticCall::verify() {
   // Verify call.
   _call->verify();
-  if (os::is_MP()) {
-    _call->verify_alignment();
-  }
+  _call->verify_alignment();
 
   // Verify stub.
   address stub = find_stub(false /* is_aot */);
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1505,7 +1505,7 @@
 #ifndef PRODUCT
   {
     char buffer[64];
-    snprintf(buffer, sizeof(buffer), "0x%"PRIX64, imm64);
+    snprintf(buffer, sizeof(buffer), "0x%" PRIX64, imm64);
     block_comment(buffer);
   }
 #endif
@@ -1568,7 +1568,7 @@
 #ifndef PRODUCT
   {
     char buffer[64];
-    snprintf(buffer, sizeof(buffer), "0x%"PRIX64, imm64);
+    snprintf(buffer, sizeof(buffer), "0x%" PRIX64, imm64);
     block_comment(buffer);
   }
 #endif
@@ -1681,7 +1681,7 @@
 #ifndef PRODUCT
     {
       char buffer[64];
-      snprintf(buffer, sizeof(buffer), "0x%"PRIX32, imm32);
+      snprintf(buffer, sizeof(buffer), "0x%" PRIX32, imm32);
       block_comment(buffer);
     }
 #endif
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1950,24 +1950,20 @@
   //     didn't see any synchronization is progress, and escapes.
   __ mov(rscratch1, _thread_in_native_trans);
 
-  if(os::is_MP()) {
-    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);
-    }
+  if (UseMembar) {
+    __ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
+
+    // Force this write out before the read below
+    __ dmb(Assembler::ISH);
   } else {
-    __ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
+    __ 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);
   }
 
   // check for safepoint operation in progress and/or pending suspend requests
--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1394,17 +1394,15 @@
   __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
   __ stlrw(rscratch1, rscratch2);
 
-  if (os::is_MP()) {
-    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);
-    }
+  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);
   }
 
   // check for safepoint operation in progress and/or pending suspend requests
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -412,7 +412,7 @@
     // Stash null_sentinel address to get its value later
     __ movptr(rarg, (uintptr_t)Universe::the_null_sentinel_addr());
     __ ldr(tmp, Address(rarg));
-    __ cmp(result, tmp);
+    __ cmpoop(result, tmp);
     __ br(Assembler::NE, notNull);
     __ mov(result, 0);  // NULL object reference
     __ bind(notNull);
--- a/src/hotspot/cpu/arm/arm.ad	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/arm/arm.ad	Fri Oct 05 11:10:27 2018 -0400
@@ -5316,8 +5316,7 @@
 // Prefetch instructions.
 // Must be safe to execute with invalid address (cannot fault).
 
-instruct prefetchAlloc_mp( memoryP mem ) %{
-  predicate(os::is_MP());
+instruct prefetchAlloc( memoryP mem ) %{
   match( PrefetchAllocation mem );
   ins_cost(MEMORY_REF_COST);
   size(4);
@@ -5333,23 +5332,6 @@
   ins_pipe(iload_mem);
 %}
 
-instruct prefetchAlloc_sp( memoryP mem ) %{
-  predicate(!os::is_MP());
-  match( PrefetchAllocation mem );
-  ins_cost(MEMORY_REF_COST);
-  size(4);
-
-  format %{ "PLD $mem\t! Prefetch allocation" %}
-  ins_encode %{
-#ifdef AARCH64
-    __ prfm(pstl1keep, $mem$$Address);
-#else
-    __ pld($mem$$Address);
-#endif
-  %}
-  ins_pipe(iload_mem);
-%}
-
 //----------Store Instructions-------------------------------------------------
 // Store Byte
 instruct storeB(memoryB mem, store_RegI src) %{
--- a/src/hotspot/cpu/arm/compiledIC_arm.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/arm/compiledIC_arm.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -155,9 +155,7 @@
 void CompiledDirectStaticCall::verify() {
   // Verify call.
   _call->verify();
-  if (os::is_MP()) {
-    _call->verify_alignment();
-  }
+  _call->verify_alignment();
 
   // Verify stub.
   address stub = find_stub(/*is_aot*/ false);
--- a/src/hotspot/cpu/arm/jniFastGetField_arm.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/arm/jniFastGetField_arm.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -127,13 +127,9 @@
   __ bic(R1, R1, JNIHandles::weak_tag_mask);
 #endif
 
-  if (os::is_MP()) {
-    // Address dependency restricts memory access ordering. It's cheaper than explicit LoadLoad barrier
-    __ andr(Rtmp1, Rsafept_cnt, (unsigned)1);
-    __ ldr(Robj, Address(R1, Rtmp1));
-  } else {
-    __ ldr(Robj, Address(R1));
-  }
+  // Address dependency restricts memory access ordering. It's cheaper than explicit LoadLoad barrier
+  __ andr(Rtmp1, Rsafept_cnt, (unsigned)1);
+  __ ldr(Robj, Address(R1, Rtmp1));
 
 #ifdef AARCH64
   __ add(Robj, Robj, AsmOperand(R2, lsr, 2));
@@ -198,25 +194,21 @@
       ShouldNotReachHere();
   }
 
-  if(os::is_MP()) {
-      // Address dependency restricts memory access ordering. It's cheaper than explicit LoadLoad barrier
+  // Address dependency restricts memory access ordering. It's cheaper than explicit LoadLoad barrier
 #if defined(__ABI_HARD__) && !defined(AARCH64)
-    if (type == T_FLOAT || type == T_DOUBLE) {
-      __ ldr_literal(Rsafepoint_counter_addr, safepoint_counter_addr);
-      __ fmrrd(Rres, Rres_hi, D0);
-      __ eor(Rtmp2, Rres, Rres);
-      __ ldr_s32(Rsafept_cnt2, Address(Rsafepoint_counter_addr, Rtmp2));
-    } else
+  if (type == T_FLOAT || type == T_DOUBLE) {
+    __ ldr_literal(Rsafepoint_counter_addr, safepoint_counter_addr);
+    __ fmrrd(Rres, Rres_hi, D0);
+    __ eor(Rtmp2, Rres, Rres);
+    __ ldr_s32(Rsafept_cnt2, Address(Rsafepoint_counter_addr, Rtmp2));
+  } else
 #endif // __ABI_HARD__ && !AARCH64
-    {
+  {
 #ifndef AARCH64
-      __ ldr_literal(Rsafepoint_counter_addr, safepoint_counter_addr);
+    __ ldr_literal(Rsafepoint_counter_addr, safepoint_counter_addr);
 #endif // !AARCH64
-      __ eor(Rtmp2, Rres, Rres);
-      __ ldr_s32(Rsafept_cnt2, Address(Rsafepoint_counter_addr, Rtmp2));
-    }
-  } else {
-    __ ldr_s32(Rsafept_cnt2, Address(Rsafepoint_counter_addr));
+    __ eor(Rtmp2, Rres, Rres);
+    __ ldr_s32(Rsafept_cnt2, Address(Rsafepoint_counter_addr, Rtmp2));
   }
   __ cmp(Rsafept_cnt2, Rsafept_cnt);
 #ifdef AARCH64
--- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1563,8 +1563,6 @@
 // Serializes memory.
 // tmp register is not used on AArch64, this parameter is provided solely for better compatibility with 32-bit ARM
 void MacroAssembler::membar(Membar_mask_bits order_constraint, Register tmp) {
-  if (!os::is_MP()) return;
-
   // TODO-AARCH64 investigate dsb vs dmb effects
   if (order_constraint == StoreStore) {
     dmb(DMB_st);
@@ -1585,7 +1583,6 @@
                             Register tmp,
                             bool preserve_flags,
                             Register load_tgt) {
-  if (!os::is_MP()) return;
 
   if (order_constraint == StoreStore) {
     dmb(DMB_st, tmp);
--- a/src/hotspot/cpu/arm/templateTable_arm.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/arm/templateTable_arm.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -3146,15 +3146,11 @@
   const Register Rindex   = R5_tmp;
   const Register Rflags   = R5_tmp;
 
-  const bool gen_volatile_check = os::is_MP();
-
   resolve_cache_and_index(byte_no, Rcache, Rindex, sizeof(u2));
   jvmti_post_field_access(Rcache, Rindex, is_static, false);
   load_field_cp_cache_entry(Rcache, Rindex, Roffset, Rflags, Robj, is_static);
 
-  if (gen_volatile_check) {
-    __ mov(Rflagsav, Rflags);
-  }
+  __ mov(Rflagsav, Rflags);
 
   if (!is_static) pop_and_check_object(Robj);
 
@@ -3391,16 +3387,13 @@
 
   __ bind(Done);
 
-  if (gen_volatile_check) {
-    // Check for volatile field
-    Label notVolatile;
-    __ tbz(Rflagsav, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-
-    volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::LoadLoad | MacroAssembler::LoadStore), Rtemp);
-
-    __ bind(notVolatile);
-  }
-
+  // Check for volatile field
+  Label notVolatile;
+  __ tbz(Rflagsav, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
+
+  volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::LoadLoad | MacroAssembler::LoadStore), Rtemp);
+
+  __ bind(notVolatile);
 }
 
 void TemplateTable::getfield(int byte_no) {
@@ -3492,22 +3485,18 @@
   const Register Rindex   = R5_tmp;
   const Register Rflags   = R5_tmp;
 
-  const bool gen_volatile_check = os::is_MP();
-
   resolve_cache_and_index(byte_no, Rcache, Rindex, sizeof(u2));
   jvmti_post_field_mod(Rcache, Rindex, is_static);
   load_field_cp_cache_entry(Rcache, Rindex, Roffset, Rflags, Robj, is_static);
 
-  if (gen_volatile_check) {
-    // Check for volatile field
-    Label notVolatile;
-    __ mov(Rflagsav, Rflags);
-    __ tbz(Rflagsav, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-
-    volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreStore | MacroAssembler::LoadStore), Rtemp);
-
-    __ bind(notVolatile);
-  }
+  // Check for volatile field
+  Label notVolatile;
+  __ mov(Rflagsav, Rflags);
+  __ tbz(Rflagsav, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
+
+  volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreStore | MacroAssembler::LoadStore), Rtemp);
+
+  __ bind(notVolatile);
 
   Label Done, Lint, shouldNotReachHere;
   Label Ltable, Lbtos, Lztos, Lctos, Lstos, Litos, Lltos, Lftos, Ldtos, Latos;
@@ -3733,36 +3722,33 @@
 
   __ bind(Done);
 
-  if (gen_volatile_check) {
-    Label notVolatile;
-    if (is_static) {
-      // Just check for volatile. Memory barrier for static final field
-      // is handled by class initialization.
-      __ tbz(Rflagsav, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-      volatile_barrier(MacroAssembler::StoreLoad, Rtemp);
-      __ bind(notVolatile);
-    } else {
-      // Check for volatile field and final field
-      Label skipMembar;
-
-      __ tst(Rflagsav, 1 << ConstantPoolCacheEntry::is_volatile_shift |
-                       1 << ConstantPoolCacheEntry::is_final_shift);
-      __ b(skipMembar, eq);
-
-      __ tbz(Rflagsav, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-
-      // StoreLoad barrier after volatile field write
-      volatile_barrier(MacroAssembler::StoreLoad, Rtemp);
-      __ b(skipMembar);
-
-      // StoreStore barrier after final field write
-      __ bind(notVolatile);
-      volatile_barrier(MacroAssembler::StoreStore, Rtemp);
-
-      __ bind(skipMembar);
-    }
+  Label notVolatile2;
+  if (is_static) {
+    // Just check for volatile. Memory barrier for static final field
+    // is handled by class initialization.
+    __ tbz(Rflagsav, ConstantPoolCacheEntry::is_volatile_shift, notVolatile2);
+    volatile_barrier(MacroAssembler::StoreLoad, Rtemp);
+    __ bind(notVolatile2);
+  } else {
+    // Check for volatile field and final field
+    Label skipMembar;
+
+    __ tst(Rflagsav, 1 << ConstantPoolCacheEntry::is_volatile_shift |
+           1 << ConstantPoolCacheEntry::is_final_shift);
+    __ b(skipMembar, eq);
+
+    __ tbz(Rflagsav, ConstantPoolCacheEntry::is_volatile_shift, notVolatile2);
+
+    // StoreLoad barrier after volatile field write
+    volatile_barrier(MacroAssembler::StoreLoad, Rtemp);
+    __ b(skipMembar);
+
+    // StoreStore barrier after final field write
+    __ bind(notVolatile2);
+    volatile_barrier(MacroAssembler::StoreStore, Rtemp);
+
+    __ bind(skipMembar);
   }
-
 }
 
 void TemplateTable::putfield(int byte_no) {
@@ -3832,31 +3818,25 @@
   const Register Rflags  = Rtmp_save0; // R4/R19
   const Register Robj    = R5_tmp;
 
-  const bool gen_volatile_check = os::is_MP();
-
   // access constant pool cache
   __ get_cache_and_index_at_bcp(Rcache, Rindex, 1);
 
   __ add(Rcache, Rcache, AsmOperand(Rindex, lsl, LogBytesPerWord));
 
-  if (gen_volatile_check) {
-    // load flags to test volatile
-    __ ldr_u32(Rflags, Address(Rcache, base + ConstantPoolCacheEntry::flags_offset()));
-  }
+  // load flags to test volatile
+  __ ldr_u32(Rflags, Address(Rcache, base + ConstantPoolCacheEntry::flags_offset()));
 
   // replace index with field offset from cache entry
   __ ldr(Roffset, Address(Rcache, base + ConstantPoolCacheEntry::f2_offset()));
 
-  if (gen_volatile_check) {
-    // Check for volatile store
-    Label notVolatile;
-    __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-
-    // TODO-AARCH64 on AArch64, store-release instructions can be used to get rid of this explict barrier
-    volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreStore | MacroAssembler::LoadStore), Rtemp);
-
-    __ bind(notVolatile);
-  }
+  // Check for volatile store
+  Label notVolatile;
+  __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
+
+  // TODO-AARCH64 on AArch64, store-release instructions can be used to get rid of this explict barrier
+  volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreStore | MacroAssembler::LoadStore), Rtemp);
+
+  __ bind(notVolatile);
 
   // Get object from stack
   pop_and_check_object(Robj);
@@ -3903,28 +3883,25 @@
       ShouldNotReachHere();
   }
 
-  if (gen_volatile_check) {
-    Label notVolatile;
-    Label skipMembar;
-    __ tst(Rflags, 1 << ConstantPoolCacheEntry::is_volatile_shift |
-                   1 << ConstantPoolCacheEntry::is_final_shift);
-    __ b(skipMembar, eq);
-
-    __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-
-    // StoreLoad barrier after volatile field write
-    volatile_barrier(MacroAssembler::StoreLoad, Rtemp);
-    __ b(skipMembar);
-
-    // StoreStore barrier after final field write
-    __ bind(notVolatile);
-    volatile_barrier(MacroAssembler::StoreStore, Rtemp);
-
-    __ bind(skipMembar);
-  }
+  Label notVolatile2;
+  Label skipMembar;
+  __ tst(Rflags, 1 << ConstantPoolCacheEntry::is_volatile_shift |
+         1 << ConstantPoolCacheEntry::is_final_shift);
+  __ b(skipMembar, eq);
+
+  __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile2);
+
+  // StoreLoad barrier after volatile field write
+  volatile_barrier(MacroAssembler::StoreLoad, Rtemp);
+  __ b(skipMembar);
+
+  // StoreStore barrier after final field write
+  __ bind(notVolatile2);
+  volatile_barrier(MacroAssembler::StoreStore, Rtemp);
+
+  __ bind(skipMembar);
 }
 
-
 void TemplateTable::fast_accessfield(TosState state) {
   transition(atos, state);
 
@@ -3954,18 +3931,14 @@
   const Register Rindex  = R3_tmp;
   const Register Roffset = R3_tmp;
 
-  const bool gen_volatile_check = os::is_MP();
-
   // access constant pool cache
   __ get_cache_and_index_at_bcp(Rcache, Rindex, 1);
   // replace index with field offset from cache entry
   __ add(Rtemp, Rcache, AsmOperand(Rindex, lsl, LogBytesPerWord));
   __ ldr(Roffset, Address(Rtemp, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::f2_offset()));
 
-  if (gen_volatile_check) {
-    // load flags to test volatile
-    __ ldr_u32(Rflags, Address(Rtemp, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
-  }
+  // load flags to test volatile
+  __ ldr_u32(Rflags, Address(Rtemp, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
 
   __ verify_oop(Robj);
   __ null_check(Robj, Rtemp);
@@ -4008,16 +3981,14 @@
       ShouldNotReachHere();
   }
 
-  if (gen_volatile_check) {
-    // Check for volatile load
-    Label notVolatile;
-    __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-
-    // TODO-AARCH64 on AArch64, load-acquire instructions can be used to get rid of this explict barrier
-    volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::LoadLoad | MacroAssembler::LoadStore), Rtemp);
-
-    __ bind(notVolatile);
-  }
+  // Check for volatile load
+  Label notVolatile;
+  __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
+
+  // TODO-AARCH64 on AArch64, load-acquire instructions can be used to get rid of this explict barrier
+  volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::LoadLoad | MacroAssembler::LoadStore), Rtemp);
+
+  __ bind(notVolatile);
 }
 
 
@@ -4039,12 +4010,8 @@
   __ add(Rtemp, Rcache, AsmOperand(Rindex, lsl, LogBytesPerWord));
   __ ldr(Roffset, Address(Rtemp, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::f2_offset()));
 
-  const bool gen_volatile_check = os::is_MP();
-
-  if (gen_volatile_check) {
-    // load flags to test volatile
-    __ ldr_u32(Rflags, Address(Rtemp, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
-  }
+  // load flags to test volatile
+  __ ldr_u32(Rflags, Address(Rtemp, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
 
   // make sure exception is reported in correct bcp range (getfield is next instruction)
   __ add(Rbcp, Rbcp, 1);
@@ -4052,32 +4019,30 @@
   __ sub(Rbcp, Rbcp, 1);
 
 #ifdef AARCH64
-  if (gen_volatile_check) {
-    Label notVolatile;
-    __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-
-    __ add(Rtemp, Robj, Roffset);
-
-    if (state == itos) {
+  Label notVolatile;
+  __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
+
+  __ add(Rtemp, Robj, Roffset);
+
+  if (state == itos) {
+    __ ldar_w(R0_tos, Rtemp);
+  } else if (state == atos) {
+    if (UseCompressedOops) {
       __ ldar_w(R0_tos, Rtemp);
-    } else if (state == atos) {
-      if (UseCompressedOops) {
-        __ ldar_w(R0_tos, Rtemp);
-        __ decode_heap_oop(R0_tos);
-      } else {
-        __ ldar(R0_tos, Rtemp);
-      }
-      __ verify_oop(R0_tos);
-    } else if (state == ftos) {
-      __ ldar_w(R0_tos, Rtemp);
-      __ fmov_sw(S0_tos, R0_tos);
+      __ decode_heap_oop(R0_tos);
     } else {
-      ShouldNotReachHere();
+      __ ldar(R0_tos, Rtemp);
     }
-    __ b(done);
-
-    __ bind(notVolatile);
+    __ verify_oop(R0_tos);
+  } else if (state == ftos) {
+    __ ldar_w(R0_tos, Rtemp);
+    __ fmov_sw(S0_tos, R0_tos);
+  } else {
+    ShouldNotReachHere();
   }
+  __ b(done);
+
+  __ bind(notVolatile);
 #endif // AARCH64
 
   if (state == itos) {
@@ -4100,15 +4065,13 @@
   }
 
 #ifndef AARCH64
-  if (gen_volatile_check) {
-    // Check for volatile load
-    Label notVolatile;
-    __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-
-    volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::LoadLoad | MacroAssembler::LoadStore), Rtemp);
-
-    __ bind(notVolatile);
-  }
+  // Check for volatile load
+  Label notVolatile;
+  __ tbz(Rflags, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
+
+  volatile_barrier(MacroAssembler::Membar_mask_bits(MacroAssembler::LoadLoad | MacroAssembler::LoadStore), Rtemp);
+
+  __ bind(notVolatile);
 #endif // !AARCH64
 
   __ bind(done);
--- a/src/hotspot/cpu/ppc/compiledIC_ppc.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/ppc/compiledIC_ppc.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -215,9 +215,7 @@
 void CompiledDirectStaticCall::verify() {
   // Verify call.
   _call->verify();
-  if (os::is_MP()) {
-    _call->verify_alignment();
-  }
+  _call->verify_alignment();
 
   // Verify stub.
   address stub = find_stub(/*is_aot*/ false);
--- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2430,17 +2430,15 @@
   {
     Label no_block, sync;
 
-    if (os::is_MP()) {
-      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);
-      }
+    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);
     }
 
     Register sync_state_addr = r_temp_4;
--- a/src/hotspot/cpu/s390/compiledIC_s390.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/s390/compiledIC_s390.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -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.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -145,9 +145,7 @@
 void CompiledDirectStaticCall::verify() {
   // Verify call.
   _call->verify();
-  if (os::is_MP()) {
-    _call->verify_alignment();
-  }
+  _call->verify_alignment();
 
   // Verify stub.
   address stub = find_stub(/*is_aot*/ false);
--- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -593,7 +593,6 @@
   static int call_far_patchable_ret_addr_offset() { return call_far_patchable_size(); }
 
   static bool call_far_patchable_requires_alignment_nop(address pc) {
-    if (!os::is_MP()) return false;
     int size = call_far_patchable_size();
     return ((intptr_t)(pc + size) & 0x03L) != 0;
   }
--- a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2161,18 +2161,17 @@
 
     save_native_result(masm, ret_type, workspace_slot_offset); // Make Z_R2 available as work reg.
 
-    if (os::is_MP()) {
-      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);
-      }
+    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);
     }
+
     __ safepoint_poll(sync, Z_R1);
 
     __ load_and_test_int(Z_R0, Address(Z_thread, JavaThread::suspend_flags_offset()));
--- a/src/hotspot/cpu/sparc/compiledIC_sparc.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/sparc/compiledIC_sparc.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -142,9 +142,7 @@
 void CompiledDirectStaticCall::verify() {
   // Verify call.
   _call->verify();
-  if (os::is_MP()) {
-    _call->verify_alignment();
-  }
+  _call->verify_alignment();
 
   // Verify stub.
   address stub = find_stub(/*is_aot*/ false);
--- a/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2786,7 +2786,7 @@
    delayed()->
    st_ptr(G0, Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
 
-   if (os::is_MP()) { membar(StoreLoad); }
+   membar(StoreLoad);
    // Check that _succ is (or remains) non-zero
    ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), Rscratch);
    andcc(Rscratch, Rscratch, G0);
--- a/src/hotspot/cpu/sparc/macroAssembler_sparc.inline.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.inline.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -614,17 +614,12 @@
 // returns if membar generates anything, obviously this code should mirror
 // membar below.
 inline bool MacroAssembler::membar_has_effect( Membar_mask_bits const7a ) {
-  if (!os::is_MP())
-    return false;  // Not needed on single CPU
   const Membar_mask_bits effective_mask =
       Membar_mask_bits(const7a & ~(LoadLoad | LoadStore | StoreStore));
   return (effective_mask != 0);
 }
 
 inline void MacroAssembler::membar( Membar_mask_bits const7a ) {
-  // Uniprocessors do not need memory barriers
-  if (!os::is_MP())
-    return;
   // Weakened for current Sparcs and TSO.  See the v9 manual, sections 8.4.3,
   // 8.4.4.3, a.31 and a.50.
   // Under TSO, setting bit 3, 2, or 0 is redundant, so the only value
--- a/src/hotspot/cpu/sparc/sharedRuntime_sparc.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/sparc/sharedRuntime_sparc.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2371,17 +2371,16 @@
     //     didn't see any synchronization is progress, and escapes.
     __ set(_thread_in_native_trans, G3_scratch);
     __ st(G3_scratch, G2_thread, JavaThread::thread_state_offset());
-    if(os::is_MP()) {
-      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);
-      }
+
+    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);
     }
 
     Label L;
--- a/src/hotspot/cpu/sparc/templateInterpreterGenerator_sparc.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/sparc/templateInterpreterGenerator_sparc.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1373,17 +1373,16 @@
     //     didn't see any synchronization is progress, and escapes.
     __ set(_thread_in_native_trans, G3_scratch);
     __ st(G3_scratch, thread_state);
-    if (os::is_MP()) {
-      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);
-      }
+
+    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);
     }
 
     Label L;
--- a/src/hotspot/cpu/x86/assembler_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/assembler_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -972,7 +972,6 @@
     return ip;
 
   case 0xF0:                    // Lock
-    assert(os::is_MP(), "only on MP");
     goto again_after_prefix;
 
   case 0xF3:                    // For SSE
@@ -1773,7 +1772,7 @@
 
 void Assembler::cvtdq2pd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xE6);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -1781,7 +1780,7 @@
 
 void Assembler::cvtdq2ps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5B);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -1889,7 +1888,7 @@
 void Assembler::cvttpd2dq(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit;
-  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xE6);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -2199,7 +2198,7 @@
 void Assembler::movapd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit;
-  InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x28);
@@ -2209,7 +2208,7 @@
 void Assembler::movaps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
   int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit;
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x28);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -2234,7 +2233,7 @@
 void Assembler::movddup(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse3(), ""));
   int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit;
-  InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes);
   emit_int8(0x12);
@@ -2465,7 +2464,7 @@
 
 void Assembler::movdqa(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6F);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -2474,7 +2473,7 @@
 void Assembler::movdqa(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6F);
@@ -2484,7 +2483,7 @@
 void Assembler::movdqu(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   simd_prefix(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6F);
@@ -2493,7 +2492,7 @@
 
 void Assembler::movdqu(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6F);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -2502,7 +2501,7 @@
 void Assembler::movdqu(Address dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   attributes.reset_is_clear_context();
   simd_prefix(src, xnoreg, dst, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
@@ -2513,7 +2512,7 @@
 // Move Unaligned 256bit Vector
 void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) {
   assert(UseAVX > 0, "");
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6F);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -2522,7 +2521,7 @@
 void Assembler::vmovdqu(XMMRegister dst, Address src) {
   assert(UseAVX > 0, "");
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6F);
@@ -2532,7 +2531,7 @@
 void Assembler::vmovdqu(Address dst, XMMRegister src) {
   assert(UseAVX > 0, "");
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   attributes.reset_is_clear_context();
   // swap src<->dst for encoding
@@ -2580,7 +2579,6 @@
 
 void Assembler::evmovdqub(XMMRegister dst, KRegister mask, Address src, int vector_len) {
   assert(VM_Version::supports_avx512vlbw(), "");
-  assert(is_vector_masking(), "");    // For stub code use only
   InstructionMark im(this);
   InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
@@ -2604,7 +2602,6 @@
 }
 
 void Assembler::evmovdquw(XMMRegister dst, KRegister mask, Address src, int vector_len) {
-  assert(is_vector_masking(), "");
   assert(VM_Version::supports_avx512vlbw(), "");
   InstructionMark im(this);
   InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
@@ -2645,7 +2642,7 @@
 
 void Assembler::evmovdqul(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6F);
@@ -2655,7 +2652,7 @@
 void Assembler::evmovdqul(XMMRegister dst, Address src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false , /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true , /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   attributes.set_is_evex_instruction();
   vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
@@ -2667,7 +2664,7 @@
   assert(VM_Version::supports_evex(), "");
   assert(src != xnoreg, "sanity");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
@@ -2678,7 +2675,7 @@
 
 void Assembler::evmovdquq(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6F);
@@ -2688,7 +2685,7 @@
 void Assembler::evmovdquq(XMMRegister dst, Address src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   attributes.set_is_evex_instruction();
   vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
@@ -2700,7 +2697,7 @@
   assert(VM_Version::supports_evex(), "");
   assert(src != xnoreg, "sanity");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
@@ -3416,7 +3413,7 @@
 
 void Assembler::vpermq(XMMRegister dst, XMMRegister src, int imm8, int vector_len) {
   assert(VM_Version::supports_avx2(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x00);
   emit_int8(0xC0 | encode);
@@ -3425,7 +3422,7 @@
 
 void Assembler::vperm2i128(XMMRegister dst,  XMMRegister nds, XMMRegister src, int imm8) {
   assert(VM_Version::supports_avx2(), "");
-  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x46);
   emit_int8(0xC0 | encode);
@@ -3434,7 +3431,7 @@
 
 void Assembler::vperm2f128(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x06);
   emit_int8(0xC0 | encode);
@@ -3464,7 +3461,7 @@
 void Assembler::pcmpestri(XMMRegister dst, Address src, int imm8) {
   assert(VM_Version::supports_sse4_2(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x61);
   emit_operand(dst, src);
@@ -3473,7 +3470,7 @@
 
 void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) {
   assert(VM_Version::supports_sse4_2(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x61);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3483,7 +3480,7 @@
 // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst
 void Assembler::pcmpeqb(XMMRegister dst, XMMRegister src) {
   assert(VM_Version::supports_sse2(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x74);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3492,7 +3489,7 @@
 // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst
 void Assembler::vpcmpeqb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x74);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3521,7 +3518,6 @@
 }
 
 void Assembler::evpcmpgtb(KRegister kdst, KRegister mask, XMMRegister nds, Address src, int vector_len) {
-  assert(is_vector_masking(), "");
   assert(VM_Version::supports_avx512vlbw(), "");
   InstructionMark im(this);
   InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
@@ -3546,7 +3542,6 @@
 }
 
 void Assembler::evpcmpuw(KRegister kdst, KRegister mask, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len) {
-  assert(is_vector_masking(), "");
   assert(VM_Version::supports_avx512vlbw(), "");
   InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
   attributes.reset_is_clear_context();
@@ -3585,7 +3580,6 @@
 
 void Assembler::evpcmpeqb(KRegister kdst, KRegister mask, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx512vlbw(), "");
-  assert(is_vector_masking(), "");    // For stub code use only
   InstructionMark im(this);
   InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_reg_mask */ false, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
@@ -3600,7 +3594,7 @@
 // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst
 void Assembler::pcmpeqw(XMMRegister dst, XMMRegister src) {
   assert(VM_Version::supports_sse2(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x75);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3609,7 +3603,7 @@
 // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst
 void Assembler::vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x75);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3640,7 +3634,7 @@
 // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst
 void Assembler::pcmpeqd(XMMRegister dst, XMMRegister src) {
   assert(VM_Version::supports_sse2(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x76);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3649,7 +3643,7 @@
 // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst
 void Assembler::vpcmpeqd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x76);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3658,7 +3652,7 @@
 // In this context, kdst is written the mask used to process the equal components
 void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   attributes.reset_is_clear_context();
   int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -3669,7 +3663,7 @@
 void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
@@ -3682,7 +3676,7 @@
 // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst
 void Assembler::pcmpeqq(XMMRegister dst, XMMRegister src) {
   assert(VM_Version::supports_sse4_1(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x29);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3691,7 +3685,7 @@
 // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst
 void Assembler::vpcmpeqq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x29);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3700,7 +3694,7 @@
 // In this context, kdst is written the mask used to process the equal components
 void Assembler::evpcmpeqq(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
@@ -3712,7 +3706,7 @@
 void Assembler::evpcmpeqq(KRegister kdst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
@@ -3724,7 +3718,7 @@
 
 void Assembler::pmovmskb(Register dst, XMMRegister src) {
   assert(VM_Version::supports_sse2(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xD7);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3732,7 +3726,7 @@
 
 void Assembler::vpmovmskb(Register dst, XMMRegister src) {
   assert(VM_Version::supports_avx2(), "");
-  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xD7);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -3913,7 +3907,6 @@
 
 
 void Assembler::evpmovzxbw(XMMRegister dst, KRegister mask, Address src, int vector_len) {
-  assert(is_vector_masking(), "");
   assert(VM_Version::supports_avx512vlbw(), "");
   assert(dst != xnoreg, "sanity");
   InstructionMark im(this);
@@ -3938,7 +3931,6 @@
 }
 
 void Assembler::evpmovwb(Address dst, KRegister mask, XMMRegister src, int vector_len) {
-  assert(is_vector_masking(), "");
   assert(VM_Version::supports_avx512vlbw(), "");
   assert(src != xnoreg, "sanity");
   InstructionMark im(this);
@@ -4001,7 +3993,7 @@
 
 void Assembler::vpopcntd(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_vpopcntdq(), "must support vpopcntdq feature");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x55);
@@ -4111,7 +4103,7 @@
   assert(isByte(mode), "invalid value");
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit;
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x70);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4123,7 +4115,7 @@
          vector_len == AVX_256bit? VM_Version::supports_avx2() :
          0, "");
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x70);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4135,7 +4127,7 @@
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x70);
@@ -4201,7 +4193,7 @@
   assert(VM_Version::supports_sse4_1(), "");
   assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x17);
   emit_operand(dst, src);
@@ -4209,7 +4201,7 @@
 
 void Assembler::ptest(XMMRegister dst, XMMRegister src) {
   assert(VM_Version::supports_sse4_1(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x17);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4218,7 +4210,7 @@
 void Assembler::vptest(XMMRegister dst, Address src) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   assert(dst != xnoreg, "sanity");
   // swap src<->dst for encoding
   vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
@@ -4228,7 +4220,7 @@
 
 void Assembler::vptest(XMMRegister dst, XMMRegister src) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x17);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4238,7 +4230,7 @@
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_vlbw, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_vlbw, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit);
   simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x60);
@@ -4247,7 +4239,7 @@
 
 void Assembler::punpcklbw(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_vlbw, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_vlbw, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x60);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4257,7 +4249,7 @@
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x62);
@@ -4266,7 +4258,7 @@
 
 void Assembler::punpckldq(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x62);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4274,7 +4266,7 @@
 
 void Assembler::punpcklqdq(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x6C);
@@ -4323,7 +4315,7 @@
 
 void Assembler::rcpps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x53);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4331,7 +4323,7 @@
 
 void Assembler::rcpss(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes);
   emit_int8(0x53);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4455,7 +4447,7 @@
 
 void Assembler::palignr(XMMRegister dst, XMMRegister src, int imm8) {
   assert(VM_Version::supports_ssse3(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8((unsigned char)0x0F);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4466,7 +4458,7 @@
   assert(vector_len == AVX_128bit? VM_Version::supports_avx() :
          vector_len == AVX_256bit? VM_Version::supports_avx2() :
          0, "");
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, nds, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8((unsigned char)0x0F);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -4475,7 +4467,7 @@
 
 void Assembler::evalignq(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x3);
@@ -4628,7 +4620,7 @@
   if (UseAVX > 0 ) {
     assert(VM_Version::supports_avx(), "");
     InstructionMark im(this);
-    InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false);
+    InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
     vex_prefix(dst, 0, 0, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
     emit_int8((unsigned char)0xAE);
     emit_operand(as_Register(3), dst);
@@ -5102,7 +5094,7 @@
 
 void Assembler::addpd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x58);
@@ -5112,7 +5104,7 @@
 void Assembler::addpd(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5123,7 +5115,7 @@
 
 void Assembler::addps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x58);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5131,7 +5123,7 @@
 
 void Assembler::vaddpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x58);
@@ -5140,7 +5132,7 @@
 
 void Assembler::vaddps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x58);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5149,7 +5141,7 @@
 void Assembler::vaddpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5160,7 +5152,7 @@
 void Assembler::vaddps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x58);
@@ -5169,7 +5161,7 @@
 
 void Assembler::subpd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5C);
@@ -5178,7 +5170,7 @@
 
 void Assembler::subps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5C);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5186,7 +5178,7 @@
 
 void Assembler::vsubpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5C);
@@ -5195,7 +5187,7 @@
 
 void Assembler::vsubps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5C);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5204,7 +5196,7 @@
 void Assembler::vsubpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5215,7 +5207,7 @@
 void Assembler::vsubps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5C);
@@ -5224,7 +5216,7 @@
 
 void Assembler::mulpd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x59);
@@ -5234,7 +5226,7 @@
 void Assembler::mulpd(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5244,7 +5236,7 @@
 
 void Assembler::mulps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x59);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5252,7 +5244,7 @@
 
 void Assembler::vmulpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x59);
@@ -5261,7 +5253,7 @@
 
 void Assembler::vmulps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x59);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5270,7 +5262,7 @@
 void Assembler::vmulpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5281,7 +5273,7 @@
 void Assembler::vmulps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x59);
@@ -5290,7 +5282,7 @@
 
 void Assembler::vfmadd231pd(XMMRegister dst, XMMRegister src1, XMMRegister src2, int vector_len) {
   assert(VM_Version::supports_fma(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8((unsigned char)0xB8);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5298,7 +5290,7 @@
 
 void Assembler::vfmadd231ps(XMMRegister dst, XMMRegister src1, XMMRegister src2, int vector_len) {
   assert(VM_Version::supports_fma(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8((unsigned char)0xB8);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5307,7 +5299,7 @@
 void Assembler::vfmadd231pd(XMMRegister dst, XMMRegister src1, Address src2, int vector_len) {
   assert(VM_Version::supports_fma(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   vex_prefix(src2, src1->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8((unsigned char)0xB8);
@@ -5317,7 +5309,7 @@
 void Assembler::vfmadd231ps(XMMRegister dst, XMMRegister src1, Address src2, int vector_len) {
   assert(VM_Version::supports_fma(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src2, src1->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8((unsigned char)0xB8);
@@ -5326,7 +5318,7 @@
 
 void Assembler::divpd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5E);
@@ -5335,7 +5327,7 @@
 
 void Assembler::divps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5E);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5343,7 +5335,7 @@
 
 void Assembler::vdivpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5E);
@@ -5352,7 +5344,7 @@
 
 void Assembler::vdivps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5E);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5361,7 +5353,7 @@
 void Assembler::vdivpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5372,7 +5364,7 @@
 void Assembler::vdivps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x5E);
@@ -5381,7 +5373,7 @@
 
 void Assembler::vsqrtpd(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x51);
@@ -5391,7 +5383,7 @@
 void Assembler::vsqrtpd(XMMRegister dst, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5401,7 +5393,7 @@
 
 void Assembler::vsqrtps(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x51);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5410,7 +5402,7 @@
 void Assembler::vsqrtps(XMMRegister dst, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x51);
@@ -5419,7 +5411,7 @@
 
 void Assembler::andpd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x54);
@@ -5428,7 +5420,7 @@
 
 void Assembler::andps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x54);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5437,7 +5429,7 @@
 void Assembler::andps(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   simd_prefix(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x54);
@@ -5447,7 +5439,7 @@
 void Assembler::andpd(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5457,7 +5449,7 @@
 
 void Assembler::vandpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x54);
@@ -5466,7 +5458,7 @@
 
 void Assembler::vandps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x54);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5475,7 +5467,7 @@
 void Assembler::vandpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5486,7 +5478,7 @@
 void Assembler::vandps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x54);
@@ -5495,7 +5487,7 @@
 
 void Assembler::unpckhpd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x15);
@@ -5504,7 +5496,7 @@
 
 void Assembler::unpcklpd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x14);
@@ -5513,7 +5505,7 @@
 
 void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x57);
@@ -5522,7 +5514,7 @@
 
 void Assembler::xorps(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x57);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5531,7 +5523,7 @@
 void Assembler::xorpd(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5542,7 +5534,7 @@
 void Assembler::xorps(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   simd_prefix(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x57);
@@ -5551,7 +5543,7 @@
 
 void Assembler::vxorpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x57);
@@ -5560,7 +5552,7 @@
 
 void Assembler::vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x57);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5569,7 +5561,7 @@
 void Assembler::vxorpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5580,7 +5572,7 @@
 void Assembler::vxorps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8(0x57);
@@ -5600,7 +5592,7 @@
 void Assembler::vphaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx() && (vector_len == 0) ||
          VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x02);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5624,7 +5616,7 @@
 
 void Assembler::paddd(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFE);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5633,7 +5625,7 @@
 void Assembler::paddd(XMMRegister dst, Address src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFE);
   emit_operand(dst, src);
@@ -5641,7 +5633,7 @@
 
 void Assembler::paddq(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xD4);
@@ -5658,7 +5650,7 @@
 
 void Assembler::phaddd(XMMRegister dst, XMMRegister src) {
   assert(VM_Version::supports_sse3(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x02);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5682,7 +5674,7 @@
 
 void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFE);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5690,7 +5682,7 @@
 
 void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xD4);
@@ -5720,7 +5712,7 @@
 void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFE);
@@ -5730,7 +5722,7 @@
 void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5755,7 +5747,7 @@
 }
 
 void Assembler::psubd(XMMRegister dst, XMMRegister src) {
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFA);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5763,7 +5755,7 @@
 
 void Assembler::psubq(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFB);
@@ -5788,7 +5780,7 @@
 
 void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFA);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5796,7 +5788,7 @@
 
 void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFB);
@@ -5826,7 +5818,7 @@
 void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xFA);
@@ -5836,7 +5828,7 @@
 void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -5854,7 +5846,7 @@
 
 void Assembler::pmulld(XMMRegister dst, XMMRegister src) {
   assert(VM_Version::supports_sse4_1(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x40);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5870,7 +5862,7 @@
 
 void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x40);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5878,7 +5870,7 @@
 
 void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 2, "requires some form of EVEX");
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x40);
@@ -5898,7 +5890,7 @@
 void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x40);
@@ -5908,7 +5900,7 @@
 void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 2, "requires some form of EVEX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_is_evex_instruction();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
@@ -5929,7 +5921,7 @@
 
 void Assembler::pslld(XMMRegister dst, int shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   // XMM6 is for /6 encoding: 66 0F 72 /6 ib
   int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x72);
@@ -5939,7 +5931,7 @@
 
 void Assembler::psllq(XMMRegister dst, int shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   // XMM6 is for /6 encoding: 66 0F 73 /6 ib
   int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x73);
@@ -5957,7 +5949,7 @@
 
 void Assembler::pslld(XMMRegister dst, XMMRegister shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xF2);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -5965,7 +5957,7 @@
 
 void Assembler::psllq(XMMRegister dst, XMMRegister shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xF3);
@@ -5985,7 +5977,7 @@
 void Assembler::vpslld(XMMRegister dst, XMMRegister src, int shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   // XMM6 is for /6 encoding: 66 0F 72 /6 ib
   int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x72);
@@ -5995,7 +5987,7 @@
 
 void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   // XMM6 is for /6 encoding: 66 0F 73 /6 ib
   int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -6014,7 +6006,7 @@
 
 void Assembler::vpslld(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xF2);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6022,7 +6014,7 @@
 
 void Assembler::vpsllq(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xF3);
@@ -6042,7 +6034,7 @@
 
 void Assembler::psrld(XMMRegister dst, int shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   // XMM2 is for /2 encoding: 66 0F 72 /2 ib
   int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x72);
@@ -6054,7 +6046,7 @@
   // Do not confuse it with psrldq SSE2 instruction which
   // shifts 128 bit value in xmm register by number of bytes.
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   // XMM2 is for /2 encoding: 66 0F 73 /2 ib
   int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -6073,7 +6065,7 @@
 
 void Assembler::psrld(XMMRegister dst, XMMRegister shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xD2);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6081,7 +6073,7 @@
 
 void Assembler::psrlq(XMMRegister dst, XMMRegister shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xD3);
@@ -6100,7 +6092,7 @@
 
 void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   // XMM2 is for /2 encoding: 66 0F 72 /2 ib
   int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x72);
@@ -6110,7 +6102,7 @@
 
 void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   // XMM2 is for /2 encoding: 66 0F 73 /2 ib
   int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
@@ -6129,7 +6121,7 @@
 
 void Assembler::vpsrld(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xD2);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6137,7 +6129,7 @@
 
 void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xD3);
@@ -6146,7 +6138,7 @@
 
 void Assembler::evpsrlvw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx512bw(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x10);
@@ -6155,7 +6147,7 @@
 
 void Assembler::evpsllvw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx512bw(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x12);
@@ -6175,7 +6167,7 @@
 
 void Assembler::psrad(XMMRegister dst, int shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   // XMM4 is for /4 encoding: 66 0F 72 /4 ib
   int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x72);
@@ -6193,7 +6185,7 @@
 
 void Assembler::psrad(XMMRegister dst, XMMRegister shift) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xE2);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6211,7 +6203,7 @@
 
 void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   // XMM4 is for /4 encoding: 66 0F 71 /4 ib
   int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8(0x72);
@@ -6229,7 +6221,7 @@
 
 void Assembler::vpsrad(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xE2);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6239,7 +6231,7 @@
 // logical operations packed integers
 void Assembler::pand(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xDB);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6247,7 +6239,7 @@
 
 void Assembler::vpand(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xDB);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6256,7 +6248,7 @@
 void Assembler::vpand(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xDB);
@@ -6265,7 +6257,7 @@
 
 void Assembler::vpandq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xDB);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6274,7 +6266,7 @@
 
 void Assembler::pandn(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xDF);
@@ -6283,7 +6275,7 @@
 
 void Assembler::vpandn(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xDF);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6292,7 +6284,7 @@
 
 void Assembler::por(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xEB);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6300,7 +6292,7 @@
 
 void Assembler::vpor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xEB);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6309,7 +6301,7 @@
 void Assembler::vpor(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xEB);
@@ -6318,7 +6310,7 @@
 
 void Assembler::vporq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xEB);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6327,7 +6319,7 @@
 
 void Assembler::pxor(XMMRegister dst, XMMRegister src) {
   NOT_LP64(assert(VM_Version::supports_sse2(), ""));
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xEF);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6335,7 +6327,7 @@
 
 void Assembler::vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xEF);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6344,7 +6336,7 @@
 void Assembler::vpxor(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
   assert(UseAVX > 0, "requires some form of AVX");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xEF);
@@ -6378,7 +6370,7 @@
 void Assembler::vinserti128(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_avx2(), "");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x38);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6392,7 +6384,7 @@
   assert(dst != xnoreg, "sanity");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x38);
@@ -6405,7 +6397,7 @@
 void Assembler::vinserti32x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_evex(), "");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x38);
@@ -6422,7 +6414,7 @@
   assert(dst != xnoreg, "sanity");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);
   attributes.set_is_evex_instruction();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
@@ -6438,7 +6430,7 @@
 void Assembler::vinserti64x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_evex(), "");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x3A);
@@ -6454,7 +6446,7 @@
 void Assembler::vinsertf128(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_avx(), "");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x18);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6468,7 +6460,7 @@
   assert(dst != xnoreg, "sanity");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x18);
@@ -6481,7 +6473,7 @@
 void Assembler::vinsertf32x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_avx2(), "");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x18);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6497,7 +6489,7 @@
   assert(dst != xnoreg, "sanity");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x18);
@@ -6512,7 +6504,7 @@
 void Assembler::vinsertf64x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_evex(), "");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x1A);
@@ -6527,7 +6519,7 @@
   assert(dst != xnoreg, "sanity");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_is_evex_instruction();
   vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
@@ -6544,7 +6536,7 @@
 void Assembler::vextracti128(XMMRegister dst, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_avx2(), "");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x39);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6558,7 +6550,7 @@
   assert(src != xnoreg, "sanity");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);
   attributes.reset_is_clear_context();
   vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
@@ -6572,7 +6564,7 @@
 void Assembler::vextracti32x4(XMMRegister dst, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_evex(), "");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x39);
@@ -6589,7 +6581,7 @@
   assert(src != xnoreg, "sanity");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
@@ -6606,7 +6598,7 @@
 void Assembler::vextracti64x2(XMMRegister dst, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_avx512dq(), "");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x39);
@@ -6621,7 +6613,7 @@
 void Assembler::vextracti64x4(XMMRegister dst, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_evex(), "");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x3B);
@@ -6636,7 +6628,7 @@
   assert(src != xnoreg, "sanity");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_64bit);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
@@ -6652,7 +6644,7 @@
 void Assembler::vextractf128(XMMRegister dst, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_avx(), "");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x19);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6666,7 +6658,7 @@
   assert(src != xnoreg, "sanity");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);
   attributes.reset_is_clear_context();
   vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
@@ -6680,7 +6672,7 @@
 void Assembler::vextractf32x4(XMMRegister dst, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_evex(), "");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x19);
@@ -6697,7 +6689,7 @@
   assert(src != xnoreg, "sanity");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
@@ -6714,7 +6706,7 @@
 void Assembler::vextractf64x2(XMMRegister dst, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_avx512dq(), "");
   assert(imm8 <= 0x03, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x19);
@@ -6729,7 +6721,7 @@
 void Assembler::vextractf64x4(XMMRegister dst, XMMRegister src, uint8_t imm8) {
   assert(VM_Version::supports_evex(), "");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x1B);
@@ -6744,7 +6736,7 @@
   assert(src != xnoreg, "sanity");
   assert(imm8 <= 0x01, "imm8: %u", imm8);
   InstructionMark im(this);
-  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T4,/* input_size_in_bits */  EVEX_64bit);
   attributes.reset_is_clear_context();
   attributes.set_is_evex_instruction();
@@ -6803,7 +6795,7 @@
 // duplicate 4-byte integer data from src into programmed locations in dest : requires AVX512VL
 void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(UseAVX >= 2, "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x58);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6813,7 +6805,7 @@
   assert(VM_Version::supports_avx2(), "");
   assert(dst != xnoreg, "sanity");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit);
   // swap src<->dst for encoding
   vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
@@ -6824,7 +6816,7 @@
 // duplicate 8-byte integer data from src into programmed locations in dest : requires AVX512VL
 void Assembler::vpbroadcastq(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx2(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x59);
@@ -6835,7 +6827,7 @@
   assert(VM_Version::supports_avx2(), "");
   assert(dst != xnoreg, "sanity");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit);
   // swap src<->dst for encoding
@@ -6846,7 +6838,7 @@
 void Assembler::evbroadcasti64x2(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(vector_len != Assembler::AVX_128bit, "");
   assert(VM_Version::supports_avx512dq(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x5A);
@@ -6858,7 +6850,7 @@
   assert(VM_Version::supports_avx512dq(), "");
   assert(dst != xnoreg, "sanity");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   attributes.set_address_attributes(/* tuple_type */ EVEX_T2, /* input_size_in_bits */ EVEX_64bit);
   // swap src<->dst for encoding
@@ -6872,7 +6864,7 @@
 // duplicate single precision data from src into programmed locations in dest : requires AVX512VL
 void Assembler::vpbroadcastss(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x18);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6882,7 +6874,7 @@
   assert(VM_Version::supports_avx(), "");
   assert(dst != xnoreg, "sanity");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit);
   // swap src<->dst for encoding
   vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
@@ -6893,7 +6885,7 @@
 // duplicate double precision data from src into programmed locations in dest : requires AVX512VL
 void Assembler::vpbroadcastsd(XMMRegister dst, XMMRegister src, int vector_len) {
   assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_rex_vex_w_reverted();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x19);
@@ -6904,7 +6896,7 @@
   assert(VM_Version::supports_avx(), "");
   assert(dst != xnoreg, "sanity");
   InstructionMark im(this);
-  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit);
   attributes.set_rex_vex_w_reverted();
   // swap src<->dst for encoding
@@ -6939,7 +6931,7 @@
 // duplicate 4-byte integer data from src into programmed locations in dest : requires AVX512VL
 void Assembler::evpbroadcastd(XMMRegister dst, Register src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x7C);
@@ -6949,7 +6941,7 @@
 // duplicate 8-byte integer data from src into programmed locations in dest : requires AVX512VL
 void Assembler::evpbroadcastq(XMMRegister dst, Register src, int vector_len) {
   assert(VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
   attributes.set_is_evex_instruction();
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
   emit_int8(0x7C);
@@ -6974,7 +6966,7 @@
 // Carry-Less Multiplication Quadword
 void Assembler::pclmulqdq(XMMRegister dst, XMMRegister src, int mask) {
   assert(VM_Version::supports_clmul(), "");
-  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x44);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -6984,7 +6976,7 @@
 // Carry-Less Multiplication Quadword
 void Assembler::vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask) {
   assert(VM_Version::supports_avx() && VM_Version::supports_clmul(), "");
-  InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x44);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -7575,7 +7567,7 @@
   emit_int8(byte3);
 
   // P2: byte 4 as zL'Lbv'aaa
-  // kregs are implemented in the low 3 bits as aaa (hard code k1, it will be initialized for now)
+  // kregs are implemented in the low 3 bits as aaa
   int byte4 = (_attributes->is_no_reg_mask()) ?
               0 :
               _attributes->get_embedded_opmask_register_specifier();
@@ -7726,7 +7718,7 @@
 void Assembler::cmppd(XMMRegister dst, XMMRegister nds, XMMRegister src, int cop, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   assert(!VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, nds, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xC2);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -7736,7 +7728,7 @@
 void Assembler::blendvpd(XMMRegister dst, XMMRegister nds, XMMRegister src1, XMMRegister src2, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   assert(!VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8((unsigned char)0x4B);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -7747,7 +7739,7 @@
 void Assembler::cmpps(XMMRegister dst, XMMRegister nds, XMMRegister src, int cop, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   assert(!VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = simd_prefix_and_encode(dst, nds, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes);
   emit_int8((unsigned char)0xC2);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -7757,7 +7749,7 @@
 void Assembler::blendvps(XMMRegister dst, XMMRegister nds, XMMRegister src1, XMMRegister src2, int vector_len) {
   assert(VM_Version::supports_avx(), "");
   assert(!VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8((unsigned char)0x4A);
   emit_int8((unsigned char)(0xC0 | encode));
@@ -7767,7 +7759,7 @@
 
 void Assembler::vpblendd(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8, int vector_len) {
   assert(VM_Version::supports_avx2(), "");
-  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ true);
+  InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
   int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8((unsigned char)0x02);
   emit_int8((unsigned char)(0xC0 | encode));
--- a/src/hotspot/cpu/x86/assembler_x86.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/assembler_x86.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -871,11 +871,6 @@
   void clear_managed(void) { _is_managed = false; }
   bool is_managed(void) { return _is_managed; }
 
-  // Following functions are for stub code use only
-  void set_vector_masking(void) { _vector_masking = true; }
-  void clear_vector_masking(void) { _vector_masking = false; }
-  bool is_vector_masking(void) { return _vector_masking; }
-
   void lea(Register dst, Address src);
 
   void mov(Register dst, Register src);
@@ -1350,40 +1345,38 @@
 
   // Serializes memory and blows flags
   void membar(Membar_mask_bits order_constraint) {
-    if (os::is_MP()) {
-      // We only have to handle StoreLoad
-      if (order_constraint & StoreLoad) {
-        // All usable chips support "locked" instructions which suffice
-        // as barriers, and are much faster than the alternative of
-        // using cpuid instruction. We use here a locked add [esp-C],0.
-        // This is conveniently otherwise a no-op except for blowing
-        // flags, and introducing a false dependency on target memory
-        // location. We can't do anything with flags, but we can avoid
-        // memory dependencies in the current method by locked-adding
-        // somewhere else on the stack. Doing [esp+C] will collide with
-        // something on stack in current method, hence we go for [esp-C].
-        // It is convenient since it is almost always in data cache, for
-        // any small C.  We need to step back from SP to avoid data
-        // dependencies with other things on below SP (callee-saves, for
-        // example). Without a clear way to figure out the minimal safe
-        // distance from SP, it makes sense to step back the complete
-        // cache line, as this will also avoid possible second-order effects
-        // with locked ops against the cache line. Our choice of offset
-        // is bounded by x86 operand encoding, which should stay within
-        // [-128; +127] to have the 8-byte displacement encoding.
-        //
-        // Any change to this code may need to revisit other places in
-        // the code where this idiom is used, in particular the
-        // orderAccess code.
-
-        int offset = -VM_Version::L1_line_size();
-        if (offset < -128) {
-          offset = -128;
-        }
-
-        lock();
-        addl(Address(rsp, offset), 0);// Assert the lock# signal here
+    // We only have to handle StoreLoad
+    if (order_constraint & StoreLoad) {
+      // All usable chips support "locked" instructions which suffice
+      // as barriers, and are much faster than the alternative of
+      // using cpuid instruction. We use here a locked add [esp-C],0.
+      // This is conveniently otherwise a no-op except for blowing
+      // flags, and introducing a false dependency on target memory
+      // location. We can't do anything with flags, but we can avoid
+      // memory dependencies in the current method by locked-adding
+      // somewhere else on the stack. Doing [esp+C] will collide with
+      // something on stack in current method, hence we go for [esp-C].
+      // It is convenient since it is almost always in data cache, for
+      // any small C.  We need to step back from SP to avoid data
+      // dependencies with other things on below SP (callee-saves, for
+      // example). Without a clear way to figure out the minimal safe
+      // distance from SP, it makes sense to step back the complete
+      // cache line, as this will also avoid possible second-order effects
+      // with locked ops against the cache line. Our choice of offset
+      // is bounded by x86 operand encoding, which should stay within
+      // [-128; +127] to have the 8-byte displacement encoding.
+      //
+      // Any change to this code may need to revisit other places in
+      // the code where this idiom is used, in particular the
+      // orderAccess code.
+
+      int offset = -VM_Version::L1_line_size();
+      if (offset < -128) {
+        offset = -128;
       }
+
+      lock();
+      addl(Address(rsp, offset), 0);// Assert the lock# signal here
     }
   }
 
@@ -2210,7 +2203,7 @@
     int vector_len,     // The length of vector to be applied in encoding - for both AVX and EVEX
     bool rex_vex_w,     // Width of data: if 32-bits or less, false, else if 64-bit or specially defined, true
     bool legacy_mode,   // Details if either this instruction is conditionally encoded to AVX or earlier if true else possibly EVEX
-    bool no_reg_mask,   // when true, k0 is used when EVEX encoding is chosen, else k1 is used under the same condition
+    bool no_reg_mask,   // when true, k0 is used when EVEX encoding is chosen, else embedded_opmask_register_specifier is used
     bool uses_vl)       // This instruction may have legacy constraints based on vector length for EVEX
     :
       _avx_vector_len(vector_len),
@@ -2225,7 +2218,7 @@
       _evex_encoding(0),
       _is_clear_context(true),
       _is_extended_context(false),
-      _embedded_opmask_register_specifier(1), // hard code k1, it will be initialized for now
+      _embedded_opmask_register_specifier(0), // hard code k0
       _current_assembler(NULL) {
     if (UseAVX < 3) _legacy_mode = true;
   }
--- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1906,9 +1906,7 @@
     assert(op->new_value()->as_register_lo() == rbx, "wrong register");
     assert(op->new_value()->as_register_hi() == rcx, "wrong register");
     Register addr = op->addr()->as_register();
-    if (os::is_MP()) {
-      __ lock();
-    }
+    __ lock();
     NOT_LP64(__ cmpxchg8(Address(addr, 0)));
 
   } else if (op->code() == lir_cas_int || op->code() == lir_cas_obj ) {
@@ -1928,24 +1926,18 @@
         __ encode_heap_oop(cmpval);
         __ mov(rscratch1, newval);
         __ encode_heap_oop(rscratch1);
-        if (os::is_MP()) {
-          __ lock();
-        }
+        __ lock();
         // cmpval (rax) is implicitly used by this instruction
         __ cmpxchgl(rscratch1, Address(addr, 0));
       } else
 #endif
       {
-        if (os::is_MP()) {
-          __ lock();
-        }
+        __ lock();
         __ cmpxchgptr(newval, Address(addr, 0));
       }
     } else {
       assert(op->code() == lir_cas_int, "lir_cas_int expected");
-      if (os::is_MP()) {
-        __ lock();
-      }
+      __ lock();
       __ cmpxchgl(newval, Address(addr, 0));
     }
 #ifdef _LP64
@@ -1958,9 +1950,7 @@
     assert(cmpval != newval, "cmp and new values must be in different registers");
     assert(cmpval != addr, "cmp and addr must be in different registers");
     assert(newval != addr, "new value and addr must be in different registers");
-    if (os::is_MP()) {
-      __ lock();
-    }
+    __ lock();
     __ cmpxchgq(newval, Address(addr, 0));
 #endif // _LP64
   } else {
@@ -2804,28 +2794,26 @@
 
 
 void LIR_Assembler::align_call(LIR_Code code) {
-  if (os::is_MP()) {
-    // make sure that the displacement word of the call ends up word aligned
-    int offset = __ offset();
-    switch (code) {
-      case lir_static_call:
-      case lir_optvirtual_call:
-      case lir_dynamic_call:
-        offset += NativeCall::displacement_offset;
-        break;
-      case lir_icvirtual_call:
-        offset += NativeCall::displacement_offset + NativeMovConstReg::instruction_size;
-      break;
-      case lir_virtual_call:  // currently, sparc-specific for niagara
-      default: ShouldNotReachHere();
-    }
-    __ align(BytesPerWord, offset);
+  // make sure that the displacement word of the call ends up word aligned
+  int offset = __ offset();
+  switch (code) {
+  case lir_static_call:
+  case lir_optvirtual_call:
+  case lir_dynamic_call:
+    offset += NativeCall::displacement_offset;
+    break;
+  case lir_icvirtual_call:
+    offset += NativeCall::displacement_offset + NativeMovConstReg::instruction_size;
+    break;
+  case lir_virtual_call:  // currently, sparc-specific for niagara
+  default: ShouldNotReachHere();
   }
+  __ align(BytesPerWord, offset);
 }
 
 
 void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
-  assert(!os::is_MP() || (__ offset() + NativeCall::displacement_offset) % BytesPerWord == 0,
+  assert((__ offset() + NativeCall::displacement_offset) % BytesPerWord == 0,
          "must be aligned");
   __ call(AddressLiteral(op->addr(), rtype));
   add_call_info(code_offset(), op->info());
@@ -2835,8 +2823,7 @@
 void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
   __ ic_call(op->addr());
   add_call_info(code_offset(), op->info());
-  assert(!os::is_MP() ||
-         (__ offset() - NativeCall::instruction_size + NativeCall::displacement_offset) % BytesPerWord == 0,
+  assert((__ offset() - NativeCall::instruction_size + NativeCall::displacement_offset) % BytesPerWord == 0,
          "must be aligned");
 }
 
@@ -2856,14 +2843,13 @@
   }
 
   int start = __ offset();
-  if (os::is_MP()) {
-    // make sure that the displacement word of the call ends up word aligned
-    __ align(BytesPerWord, __ offset() + NativeMovConstReg::instruction_size + NativeCall::displacement_offset);
-  }
+
+  // make sure that the displacement word of the call ends up word aligned
+  __ align(BytesPerWord, __ offset() + NativeMovConstReg::instruction_size + NativeCall::displacement_offset);
   __ relocate(static_stub_Relocation::spec(call_pc, false /* is_aot */));
   __ mov_metadata(rbx, (Metadata*)NULL);
   // must be set to -1 at code generation time
-  assert(!os::is_MP() || ((__ offset() + 1) % BytesPerWord) == 0, "must be aligned on MP");
+  assert(((__ offset() + 1) % BytesPerWord) == 0, "must be aligned");
   // On 64bit this will die since it will take a movq & jmp, must be only a jmp
   __ jump(RuntimeAddress(__ pc()));
 
@@ -3992,9 +3978,7 @@
 
   if (data->type() == T_INT) {
     if (code == lir_xadd) {
-      if (os::is_MP()) {
-        __ lock();
-      }
+      __ lock();
       __ xaddl(as_Address(src->as_address_ptr()), data->as_register());
     } else {
       __ xchgl(data->as_register(), as_Address(src->as_address_ptr()));
@@ -4017,9 +4001,7 @@
 #ifdef _LP64
     assert(data->as_register_lo() == data->as_register_hi(), "should be a single register");
     if (code == lir_xadd) {
-      if (os::is_MP()) {
-        __ lock();
-      }
+      __ lock();
       __ xaddq(as_Address(src->as_address_ptr()), data->as_register_lo());
     } else {
       __ xchgq(data->as_register_lo(), as_Address(src->as_address_ptr()));
--- a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -65,7 +65,7 @@
   // test if object header is still the same (i.e. unlocked), and if so, store the
   // displaced header address in the object header - if it is not the same, get the
   // object header instead
-  if (os::is_MP()) MacroAssembler::lock(); // must be immediately before cmpxchg!
+  MacroAssembler::lock(); // must be immediately before cmpxchg!
   cmpxchgptr(disp_hdr, Address(obj, hdr_offset));
   // if the object header was the same, we're done
   if (PrintBiasedLockingStatistics) {
@@ -126,7 +126,7 @@
   // test if object header is pointing to the displaced header, and if so, restore
   // the displaced header in the object - if the object header is not pointing to
   // the displaced header, get the object header instead
-  if (os::is_MP()) MacroAssembler::lock(); // must be immediately before cmpxchg!
+  MacroAssembler::lock(); // must be immediately before cmpxchg!
   cmpxchgptr(hdr, Address(obj, hdr_offset));
   // if the object header was not pointing to the displaced header,
   // we do unlocking via runtime call
--- a/src/hotspot/cpu/x86/compiledIC_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/compiledIC_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -198,9 +198,7 @@
 void CompiledDirectStaticCall::verify() {
   // Verify call.
   _call->verify();
-  if (os::is_MP()) {
-    _call->verify_alignment();
-  }
+  _call->verify_alignment();
 
 #ifdef ASSERT
   CodeBlob *cb = CodeCache::find_blob_unsafe((address) _call);
--- a/src/hotspot/cpu/x86/interp_masm_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1191,7 +1191,7 @@
     assert(lock_offset == 0,
            "displaced header must be first word in BasicObjectLock");
 
-    if (os::is_MP()) lock();
+    lock();
     cmpxchgptr(lock_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
     if (PrintBiasedLockingStatistics) {
       cond_inc32(Assembler::zero,
@@ -1288,7 +1288,7 @@
     jcc(Assembler::zero, done);
 
     // Atomic swap back the old header
-    if (os::is_MP()) lock();
+    lock();
     cmpxchgptr(header_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
 
     // zero for simple unlock of a stack-lock case
--- a/src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -75,15 +75,11 @@
   __ mov32 (rcx, counter);
   __ testb (rcx, 1);
   __ jcc (Assembler::notZero, slow);
-  if (os::is_MP()) {
-    __ mov(rax, rcx);
-    __ andptr(rax, 1);                         // rax, must end up 0
-    __ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize));
-                                              // obj, notice rax, is 0.
-                                              // rdx is data dependent on rcx.
-  } else {
-    __ movptr (rdx, Address(rsp, 2*wordSize));  // obj
-  }
+  __ mov(rax, rcx);
+  __ andptr(rax, 1);                         // rax, must end up 0
+  __ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize));
+                                            // obj, notice rax, is 0.
+                                            // rdx is data dependent on rcx.
   __ movptr(rax, Address(rsp, 3*wordSize));  // jfieldID
 
   __ clear_jweak_tag(rdx);
@@ -103,17 +99,13 @@
   }
 
   Address ca1;
-  if (os::is_MP()) {
-    __ lea(rdx, counter);
-    __ xorptr(rdx, rax);
-    __ xorptr(rdx, rax);
-    __ cmp32(rcx, Address(rdx, 0));
-    // ca1 is the same as ca because
-    // rax, ^ counter_addr ^ rax, = address
-    // ca1 is data dependent on rax,.
-  } else {
-    __ cmp32(rcx, counter);
-  }
+  __ lea(rdx, counter);
+  __ xorptr(rdx, rax);
+  __ xorptr(rdx, rax);
+  __ cmp32(rcx, Address(rdx, 0));
+  // ca1 is the same as ca because
+  // rax, ^ counter_addr ^ rax, = address
+  // ca1 is data dependent on rax,.
   __ jcc (Assembler::notEqual, slow);
 
 #ifndef _WINDOWS
@@ -196,15 +188,11 @@
   __ mov32 (rcx, counter);
   __ testb (rcx, 1);
   __ jcc (Assembler::notZero, slow);
-  if (os::is_MP()) {
-    __ mov(rax, rcx);
-    __ andptr(rax, 1);                         // rax, must end up 0
-    __ movptr(rdx, Address(rsp, rax, Address::times_1, 3*wordSize));
-                                              // obj, notice rax, is 0.
-                                              // rdx is data dependent on rcx.
-  } else {
-    __ movptr(rdx, Address(rsp, 3*wordSize));  // obj
-  }
+  __ mov(rax, rcx);
+  __ andptr(rax, 1);                         // rax, must end up 0
+  __ movptr(rdx, Address(rsp, rax, Address::times_1, 3*wordSize));
+                                            // obj, notice rax, is 0.
+                                            // rdx is data dependent on rcx.
   __ movptr(rsi, Address(rsp, 4*wordSize));  // jfieldID
 
   __ clear_jweak_tag(rdx);
@@ -220,19 +208,15 @@
   __ movl(rdx, Address(rdx, rsi, Address::times_1, 4));
 #endif // _LP64
 
-  if (os::is_MP()) {
-    __ lea(rsi, counter);
-    __ xorptr(rsi, rdx);
-    __ xorptr(rsi, rax);
-    __ xorptr(rsi, rdx);
-    __ xorptr(rsi, rax);
-    __ cmp32(rcx, Address(rsi, 0));
-    // ca1 is the same as ca because
-    // rax, ^ rdx ^ counter_addr ^ rax, ^ rdx = address
-    // ca1 is data dependent on both rax, and rdx.
-  } else {
-    __ cmp32(rcx, counter);
-  }
+  __ lea(rsi, counter);
+  __ xorptr(rsi, rdx);
+  __ xorptr(rsi, rax);
+  __ xorptr(rsi, rdx);
+  __ xorptr(rsi, rax);
+  __ cmp32(rcx, Address(rsi, 0));
+  // ca1 is the same as ca because
+  // rax, ^ rdx ^ counter_addr ^ rax, ^ rdx = address
+  // ca1 is data dependent on both rax, and rdx.
   __ jcc (Assembler::notEqual, slow);
 
   __ pop (rsi);
@@ -288,15 +272,11 @@
   __ mov32 (rcx, counter);
   __ testb (rcx, 1);
   __ jcc (Assembler::notZero, slow);
-  if (os::is_MP()) {
-    __ mov(rax, rcx);
-    __ andptr(rax, 1);                         // rax, must end up 0
-    __ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize));
-                                              // obj, notice rax, is 0.
-                                              // rdx is data dependent on rcx.
-  } else {
-    __ movptr(rdx, Address(rsp, 2*wordSize)); // obj
-  }
+  __ mov(rax, rcx);
+  __ andptr(rax, 1);                         // rax, must end up 0
+  __ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize));
+                                            // obj, notice rax, is 0.
+                                            // rdx is data dependent on rcx.
   __ movptr(rax, Address(rsp, 3*wordSize));  // jfieldID
 
   __ clear_jweak_tag(rdx);
@@ -318,20 +298,16 @@
   }
 
   Address ca1;
-  if (os::is_MP()) {
-    __ fst_s (Address(rsp, -4));
-    __ lea(rdx, counter);
-    __ movl (rax, Address(rsp, -4));
-    // garbage hi-order bits on 64bit are harmless.
-    __ xorptr(rdx, rax);
-    __ xorptr(rdx, rax);
-    __ cmp32(rcx, Address(rdx, 0));
-                                          // rax, ^ counter_addr ^ rax, = address
-                                          // ca1 is data dependent on the field
-                                          // access.
-  } else {
-    __ cmp32(rcx, counter);
-  }
+  __ fst_s (Address(rsp, -4));
+  __ lea(rdx, counter);
+  __ movl (rax, Address(rsp, -4));
+  // garbage hi-order bits on 64bit are harmless.
+  __ xorptr(rdx, rax);
+  __ xorptr(rdx, rax);
+  __ cmp32(rcx, Address(rdx, 0));
+  // rax, ^ counter_addr ^ rax, = address
+  // ca1 is data dependent on the field
+  // access.
   __ jcc (Assembler::notEqual, slow_with_pop);
 
 #ifndef _WINDOWS
--- a/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -77,12 +77,11 @@
   __ mov   (robj, c_rarg1);
   __ testb (rcounter, 1);
   __ jcc (Assembler::notZero, slow);
-  if (os::is_MP()) {
-    __ xorptr(robj, rcounter);
-    __ xorptr(robj, rcounter);                   // obj, since
-                                                // robj ^ rcounter ^ rcounter == robj
-                                                // robj is data dependent on rcounter.
-  }
+
+  __ xorptr(robj, rcounter);
+  __ xorptr(robj, rcounter);  // obj, since
+                              // robj ^ rcounter ^ rcounter == robj
+                              // robj is data dependent on rcounter.
 
   __ mov   (roffset, c_rarg2);
   __ shrptr(roffset, 2);                         // offset
@@ -104,15 +103,12 @@
     default:        ShouldNotReachHere();
   }
 
-  if (os::is_MP()) {
-    __ lea(rcounter_addr, counter);
-    // ca is data dependent on rax.
-    __ xorptr(rcounter_addr, rax);
-    __ xorptr(rcounter_addr, rax);
-    __ cmpl (rcounter, Address(rcounter_addr, 0));
-  } else {
-    __ cmp32 (rcounter, counter);
-  }
+  // create data dependency on rax
+  __ lea(rcounter_addr, counter);
+  __ xorptr(rcounter_addr, rax);
+  __ xorptr(rcounter_addr, rax);
+  __ cmpl (rcounter, Address(rcounter_addr, 0));
+
   __ jcc (Assembler::notEqual, slow);
 
   __ ret (0);
@@ -181,12 +177,11 @@
   __ mov   (robj, c_rarg1);
   __ testb (rcounter, 1);
   __ jcc (Assembler::notZero, slow);
-  if (os::is_MP()) {
-    __ xorptr(robj, rcounter);
-    __ xorptr(robj, rcounter);                   // obj, since
-                                                // robj ^ rcounter ^ rcounter == robj
-                                                // robj is data dependent on rcounter.
-  }
+
+  __ xorptr(robj, rcounter);
+  __ xorptr(robj, rcounter);  // obj, since
+                              // robj ^ rcounter ^ rcounter == robj
+                              // robj is data dependent on rcounter.
 
   // Both robj and rtmp are clobbered by try_resolve_jobject_in_native.
   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
@@ -204,16 +199,12 @@
     default:        ShouldNotReachHere();
   }
 
-  if (os::is_MP()) {
-    __ lea(rcounter_addr, counter);
-    __ movdq (rax, xmm0);
-    // counter address is data dependent on xmm0.
-    __ xorptr(rcounter_addr, rax);
-    __ xorptr(rcounter_addr, rax);
-    __ cmpl (rcounter, Address(rcounter_addr, 0));
-  } else {
-    __ cmp32 (rcounter, counter);
-  }
+  __ lea(rcounter_addr, counter);
+  __ movdq (rax, xmm0);
+  // counter address is data dependent on xmm0.
+  __ xorptr(rcounter_addr, rax);
+  __ xorptr(rcounter_addr, rax);
+  __ cmpl (rcounter, Address(rcounter_addr, 0));
   __ jcc (Assembler::notEqual, slow);
 
   __ ret (0);
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1030,8 +1030,7 @@
 }
 
 void MacroAssembler::atomic_incl(Address counter_addr) {
-  if (os::is_MP())
-    lock();
+  lock();
   incrementl(counter_addr);
 }
 
@@ -1046,8 +1045,7 @@
 
 #ifdef _LP64
 void MacroAssembler::atomic_incq(Address counter_addr) {
-  if (os::is_MP())
-    lock();
+  lock();
   incrementq(counter_addr);
 }
 
@@ -1213,9 +1211,7 @@
   get_thread(tmp_reg);
   orptr(tmp_reg, swap_reg);
 #endif
-  if (os::is_MP()) {
-    lock();
-  }
+  lock();
   cmpxchgptr(tmp_reg, mark_addr); // compare tmp_reg and swap_reg
   // If the biasing toward our thread failed, this means that
   // another thread succeeded in biasing it toward itself and we
@@ -1248,9 +1244,7 @@
   orptr(tmp_reg, swap_reg);
   movptr(swap_reg, saved_mark_addr);
 #endif
-  if (os::is_MP()) {
-    lock();
-  }
+  lock();
   cmpxchgptr(tmp_reg, mark_addr); // compare tmp_reg and swap_reg
   // If the biasing toward our thread failed, then another thread
   // succeeded in biasing it toward itself and we need to revoke that
@@ -1278,9 +1272,7 @@
   // bits in this situation. Should attempt to preserve them.
   NOT_LP64( movptr(swap_reg, saved_mark_addr); )
   load_prototype_header(tmp_reg, obj_reg);
-  if (os::is_MP()) {
-    lock();
-  }
+  lock();
   cmpxchgptr(tmp_reg, mark_addr); // compare tmp_reg and swap_reg
   // Fall through to the normal CAS-based lock, because no matter what
   // the result of the above CAS, some thread must have succeeded in
@@ -1376,9 +1368,7 @@
   if (method_data != NULL) {
     // set rtm_state to "no rtm" in MDO
     mov_metadata(tmpReg, method_data);
-    if (os::is_MP()) {
-      lock();
-    }
+    lock();
     orl(Address(tmpReg, MethodData::rtm_state_offset_in_bytes()), NoRTM);
   }
   jmpb(L_done);
@@ -1392,9 +1382,7 @@
   if (method_data != NULL) {
     // set rtm_state to "always rtm" in MDO
     mov_metadata(tmpReg, method_data);
-    if (os::is_MP()) {
-      lock();
-    }
+    lock();
     orl(Address(tmpReg, MethodData::rtm_state_offset_in_bytes()), UseRTM);
   }
   bind(L_done);
@@ -1605,9 +1593,7 @@
   get_thread(scrReg);
   Register threadReg = scrReg;
 #endif
-  if (os::is_MP()) {
-    lock();
-  }
+  lock();
   cmpxchgptr(threadReg, Address(boxReg, owner_offset)); // Updates tmpReg
 
   if (RTMRetryCount > 0) {
@@ -1767,9 +1753,7 @@
   // Attempt stack-locking ...
   orptr (tmpReg, markOopDesc::unlocked_value);
   movptr(Address(boxReg, 0), tmpReg);          // Anticipate successful CAS
-  if (os::is_MP()) {
-    lock();
-  }
+  lock();
   cmpxchgptr(boxReg, Address(objReg, oopDesc::mark_offset_in_bytes()));      // Updates tmpReg
   if (counters != NULL) {
     cond_inc32(Assembler::equal,
@@ -1826,9 +1810,7 @@
   // we later store "Self" into m->Owner.  Transiently storing a stack address
   // (rsp or the address of the box) into  m->owner is harmless.
   // Invariant: tmpReg == 0.  tmpReg is EAX which is the implicit cmpxchg comparand.
-  if (os::is_MP()) {
-    lock();
-  }
+  lock();
   cmpxchgptr(scrReg, Address(boxReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
   movptr(Address(scrReg, 0), 3);          // box->_displaced_header = 3
   // If we weren't able to swing _owner from NULL to the BasicLock
@@ -1851,9 +1833,7 @@
   movq(scrReg, tmpReg);
   xorq(tmpReg, tmpReg);
 
-  if (os::is_MP()) {
-    lock();
-  }
+  lock();
   cmpxchgptr(r15_thread, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
   // Unconditionally set box->_displaced_header = markOopDesc::unused_mark().
   // Without cast to int32_t movptr will destroy r10 which is typically obj.
@@ -2000,9 +1980,7 @@
   // The "box" value on the stack is stable, so we can reload
   // and be assured we observe the same value as above.
   movptr(tmpReg, Address(boxReg, 0));
-  if (os::is_MP()) {
-    lock();
-  }
+  lock();
   cmpxchgptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes())); // Uses RAX which is box
   // Intention fall-thru into DONE_LABEL
 
@@ -2036,16 +2014,16 @@
 
   xorptr(boxReg, boxReg);
   movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), (int32_t)NULL_WORD);
-  if (os::is_MP()) {
-    // Memory barrier/fence
-    // Dekker pivot point -- fulcrum : ST Owner; MEMBAR; LD Succ
-    // Instead of MFENCE we use a dummy locked add of 0 to the top-of-stack.
-    // This is faster on Nehalem and AMD Shanghai/Barcelona.
-    // See https://blogs.oracle.com/dave/entry/instruction_selection_for_volatile_fences
-    // We might also restructure (ST Owner=0;barrier;LD _Succ) to
-    // (mov box,0; xchgq box, &m->Owner; LD _succ) .
-    lock(); addl(Address(rsp, 0), 0);
-  }
+
+  // Memory barrier/fence
+  // Dekker pivot point -- fulcrum : ST Owner; MEMBAR; LD Succ
+  // Instead of MFENCE we use a dummy locked add of 0 to the top-of-stack.
+  // This is faster on Nehalem and AMD Shanghai/Barcelona.
+  // See https://blogs.oracle.com/dave/entry/instruction_selection_for_volatile_fences
+  // We might also restructure (ST Owner=0;barrier;LD _Succ) to
+  // (mov box,0; xchgq box, &m->Owner; LD _succ) .
+  lock(); addl(Address(rsp, 0), 0);
+
   cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), (int32_t)NULL_WORD);
   jccb  (Assembler::notZero, LSuccess);
 
@@ -2063,7 +2041,7 @@
 
   // box is really RAX -- the following CMPXCHG depends on that binding
   // cmpxchg R,[M] is equivalent to rax = CAS(M,rax,R)
-  if (os::is_MP()) { lock(); }
+  lock();
   cmpxchgptr(r15_thread, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
   // There's no successor so we tried to regrab the lock.
   // If that didn't work, then another thread grabbed the
@@ -2081,7 +2059,7 @@
 
   bind  (Stacked);
   movptr(tmpReg, Address (boxReg, 0));      // re-fetch
-  if (os::is_MP()) { lock(); }
+  lock();
   cmpxchgptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes())); // Uses RAX which is box
 
 #endif
@@ -2633,13 +2611,11 @@
 
 void MacroAssembler::locked_cmpxchgptr(Register reg, AddressLiteral adr) {
   if (reachable(adr)) {
-    if (os::is_MP())
-      lock();
+    lock();
     cmpxchgptr(reg, as_Address(adr));
   } else {
     lea(rscratch1, adr);
-    if (os::is_MP())
-      lock();
+    lock();
     cmpxchgptr(reg, Address(rscratch1, 0));
   }
 }
@@ -3266,7 +3242,9 @@
   }
 }
 
+#ifdef COMPILER2
 void MacroAssembler::setvectmask(Register dst, Register src) {
+  guarantee(PostLoopMultiversioning, "must be");
   Assembler::movl(dst, 1);
   Assembler::shlxl(dst, dst, src);
   Assembler::decl(dst);
@@ -3275,8 +3253,10 @@
 }
 
 void MacroAssembler::restorevectmask() {
+  guarantee(PostLoopMultiversioning, "must be");
   Assembler::knotwl(k1, k0);
 }
+#endif // COMPILER2
 
 void MacroAssembler::movdbl(XMMRegister dst, AddressLiteral src) {
   if (reachable(src)) {
@@ -5026,12 +5006,15 @@
   // Clear upper bits of YMM registers to avoid SSE <-> AVX transition penalty.
   vzeroupper();
   // Reset k1 to 0xffff.
-  if (VM_Version::supports_evex()) {
+
+#ifdef COMPILER2
+  if (PostLoopMultiversioning && VM_Version::supports_evex()) {
     push(rcx);
     movl(rcx, 0xffff);
     kmovwl(k1, rcx);
     pop(rcx);
   }
+#endif // COMPILER2
 
 #ifndef _LP64
   // Either restore the x87 floating pointer control word after returning
@@ -6681,8 +6664,6 @@
     VM_Version::supports_avx512vlbw() &&
     VM_Version::supports_bmi2()) {
 
-    set_vector_masking();  // opening of the stub context for programming mask registers
-
     Label test_64_loop, test_tail;
     Register tmp3_aliased = len;
 
@@ -6711,15 +6692,12 @@
     testl(tmp1, -1);
     jcc(Assembler::zero, FALSE_LABEL);
 
-    // Save k1
-    kmovql(k3, k1);
-
     // ~(~0 << len) applied up to two times (for 32-bit scenario)
 #ifdef _LP64
     mov64(tmp3_aliased, 0xFFFFFFFFFFFFFFFF);
     shlxq(tmp3_aliased, tmp3_aliased, tmp1);
     notq(tmp3_aliased);
-    kmovql(k1, tmp3_aliased);
+    kmovql(k3, tmp3_aliased);
 #else
     Label k_init;
     jmp(k_init);
@@ -6728,7 +6706,7 @@
     // data required to compose 64 1's to the instruction stream
     // We emit 64 byte wide series of elements from 0..63 which later on would
     // be used as a compare targets with tail count contained in tmp1 register.
-    // Result would be a k1 register having tmp1 consecutive number or 1
+    // Result would be a k register having tmp1 consecutive number or 1
     // counting from least significant bit.
     address tmp = pc();
     emit_int64(0x0706050403020100);
@@ -6744,18 +6722,14 @@
     lea(len, InternalAddress(tmp));
     // create mask to test for negative byte inside a vector
     evpbroadcastb(vec1, tmp1, Assembler::AVX_512bit);
-    evpcmpgtb(k1, vec1, Address(len, 0), Assembler::AVX_512bit);
+    evpcmpgtb(k3, vec1, Address(len, 0), Assembler::AVX_512bit);
 
 #endif
-    evpcmpgtb(k2, k1, vec2, Address(ary1, 0), Assembler::AVX_512bit);
-    ktestq(k2, k1);
-    // Restore k1
-    kmovql(k1, k3);
+    evpcmpgtb(k2, k3, vec2, Address(ary1, 0), Assembler::AVX_512bit);
+    ktestq(k2, k3);
     jcc(Assembler::notZero, TRUE_LABEL);
 
     jmp(FALSE_LABEL);
-
-    clear_vector_masking();   // closing of the stub context for programming mask registers
   } else {
     movl(result, len); // copy
 
@@ -7197,10 +7171,6 @@
     {
       assert( UseSSE >= 2, "supported cpu only" );
       Label L_fill_32_bytes_loop, L_check_fill_8_bytes, L_fill_8_bytes_loop, L_fill_8_bytes;
-      if (UseAVX > 2) {
-        movl(rtmp, 0xffff);
-        kmovwl(k1, rtmp);
-      }
       movdl(xtmp, value);
       if (UseAVX > 2 && UseUnalignedLoadStores) {
         // Fill 64-byte chunks
@@ -7945,7 +7915,6 @@
       VM_Version::supports_avx512vlbw()) {
     Label VECTOR64_LOOP, VECTOR64_NOT_EQUAL, VECTOR32_TAIL;
 
-    set_vector_masking();  // opening of the stub context for programming mask registers
     cmpq(length, 64);
     jcc(Assembler::less, VECTOR32_TAIL);
     movq(tmp1, length);
@@ -7968,19 +7937,15 @@
 
     //bind(VECTOR64_TAIL);
     // AVX512 code to compare upto 63 byte vectors.
-    // Save k1
-    kmovql(k3, k1);
     mov64(tmp2, 0xFFFFFFFFFFFFFFFF);
     shlxq(tmp2, tmp2, tmp1);
     notq(tmp2);
-    kmovql(k1, tmp2);
-
-    evmovdqub(rymm0, k1, Address(obja, result), Assembler::AVX_512bit);
-    evpcmpeqb(k7, k1, rymm0, Address(objb, result), Assembler::AVX_512bit);
-
-    ktestql(k7, k1);
-    // Restore k1
-    kmovql(k1, k3);
+    kmovql(k3, tmp2);
+
+    evmovdqub(rymm0, k3, Address(obja, result), Assembler::AVX_512bit);
+    evpcmpeqb(k7, k3, rymm0, Address(objb, result), Assembler::AVX_512bit);
+
+    ktestql(k7, k3);
     jcc(Assembler::below, SAME_TILL_END);     // not mismatch
 
     bind(VECTOR64_NOT_EQUAL);
@@ -7991,7 +7956,6 @@
     shrq(result);
     jmp(DONE);
     bind(VECTOR32_TAIL);
-    clear_vector_masking();   // closing of the stub context for programming mask registers
   }
 
   cmpq(length, 8);
@@ -8752,11 +8716,6 @@
   // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
   // context for the registers used, where all instructions below are using 128-bit mode
   // On EVEX without VL and BW, these instructions will all be AVX.
-  if (VM_Version::supports_avx512vlbw()) {
-    movl(tmp, 0xffff);
-    kmovwl(k1, tmp);
-  }
-
   lea(table, ExternalAddress(StubRoutines::crc_table_addr()));
   notl(crc); // ~crc
   cmpl(len, 16);
@@ -9418,9 +9377,7 @@
     VM_Version::supports_avx512vlbw() &&
     VM_Version::supports_bmi2()) {
 
-    set_vector_masking();  // opening of the stub context for programming mask registers
-
-    Label copy_32_loop, copy_loop_tail, restore_k1_return_zero, below_threshold;
+    Label copy_32_loop, copy_loop_tail, below_threshold;
 
     // alignment
     Label post_alignment;
@@ -9434,9 +9391,6 @@
     movl(result, 0x00FF);
     evpbroadcastw(tmp2Reg, result, Assembler::AVX_512bit);
 
-    // Save k1
-    kmovql(k3, k1);
-
     testl(len, -64);
     jcc(Assembler::zero, post_alignment);
 
@@ -9453,14 +9407,14 @@
     movl(result, 0xFFFFFFFF);
     shlxl(result, result, tmp5);
     notl(result);
-    kmovdl(k1, result);
-
-    evmovdquw(tmp1Reg, k1, Address(src, 0), Assembler::AVX_512bit);
-    evpcmpuw(k2, k1, tmp1Reg, tmp2Reg, Assembler::le, Assembler::AVX_512bit);
-    ktestd(k2, k1);
-    jcc(Assembler::carryClear, restore_k1_return_zero);
-
-    evpmovwb(Address(dst, 0), k1, tmp1Reg, Assembler::AVX_512bit);
+    kmovdl(k3, result);
+
+    evmovdquw(tmp1Reg, k3, Address(src, 0), Assembler::AVX_512bit);
+    evpcmpuw(k2, k3, tmp1Reg, tmp2Reg, Assembler::le, Assembler::AVX_512bit);
+    ktestd(k2, k3);
+    jcc(Assembler::carryClear, return_zero);
+
+    evpmovwb(Address(dst, 0), k3, tmp1Reg, Assembler::AVX_512bit);
 
     addptr(src, tmp5);
     addptr(src, tmp5);
@@ -9483,7 +9437,7 @@
     evmovdquw(tmp1Reg, Address(src, len, Address::times_2), Assembler::AVX_512bit);
     evpcmpuw(k2, tmp1Reg, tmp2Reg, Assembler::le, Assembler::AVX_512bit);
     kortestdl(k2, k2);
-    jcc(Assembler::carryClear, restore_k1_return_zero);
+    jcc(Assembler::carryClear, return_zero);
 
     // All elements in current processed chunk are valid candidates for
     // compression. Write a truncated byte elements to the memory.
@@ -9494,8 +9448,6 @@
     bind(copy_loop_tail);
     // bail out when there is nothing to be done
     testl(tmp5, 0xFFFFFFFF);
-    // Restore k1
-    kmovql(k1, k3);
     jcc(Assembler::zero, return_length);
 
     movl(len, tmp5);
@@ -9505,25 +9457,16 @@
     shlxl(result, result, len);
     notl(result);
 
-    kmovdl(k1, result);
-
-    evmovdquw(tmp1Reg, k1, Address(src, 0), Assembler::AVX_512bit);
-    evpcmpuw(k2, k1, tmp1Reg, tmp2Reg, Assembler::le, Assembler::AVX_512bit);
-    ktestd(k2, k1);
-    jcc(Assembler::carryClear, restore_k1_return_zero);
-
-    evpmovwb(Address(dst, 0), k1, tmp1Reg, Assembler::AVX_512bit);
-    // Restore k1
-    kmovql(k1, k3);
+    kmovdl(k3, result);
+
+    evmovdquw(tmp1Reg, k3, Address(src, 0), Assembler::AVX_512bit);
+    evpcmpuw(k2, k3, tmp1Reg, tmp2Reg, Assembler::le, Assembler::AVX_512bit);
+    ktestd(k2, k3);
+    jcc(Assembler::carryClear, return_zero);
+
+    evpmovwb(Address(dst, 0), k3, tmp1Reg, Assembler::AVX_512bit);
     jmp(return_length);
 
-    bind(restore_k1_return_zero);
-    // Restore k1
-    kmovql(k1, k3);
-    jmp(return_zero);
-
-    clear_vector_masking();   // closing of the stub context for programming mask registers
-
     bind(below_threshold);
   }
 
@@ -9637,8 +9580,6 @@
     VM_Version::supports_avx512vlbw() &&
     VM_Version::supports_bmi2()) {
 
-    set_vector_masking();  // opening of the stub context for programming mask registers
-
     Label copy_32_loop, copy_tail;
     Register tmp3_aliased = len;
 
@@ -9670,22 +9611,15 @@
     testl(tmp2, -1); // we don't destroy the contents of tmp2 here
     jcc(Assembler::zero, done);
 
-    // Save k1
-    kmovql(k2, k1);
-
     // ~(~0 << length), where length is the # of remaining elements to process
     movl(tmp3_aliased, -1);
     shlxl(tmp3_aliased, tmp3_aliased, tmp2);
     notl(tmp3_aliased);
-    kmovdl(k1, tmp3_aliased);
-    evpmovzxbw(tmp1, k1, Address(src, 0), Assembler::AVX_512bit);
-    evmovdquw(Address(dst, 0), k1, tmp1, Assembler::AVX_512bit);
-
-    // Restore k1
-    kmovql(k1, k2);
+    kmovdl(k2, tmp3_aliased);
+    evpmovzxbw(tmp1, k2, Address(src, 0), Assembler::AVX_512bit);
+    evmovdquw(Address(dst, 0), k2, tmp1, Assembler::AVX_512bit);
+
     jmp(done);
-
-    clear_vector_masking();   // closing of the stub context for programming mask registers
   }
   if (UseSSE42Intrinsics) {
     Label copy_16_loop, copy_8_loop, copy_bytes, copy_new_tail, copy_tail;
--- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -156,9 +156,11 @@
   void incrementq(Register reg, int value = 1);
   void incrementq(Address dst, int value = 1);
 
+#ifdef COMPILER2
   // special instructions for EVEX
   void setvectmask(Register dst, Register src);
   void restorevectmask();
+#endif
 
   // Support optimal SSE move instructions.
   void movflt(XMMRegister dst, XMMRegister src) {
--- a/src/hotspot/cpu/x86/nativeInst_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/nativeInst_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -202,9 +202,7 @@
   assert (instr_addr != NULL, "illegal address for code patching");
 
   NativeCall* n_call =  nativeCall_at (instr_addr); // checking that it is a call
-  if (os::is_MP()) {
-    guarantee((intptr_t)instr_addr % BytesPerWord == 0, "must be aligned");
-  }
+  guarantee((intptr_t)instr_addr % BytesPerWord == 0, "must be aligned");
 
   // First patch dummy jmp in place
   unsigned char patch[4];
@@ -262,67 +260,14 @@
   assert(Patching_lock->is_locked() ||
          SafepointSynchronize::is_at_safepoint(), "concurrent code patching");
   // Both C1 and C2 should now be generating code which aligns the patched address
-  // to be within a single cache line except that C1 does not do the alignment on
-  // uniprocessor systems.
+  // to be within a single cache line.
   bool is_aligned = ((uintptr_t)displacement_address() + 0) / cache_line_size ==
                     ((uintptr_t)displacement_address() + 3) / cache_line_size;
 
-  guarantee(!os::is_MP() || is_aligned, "destination must be aligned");
-
-  if (is_aligned) {
-    // Simple case:  The destination lies within a single cache line.
-    set_destination(dest);
-  } else if ((uintptr_t)instruction_address() / cache_line_size ==
-             ((uintptr_t)instruction_address()+1) / cache_line_size) {
-    // Tricky case:  The instruction prefix lies within a single cache line.
-    intptr_t disp = dest - return_address();
-#ifdef AMD64
-    guarantee(disp == (intptr_t)(jint)disp, "must be 32-bit offset");
-#endif // AMD64
-
-    int call_opcode = instruction_address()[0];
-
-    // First patch dummy jump in place:
-    {
-      u_char patch_jump[2];
-      patch_jump[0] = 0xEB;       // jmp rel8
-      patch_jump[1] = 0xFE;       // jmp to self
-
-      assert(sizeof(patch_jump)==sizeof(short), "sanity check");
-      *(short*)instruction_address() = *(short*)patch_jump;
-    }
-    // Invalidate.  Opteron requires a flush after every write.
-    wrote(0);
+  guarantee(is_aligned, "destination must be aligned");
 
-    // (Note: We assume any reader which has already started to read
-    // the unpatched call will completely read the whole unpatched call
-    // without seeing the next writes we are about to make.)
-
-    // Next, patch the last three bytes:
-    u_char patch_disp[5];
-    patch_disp[0] = call_opcode;
-    *(int32_t*)&patch_disp[1] = (int32_t)disp;
-    assert(sizeof(patch_disp)==instruction_size, "sanity check");
-    for (int i = sizeof(short); i < instruction_size; i++)
-      instruction_address()[i] = patch_disp[i];
-
-    // Invalidate.  Opteron requires a flush after every write.
-    wrote(sizeof(short));
-
-    // (Note: We assume that any reader which reads the opcode we are
-    // about to repatch will also read the writes we just made.)
-
-    // Finally, overwrite the jump:
-    *(short*)instruction_address() = *(short*)patch_disp;
-    // Invalidate.  Opteron requires a flush after every write.
-    wrote(0);
-
-    debug_only(verify());
-    guarantee(destination() == dest, "patch succeeded");
-  } else {
-    // Impossible:  One or the other must be atomically writable.
-    ShouldNotReachHere();
-  }
+  // The destination lies within a single cache line.
+  set_destination(dest);
 }
 
 
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2007,12 +2007,9 @@
     // Save (object->mark() | 1) into BasicLock's displaced header
     __ movptr(Address(lock_reg, mark_word_offset), swap_reg);
 
-    if (os::is_MP()) {
-      __ lock();
-    }
-
     // src -> dest iff dest == rax, else rax, <- dest
     // *obj_reg = lock_reg iff *obj_reg == rax, else rax, = *(obj_reg)
+    __ lock();
     __ cmpxchgptr(lock_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
     __ jcc(Assembler::equal, lock_done);
 
@@ -2091,19 +2088,17 @@
   //     didn't see any synchronization is progress, and escapes.
   __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_native_trans);
 
-  if(os::is_MP()) {
-    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);
-    }
+  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);
   }
 
   if (AlwaysRestoreFPU) {
@@ -2199,12 +2194,9 @@
     __ lea(rax, Address(rbp, lock_slot_rbp_offset));
 
     // Atomic swap old header if oop still contains the stack lock
-    if (os::is_MP()) {
-    __ lock();
-    }
-
     // src -> dest iff dest == rax, else rax, <- dest
     // *obj_reg = rbx, iff *obj_reg == rax, else rax, = *(obj_reg)
+    __ lock();
     __ cmpxchgptr(rbx, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
     __ jcc(Assembler::notEqual, slow_path_unlock);
 
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2464,11 +2464,8 @@
     // Save (object->mark() | 1) into BasicLock's displaced header
     __ movptr(Address(lock_reg, mark_word_offset), swap_reg);
 
-    if (os::is_MP()) {
-      __ lock();
-    }
-
     // src -> dest iff dest == rax else rax <- dest
+    __ lock();
     __ cmpxchgptr(lock_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
     __ jcc(Assembler::equal, lock_done);
 
@@ -2558,19 +2555,17 @@
   //     didn't see any synchronization is progress, and escapes.
   __ movl(Address(r15_thread, JavaThread::thread_state_offset()), _thread_in_native_trans);
 
-  if(os::is_MP()) {
-    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);
-    }
+  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);
   }
 
   Label after_transition;
@@ -2661,9 +2656,7 @@
     __ movptr(old_hdr, Address(rax, 0));
 
     // Atomic swap old header if oop still contains the stack lock
-    if (os::is_MP()) {
-      __ lock();
-    }
+    __ lock();
     __ cmpxchgptr(old_hdr, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
     __ jcc(Assembler::notEqual, slow_path_unlock);
 
--- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -153,12 +153,6 @@
     __ movptr(saved_rsi, rsi);
     __ movptr(saved_rbx, rbx);
 
-    // provide initial value for required masks
-    if (UseAVX > 2) {
-      __ movl(rbx, 0xffff);
-      __ kmovwl(k1, rbx);
-    }
-
     // save and initialize %mxcsr
     if (sse_save) {
       Label skip_ldmx;
@@ -679,12 +673,7 @@
   void xmm_copy_forward(Register from, Register to_from, Register qword_count) {
     assert( UseSSE >= 2, "supported cpu only" );
     Label L_copy_64_bytes_loop, L_copy_64_bytes, L_copy_8_bytes, L_exit;
-    if (UseAVX > 2) {
-      __ push(rbx);
-      __ movl(rbx, 0xffff);
-      __ kmovwl(k1, rbx);
-      __ pop(rbx);
-    }
+
     // Copy 64-byte chunks
     __ jmpb(L_copy_64_bytes);
     __ align(OptoLoopAlignment);
@@ -2115,14 +2104,6 @@
 
     __ enter();   // required for proper stackwalking of RuntimeStub frame
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rdx, 0xffff);
-      __ kmovdl(k1, rdx);
-    }
-
     __ movptr(from, from_param);
     __ movptr(key, key_param);
 
@@ -2222,14 +2203,6 @@
 
     __ enter(); // required for proper stackwalking of RuntimeStub frame
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rdx, 0xffff);
-      __ kmovdl(k1, rdx);
-    }
-
     __ movptr(from, from_param);
     __ movptr(key, key_param);
 
@@ -2356,14 +2329,6 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     handleSOERegisters(true /*saving*/);
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rdx, 0xffff);
-      __ kmovdl(k1, rdx);
-    }
-
     // load registers from incoming parameters
     const Address  from_param(rbp, 8+0);
     const Address  to_param  (rbp, 8+4);
@@ -2532,14 +2497,6 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     handleSOERegisters(true /*saving*/);
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rdx, 0xffff);
-      __ kmovdl(k1, rdx);
-    }
-
     // load registers from incoming parameters
     const Address  from_param(rbp, 8+0);
     const Address  to_param  (rbp, 8+4);
@@ -2693,14 +2650,6 @@
     __ enter(); // required for proper stackwalking of RuntimeStub frame
     handleSOERegisters(true /*saving*/); // save rbx, rsi, rdi
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rdx, 0xffff);
-      __ kmovdl(k1, rdx);
-    }
-
     // load registers from incoming parameters
     const Address  from_param(rbp, 8+0);
     const Address  to_param  (rbp, 8+4);
@@ -3154,14 +3103,6 @@
     __ enter();
     handleSOERegisters(true);  // Save registers
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rdx, 0xffff);
-      __ kmovdl(k1, rdx);
-    }
-
     __ movptr(state, state_param);
     __ movptr(subkeyH, subkeyH_param);
     __ movptr(data, data_param);
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -254,10 +254,7 @@
     __ movptr(r13_save, r13);
     __ movptr(r14_save, r14);
     __ movptr(r15_save, r15);
-    if (UseAVX > 2) {
-      __ movl(rbx, 0xffff);
-      __ kmovwl(k1, rbx);
-    }
+
 #ifdef _WIN64
     int last_reg = 15;
     if (UseAVX > 2) {
@@ -610,7 +607,7 @@
     address start = __ pc();
 
     __ movl(rax, c_rarg2);
-   if ( os::is_MP() ) __ lock();
+    __ lock();
     __ cmpxchgl(c_rarg0, Address(c_rarg1, 0));
     __ ret(0);
 
@@ -636,7 +633,7 @@
     address start = __ pc();
 
     __ movsbq(rax, c_rarg2);
-   if ( os::is_MP() ) __ lock();
+    __ lock();
     __ cmpxchgb(c_rarg0, Address(c_rarg1, 0));
     __ ret(0);
 
@@ -662,7 +659,7 @@
     address start = __ pc();
 
     __ movq(rax, c_rarg2);
-   if ( os::is_MP() ) __ lock();
+    __ lock();
     __ cmpxchgq(c_rarg0, Address(c_rarg1, 0));
     __ ret(0);
 
@@ -683,7 +680,7 @@
     address start = __ pc();
 
     __ movl(rax, c_rarg0);
-   if ( os::is_MP() ) __ lock();
+    __ lock();
     __ xaddl(Address(c_rarg1, 0), c_rarg0);
     __ addl(rax, c_rarg0);
     __ ret(0);
@@ -705,7 +702,7 @@
     address start = __ pc();
 
     __ movptr(rax, c_rarg0); // Copy to eax we need a return value anyhow
-   if ( os::is_MP() ) __ lock();
+    __ lock();
     __ xaddptr(Address(c_rarg1, 0), c_rarg0);
     __ addptr(rax, c_rarg0);
     __ ret(0);
@@ -1257,10 +1254,6 @@
     __ align(OptoLoopAlignment);
     if (UseUnalignedLoadStores) {
       Label L_end;
-      if (UseAVX > 2) {
-        __ movl(to, 0xffff);
-        __ kmovwl(k1, to);
-      }
       // Copy 64-bytes per iteration
       __ BIND(L_loop);
       if (UseAVX > 2) {
@@ -1341,10 +1334,6 @@
     __ align(OptoLoopAlignment);
     if (UseUnalignedLoadStores) {
       Label L_end;
-      if (UseAVX > 2) {
-        __ movl(to, 0xffff);
-        __ kmovwl(k1, to);
-      }
       // Copy 64-bytes per iteration
       __ BIND(L_loop);
       if (UseAVX > 2) {
@@ -3005,14 +2994,6 @@
 
     __ enter(); // required for proper stackwalking of RuntimeStub frame
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rax, 0xffff);
-      __ kmovql(k1, rax);
-    }
-
     // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
     __ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
 
@@ -3107,14 +3088,6 @@
 
     __ enter(); // required for proper stackwalking of RuntimeStub frame
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rax, 0xffff);
-      __ kmovql(k1, rax);
-    }
-
     // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
     __ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
 
@@ -3227,14 +3200,6 @@
 
     __ enter(); // required for proper stackwalking of RuntimeStub frame
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rax, 0xffff);
-      __ kmovql(k1, rax);
-    }
-
 #ifdef _WIN64
     // on win64, fill len_reg from stack position
     __ movl(len_reg, len_mem);
@@ -3428,14 +3393,6 @@
 
     __ enter(); // required for proper stackwalking of RuntimeStub frame
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rax, 0xffff);
-      __ kmovql(k1, rax);
-    }
-
 #ifdef _WIN64
     // on win64, fill len_reg from stack position
     __ movl(len_reg, len_mem);
@@ -3902,14 +3859,6 @@
 
     __ enter(); // required for proper stackwalking of RuntimeStub frame
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-        __ movl(rax, 0xffff);
-        __ kmovql(k1, rax);
-    }
-
 #ifdef _WIN64
     // allocate spill slots for r13, r14
     enum {
@@ -4484,14 +4433,6 @@
 
     __ enter();
 
-    // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge
-    // context for the registers used, where all instructions below are using 128-bit mode
-    // On EVEX without VL and BW, these instructions will all be AVX.
-    if (VM_Version::supports_avx512vlbw()) {
-      __ movl(rax, 0xffff);
-      __ kmovql(k1, rax);
-    }
-
     __ movdqu(xmm_temp10, ExternalAddress(StubRoutines::x86::ghash_long_swap_mask_addr()));
 
     __ movdqu(xmm_temp0, Address(state, 0));
@@ -4761,7 +4702,6 @@
     __ push(r13);
     __ push(r14);
     __ push(r15);
-    __ push(rbx);
 
     // arguments
     const Register source = c_rarg0; // Source Array
@@ -4790,8 +4730,6 @@
     __ cmpl(length, 0);
     __ jcc(Assembler::lessEqual, L_exit);
 
-    // Save k1 value in rbx
-    __ kmovql(rbx, k1);
     __ lea(r11, ExternalAddress(StubRoutines::x86::base64_charset_addr()));
     // check if base64 charset(isURL=0) or base64 url charset(isURL=1) needs to be loaded
     __ cmpl(isURL, 0);
@@ -4802,7 +4740,7 @@
     __ BIND(L_processdata);
     __ movdqu(xmm16, ExternalAddress(StubRoutines::x86::base64_gather_mask_addr()));
     // Set 64 bits of K register.
-    __ evpcmpeqb(k1, xmm16, xmm16, Assembler::AVX_512bit);
+    __ evpcmpeqb(k3, xmm16, xmm16, Assembler::AVX_512bit);
     __ evmovdquq(xmm12, ExternalAddress(StubRoutines::x86::base64_bswap_mask_addr()), Assembler::AVX_256bit, r13);
     __ evmovdquq(xmm13, ExternalAddress(StubRoutines::x86::base64_right_shift_mask_addr()), Assembler::AVX_512bit, r13);
     __ evmovdquq(xmm14, ExternalAddress(StubRoutines::x86::base64_left_shift_mask_addr()), Assembler::AVX_512bit, r13);
@@ -4881,17 +4819,17 @@
     __ vextracti64x4(xmm4, xmm5, 1);
     __ vpmovzxwd(xmm7, xmm4, Assembler::AVX_512bit);
 
-    __ kmovql(k2, k1);
+    __ kmovql(k2, k3);
     __ evpgatherdd(xmm4, k2, Address(r11, xmm0, Address::times_4, 0), Assembler::AVX_512bit);
-    __ kmovql(k2, k1);
+    __ kmovql(k2, k3);
     __ evpgatherdd(xmm5, k2, Address(r11, xmm1, Address::times_4, 0), Assembler::AVX_512bit);
-    __ kmovql(k2, k1);
+    __ kmovql(k2, k3);
     __ evpgatherdd(xmm8, k2, Address(r11, xmm2, Address::times_4, 0), Assembler::AVX_512bit);
-    __ kmovql(k2, k1);
+    __ kmovql(k2, k3);
     __ evpgatherdd(xmm9, k2, Address(r11, xmm3, Address::times_4, 0), Assembler::AVX_512bit);
-    __ kmovql(k2, k1);
+    __ kmovql(k2, k3);
     __ evpgatherdd(xmm10, k2, Address(r11, xmm6, Address::times_4, 0), Assembler::AVX_512bit);
-    __ kmovql(k2, k1);
+    __ kmovql(k2, k3);
     __ evpgatherdd(xmm11, k2, Address(r11, xmm7, Address::times_4, 0), Assembler::AVX_512bit);
 
     //Down convert dword to byte. Final output is 16*6 = 96 bytes long
@@ -4927,9 +4865,9 @@
     __ vpmovzxwd(xmm6, xmm9, Assembler::AVX_512bit);
     __ vextracti64x4(xmm9, xmm1, 1);
     __ vpmovzxwd(xmm5, xmm9,  Assembler::AVX_512bit);
-    __ kmovql(k2, k1);
+    __ kmovql(k2, k3);
     __ evpgatherdd(xmm8, k2, Address(r11, xmm6, Address::times_4, 0), Assembler::AVX_512bit);
-    __ kmovql(k2, k1);
+    __ kmovql(k2, k3);
     __ evpgatherdd(xmm10, k2, Address(r11, xmm5, Address::times_4, 0), Assembler::AVX_512bit);
     __ evpmovdb(Address(dest, dp, Address::times_1, 0), xmm8, Assembler::AVX_512bit);
     __ evpmovdb(Address(dest, dp, Address::times_1, 16), xmm10, Assembler::AVX_512bit);
@@ -4985,9 +4923,6 @@
     __ addq(source, 3);
     __ jmp(L_process3);
     __ BIND(L_exit);
-    // restore k1 register value
-    __ kmovql(k1, rbx);
-    __ pop(rbx);
     __ pop(r15);
     __ pop(r14);
     __ pop(r13);
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1090,19 +1090,17 @@
   __ movl(Address(thread, JavaThread::thread_state_offset()),
           _thread_in_native_trans);
 
-  if (os::is_MP()) {
-    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);
-    }
+  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);
   }
 
 #ifndef _LP64
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -448,7 +448,7 @@
     Label notNull;
     ExternalAddress null_sentinel((address)Universe::the_null_sentinel_addr());
     __ movptr(tmp, null_sentinel);
-    __ cmpptr(tmp, result);
+    __ cmpoop(tmp, result);
     __ jccb(Assembler::notEqual, notNull);
     __ xorptr(result, result);  // NULL object reference
     __ bind(notNull);
@@ -2714,7 +2714,6 @@
 
 void TemplateTable::volatile_barrier(Assembler::Membar_mask_bits order_constraint ) {
   // Helper function to insert a is-volatile test and memory barrier
-  if(!os::is_MP()) return;    // Not needed on single CPU
   __ membar(order_constraint);
 }
 
@@ -3493,13 +3492,12 @@
   __ get_cache_and_index_at_bcp(rcx, rbx, 1);
   // replace index with field offset from cache entry
   // [jk] not needed currently
-  // if (os::is_MP()) {
-  //   __ movl(rdx, Address(rcx, rbx, Address::times_8,
-  //                        in_bytes(ConstantPoolCache::base_offset() +
-  //                                 ConstantPoolCacheEntry::flags_offset())));
-  //   __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
-  //   __ andl(rdx, 0x1);
-  // }
+  // __ movl(rdx, Address(rcx, rbx, Address::times_8,
+  //                      in_bytes(ConstantPoolCache::base_offset() +
+  //                               ConstantPoolCacheEntry::flags_offset())));
+  // __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
+  // __ andl(rdx, 0x1);
+  //
   __ movptr(rbx, Address(rcx, rbx, Address::times_ptr,
                          in_bytes(ConstantPoolCache::base_offset() +
                                   ConstantPoolCacheEntry::f2_offset())));
@@ -3544,13 +3542,11 @@
     ShouldNotReachHere();
   }
   // [jk] not needed currently
-  // if (os::is_MP()) {
   //   Label notVolatile;
   //   __ testl(rdx, rdx);
   //   __ jcc(Assembler::zero, notVolatile);
   //   __ membar(Assembler::LoadLoad);
   //   __ bind(notVolatile);
-  //};
 }
 
 void TemplateTable::fast_xaccess(TosState state) {
@@ -3585,17 +3581,15 @@
   }
 
   // [jk] not needed currently
-  // if (os::is_MP()) {
-  //   Label notVolatile;
-  //   __ movl(rdx, Address(rcx, rdx, Address::times_8,
-  //                        in_bytes(ConstantPoolCache::base_offset() +
-  //                                 ConstantPoolCacheEntry::flags_offset())));
-  //   __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
-  //   __ testl(rdx, 0x1);
-  //   __ jcc(Assembler::zero, notVolatile);
-  //   __ membar(Assembler::LoadLoad);
-  //   __ bind(notVolatile);
-  // }
+  // Label notVolatile;
+  // __ movl(rdx, Address(rcx, rdx, Address::times_8,
+  //                      in_bytes(ConstantPoolCache::base_offset() +
+  //                               ConstantPoolCacheEntry::flags_offset())));
+  // __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
+  // __ testl(rdx, 0x1);
+  // __ jcc(Assembler::zero, notVolatile);
+  // __ membar(Assembler::LoadLoad);
+  // __ bind(notVolatile);
 
   __ decrement(rbcp);
 }
--- a/src/hotspot/cpu/x86/vm_version_x86.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/vm_version_x86.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -401,8 +401,6 @@
       // load value into all 64 bytes of zmm7 register
       __ movl(rcx, VM_Version::ymm_test_value());
       __ movdl(xmm0, rcx);
-      __ movl(rcx, 0xffff);
-      __ kmovwl(k1, rcx);
       __ vpbroadcastd(xmm0, xmm0, Assembler::AVX_512bit);
       __ evmovdqul(xmm7, xmm0, Assembler::AVX_512bit);
 #ifdef _LP64
--- a/src/hotspot/cpu/x86/vm_version_x86.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/vm_version_x86.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -608,10 +608,10 @@
 
   static bool os_supports_avx_vectors() {
     bool retVal = false;
+    int nreg = 2 LP64_ONLY(+2);
     if (supports_evex()) {
       // Verify that OS save/restore all bits of EVEX registers
       // during signal processing.
-      int nreg = 2 LP64_ONLY(+2);
       retVal = true;
       for (int i = 0; i < 16 * nreg; i++) { // 64 bytes per zmm register
         if (_cpuid_info.zmm_save[i] != ymm_test_value()) {
@@ -622,7 +622,6 @@
     } else if (supports_avx()) {
       // Verify that OS save/restore all bits of AVX registers
       // during signal processing.
-      int nreg = 2 LP64_ONLY(+2);
       retVal = true;
       for (int i = 0; i < 8 * nreg; i++) { // 32 bytes per ymm register
         if (_cpuid_info.ymm_save[i] != ymm_test_value()) {
@@ -634,7 +633,6 @@
       if (retVal == false) {
         // Verify that OS save/restore all bits of EVEX registers
         // during signal processing.
-        int nreg = 2 LP64_ONLY(+2);
         retVal = true;
         for (int i = 0; i < 16 * nreg; i++) { // 64 bytes per zmm register
           if (_cpuid_info.zmm_save[i] != ymm_test_value()) {
--- a/src/hotspot/cpu/x86/x86.ad	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/x86.ad	Fri Oct 05 11:10:27 2018 -0400
@@ -2804,11 +2804,7 @@
 
   format %{
     $$template
-    if (os::is_MP()) {
-      $$emit$$"pause\t! membar_onspinwait"
-    } else {
-      $$emit$$"MEMBAR-onspinwait ! (empty encoding)"
-    }
+    $$emit$$"pause\t! membar_onspinwait"
   %}
   ins_encode %{
     __ pause();
--- a/src/hotspot/cpu/x86/x86_32.ad	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/x86_32.ad	Fri Oct 05 11:10:27 2018 -0400
@@ -2087,8 +2087,7 @@
   %}
 
   enc_class lock_prefix( ) %{
-    if( os::is_MP() )
-      emit_opcode(cbuf,0xF0);         // [Lock]
+    emit_opcode(cbuf,0xF0);         // [Lock]
   %}
 
   // Cmp-xchg long value.
@@ -2102,8 +2101,7 @@
     emit_opcode(cbuf,0x87);
     emit_opcode(cbuf,0xD9);
     // [Lock]
-    if( os::is_MP() )
-      emit_opcode(cbuf,0xF0);
+    emit_opcode(cbuf,0xF0);
     // CMPXCHG8 [Eptr]
     emit_opcode(cbuf,0x0F);
     emit_opcode(cbuf,0xC7);
@@ -2115,8 +2113,7 @@
 
   enc_class enc_cmpxchg(eSIRegP mem_ptr) %{
     // [Lock]
-    if( os::is_MP() )
-      emit_opcode(cbuf,0xF0);
+    emit_opcode(cbuf,0xF0);
 
     // CMPXCHG [Eptr]
     emit_opcode(cbuf,0x0F);
@@ -2126,8 +2123,7 @@
 
   enc_class enc_cmpxchgb(eSIRegP mem_ptr) %{
     // [Lock]
-    if( os::is_MP() )
-      emit_opcode(cbuf,0xF0);
+    emit_opcode(cbuf,0xF0);
 
     // CMPXCHGB [Eptr]
     emit_opcode(cbuf,0x0F);
@@ -2137,8 +2133,7 @@
 
   enc_class enc_cmpxchgw(eSIRegP mem_ptr) %{
     // [Lock]
-    if( os::is_MP() )
-      emit_opcode(cbuf,0xF0);
+    emit_opcode(cbuf,0xF0);
 
     // 16-bit mode
     emit_opcode(cbuf, 0x66);
@@ -6764,11 +6759,7 @@
 
   format %{
     $$template
-    if (os::is_MP()) {
-      $$emit$$"LOCK ADDL [ESP + #0], 0\t! membar_volatile"
-    } else {
-      $$emit$$"MEMBAR-volatile ! (empty encoding)"
-    }
+    $$emit$$"LOCK ADDL [ESP + #0], 0\t! membar_volatile"
   %}
   ins_encode %{
     __ membar(Assembler::StoreLoad);
@@ -7373,8 +7364,7 @@
     //       rcx as the high order word of the new value to store but
     //       our register encoding uses rbx.
     __ xchgl(as_Register(EBX_enc), as_Register(ECX_enc));
-    if( os::is_MP() )
-      __ lock();
+    __ lock();
     __ cmpxchg8($mem$$Address);
     __ xchgl(as_Register(EBX_enc), as_Register(ECX_enc));
   %}
@@ -7499,7 +7489,7 @@
   effect(KILL cr);
   format %{ "ADDB  [$mem],$add" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ addb($mem$$Address, $add$$constant);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7511,7 +7501,7 @@
   effect(KILL cr);
   format %{ "XADDB  [$mem],$newval" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ xaddb($mem$$Address, $newval$$Register);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7523,7 +7513,7 @@
   effect(KILL cr);
   format %{ "ADDS  [$mem],$add" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ addw($mem$$Address, $add$$constant);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7534,7 +7524,7 @@
   effect(KILL cr);
   format %{ "XADDS  [$mem],$newval" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ xaddw($mem$$Address, $newval$$Register);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7546,7 +7536,7 @@
   effect(KILL cr);
   format %{ "ADDL  [$mem],$add" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ addl($mem$$Address, $add$$constant);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7557,7 +7547,7 @@
   effect(KILL cr);
   format %{ "XADDL  [$mem],$newval" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ xaddl($mem$$Address, $newval$$Register);
   %}
   ins_pipe( pipe_cmpxchg );
--- a/src/hotspot/cpu/x86/x86_64.ad	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/cpu/x86/x86_64.ad	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -2341,9 +2341,7 @@
 
   enc_class lock_prefix()
   %{
-    if (os::is_MP()) {
-      emit_opcode(cbuf, 0xF0); // lock
-    }
+    emit_opcode(cbuf, 0xF0); // lock
   %}
 
   enc_class REX_mem(memory mem)
@@ -6601,11 +6599,7 @@
 
   format %{
     $$template
-    if (os::is_MP()) {
-      $$emit$$"lock addl [rsp + #0], 0\t! membar_volatile"
-    } else {
-      $$emit$$"MEMBAR-volatile ! (empty encoding)"
-    }
+    $$emit$$"lock addl [rsp + #0], 0\t! membar_volatile"
   %}
   ins_encode %{
     __ membar(Assembler::StoreLoad);
@@ -7801,7 +7795,7 @@
   effect(KILL cr);
   format %{ "ADDB  [$mem],$add" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ addb($mem$$Address, $add$$constant);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7812,7 +7806,7 @@
   effect(KILL cr);
   format %{ "XADDB  [$mem],$newval" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ xaddb($mem$$Address, $newval$$Register);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7824,7 +7818,7 @@
   effect(KILL cr);
   format %{ "ADDW  [$mem],$add" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ addw($mem$$Address, $add$$constant);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7835,7 +7829,7 @@
   effect(KILL cr);
   format %{ "XADDW  [$mem],$newval" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ xaddw($mem$$Address, $newval$$Register);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7847,7 +7841,7 @@
   effect(KILL cr);
   format %{ "ADDL  [$mem],$add" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ addl($mem$$Address, $add$$constant);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7858,7 +7852,7 @@
   effect(KILL cr);
   format %{ "XADDL  [$mem],$newval" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ xaddl($mem$$Address, $newval$$Register);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7870,7 +7864,7 @@
   effect(KILL cr);
   format %{ "ADDQ  [$mem],$add" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ addq($mem$$Address, $add$$constant);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -7881,7 +7875,7 @@
   effect(KILL cr);
   format %{ "XADDQ  [$mem],$newval" %}
   ins_encode %{
-    if (os::is_MP()) { __ lock(); }
+    __ lock();
     __ xaddq($mem$$Address, $newval$$Register);
   %}
   ins_pipe( pipe_cmpxchg );
@@ -10898,7 +10892,7 @@
   ins_pipe(pipe_slow);
 %}
 
-instruct rep_stos_large(rcx_RegL cnt, rdi_RegP base, regD tmp, rax_RegI zero, 
+instruct rep_stos_large(rcx_RegL cnt, rdi_RegP base, regD tmp, rax_RegI zero,
                         Universe dummy, rFlagsReg cr)
 %{
   predicate(((ClearArrayNode*)n)->is_large());
@@ -10942,7 +10936,7 @@
     }
   %}
   ins_encode %{
-    __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register, 
+    __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register,
                  $tmp$$XMMRegister, true);
   %}
   ins_pipe(pipe_slow);
--- a/src/hotspot/os/linux/os_linux.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/os/linux/os_linux.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -137,7 +137,6 @@
 address   os::Linux::_initial_thread_stack_bottom = NULL;
 uintptr_t os::Linux::_initial_thread_stack_size   = 0;
 
-int (*os::Linux::_clock_gettime)(clockid_t, struct timespec *) = NULL;
 int (*os::Linux::_pthread_getcpuclockid)(pthread_t, clockid_t *) = NULL;
 int (*os::Linux::_pthread_setname_np)(pthread_t, const char*) = NULL;
 Mutex* os::Linux::_createThread_lock = NULL;
@@ -268,8 +267,7 @@
 
 // Most versions of linux have a bug where the number of processors are
 // determined by looking at the /proc file system.  In a chroot environment,
-// the system call returns 1.  This causes the VM to act as if it is
-// a single processor and elide locking (see is_MP() call).
+// the system call returns 1.
 static bool unsafe_chroot_detected = false;
 static const char *unstable_chroot_error = "/proc file system not found.\n"
                      "Java may be unstable running multithreaded in a chroot "
@@ -1173,6 +1171,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 // time support
 
+#ifndef SUPPORTS_CLOCK_MONOTONIC
+#error "Build platform doesn't support clock_gettime and related functionality"
+#endif
+
 // Time since start-up in seconds to a fine granularity.
 // Used by VMSelfDestructTimer and the MemProfiler.
 double os::elapsedTime() {
@@ -1218,62 +1220,6 @@
   nanos = jlong(time.tv_usec) * 1000;
 }
 
-
-#ifndef CLOCK_MONOTONIC
-  #define CLOCK_MONOTONIC (1)
-#endif
-
-void os::Linux::clock_init() {
-  // we do dlopen's in this particular order due to bug in linux
-  // dynamical loader (see 6348968) leading to crash on exit
-  void* handle = dlopen("librt.so.1", RTLD_LAZY);
-  if (handle == NULL) {
-    handle = dlopen("librt.so", RTLD_LAZY);
-  }
-
-  if (handle) {
-    int (*clock_getres_func)(clockid_t, struct timespec*) =
-           (int(*)(clockid_t, struct timespec*))dlsym(handle, "clock_getres");
-    int (*clock_gettime_func)(clockid_t, struct timespec*) =
-           (int(*)(clockid_t, struct timespec*))dlsym(handle, "clock_gettime");
-    if (clock_getres_func && clock_gettime_func) {
-      // See if monotonic clock is supported by the kernel. Note that some
-      // early implementations simply return kernel jiffies (updated every
-      // 1/100 or 1/1000 second). It would be bad to use such a low res clock
-      // for nano time (though the monotonic property is still nice to have).
-      // It's fixed in newer kernels, however clock_getres() still returns
-      // 1/HZ. We check if clock_getres() works, but will ignore its reported
-      // resolution for now. Hopefully as people move to new kernels, this
-      // won't be a problem.
-      struct timespec res;
-      struct timespec tp;
-      if (clock_getres_func (CLOCK_MONOTONIC, &res) == 0 &&
-          clock_gettime_func(CLOCK_MONOTONIC, &tp)  == 0) {
-        // yes, monotonic clock is supported
-        _clock_gettime = clock_gettime_func;
-        return;
-      } else {
-        // close librt if there is no monotonic clock
-        dlclose(handle);
-      }
-    }
-  }
-  warning("No monotonic clock was available - timed services may " \
-          "be adversely affected if the time-of-day clock changes");
-}
-
-#ifndef SYS_clock_getres
-  #if defined(X86) || defined(PPC64) || defined(S390)
-    #define SYS_clock_getres AMD64_ONLY(229) IA32_ONLY(266) PPC64_ONLY(247) S390_ONLY(261)
-    #define sys_clock_getres(x,y)  ::syscall(SYS_clock_getres, x, y)
-  #else
-    #warning "SYS_clock_getres not defined for this platform, disabling fast_thread_cpu_time"
-    #define sys_clock_getres(x,y)  -1
-  #endif
-#else
-  #define sys_clock_getres(x,y)  ::syscall(SYS_clock_getres, x, y)
-#endif
-
 void os::Linux::fast_thread_clock_init() {
   if (!UseLinuxPosixThreadCPUClocks) {
     return;
@@ -1284,17 +1230,17 @@
       (int(*)(pthread_t, clockid_t *)) dlsym(RTLD_DEFAULT, "pthread_getcpuclockid");
 
   // Switch to using fast clocks for thread cpu time if
-  // the sys_clock_getres() returns 0 error code.
+  // the clock_getres() returns 0 error code.
   // Note, that some kernels may support the current thread
   // clock (CLOCK_THREAD_CPUTIME_ID) but not the clocks
   // returned by the pthread_getcpuclockid().
-  // If the fast Posix clocks are supported then the sys_clock_getres()
+  // If the fast Posix clocks are supported then the clock_getres()
   // must return at least tp.tv_sec == 0 which means a resolution
   // better than 1 sec. This is extra check for reliability.
 
   if (pthread_getcpuclockid_func &&
       pthread_getcpuclockid_func(_main_thread, &clockid) == 0 &&
-      sys_clock_getres(clockid, &tp) == 0 && tp.tv_sec == 0) {
+      os::Posix::clock_getres(clockid, &tp) == 0 && tp.tv_sec == 0) {
     _supports_fast_thread_cpu_time = true;
     _pthread_getcpuclockid = pthread_getcpuclockid_func;
   }
@@ -1303,7 +1249,7 @@
 jlong os::javaTimeNanos() {
   if (os::supports_monotonic_clock()) {
     struct timespec tp;
-    int status = Linux::clock_gettime(CLOCK_MONOTONIC, &tp);
+    int status = os::Posix::clock_gettime(CLOCK_MONOTONIC, &tp);
     assert(status == 0, "gettime error");
     jlong result = jlong(tp.tv_sec) * (1000 * 1000 * 1000) + jlong(tp.tv_nsec);
     return result;
@@ -1622,9 +1568,6 @@
         // This is OK - No Java threads have been created yet, and hence no
         // stack guard pages to fix.
         //
-        // This should happen only when you are building JDK7 using a very
-        // old version of JDK6 (e.g., with JPRT) and running test_gamma.
-        //
         // Dynamic loader will make all stacks executable after
         // this function returns, and will not do that again.
         assert(Threads::number_of_threads() == 0, "no Java threads should exist yet.");
@@ -2482,7 +2425,7 @@
 static struct timespec create_semaphore_timespec(unsigned int sec, int nsec) {
   struct timespec ts;
   // Semaphore's are always associated with CLOCK_REALTIME
-  os::Linux::clock_gettime(CLOCK_REALTIME, &ts);
+  os::Posix::clock_gettime(CLOCK_REALTIME, &ts);
   // see os_posix.cpp for discussion on overflow checking
   if (sec >= MAX_SECS) {
     ts.tv_sec += MAX_SECS;
@@ -4715,7 +4658,7 @@
 
 jlong os::Linux::fast_thread_cpu_time(clockid_t clockid) {
   struct timespec tp;
-  int rc = os::Linux::clock_gettime(clockid, &tp);
+  int rc = os::Posix::clock_gettime(clockid, &tp);
   assert(rc == 0, "clock_gettime is expected to return 0 code");
 
   return (tp.tv_sec * NANOSECS_PER_SEC) + tp.tv_nsec;
@@ -4987,14 +4930,19 @@
   // _main_thread points to the thread that created/loaded the JVM.
   Linux::_main_thread = pthread_self();
 
-  Linux::clock_init();
-  initial_time_count = javaTimeNanos();
-
   // retrieve entry point for pthread_setname_np
   Linux::_pthread_setname_np =
     (int(*)(pthread_t, const char*))dlsym(RTLD_DEFAULT, "pthread_setname_np");
 
   os::Posix::init();
+
+  initial_time_count = javaTimeNanos();
+
+  // Always warn if no monotonic clock available
+  if (!os::Posix::supports_monotonic_clock()) {
+    warning("No monotonic clock was available - timed services may "    \
+            "be adversely affected if the time-of-day clock changes");
+  }
 }
 
 // To install functions for atexit system call
--- a/src/hotspot/os/linux/os_linux.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/os/linux/os_linux.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -43,7 +43,6 @@
 
   static void check_signal_handler(int sig);
 
-  static int (*_clock_gettime)(clockid_t, struct timespec *);
   static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *);
   static int (*_pthread_setname_np)(pthread_t, const char*);
 
@@ -190,16 +189,9 @@
   static bool manually_expand_stack(JavaThread * t, address addr);
   static int max_register_window_saves_before_flushing();
 
-  // Real-time clock functions
-  static void clock_init(void);
-
   // fast POSIX clocks support
   static void fast_thread_clock_init(void);
 
-  static int clock_gettime(clockid_t clock_id, struct timespec *tp) {
-    return _clock_gettime ? _clock_gettime(clock_id, tp) : -1;
-  }
-
   static int pthread_getcpuclockid(pthread_t tid, clockid_t *clock_id) {
     return _pthread_getcpuclockid ? _pthread_getcpuclockid(tid, clock_id) : -1;
   }
--- a/src/hotspot/os/linux/os_linux.inline.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/os/linux/os_linux.inline.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -141,7 +141,7 @@
 }
 
 inline bool os::supports_monotonic_clock() {
-  return Linux::_clock_gettime != NULL;
+  return os::Posix::supports_monotonic_clock();
 }
 
 inline void os::exit(int num) {
--- a/src/hotspot/os/posix/os_posix.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/os/posix/os_posix.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1609,10 +1609,25 @@
 // This means we have clockid_t, clock_gettime et al and CLOCK_MONOTONIC
 
 static int (*_clock_gettime)(clockid_t, struct timespec *);
+static int (*_clock_getres)(clockid_t, struct timespec *);
 static int (*_pthread_condattr_setclock)(pthread_condattr_t *, clockid_t);
 
 static bool _use_clock_monotonic_condattr;
 
+// Exported clock functionality
+
+int os::Posix::clock_gettime(clockid_t clock_id, struct timespec *tp) {
+  return _clock_gettime != NULL ? _clock_gettime(clock_id, tp) : -1;
+}
+
+int os::Posix::clock_getres(clockid_t clock_id, struct timespec *tp) {
+  return _clock_getres != NULL ? _clock_getres(clock_id, tp) : -1;
+}
+
+bool os::Posix::supports_monotonic_clock() {
+  return _clock_gettime != NULL;
+}
+
 // Determine what POSIX API's are present and do appropriate
 // configuration.
 void os::Posix::init(void) {
@@ -1620,8 +1635,6 @@
   // NOTE: no logging available when this is called. Put logging
   // statements in init_2().
 
-  // Copied from os::Linux::clock_init(). The duplication is temporary.
-
   // 1. Check for CLOCK_MONOTONIC support.
 
   void* handle = NULL;
@@ -1642,6 +1655,7 @@
   }
 
   _clock_gettime = NULL;
+  _clock_getres = NULL;
 
   int (*clock_getres_func)(clockid_t, struct timespec*) =
     (int(*)(clockid_t, struct timespec*))dlsym(handle, "clock_getres");
@@ -1656,6 +1670,7 @@
         clock_gettime_func(CLOCK_MONOTONIC, &tp) == 0) {
       // Yes, monotonic clock is supported.
       _clock_gettime = clock_gettime_func;
+      _clock_getres = clock_getres_func;
     } else {
 #ifdef NEEDS_LIBRT
       // Close librt if there is no monotonic clock.
--- a/src/hotspot/os/posix/os_posix.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/os/posix/os_posix.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -116,6 +116,18 @@
   // Returns true if either given uid is effective uid and given gid is
   // effective gid, or if given uid is root.
   static bool matches_effective_uid_and_gid_or_root(uid_t uid, gid_t gid);
+
+#ifdef SUPPORTS_CLOCK_MONOTONIC
+
+  static bool supports_monotonic_clock();
+  static int clock_gettime(clockid_t clock_id, struct timespec *tp);
+  static int clock_getres(clockid_t clock_id, struct timespec *tp);
+
+#else
+
+  static bool supports_monotonic_clock() { return false; }
+
+#endif
 };
 
 // On POSIX platforms the signal handler is global so we just do the write.
--- a/src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -136,7 +136,7 @@
 
 extern "C" {
   // defined in bsd_x86.s
-  int64_t _Atomic_cmpxchg_long(int64_t, volatile int64_t*, int64_t, bool);
+  int64_t _Atomic_cmpxchg_long(int64_t, volatile int64_t*, int64_t);
   void _Atomic_move_long(const volatile int64_t* src, volatile int64_t* dst);
 }
 
--- a/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s	Fri Oct 05 11:10:27 2018 -0400
@@ -635,8 +635,7 @@
 
         # Support for int64_t Atomic::cmpxchg(int64_t exchange_value,
         #                                     volatile int64_t* dest,
-        #                                     int64_t compare_value,
-        #                                     bool is_MP)
+        #                                     int64_t compare_value)
         #
         .p2align 4,,15
         ELF_TYPE(_Atomic_cmpxchg_long,@function)
@@ -649,10 +648,8 @@
         movl     24(%esp), %eax    # 24(%esp) : compare_value (low)
         movl     28(%esp), %edx    # 28(%esp) : compare_value (high)
         movl     20(%esp), %edi    # 20(%esp) : dest
-        cmpl     $0, 32(%esp)      # 32(%esp) : is_MP
-        je       1f
         lock
-1:      cmpxchg8b (%edi)
+        cmpxchg8b (%edi)
         popl     %edi
         popl     %ebx
         ret
--- a/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -50,17 +50,12 @@
 //
 // inline void _OrderAccess_dsb() {
 //    volatile intptr_t dummy = 0;
-//    if (os::is_MP()) {
-//      __asm__ volatile (
-//        "mcr p15, 0, %0, c7, c10, 4"
-//        : : "r" (dummy) : "memory");
-//    }
+//    __asm__ volatile (
+//      "mcr p15, 0, %0, c7, c10, 4"
+//      : : "r" (dummy) : "memory");
 // }
 
 inline static void dmb_sy() {
-   if (!os::is_MP()) {
-     return;
-   }
 #ifdef AARCH64
    __asm__ __volatile__ ("dmb sy" : : : "memory");
 #else
@@ -82,9 +77,6 @@
 }
 
 inline static void dmb_st() {
-   if (!os::is_MP()) {
-     return;
-   }
 #ifdef AARCH64
    __asm__ __volatile__ ("dmb st" : : : "memory");
 #else
@@ -108,9 +100,6 @@
 // Load-Load/Store barrier
 inline static void dmb_ld() {
 #ifdef AARCH64
-   if (!os::is_MP()) {
-     return;
-   }
    __asm__ __volatile__ ("dmb ld" : : : "memory");
 #else
    dmb_sy();
--- a/src/hotspot/share/c1/c1_CodeStubs.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/c1/c1_CodeStubs.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -394,11 +394,9 @@
       _id(id)
     , _info(NULL)
     , _index(index) {
-    if (os::is_MP()) {
-      // force alignment of patch sites on MP hardware so we
-      // can guarantee atomic writes to the patch site.
-      align_patch_site(masm);
-    }
+    // force alignment of patch sites so we
+    // can guarantee atomic writes to the patch site.
+    align_patch_site(masm);
     _pc_start = masm->pc();
     masm->bind(_patch_site_entry);
   }
--- a/src/hotspot/share/c1/c1_InstructionPrinter.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/c1/c1_InstructionPrinter.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -918,18 +918,16 @@
 }
 
 void InstructionPrinter::do_MemBar(MemBar* x) {
-  if (os::is_MP()) {
-    LIR_Code code = x->code();
-    switch (code) {
-      case lir_membar_acquire   : output()->print("membar_acquire"); break;
-      case lir_membar_release   : output()->print("membar_release"); break;
-      case lir_membar           : output()->print("membar"); break;
-      case lir_membar_loadload  : output()->print("membar_loadload"); break;
-      case lir_membar_storestore: output()->print("membar_storestore"); break;
-      case lir_membar_loadstore : output()->print("membar_loadstore"); break;
-      case lir_membar_storeload : output()->print("membar_storeload"); break;
-      default                   : ShouldNotReachHere(); break;
-    }
+  LIR_Code code = x->code();
+  switch (code) {
+  case lir_membar_acquire   : output()->print("membar_acquire"); break;
+  case lir_membar_release   : output()->print("membar_release"); break;
+  case lir_membar           : output()->print("membar"); break;
+  case lir_membar_loadload  : output()->print("membar_loadload"); break;
+  case lir_membar_storestore: output()->print("membar_storestore"); break;
+  case lir_membar_loadstore : output()->print("membar_loadstore"); break;
+  case lir_membar_storeload : output()->print("membar_storeload"); break;
+  default                   : ShouldNotReachHere(); break;
   }
 }
 
--- a/src/hotspot/share/c1/c1_LIRAssembler.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/c1/c1_LIRAssembler.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -446,10 +446,8 @@
 void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
   verify_oop_map(op->info());
 
-  if (os::is_MP()) {
-    // must align calls sites, otherwise they can't be updated atomically on MP hardware
-    align_call(op->code());
-  }
+  // must align calls sites, otherwise they can't be updated atomically
+  align_call(op->code());
 
   // emit the static call stub stuff out of line
   emit_static_call_stub();
--- a/src/hotspot/share/c1/c1_LIRGenerator.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -3068,13 +3068,13 @@
     break;
 
   case vmIntrinsics::_loadFence :
-    if (os::is_MP()) __ membar_acquire();
+    __ membar_acquire();
     break;
   case vmIntrinsics::_storeFence:
-    if (os::is_MP()) __ membar_release();
+    __ membar_release();
     break;
   case vmIntrinsics::_fullFence :
-    if (os::is_MP()) __ membar();
+    __ membar();
     break;
   case vmIntrinsics::_onSpinWait:
     __ on_spin_wait();
@@ -3623,18 +3623,16 @@
 }
 
 void LIRGenerator::do_MemBar(MemBar* x) {
-  if (os::is_MP()) {
-    LIR_Code code = x->code();
-    switch(code) {
-      case lir_membar_acquire   : __ membar_acquire(); break;
-      case lir_membar_release   : __ membar_release(); break;
-      case lir_membar           : __ membar(); break;
-      case lir_membar_loadload  : __ membar_loadload(); break;
-      case lir_membar_storestore: __ membar_storestore(); break;
-      case lir_membar_loadstore : __ membar_loadstore(); break;
-      case lir_membar_storeload : __ membar_storeload(); break;
-      default                   : ShouldNotReachHere(); break;
-    }
+  LIR_Code code = x->code();
+  switch(code) {
+  case lir_membar_acquire   : __ membar_acquire(); break;
+  case lir_membar_release   : __ membar_release(); break;
+  case lir_membar           : __ membar(); break;
+  case lir_membar_loadload  : __ membar_loadload(); break;
+  case lir_membar_storestore: __ membar_storestore(); break;
+  case lir_membar_loadstore : __ membar_loadstore(); break;
+  case lir_membar_storeload : __ membar_storeload(); break;
+  default                   : ShouldNotReachHere(); break;
   }
 }
 
--- a/src/hotspot/share/ci/ciEnv.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/ci/ciEnv.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -399,8 +399,8 @@
 
   // Now we need to check the SystemDictionary
   Symbol* sym = name->get_symbol();
-  if (sym->byte_at(0) == 'L' &&
-    sym->byte_at(sym->utf8_length()-1) == ';') {
+  if (sym->char_at(0) == 'L' &&
+    sym->char_at(sym->utf8_length()-1) == ';') {
     // This is a name from a signature.  Strip off the trimmings.
     // Call recursive to keep scope of strippedsym.
     TempNewSymbol strippedsym = SymbolTable::new_symbol(sym->as_utf8()+1,
@@ -427,7 +427,7 @@
 
   // setup up the proper type to return on OOM
   ciKlass* fail_type;
-  if (sym->byte_at(0) == '[') {
+  if (sym->char_at(0) == '[') {
     fail_type = _unloaded_ciobjarrayklass;
   } else {
     fail_type = _unloaded_ciinstance_klass;
@@ -453,8 +453,8 @@
   // we must build an array type around it.  The CI requires array klasses
   // to be loaded if their element klasses are loaded, except when memory
   // is exhausted.
-  if (sym->byte_at(0) == '[' &&
-      (sym->byte_at(1) == '[' || sym->byte_at(1) == 'L')) {
+  if (sym->char_at(0) == '[' &&
+      (sym->char_at(1) == '[' || sym->char_at(1) == 'L')) {
     // We have an unloaded array.
     // Build it on the fly if the element class exists.
     TempNewSymbol elem_sym = SymbolTable::new_symbol(sym->as_utf8()+1,
--- a/src/hotspot/share/ci/ciInstanceKlass.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/ci/ciInstanceKlass.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -116,7 +116,7 @@
                                  jobject loader, jobject protection_domain)
   : ciKlass(name, T_OBJECT)
 {
-  assert(name->byte_at(0) != '[', "not an instance klass");
+  assert(name->char_at(0) != '[', "not an instance klass");
   _init_state = (InstanceKlass::ClassState)0;
   _nonstatic_field_size = -1;
   _has_nonstatic_fields = false;
@@ -299,7 +299,7 @@
     return false;
 
   // Test for trailing '/'
-  if ((char) name()->byte_at(len) != '/')
+  if (name()->char_at(len) != '/')
     return false;
 
   // Make sure it's not actually in a subpackage:
--- a/src/hotspot/share/ci/ciObjArrayKlass.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/ci/ciObjArrayKlass.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -112,9 +112,9 @@
   Symbol* base_name_sym = element_name->get_symbol();
   char* name;
 
-  if (base_name_sym->byte_at(0) == '[' ||
-      (base_name_sym->byte_at(0) == 'L' &&  // watch package name 'Lxx'
-       base_name_sym->byte_at(element_len-1) == ';')) {
+  if (base_name_sym->char_at(0) == '[' ||
+      (base_name_sym->char_at(0) == 'L' &&  // watch package name 'Lxx'
+       base_name_sym->char_at(element_len-1) == ';')) {
 
     int new_len = element_len + dimension + 1; // for the ['s and '\0'
     name = CURRENT_THREAD_ENV->name_buffer(new_len);
--- a/src/hotspot/share/ci/ciObjectFactory.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/ci/ciObjectFactory.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -466,7 +466,7 @@
 
   // Two cases: this is an unloaded ObjArrayKlass or an
   // unloaded InstanceKlass.  Deal with both.
-  if (name->byte_at(0) == '[') {
+  if (name->char_at(0) == '[') {
     // Decompose the name.'
     FieldArrayInfo fd;
     BasicType element_type = FieldType::get_array_info(name->get_symbol(),
--- a/src/hotspot/share/ci/ciSymbol.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/ci/ciSymbol.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, 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
@@ -68,14 +68,14 @@
 
 // ------------------------------------------------------------------
 // ciSymbol::base
-const jbyte* ciSymbol::base() {
+const u1* ciSymbol::base() {
   GUARDED_VM_ENTRY(return get_symbol()->base();)
 }
 
 // ------------------------------------------------------------------
-// ciSymbol::byte_at
-int ciSymbol::byte_at(int i) {
-  GUARDED_VM_ENTRY(return get_symbol()->byte_at(i);)
+// ciSymbol::char_at
+char ciSymbol::char_at(int i) {
+  GUARDED_VM_ENTRY(return get_symbol()->char_at(i);)
 }
 
 // ------------------------------------------------------------------
--- a/src/hotspot/share/ci/ciSymbol.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/ci/ciSymbol.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, 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
@@ -61,7 +61,7 @@
   void print_impl(outputStream* st);
 
   // This is public in Symbol* but private here, because the base can move:
-  const jbyte* base();
+  const u1* base();
 
   // Make a ciSymbol from a C string (implementation).
   static ciSymbol* make_impl(const char* s);
@@ -77,8 +77,8 @@
   // The text of the symbol as ascii with all non-printable characters quoted as \u####
   const char* as_quoted_ascii();
 
-  // Return the i-th utf8 byte, where i < utf8_length
-  int         byte_at(int i);
+  // Return the i-th utf byte as a char, where i < utf8_length
+  char        char_at(int i);
 
   // Tests if the symbol starts with the given prefix.
   bool starts_with(const char* prefix, int len) const;
--- a/src/hotspot/share/classfile/classFileParser.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -655,7 +655,7 @@
             "Illegal zero length constant pool entry at %d in class %s",
             name_index, CHECK);
 
-          if (sig->byte_at(0) == JVM_SIGNATURE_FUNC) {
+          if (sig->char_at(0) == JVM_SIGNATURE_FUNC) {
             // Format check method name and signature
             verify_legal_method_name(name, CHECK);
             verify_legal_method_signature(name, sig, CHECK);
@@ -682,7 +682,7 @@
           // CONSTANT_Dynamic's name and signature are verified above, when iterating NameAndType_info.
           // Need only to be sure signature is non-zero length and the right type.
           if (signature->utf8_length() == 0 ||
-              signature->byte_at(0) == JVM_SIGNATURE_FUNC) {
+              signature->char_at(0) == JVM_SIGNATURE_FUNC) {
             throwIllegalSignature("CONSTANT_Dynamic", name, signature, CHECK);
           }
         }
@@ -707,7 +707,7 @@
             // Field name and signature are verified above, when iterating NameAndType_info.
             // Need only to be sure signature is non-zero length and the right type.
             if (signature->utf8_length() == 0 ||
-                signature->byte_at(0) == JVM_SIGNATURE_FUNC) {
+                signature->char_at(0) == JVM_SIGNATURE_FUNC) {
               throwIllegalSignature("Field", name, signature, CHECK);
             }
           }
@@ -716,7 +716,7 @@
             // Method name and signature are verified above, when iterating NameAndType_info.
             // Need only to be sure signature is non-zero length and the right type.
             if (signature->utf8_length() == 0 ||
-                signature->byte_at(0) != JVM_SIGNATURE_FUNC) {
+                signature->char_at(0) != JVM_SIGNATURE_FUNC) {
               throwIllegalSignature("Method", name, signature, CHECK);
             }
           }
@@ -724,7 +724,7 @@
           const unsigned int name_len = name->utf8_length();
           if (tag == JVM_CONSTANT_Methodref &&
               name_len != 0 &&
-              name->byte_at(0) == '<' &&
+              name->char_at(0) == '<' &&
               name != vmSymbols::object_initializer_name()) {
             classfile_parse_error(
               "Bad method name at constant pool index %u in class file %s",
@@ -942,7 +942,7 @@
 
         // Don't need to check legal name because it's checked when parsing constant pool.
         // But need to make sure it's not an array type.
-        guarantee_property(unresolved_klass->byte_at(0) != JVM_SIGNATURE_ARRAY,
+        guarantee_property(unresolved_klass->char_at(0) != JVM_SIGNATURE_ARRAY,
                            "Bad interface name in class file %s", CHECK);
 
         // Call resolve_super so classcircularity is checked
@@ -3752,7 +3752,7 @@
       if (need_verify)
         is_array = super_klass->is_array_klass();
     } else if (need_verify) {
-      is_array = (cp->klass_name_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY);
+      is_array = (cp->klass_name_at(super_class_index)->char_at(0) == JVM_SIGNATURE_ARRAY);
     }
     if (need_verify) {
       guarantee_property(!is_array,
@@ -5379,7 +5379,7 @@
     // The first non-signature thing better be a ')'
     if ((length > 0) && (*p++ == JVM_SIGNATURE_ENDFUNC)) {
       length--;
-      if (name->utf8_length() > 0 && name->byte_at(0) == '<') {
+      if (name->utf8_length() > 0 && name->char_at(0) == '<') {
         // All internal methods must return void
         if ((length == 1) && (p[0] == JVM_SIGNATURE_VOID)) {
           return args_size;
@@ -5796,7 +5796,7 @@
 void ClassFileParser::fix_unsafe_anonymous_class_name(TRAPS) {
   assert(_unsafe_anonymous_host != NULL, "Expected an unsafe anonymous class");
 
-  const jbyte* anon_last_slash = UTF8::strrchr(_class_name->base(),
+  const jbyte* anon_last_slash = UTF8::strrchr((const jbyte*)_class_name->base(),
                                                _class_name->utf8_length(), '/');
   if (anon_last_slash == NULL) {  // Unnamed package
     prepend_host_package_name(_unsafe_anonymous_host, CHECK);
@@ -6119,7 +6119,7 @@
   // It has been checked when constant pool is parsed.
   // However, make sure it is not an array type.
   if (_need_verify) {
-    guarantee_property(_class_name->byte_at(0) != JVM_SIGNATURE_ARRAY,
+    guarantee_property(_class_name->char_at(0) != JVM_SIGNATURE_ARRAY,
                        "Bad class name in class file %s",
                        CHECK);
   }
--- a/src/hotspot/share/classfile/classLoaderData.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderData.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -183,7 +183,7 @@
   bool keep_alive() const       { return _keep_alive > 0; }
 
   oop holder_phantom() const;
-  void classes_do(void f(Klass*));
+  void classes_do(void f(Klass* const));
   void loaded_classes_do(KlassClosure* klass_closure);
   void classes_do(void f(InstanceKlass*));
   void methods_do(void f(Method*));
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -487,6 +487,21 @@
 }
 #endif // PRODUCT
 
+bool ClassLoaderDataGraph::is_valid(ClassLoaderData* loader_data) {
+  DEBUG_ONLY( if (!VMError::is_error_reported()) { assert_locked_or_safepoint(ClassLoaderDataGraph_lock); } )
+  if (loader_data != NULL) {
+    if (loader_data == ClassLoaderData::the_null_class_loader_data()) {
+      return true;
+    }
+    for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {
+      if (loader_data == data) {
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
 // Move class loader data from main list to the unloaded list for unloading
 // and deallocation later.
 bool ClassLoaderDataGraph::do_unloading(bool do_cleaning) {
--- a/src/hotspot/share/classfile/classLoaderDataGraph.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -146,6 +146,10 @@
 #ifndef PRODUCT
   static bool contains_loader_data(ClassLoaderData* loader_data);
 #endif
+
+  // Check if ClassLoaderData is part of the ClassLoaderDataGraph (not unloaded)
+  // Usage without lock only allowed during error reporting.
+  static bool is_valid(ClassLoaderData* loader_data);
 };
 
 class LockedClassesDo : public KlassClosure {
--- a/src/hotspot/share/classfile/symbolTable.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/symbolTable.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -478,8 +478,8 @@
 #ifdef ASSERT
     assert(sym->utf8_length() == _len, "%s [%d,%d]", where, sym->utf8_length(), _len);
     for (int i = 0; i < _len; i++) {
-      assert(sym->byte_at(i) == (jbyte) _name[i],
-             "%s [%d,%d,%d]", where, i, sym->byte_at(i), _name[i]);
+      assert(sym->char_at(i) == _name[i],
+             "%s [%d,%d,%d]", where, i, sym->char_at(i), _name[i]);
     }
 #endif
   }
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2601,7 +2601,7 @@
   if (type->utf8_length() == 1) {
 
     // It's a primitive.  (Void has a primitive mirror too.)
-    char ch = (char) type->byte_at(0);
+    char ch = type->char_at(0);
     assert(is_java_primitive(char2type(ch)) || ch == 'V', "");
     return Handle(THREAD, find_java_mirror_for_type(ch));
 
--- a/src/hotspot/share/classfile/verificationType.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/verificationType.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -120,7 +120,7 @@
 VerificationType VerificationType::get_component(ClassVerifier *context, TRAPS) const {
   assert(is_array() && name()->utf8_length() >= 2, "Must be a valid array");
   Symbol* component;
-  switch (name()->byte_at(1)) {
+  switch (name()->char_at(1)) {
     case 'Z': return VerificationType(Boolean);
     case 'B': return VerificationType(Byte);
     case 'C': return VerificationType(Char);
--- a/src/hotspot/share/classfile/verificationType.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/verificationType.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -207,7 +207,7 @@
   bool is_check() const { return (_u._data & TypeQuery) == TypeQuery; }
 
   bool is_x_array(char sig) const {
-    return is_null() || (is_array() && (name()->byte_at(1) == sig));
+    return is_null() || (is_array() && (name()->char_at(1) == sig));
   }
   bool is_int_array() const { return is_x_array('I'); }
   bool is_byte_array() const { return is_x_array('B'); }
@@ -223,10 +223,10 @@
     { return is_object_array() || is_array_array(); }
   bool is_object() const
     { return (is_reference() && !is_null() && name()->utf8_length() >= 1 &&
-              name()->byte_at(0) != '['); }
+              name()->char_at(0) != '['); }
   bool is_array() const
     { return (is_reference() && !is_null() && name()->utf8_length() >= 2 &&
-              name()->byte_at(0) == '['); }
+              name()->char_at(0) == '['); }
   bool is_uninitialized() const
     { return ((_u._data & Uninitialized) == Uninitialized); }
   bool is_uninitialized_this() const
@@ -322,7 +322,7 @@
   int dimensions() const {
     assert(is_array(), "Must be an array");
     int index = 0;
-    while (name()->byte_at(index) == '[') index++;
+    while (name()->char_at(index) == '[') index++;
     return index;
   }
 
--- a/src/hotspot/share/classfile/verifier.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/verifier.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2809,7 +2809,7 @@
     }
   }
 
-  if (method_name->byte_at(0) == '<') {
+  if (method_name->char_at(0) == '<') {
     // Make sure <init> can only be invoked by invokespecial
     if (opcode != Bytecodes::_invokespecial ||
         method_name != vmSymbols::object_initializer_name()) {
--- a/src/hotspot/share/classfile/vmSymbols.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/classfile/vmSymbols.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -212,7 +212,7 @@
 BasicType vmSymbols::signature_type(const Symbol* s) {
   assert(s != NULL, "checking");
   if (s->utf8_length() == 1) {
-    BasicType result = char2type(s->byte_at(0));
+    BasicType result = char2type(s->char_at(0));
     if (is_java_primitive(result) || result == T_VOID) {
       assert(s == _type_signatures[result], "");
       return result;
--- a/src/hotspot/share/code/codeBlob.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/code/codeBlob.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -26,7 +26,9 @@
 #include "jvm.h"
 #include "code/codeBlob.hpp"
 #include "code/codeCache.hpp"
+#include "code/icBuffer.hpp"
 #include "code/relocInfo.hpp"
+#include "code/vtableStubs.hpp"
 #include "compiler/disassembler.hpp"
 #include "interpreter/bytecode.hpp"
 #include "memory/allocation.inline.hpp"
@@ -559,6 +561,67 @@
   st->print_cr("[CodeBlob]");
 }
 
+void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const {
+  if (is_buffer_blob()) {
+    // the interpreter is generated into a buffer blob
+    InterpreterCodelet* i = Interpreter::codelet_containing(addr);
+    if (i != NULL) {
+      st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an Interpreter codelet", p2i(addr), (int)(addr - i->code_begin()));
+      i->print_on(st);
+      return;
+    }
+    if (Interpreter::contains(addr)) {
+      st->print_cr(INTPTR_FORMAT " is pointing into interpreter code"
+                   " (not bytecode specific)", p2i(addr));
+      return;
+    }
+    //
+    if (AdapterHandlerLibrary::contains(this)) {
+      st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an AdapterHandler", p2i(addr), (int)(addr - code_begin()));
+      AdapterHandlerLibrary::print_handler_on(st, this);
+    }
+    // the stubroutines are generated into a buffer blob
+    StubCodeDesc* d = StubCodeDesc::desc_for(addr);
+    if (d != NULL) {
+      st->print_cr(INTPTR_FORMAT " is at begin+%d in a stub", p2i(addr), (int)(addr - d->begin()));
+      d->print_on(st);
+      st->cr();
+      return;
+    }
+    if (StubRoutines::contains(addr)) {
+      st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) stub routine", p2i(addr));
+      return;
+    }
+    // the InlineCacheBuffer is using stubs generated into a buffer blob
+    if (InlineCacheBuffer::contains(addr)) {
+      st->print_cr(INTPTR_FORMAT " is pointing into InlineCacheBuffer", p2i(addr));
+      return;
+    }
+    VtableStub* v = VtableStubs::stub_containing(addr);
+    if (v != NULL) {
+      st->print_cr(INTPTR_FORMAT " is at entry_point+%d in a vtable stub", p2i(addr), (int)(addr - v->entry_point()));
+      v->print_on(st);
+      st->cr();
+      return;
+    }
+  }
+  if (is_nmethod()) {
+    nmethod* nm = (nmethod*)this;
+    ResourceMark rm;
+    st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
+              p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
+    if (verbose) {
+      st->print(" for ");
+      nm->method()->print_value_on(st);
+    }
+    st->cr();
+    nm->print_nmethod(verbose);
+    return;
+  }
+  st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - code_begin()));
+  print_on(st);
+}
+
 void RuntimeBlob::verify() {
   ShouldNotReachHere();
 }
--- a/src/hotspot/share/code/codeBlob.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/code/codeBlob.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -221,6 +221,7 @@
   virtual void print() const                     { print_on(tty); };
   virtual void print_on(outputStream* st) const;
   virtual void print_value_on(outputStream* st) const;
+  void dump_for_addr(address addr, outputStream* st, bool verbose) const;
   void print_code();
 
   // Print the comment associated with offset on stream, if there is one
--- a/src/hotspot/share/code/nmethod.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/code/nmethod.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2748,9 +2748,7 @@
   virtual void verify() const {
     // make sure code pattern is actually a call imm32 instruction
     _call->verify();
-    if (os::is_MP()) {
-      _call->verify_alignment();
-    }
+    _call->verify_alignment();
   }
 
   virtual void verify_resolve_call(address dest) const {
--- a/src/hotspot/share/compiler/compileBroker.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/compiler/compileBroker.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1781,30 +1781,31 @@
           return; // Stop this thread.
         }
       }
-      continue;
-    }
-
-    if (UseDynamicNumberOfCompilerThreads) {
-      possibly_add_compiler_threads();
-    }
+    } else {
+      // Assign the task to the current thread.  Mark this compilation
+      // thread as active for the profiler.
+      // CompileTaskWrapper also keeps the Method* from being deallocated if redefinition
+      // occurs after fetching the compile task off the queue.
+      CompileTaskWrapper ctw(task);
+      nmethodLocker result_handle;  // (handle for the nmethod produced by this task)
+      task->set_code_handle(&result_handle);
+      methodHandle method(thread, task->method());
 
-    // Assign the task to the current thread.  Mark this compilation
-    // thread as active for the profiler.
-    CompileTaskWrapper ctw(task);
-    nmethodLocker result_handle;  // (handle for the nmethod produced by this task)
-    task->set_code_handle(&result_handle);
-    methodHandle method(thread, task->method());
+      // Never compile a method if breakpoints are present in it
+      if (method()->number_of_breakpoints() == 0) {
+        // Compile the method.
+        if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) {
+          invoke_compiler_on_method(task);
+          thread->start_idle_timer();
+        } else {
+          // After compilation is disabled, remove remaining methods from queue
+          method->clear_queued_for_compilation();
+          task->set_failure_reason("compilation is disabled");
+        }
+      }
 
-    // Never compile a method if breakpoints are present in it
-    if (method()->number_of_breakpoints() == 0) {
-      // Compile the method.
-      if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) {
-        invoke_compiler_on_method(task);
-        thread->start_idle_timer();
-      } else {
-        // After compilation is disabled, remove remaining methods from queue
-        method->clear_queued_for_compilation();
-        task->set_failure_reason("compilation is disabled");
+      if (UseDynamicNumberOfCompilerThreads) {
+        possibly_add_compiler_threads();
       }
     }
   }
--- a/src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -136,7 +136,6 @@
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
-
   return JVMFlag::SUCCESS;
 }
 
@@ -151,12 +150,11 @@
     if (value % HeapWordSize != 0) {
       JVMFlag::printError(verbose,
                           "CMSRescanMultiple (" SIZE_FORMAT ") must be "
-                          "a multiple of " SIZE_FORMAT "\n",
+                          "a multiple of %d\n",
                           value, HeapWordSize);
       status = JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
-
   return status;
 }
 
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1049,6 +1049,9 @@
   // Rebuild the strong code root lists for each region
   rebuild_strong_code_roots();
 
+  // Purge code root memory
+  purge_code_root_memory();
+
   // Start a new incremental collection set for the next pause
   start_new_collection_set();
 
--- a/src/hotspot/share/gc/parallel/adjoiningGenerations.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/parallel/adjoiningGenerations.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, 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
@@ -122,7 +122,7 @@
 }
 
 void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_bytes, size_t max_size) {
-  Log(heap, ergo) log;
+  Log(gc, ergo, heap) log;
   if (!log.is_debug()) {
    return;
   }
@@ -136,7 +136,7 @@
 }
 
 void log_after_expansion(bool old, size_t max_size) {
-  Log(heap, ergo) log;
+  Log(gc, ergo, heap) log;
   if (!log.is_debug()) {
    return;
   }
--- a/src/hotspot/share/gc/parallel/psMarkSweep.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/parallel/psMarkSweep.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -433,15 +433,15 @@
     return false; // Respect young gen minimum size.
   }
 
-  log_trace(heap, ergo)(" absorbing " SIZE_FORMAT "K:  "
-                        "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K "
-                        "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K "
-                        "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ",
-                        absorb_size / K,
-                        eden_capacity / K, (eden_capacity - absorb_size) / K,
-                        young_gen->from_space()->used_in_bytes() / K,
-                        young_gen->to_space()->used_in_bytes() / K,
-                        young_gen->capacity_in_bytes() / K, new_young_size / K);
+  log_trace(gc, ergo, heap)(" absorbing " SIZE_FORMAT "K:  "
+                            "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K "
+                            "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K "
+                            "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ",
+                            absorb_size / K,
+                            eden_capacity / K, (eden_capacity - absorb_size) / K,
+                            young_gen->from_space()->used_in_bytes() / K,
+                            young_gen->to_space()->used_in_bytes() / K,
+                            young_gen->capacity_in_bytes() / K, new_young_size / K);
 
   // Fill the unused part of the old gen.
   MutableSpace* const old_space = old_gen->object_space();
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -2000,15 +2000,15 @@
     return false; // Respect young gen minimum size.
   }
 
-  log_trace(heap, ergo)(" absorbing " SIZE_FORMAT "K:  "
-                        "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K "
-                        "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K "
-                        "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ",
-                        absorb_size / K,
-                        eden_capacity / K, (eden_capacity - absorb_size) / K,
-                        young_gen->from_space()->used_in_bytes() / K,
-                        young_gen->to_space()->used_in_bytes() / K,
-                        young_gen->capacity_in_bytes() / K, new_young_size / K);
+  log_trace(gc, ergo, heap)(" absorbing " SIZE_FORMAT "K:  "
+                            "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K "
+                            "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K "
+                            "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ",
+                            absorb_size / K,
+                            eden_capacity / K, (eden_capacity - absorb_size) / K,
+                            young_gen->from_space()->used_in_bytes() / K,
+                            young_gen->to_space()->used_in_bytes() / K,
+                            young_gen->capacity_in_bytes() / K, new_young_size / K);
 
   // Fill the unused part of the old gen.
   MutableSpace* const old_space = old_gen->object_space();
--- a/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -135,7 +135,7 @@
 
 void BarrierSetC1::store_at_resolved(LIRAccess& access, LIR_Opr value) {
   DecoratorSet decorators = access.decorators();
-  bool is_volatile = (((decorators & MO_SEQ_CST) != 0) || AlwaysAtomicAccesses) && os::is_MP();
+  bool is_volatile = (((decorators & MO_SEQ_CST) != 0) || AlwaysAtomicAccesses);
   bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0;
   bool mask_boolean = (decorators & C1_MASK_BOOLEAN) != 0;
   LIRGenerator* gen = access.gen();
@@ -144,7 +144,7 @@
     value = gen->mask_boolean(access.base().opr(), value, access.access_emit_info());
   }
 
-  if (is_volatile && os::is_MP()) {
+  if (is_volatile) {
     __ membar_release();
   }
 
@@ -163,7 +163,7 @@
 void BarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) {
   LIRGenerator *gen = access.gen();
   DecoratorSet decorators = access.decorators();
-  bool is_volatile = (((decorators & MO_SEQ_CST) != 0) || AlwaysAtomicAccesses) && os::is_MP();
+  bool is_volatile = (((decorators & MO_SEQ_CST) != 0) || AlwaysAtomicAccesses);
   bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0;
   bool mask_boolean = (decorators & C1_MASK_BOOLEAN) != 0;
   bool in_native = (decorators & IN_NATIVE) != 0;
@@ -181,7 +181,7 @@
     __ load(access.resolved_addr()->as_address_ptr(), result, access.access_emit_info(), patch_code);
   }
 
-  if (is_volatile && os::is_MP()) {
+  if (is_volatile) {
     __ membar_acquire();
   }
 
@@ -296,6 +296,10 @@
   if (gen_pre_barrier) {
     // We can have generate one runtime check here. Let's start with
     // the offset check.
+    // Allocate temp register to base and load it here, otherwise
+    // control flow below may confuse register allocator.
+    LIR_Opr base_reg = gen->new_register(T_OBJECT);
+    __ move(base.result(), base_reg);
     if (gen_offset_check) {
       // if (offset != referent_offset) -> continue
       // If offset is an int then we can do the comparison with the
@@ -318,14 +322,14 @@
     if (gen_source_check) {
       // offset is a const and equals referent offset
       // if (source == null) -> continue
-      __ cmp(lir_cond_equal, base.result(), LIR_OprFact::oopConst(NULL));
+      __ cmp(lir_cond_equal, base_reg, LIR_OprFact::oopConst(NULL));
       __ branch(lir_cond_equal, T_OBJECT, cont->label());
     }
     LIR_Opr src_klass = gen->new_register(T_METADATA);
     if (gen_type_check) {
       // We have determined that offset == referent_offset && src != null.
       // if (src->_klass->_reference_type == REF_NONE) -> continue
-      __ move(new LIR_Address(base.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), src_klass);
+      __ move(new LIR_Address(base_reg, oopDesc::klass_offset_in_bytes(), T_ADDRESS), src_klass);
       LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE);
       LIR_Opr reference_type = gen->new_register(T_INT);
       __ move(reference_type_addr, reference_type);
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -598,6 +598,7 @@
   ac->set_clonebasic();
   Node* n = kit->gvn().transform(ac);
   if (n == ac) {
+    ac->_adr_type = TypeRawPtr::BOTTOM;
     kit->set_predefined_output_for_runtime_call(ac, ac->in(TypeFunc::Memory), raw_adr_type);
   } else {
     kit->set_all_memory(n);
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -197,7 +197,12 @@
                              intx prefetch_lines) const;
 
   // These are general helper methods used by C2
-  virtual bool array_copy_requires_gc_barriers(BasicType type) const { return false; }
+  enum ArrayCopyPhase {
+    Parsing,
+    Optimization,
+    Expansion
+  };
+  virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const { return false; }
 
   // Support for GC barriers emitted during parsing
   virtual bool has_load_barriers() const { return false; }
--- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -186,6 +186,7 @@
   }
 }
 
-bool CardTableBarrierSetC2::array_copy_requires_gc_barriers(BasicType type) const {
-  return !use_ReduceInitialCardMarks();
+bool CardTableBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
+  bool is_oop = type == T_OBJECT || type == T_ARRAY;
+  return is_oop && (!tightly_coupled_alloc || !use_ReduceInitialCardMarks());
 }
--- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -45,7 +45,7 @@
   virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const;
   virtual bool is_gc_barrier_node(Node* node) const;
   virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const;
-  virtual bool array_copy_requires_gc_barriers(BasicType type) const;
+  virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const;
 
   bool use_ReduceInitialCardMarks() const;
 };
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -194,7 +194,7 @@
   virtual void enqueue_useful_gc_barrier(Unique_Node_List &worklist, Node* node) const;
   virtual void register_potential_barrier_node(Node* node) const;
   virtual void unregister_potential_barrier_node(Node* node) const;
-  virtual bool array_copy_requires_gc_barriers(BasicType type) const { return true; }
+  virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const { return true; }
   virtual Node* step_over_gc_barrier(Node* c) const;
   // 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.
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -435,8 +435,8 @@
   if (resolve) {
     resolved_klass = SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, CHECK_0);
   } else {
-    if (class_name->byte_at(0) == 'L' &&
-      class_name->byte_at(class_name->utf8_length()-1) == ';') {
+    if (class_name->char_at(0) == 'L' &&
+      class_name->char_at(class_name->utf8_length()-1) == ';') {
       // This is a name from a signature.  Strip off the trimmings.
       // Call recursive to keep scope of strippedsym.
       TempNewSymbol strippedsym = SymbolTable::new_symbol(class_name->as_utf8()+1,
--- a/src/hotspot/share/jvmci/jvmciEnv.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/jvmci/jvmciEnv.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -98,8 +98,8 @@
   JVMCI_EXCEPTION_CONTEXT;
 
   // Now we need to check the SystemDictionary
-  if (sym->byte_at(0) == 'L' &&
-    sym->byte_at(sym->utf8_length()-1) == ';') {
+  if (sym->char_at(0) == 'L' &&
+    sym->char_at(sym->utf8_length()-1) == ';') {
     // This is a name from a signature.  Strip off the trimmings.
     // Call recursive to keep scope of strippedsym.
     TempNewSymbol strippedsym = SymbolTable::new_symbol(sym->as_utf8()+1,
@@ -132,8 +132,8 @@
   // we must build an array type around it.  The CI requires array klasses
   // to be loaded if their element klasses are loaded, except when memory
   // is exhausted.
-  if (sym->byte_at(0) == '[' &&
-      (sym->byte_at(1) == '[' || sym->byte_at(1) == 'L')) {
+  if (sym->char_at(0) == '[' &&
+      (sym->char_at(1) == '[' || sym->char_at(1) == 'L')) {
     // We have an unloaded array.
     // Build it on the fly if the element class exists.
     TempNewSymbol elem_sym = SymbolTable::new_symbol(sym->as_utf8()+1,
--- a/src/hotspot/share/memory/metaspace.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/memory/metaspace.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -863,6 +863,42 @@
 #endif
 }
 
+// Utils to check if a pointer or range is part of a committed metaspace region.
+metaspace::VirtualSpaceNode* MetaspaceUtils::find_enclosing_virtual_space(const void* p) {
+  VirtualSpaceNode* vsn = Metaspace::space_list()->find_enclosing_space(p);
+  if (Metaspace::using_class_space() && vsn == NULL) {
+    vsn = Metaspace::class_space_list()->find_enclosing_space(p);
+  }
+  return vsn;
+}
+
+bool MetaspaceUtils::is_in_committed(const void* p) {
+#if INCLUDE_CDS
+  if (UseSharedSpaces) {
+    for (int idx = MetaspaceShared::ro; idx <= MetaspaceShared::mc; idx++) {
+      if (FileMapInfo::current_info()->is_in_shared_region(p, idx)) {
+        return true;
+      }
+    }
+  }
+#endif
+  return find_enclosing_virtual_space(p) != NULL;
+}
+
+bool MetaspaceUtils::is_range_in_committed(const void* from, const void* to) {
+#if INCLUDE_CDS
+  if (UseSharedSpaces) {
+    for (int idx = MetaspaceShared::ro; idx <= MetaspaceShared::mc; idx++) {
+      if (FileMapInfo::current_info()->is_in_shared_region(from, idx)) {
+        return FileMapInfo::current_info()->is_in_shared_region(to, idx);
+      }
+    }
+  }
+#endif
+  VirtualSpaceNode* vsn = find_enclosing_virtual_space(from);
+  return (vsn != NULL) && vsn->contains(to);
+}
+
 
 // Metaspace methods
 
--- a/src/hotspot/share/memory/metaspace.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/memory/metaspace.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -71,6 +71,7 @@
   class PrintCLDMetaspaceInfoClosure;
   class SpaceManager;
   class VirtualSpaceList;
+  class VirtualSpaceNode;
 }
 
 // Metaspaces each have a  SpaceManager and allocations
@@ -297,6 +298,10 @@
   // Spacemanager updates running counters.
   friend class metaspace::SpaceManager;
 
+  // Special access for error reporting (checks without locks).
+  friend class oopDesc;
+  friend class Klass;
+
   // Running counters for statistics concerning in-use chunks.
   // Note: capacity = used + free + waste + overhead. Note that we do not
   // count free and waste. Their sum can be deduces from the three other values.
@@ -324,6 +329,12 @@
   // Helper for print_xx_report.
   static void print_vs(outputStream* out, size_t scale);
 
+  // Utils to check if a pointer or range is part of a committed metaspace region
+  // without acquiring any locks.
+  static metaspace::VirtualSpaceNode* find_enclosing_virtual_space(const void* p);
+  static bool is_in_committed(const void* p);
+  static bool is_range_in_committed(const void* from, const void* to);
+
 public:
 
   // Collect used metaspace statistics. This involves walking the CLDG. The resulting
--- a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -141,17 +141,17 @@
 // This function looks at the mmap regions in the metaspace without locking.
 // The chunks are added with store ordering and not deleted except for at
 // unloading time during a safepoint.
-bool VirtualSpaceList::contains(const void* ptr) {
+VirtualSpaceNode* VirtualSpaceList::find_enclosing_space(const void* ptr) {
   // List should be stable enough to use an iterator here because removing virtual
   // space nodes is only allowed at a safepoint.
   VirtualSpaceListIterator iter(virtual_space_list());
   while (iter.repeat()) {
     VirtualSpaceNode* vsn = iter.get_next();
     if (vsn->contains(ptr)) {
-      return true;
+      return vsn;
     }
   }
-  return false;
+  return NULL;
 }
 
 void VirtualSpaceList::retire_current_virtual_space() {
--- a/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -116,7 +116,8 @@
   void inc_virtual_space_count();
   void dec_virtual_space_count();
 
-  bool contains(const void* ptr);
+  VirtualSpaceNode* find_enclosing_space(const void* ptr);
+  bool contains(const void* ptr) { return find_enclosing_space(ptr) != NULL; }
 
   // Unlink empty VirtualSpaceNodes and free it.
   void purge(ChunkManager* chunk_manager);
--- a/src/hotspot/share/oops/klass.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/oops/klass.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.inline.hpp"
+#include "classfile/classLoaderDataGraph.inline.hpp"
 #include "classfile/dictionary.hpp"
 #include "classfile/javaClasses.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -740,6 +741,22 @@
   guarantee(obj->klass()->is_klass(), "klass field is not a klass");
 }
 
+Klass* Klass::decode_klass_raw(narrowKlass narrow_klass) {
+  return (Klass*)(void*)( (uintptr_t)Universe::narrow_klass_base() +
+                         ((uintptr_t)narrow_klass << Universe::narrow_klass_shift()));
+}
+
+bool Klass::is_valid(Klass* k) {
+  if (!is_aligned(k, sizeof(MetaWord))) return false;
+  if ((size_t)k < os::min_page_size()) return false;
+
+  if (!os::is_readable_range(k, k + 1)) return false;
+  if (!MetaspaceUtils::is_range_in_committed(k, k + 1)) return false;
+
+  if (!Symbol::is_valid(k->name())) return false;
+  return ClassLoaderDataGraph::is_valid(k->class_loader_data());
+}
+
 klassVtable Klass::vtable() const {
   return klassVtable(const_cast<Klass*>(this), start_of_vtable(), vtable_length() / vtableEntry::size());
 }
--- a/src/hotspot/share/oops/klass.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/oops/klass.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -715,6 +715,10 @@
 
   virtual void oop_verify_on(oop obj, outputStream* st);
 
+  // for error reporting
+  static Klass* decode_klass_raw(narrowKlass narrow_klass);
+  static bool is_valid(Klass* k);
+
   static bool is_null(narrowKlass obj);
   static bool is_null(Klass* obj);
 
--- a/src/hotspot/share/oops/oop.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/oops/oop.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -171,6 +171,63 @@
   return UseCompressedClassPointers;
 }
 
+oop oopDesc::decode_oop_raw(narrowOop narrow_oop) {
+  return (oop)(void*)( (uintptr_t)Universe::narrow_oop_base() +
+                      ((uintptr_t)narrow_oop << Universe::narrow_oop_shift()));
+}
+
+void* oopDesc::load_klass_raw(oop obj) {
+  if (UseCompressedClassPointers) {
+    narrowKlass narrow_klass = *(obj->compressed_klass_addr());
+    if (narrow_klass == 0) return NULL;
+    return (void*)Klass::decode_klass_raw(narrow_klass);
+  } else {
+    return *(void**)(obj->klass_addr());
+  }
+}
+
+void* oopDesc::load_oop_raw(oop obj, int offset) {
+  uintptr_t addr = (uintptr_t)(void*)obj + (uint)offset;
+  if (UseCompressedOops) {
+    narrowOop narrow_oop = *(narrowOop*)addr;
+    if (narrow_oop == 0) return NULL;
+    return (void*)decode_oop_raw(narrow_oop);
+  } else {
+    return *(void**)addr;
+  }
+}
+
+bool oopDesc::is_valid(oop obj) {
+  if (!is_object_aligned(obj)) return false;
+  if ((size_t)(oopDesc*)obj < os::min_page_size()) return false;
+
+  // We need at least the mark and the klass word in the committed region.
+  if (!os::is_readable_range(obj, (oopDesc*)obj + 1)) return false;
+  if (!Universe::heap()->is_in(obj)) return false;
+
+  Klass* k = (Klass*)load_klass_raw(obj);
+
+  if (!os::is_readable_range(k, k + 1)) return false;
+  return MetaspaceUtils::is_range_in_committed(k, k + 1);
+}
+
+oop oopDesc::oop_or_null(address addr) {
+  if (is_valid(oop(addr))) {
+    // We were just given an oop directly.
+    return oop(addr);
+  }
+
+  // Try to find addr using block_start.
+  HeapWord* p = Universe::heap()->block_start(addr);
+  if (p != NULL && Universe::heap()->block_is_obj(p)) {
+    if (!is_valid(oop(p))) return NULL;
+    return oop(p);
+  }
+
+  // If we can't find it it just may mean that heap wasn't parsable.
+  return NULL;
+}
+
 oop oopDesc::obj_field_acquire(int offset) const                      { return HeapAccess<MO_ACQUIRE>::oop_load_at(as_oop(), offset); }
 
 void oopDesc::obj_field_put_raw(int offset, oop value)                { RawAccess<>::oop_store_at(as_oop(), offset, value); }
--- a/src/hotspot/share/oops/oop.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/oops/oop.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -334,6 +334,13 @@
     assert(has_klass_gap(), "only applicable to compressed klass pointers");
     return klass_offset_in_bytes() + sizeof(narrowKlass);
   }
+
+  // for error reporting
+  static oop   decode_oop_raw(narrowOop narrow_oop);
+  static void* load_klass_raw(oop obj);
+  static void* load_oop_raw(oop obj, int offset);
+  static bool  is_valid(oop obj);
+  static oop   oop_or_null(address addr);
 };
 
 #endif // SHARE_VM_OOPS_OOP_HPP
--- a/src/hotspot/share/oops/symbol.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/oops/symbol.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -26,6 +26,7 @@
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
 #include "classfile/classLoaderData.hpp"
+#include "gc/shared/collectedHeap.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
@@ -79,7 +80,7 @@
 bool Symbol::starts_with(const char* prefix, int len) const {
   if (len > utf8_length()) return false;
   while (len-- > 0) {
-    if (prefix[len] != (char) byte_at(len))
+    if (prefix[len] != char_at(len))
       return false;
   }
   assert(len == -1, "we should be at the beginning");
@@ -117,7 +118,7 @@
   if (size > 0) {
     int len = MIN2(size - 1, utf8_length());
     for (int i = 0; i < len; i++) {
-      buf[i] = byte_at(i);
+      buf[i] = char_at(i);
     }
     buf[len] = '\0';
   }
@@ -311,11 +312,27 @@
   } else {
     st->print("'");
     for (int i = 0; i < utf8_length(); i++) {
-      st->print("%c", byte_at(i));
+      st->print("%c", char_at(i));
     }
     st->print("'");
   }
 }
 
+bool Symbol::is_valid(Symbol* s) {
+  if (!is_aligned(s, sizeof(MetaWord))) return false;
+  if ((size_t)s < os::min_page_size()) return false;
+
+  if (!os::is_readable_range(s, s + 1)) return false;
+
+  // Symbols are not allocated in Java heap.
+  if (Universe::heap()->is_in_reserved(s)) return false;
+
+  int len = s->utf8_length();
+  if (len < 0) return false;
+
+  jbyte* bytes = (jbyte*) s->bytes();
+  return os::is_readable_range(bytes, bytes + len);
+}
+
 // SymbolTable prints this in its statistics
 NOT_PRODUCT(size_t Symbol::_total_count = 0;)
--- a/src/hotspot/share/oops/symbol.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/oops/symbol.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -112,7 +112,7 @@
   // in high half word. length is the number of UTF8 characters in the symbol
   volatile uint32_t _length_and_refcount;
   short _identity_hash;
-  jbyte _body[2];
+  u1 _body[2];
 
   enum {
     // max_symbol_length must fit into the top 16 bits of _length_and_refcount
@@ -128,7 +128,7 @@
     return (int)heap_word_size(byte_size(length));
   }
 
-  void byte_at_put(int index, int value) {
+  void byte_at_put(int index, u1 value) {
     assert(index >=0 && index < length(), "symbol index overflow");
     _body[index] = value;
   }
@@ -148,7 +148,7 @@
 
  public:
   // Low-level access (used with care, since not GC-safe)
-  const jbyte* base() const { return &_body[0]; }
+  const u1* base() const { return &_body[0]; }
 
   int size()                { return size(utf8_length()); }
   int byte_size()           { return byte_size(utf8_length()); }
@@ -176,12 +176,16 @@
     return (refcount() == PERM_REFCOUNT);
   }
 
-  int byte_at(int index) const {
+  // Function char_at() returns the Symbol's selected u1 byte as a char type.
+  //
+  // Note that all multi-byte chars have the sign bit set on all their bytes.
+  // No single byte chars have their sign bit set.
+  char char_at(int index) const {
     assert(index >=0 && index < length(), "symbol index overflow");
-    return base()[index];
+    return (char)base()[index];
   }
 
-  const jbyte* bytes() const { return base(); }
+  const u1* bytes() const { return base(); }
 
   int utf8_length() const { return length(); }
 
@@ -190,7 +194,7 @@
     int l = utf8_length();
     if (l != len) return false;
     while (l-- > 0) {
-      if (str[l] != (char) byte_at(l))
+      if (str[l] != char_at(l))
         return false;
     }
     assert(l == -1, "we should be at the beginning");
@@ -251,6 +255,8 @@
   void print()         { print_on(tty);       }
   void print_value()   { print_value_on(tty); }
 
+  static bool is_valid(Symbol* s);
+
 #ifndef PRODUCT
   // Empty constructor to create a dummy symbol object on stack
   // only for getting its vtable pointer.
--- a/src/hotspot/share/opto/arraycopynode.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/opto/arraycopynode.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
 #include "utilities/macros.hpp"
 
 ArrayCopyNode::ArrayCopyNode(Compile* C, bool alloc_tightly_coupled, bool has_negative_length_guard)
-  : CallNode(arraycopy_type(), NULL, TypeRawPtr::BOTTOM),
+  : CallNode(arraycopy_type(), NULL, TypePtr::BOTTOM),
     _kind(None),
     _alloc_tightly_coupled(alloc_tightly_coupled),
     _has_negative_length_guard(has_negative_length_guard),
@@ -257,8 +257,7 @@
     }
 
     BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-    if (dest_elem == T_OBJECT && (!is_alloc_tightly_coupled() ||
-                                  bs->array_copy_requires_gc_barriers(T_OBJECT))) {
+    if (bs->array_copy_requires_gc_barriers(is_alloc_tightly_coupled(), dest_elem, false, BarrierSetC2::Optimization)) {
       // It's an object array copy but we can't emit the card marking
       // that is needed
       return false;
@@ -307,6 +306,11 @@
     BasicType elem = ary_src->klass()->as_array_klass()->element_type()->basic_type();
     if (elem == T_ARRAY)  elem = T_OBJECT;
 
+    BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+    if (bs->array_copy_requires_gc_barriers(true, elem, true, BarrierSetC2::Optimization)) {
+      return false;
+    }
+
     int diff = arrayOopDesc::base_offset_in_bytes(elem) - phase->type(src->in(AddPNode::Offset))->is_intptr_t()->get_con();
     assert(diff >= 0, "clone should not start after 1st array element");
     if (diff > 0) {
@@ -350,9 +354,8 @@
 
 Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase,
                                         bool can_reshape,
-                                        Node* forward_ctl,
-                                        Node* start_mem_src,
-                                        Node* start_mem_dest,
+                                        Node*& forward_ctl,
+                                        MergeMemNode* mm,
                                         const TypePtr* atp_src,
                                         const TypePtr* atp_dest,
                                         Node* adr_src,
@@ -362,12 +365,14 @@
                                         BasicType copy_type,
                                         const Type* value_type,
                                         int count) {
-  Node* mem = phase->C->top();
   if (!forward_ctl->is_top()) {
     // copy forward
-    mem = start_mem_dest;
+    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) {
@@ -384,20 +389,21 @@
         mem = StoreNode::make(*phase, forward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered);
         mem = phase->transform(mem);
       }
+      mm->set_memory_at(alias_idx_dest, mem);
     } else if(can_reshape) {
       PhaseIterGVN* igvn = phase->is_IterGVN();
       igvn->_worklist.push(adr_src);
       igvn->_worklist.push(adr_dest);
     }
+    return mm;
   }
-  return mem;
+  return phase->C->top();
 }
 
 Node* ArrayCopyNode::array_copy_backward(PhaseGVN *phase,
                                          bool can_reshape,
-                                         Node* backward_ctl,
-                                         Node* start_mem_src,
-                                         Node* start_mem_dest,
+                                         Node*& backward_ctl,
+                                         MergeMemNode* mm,
                                          const TypePtr* atp_src,
                                          const TypePtr* atp_dest,
                                          Node* adr_src,
@@ -407,12 +413,17 @@
                                          BasicType copy_type,
                                          const Type* value_type,
                                          int count) {
-  Node* mem = phase->C->top();
   if (!backward_ctl->is_top()) {
     // copy backward
-    mem = start_mem_dest;
+    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) {
@@ -429,13 +440,15 @@
       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);
     } else if(can_reshape) {
       PhaseIterGVN* igvn = phase->is_IterGVN();
       igvn->_worklist.push(adr_src);
       igvn->_worklist.push(adr_dest);
     }
+    return phase->transform(mm);
   }
-  return mem;
+  return phase->C->top();
 }
 
 bool ArrayCopyNode::finish_transform(PhaseGVN *phase, bool can_reshape,
@@ -449,7 +462,7 @@
       BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
       if (out_mem->outcnt() != 1 || !out_mem->raw_out(0)->is_MergeMem() ||
           out_mem->raw_out(0)->outcnt() != 1 || !out_mem->raw_out(0)->raw_out(0)->is_MemBar()) {
-        assert(bs->array_copy_requires_gc_barriers(T_OBJECT), "can only happen with card marking");
+        assert(bs->array_copy_requires_gc_barriers(true, T_OBJECT, true, BarrierSetC2::Optimization), "can only happen with card marking");
         return false;
       }
 
@@ -486,6 +499,7 @@
     if (in(TypeFunc::Control) != ctl) {
       // we can't return new memory and control from Ideal at parse time
       assert(!is_clonebasic(), "added control for clone?");
+      phase->record_for_igvn(this);
       return false;
     }
   }
@@ -559,15 +573,10 @@
   Node* dest = in(ArrayCopyNode::Dest);
   const TypePtr* atp_src = get_address_type(phase, src);
   const TypePtr* atp_dest = get_address_type(phase, dest);
-  uint alias_idx_src = phase->C->get_alias_index(atp_src);
-  uint alias_idx_dest = phase->C->get_alias_index(atp_dest);
 
   Node *in_mem = in(TypeFunc::Memory);
-  Node *start_mem_src = in_mem;
-  Node *start_mem_dest = in_mem;
-  if (in_mem->is_MergeMem()) {
-    start_mem_src = in_mem->as_MergeMem()->memory_at(alias_idx_src);
-    start_mem_dest = in_mem->as_MergeMem()->memory_at(alias_idx_dest);
+  if (!in_mem->is_MergeMem()) {
+    in_mem = MergeMemNode::make(in_mem);
   }
 
 
@@ -581,13 +590,13 @@
   array_copy_test_overlap(phase, can_reshape, disjoint_bases, count, forward_ctl, backward_ctl);
 
   Node* forward_mem = array_copy_forward(phase, can_reshape, forward_ctl,
-                                         start_mem_src, start_mem_dest,
+                                         in_mem->as_MergeMem(),
                                          atp_src, atp_dest,
                                          adr_src, base_src, adr_dest, base_dest,
                                          copy_type, value_type, count);
 
   Node* backward_mem = array_copy_backward(phase, can_reshape, backward_ctl,
-                                           start_mem_src, start_mem_dest,
+                                           in_mem->as_MergeMem(),
                                            atp_src, atp_dest,
                                            adr_src, base_src, adr_dest, base_dest,
                                            copy_type, value_type, count);
@@ -595,13 +604,21 @@
   Node* ctl = NULL;
   if (!forward_ctl->is_top() && !backward_ctl->is_top()) {
     ctl = new RegionNode(3);
-    mem = new PhiNode(ctl, Type::MEMORY, atp_dest);
     ctl->init_req(1, forward_ctl);
-    mem->init_req(1, forward_mem);
     ctl->init_req(2, backward_ctl);
-    mem->init_req(2, backward_mem);
     ctl = phase->transform(ctl);
-    mem = phase->transform(mem);
+    MergeMemNode* forward_mm = forward_mem->as_MergeMem();
+    MergeMemNode* backward_mm = backward_mem->as_MergeMem();
+    for (MergeMemStream mms(forward_mm, backward_mm); mms.next_non_empty2(); ) {
+      if (mms.memory() != mms.memory2()) {
+        Node* phi = new PhiNode(ctl, Type::MEMORY, phase->C->get_adr_type(mms.alias_idx()));
+        phi->init_req(1, mms.memory());
+        phi->init_req(2, mms.memory2());
+        phi = phase->transform(phi);
+        mms.set_memory(phi);
+      }
+    }
+    mem = forward_mem;
   } else if (!forward_ctl->is_top()) {
     ctl = forward_ctl;
     mem = forward_mem;
@@ -616,10 +633,6 @@
     phase->is_IterGVN()->set_delay_transform(false);
   }
 
-  MergeMemNode* out_mem = MergeMemNode::make(in_mem);
-  out_mem->set_memory_at(alias_idx_dest, mem);
-  mem = out_mem;
-
   if (!finish_transform(phase, can_reshape, ctl, mem)) {
     return NULL;
   }
--- a/src/hotspot/share/opto/arraycopynode.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/opto/arraycopynode.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -96,13 +96,13 @@
   void array_copy_test_overlap(PhaseGVN *phase, bool can_reshape,
                                bool disjoint_bases, int count,
                                Node*& forward_ctl, Node*& backward_ctl);
-  Node* array_copy_forward(PhaseGVN *phase, bool can_reshape, Node* ctl,
-                           Node* start_mem_src, Node* start_mem_dest,
+  Node* array_copy_forward(PhaseGVN *phase, bool can_reshape, Node*& ctl,
+                           MergeMemNode* mm,
                            const TypePtr* atp_src, const TypePtr* atp_dest,
                            Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
                            BasicType copy_type, const Type* value_type, int count);
-  Node* array_copy_backward(PhaseGVN *phase, bool can_reshape, Node* ctl,
-                            Node *start_mem_src, Node* start_mem_dest,
+  Node* array_copy_backward(PhaseGVN *phase, bool can_reshape, Node*& ctl,
+                            MergeMemNode* mm,
                             const TypePtr* atp_src, const TypePtr* atp_dest,
                             Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
                             BasicType copy_type, const Type* value_type, int count);
--- a/src/hotspot/share/opto/library_call.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/opto/library_call.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -4330,7 +4330,7 @@
       Node* alloc_obj = new_array(obj_klass, obj_length, 0, &obj_size);  // no arguments to push
 
       BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-      if (bs->array_copy_requires_gc_barriers(T_OBJECT)) {
+      if (bs->array_copy_requires_gc_barriers(true, T_OBJECT, true, BarrierSetC2::Parsing)) {
         // If it is an oop array, it requires very special treatment,
         // because gc barriers are required when accessing the array.
         Node* is_obja = generate_objArray_guard(obj_klass, (RegionNode*)NULL);
--- a/src/hotspot/share/opto/macroArrayCopy.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/opto/macroArrayCopy.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -552,7 +552,7 @@
     // At this point we know we do not need type checks on oop stores.
 
     BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-    if (alloc != NULL && !bs->array_copy_requires_gc_barriers(copy_type)) {
+    if (!bs->array_copy_requires_gc_barriers(alloc != NULL, copy_type, false, BarrierSetC2::Expansion)) {
       // If we do not need gc barriers, copy using the jint or jlong stub.
       copy_type = LP64_ONLY(UseCompressedOops ? T_INT : T_LONG) NOT_LP64(T_INT);
       assert(type2aelembytes(basic_elem_type) == type2aelembytes(copy_type),
@@ -1127,9 +1127,6 @@
     if (ac->_dest_type != TypeOopPtr::BOTTOM) {
       adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr();
     }
-    if (ac->_src_type != ac->_dest_type) {
-      adr_type = TypeRawPtr::BOTTOM;
-    }
     generate_arraycopy(ac, alloc, &ctrl, merge_mem, &io,
                        adr_type, T_OBJECT,
                        src, src_offset, dest, dest_offset, length,
--- a/src/hotspot/share/prims/jni.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/prims/jni.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -3779,13 +3779,7 @@
 void quicken_jni_functions() {
   // Replace Get<Primitive>Field with fast versions
   if (UseFastJNIAccessors && !JvmtiExport::can_post_field_access()
-      && !VerifyJNIFields && !CountJNICalls && !CheckJNICalls
-#if defined(_WINDOWS) && defined(IA32) && defined(COMPILER2)
-      // windows x86 currently needs SEH wrapper and the gain of the fast
-      // versions currently isn't certain for server vm on uniprocessor.
-      && os::is_MP()
-#endif
-  ) {
+      && !VerifyJNIFields && !CountJNICalls && !CheckJNICalls) {
     address func;
     func = JNI_FastGetField::generate_fast_get_boolean_field();
     if (func != (address)-1) {
@@ -3918,9 +3912,7 @@
 
   // We use Atomic::xchg rather than Atomic::add/dec since on some platforms
   // the add/dec implementations are dependent on whether we are running
-  // on a multiprocessor, and at this stage of initialization the os::is_MP
-  // function used to determine this will always return false. Atomic::xchg
-  // does not have this problem.
+  // on a multiprocessor Atomic::xchg does not have this problem.
   if (Atomic::xchg(1, &vm_created) == 1) {
     return JNI_EEXIST;   // already created, or create attempt in progress
   }
--- a/src/hotspot/share/prims/jvmtiTagMap.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/prims/jvmtiTagMap.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -853,7 +853,7 @@
     if (!fld.access_flags().is_static()) {
       continue;
     }
-    field_map->add(max_field_index - index, fld.signature()->byte_at(0), fld.offset());
+    field_map->add(max_field_index - index, fld.signature()->char_at(0), fld.offset());
   }
   return field_map;
 }
@@ -879,7 +879,7 @@
     if (fld.access_flags().is_static()) {
       continue;
     }
-    field_map->add(max_field_index - index, fld.signature()->byte_at(0), fld.offset());
+    field_map->add(max_field_index - index, fld.signature()->char_at(0), fld.offset());
   }
 
   return field_map;
--- a/src/hotspot/share/prims/methodHandles.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/prims/methodHandles.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -537,7 +537,7 @@
   assert(vmSymbols::object_signature()->equals(OBJ_SIG), "");
   const int len = sig->utf8_length();
   for (int i = 0; i < len; i++) {
-    switch (sig->byte_at(i)) {
+    switch (sig->char_at(i)) {
     case 'L':
       // only java/lang/Object is valid here
       if (sig->index_of_at(i, OBJ_SIG, OBJ_SIG_LEN) != i)
@@ -563,8 +563,8 @@
   } else if (is_basic_type_signature(sig)) {
     sig->increment_refcount();
     return sig;  // that was easy
-  } else if (sig->byte_at(0) != '(') {
-    BasicType bt = char2type(sig->byte_at(0));
+  } else if (sig->char_at(0) != '(') {
+    BasicType bt = char2type(sig->char_at(0));
     if (is_subword_type(bt)) {
       bsig = vmSymbols::int_signature();
     } else {
@@ -615,7 +615,7 @@
   int array = 0;
   bool prev_type = false;
   for (int i = 0; i < len; i++) {
-    char ch = sig->byte_at(i);
+    char ch = sig->char_at(i);
     switch (ch) {
     case '(': case ')':
       prev_type = false;
@@ -630,7 +630,7 @@
       {
         if (prev_type)  st->put(',');
         int start = i+1, slash = start;
-        while (++i < len && (ch = sig->byte_at(i)) != ';') {
+        while (++i < len && (ch = sig->char_at(i)) != ';') {
           if (ch == '/' || ch == '.' || ch == '$')  slash = i+1;
         }
         if (slash < i)  start = slash;
@@ -638,7 +638,7 @@
           st->put('L');
         } else {
           for (int j = start; j < i; j++)
-            st->put(sig->byte_at(j));
+            st->put(sig->char_at(j));
           prev_type = true;
         }
         break;
@@ -975,7 +975,7 @@
   }
   if (sig != NULL) {
     if (sig->utf8_length() == 0)  return 0; // a match is not possible
-    if (sig->byte_at(0) == '(')
+    if (sig->char_at(0) == '(')
       match_flags &= ~(IS_FIELD | IS_TYPE);
     else
       match_flags &= ~(IS_CONSTRUCTOR | IS_METHOD);
@@ -1456,7 +1456,7 @@
           {
             Symbol* type = caller->constants()->signature_ref_at(bss_index_in_pool);
             Handle th;
-            if (type->byte_at(0) == '(') {
+            if (type->char_at(0) == '(') {
               th = SystemDictionary::find_method_handle_type(type, caller, CHECK);
             } else {
               th = SystemDictionary::find_java_mirror_for_type(type, caller, SignatureStream::NCDFError, CHECK);
--- a/src/hotspot/share/prims/nativeLookup.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/prims/nativeLookup.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -103,7 +103,7 @@
   st.print("__");
   // find ')'
   int end;
-  for (end = 0; end < signature->utf8_length() && signature->byte_at(end) != ')'; end++);
+  for (end = 0; end < signature->utf8_length() && signature->char_at(end) != ')'; end++);
   // skip first '('
   mangle_name_on(&st, signature, 1, end);
   return st.as_string();
@@ -288,7 +288,7 @@
 
   Symbol* signature = method->signature();
   for (int end = 0; end < signature->utf8_length(); end++) {
-    if (signature->byte_at(end) == 'L') {
+    if (signature->char_at(end) == 'L') {
       // Don't allow object types
       return NULL;
     }
--- a/src/hotspot/share/runtime/arguments.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/arguments.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -526,8 +526,6 @@
   // --- Non-alias flags - sorted by obsolete_in then expired_in:
   { "MaxGCMinorPauseMillis",        JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
   { "UseConcMarkSweepGC",           JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
-  { "AssumeMP",                     JDK_Version::jdk(10),JDK_Version::undefined(), JDK_Version::undefined() },
-  { "MonitorInUseLists",            JDK_Version::jdk(10),JDK_Version::undefined(), JDK_Version::undefined() },
   { "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() },
@@ -540,34 +538,16 @@
   // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
   { "DefaultMaxRAMFraction",        JDK_Version::jdk(8),  JDK_Version::undefined(), JDK_Version::undefined() },
   { "CreateMinidumpOnCrash",        JDK_Version::jdk(9),  JDK_Version::undefined(), JDK_Version::undefined() },
-  { "MustCallLoadClassInternal",    JDK_Version::jdk(10), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "UnsyncloadClass",              JDK_Version::jdk(10), JDK_Version::jdk(11), JDK_Version::jdk(12) },
   { "TLABStats",                    JDK_Version::jdk(12), JDK_Version::undefined(), JDK_Version::undefined() },
 
   // -------------- Obsolete Flags - sorted by expired_in --------------
-  { "CheckAssertionStatusDirectives",JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "PrintMallocFree",               JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "PrintMalloc",                   JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "ShowSafepointMsgs",             JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "FastTLABRefill",                JDK_Version::jdk(10),     JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "SafepointSpinBeforeYield",      JDK_Version::jdk(10),     JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "CheckEndorsedAndExtDirs",       JDK_Version::jdk(10),     JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "DeferThrSuspendLoopCount",      JDK_Version::jdk(10),     JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "DeferPollingPageLoopCount",     JDK_Version::jdk(10),     JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "TraceScavenge",                 JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
   { "PermSize",                      JDK_Version::undefined(), JDK_Version::jdk(8),  JDK_Version::undefined() },
   { "MaxPermSize",                   JDK_Version::undefined(), JDK_Version::jdk(8),  JDK_Version::undefined() },
   { "SharedReadWriteSize",           JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
   { "SharedReadOnlySize",            JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
   { "SharedMiscDataSize",            JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
   { "SharedMiscCodeSize",            JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
-  { "UseUTCFileTimestamp",           JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "InlineNotify",                  JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "EnableTracing",                 JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "UseLockedTracing",              JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "NativeMonitorTimeout",          JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "NativeMonitorSpinLimit",        JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "NativeMonitorFlags",            JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
+  { "AssumeMP",                      JDK_Version::jdk(10),     JDK_Version::jdk(12), JDK_Version::jdk(13) },
   { "UnlinkSymbolsALot",             JDK_Version::jdk(11),     JDK_Version::jdk(12), JDK_Version::jdk(13) },
   { "AllowNonVirtualCalls",          JDK_Version::jdk(11),     JDK_Version::jdk(12), JDK_Version::jdk(13) },
   { "PrintSafepointStatistics",      JDK_Version::jdk(11),     JDK_Version::jdk(12), JDK_Version::jdk(13) },
@@ -579,6 +559,7 @@
   { "SyncVerbose",                   JDK_Version::undefined(), JDK_Version::jdk(12), JDK_Version::jdk(13) },
   { "SyncFlags",                     JDK_Version::undefined(), JDK_Version::jdk(12), JDK_Version::jdk(13) },
   { "SyncKnobs",                     JDK_Version::undefined(), JDK_Version::jdk(12), JDK_Version::jdk(13) },
+  { "MonitorInUseLists",             JDK_Version::jdk(10),     JDK_Version::jdk(12), JDK_Version::jdk(13) },
 
 #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
   { "dep > obs",                    JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
--- a/src/hotspot/share/runtime/deoptimization.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/deoptimization.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1451,7 +1451,7 @@
   Symbol*  symbol  = constant_pool->symbol_at(index);
 
   // class name?
-  if (symbol->byte_at(0) != '(') {
+  if (symbol->char_at(0) != '(') {
     Handle protection_domain (THREAD, constant_pool->pool_holder()->protection_domain());
     SystemDictionary::resolve_or_null(symbol, class_loader, protection_domain, CHECK);
     return;
--- a/src/hotspot/share/runtime/fieldType.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/fieldType.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -32,21 +32,21 @@
 #include "runtime/signature.hpp"
 
 BasicType FieldType::basic_type(Symbol* signature) {
-  return char2type(signature->byte_at(0));
+  return char2type(signature->char_at(0));
 }
 
 // Check if it is a valid array signature
 bool FieldType::is_valid_array_signature(Symbol* sig) {
   assert(sig->utf8_length() > 1, "this should already have been checked");
-  assert(sig->byte_at(0) == '[', "this should already have been checked");
+  assert(sig->char_at(0) == '[', "this should already have been checked");
   // The first character is already checked
   int i = 1;
   int len = sig->utf8_length();
   // First skip all '['s
-  while(i < len - 1 && sig->byte_at(i) == '[') i++;
+  while(i < len - 1 && sig->char_at(i) == '[') i++;
 
   // Check type
-  switch(sig->byte_at(i)) {
+  switch(sig->char_at(i)) {
     case 'B': // T_BYTE
     case 'C': // T_CHAR
     case 'D': // T_DOUBLE
@@ -59,7 +59,7 @@
       return (i + 1 == len);
     case 'L':
       // If it is an object, the last character must be a ';'
-      return sig->byte_at(len - 1) == ';';
+      return sig->char_at(len - 1) == ';';
   }
 
   return false;
@@ -70,7 +70,7 @@
   assert(basic_type(signature) == T_ARRAY, "must be array");
   int index = 1;
   int dim   = 1;
-  while (signature->byte_at(index) == '[') {
+  while (signature->char_at(index) == '[') {
     index++;
     dim++;
   }
--- a/src/hotspot/share/runtime/fieldType.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/fieldType.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -58,14 +58,14 @@
   static BasicType basic_type(Symbol* signature);
 
   // Testing
-  static bool is_array(Symbol* signature) { return signature->utf8_length() > 1 && signature->byte_at(0) == '[' && is_valid_array_signature(signature); }
+  static bool is_array(Symbol* signature) { return signature->utf8_length() > 1 && signature->char_at(0) == '[' && is_valid_array_signature(signature); }
 
   static bool is_obj(Symbol* signature) {
      int sig_length = signature->utf8_length();
      // Must start with 'L' and end with ';'
      return (sig_length >= 2 &&
-             (signature->byte_at(0) == 'L') &&
-             (signature->byte_at(sig_length - 1) == ';'));
+             (signature->char_at(0) == 'L') &&
+             (signature->char_at(sig_length - 1) == ';'));
   }
 
   // Parse field and extract array information. Works for T_ARRAY only.
--- a/src/hotspot/share/runtime/flags/jvmFlag.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/flags/jvmFlag.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -272,7 +272,7 @@
 
   // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
   static void printFlags(outputStream* out, bool withComments, bool printRanges = false, bool skipDefaults = false);
-  static void printError(bool verbose, const char* msg, ...);
+  static void printError(bool verbose, const char* msg, ...) ATTRIBUTE_PRINTF(2, 3);
 
   static void verify() PRODUCT_RETURN;
 };
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -94,7 +94,7 @@
   if (value < 0 || value > 512) {
     JVMFlag::printError(verbose,
                         "AllocatePrefetchDistance (" INTX_FORMAT ") must be "
-                        "between 0 and " INTX_FORMAT "\n",
+                        "between 0 and %d\n",
                         AllocatePrefetchDistance, 512);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
@@ -162,7 +162,7 @@
       JVMFlag::printError(verbose,
                           "CompileThreshold * (InterpreterProfilePercentage - OnStackReplacePercentage) / 100 = "
                           INTX_FORMAT " "
-                          "must be between 0 and " INTX_FORMAT ", try changing "
+                          "must be between 0 and %d, try changing "
                           "CompileThreshold, InterpreterProfilePercentage, and/or OnStackReplacePercentage\n",
                           (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100,
                           INT_MAX >> InvocationCounter::count_shift);
@@ -182,7 +182,7 @@
     if (backward_branch_limit < 0) {
       JVMFlag::printError(verbose,
                           "CompileThreshold * OnStackReplacePercentage / 100 = " INTX_FORMAT " "
-                          "must be between 0 and " INTX_FORMAT ", try changing "
+                          "must be between 0 and %d, try changing "
                           "CompileThreshold and/or OnStackReplacePercentage\n",
                           (CompileThreshold * OnStackReplacePercentage) / 100,
                           INT_MAX >> InvocationCounter::count_shift);
@@ -395,8 +395,8 @@
 #if INCLUDE_RTM_OPT
   if (UseRTMLocking && !is_power_of_2(RTMTotalCountIncrRate)) {
     JVMFlag::printError(verbose,
-                        "RTMTotalCountIncrRate (" INTX_FORMAT
-                        ") must be a power of 2, resetting it to 64\n",
+                        "RTMTotalCountIncrRate (%d) must be "
+                        "a power of 2, resetting it to 64\n",
                         RTMTotalCountIncrRate);
     FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
   }
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -42,8 +42,8 @@
   if (value >= (intx)os::vm_page_size()) {
     JVMFlag::printError(verbose,
                         "ObjectAlignmentInBytes (" INTX_FORMAT ") must be "
-                        "less than page size (" INTX_FORMAT ")\n",
-                        value, (intx)os::vm_page_size());
+                        "less than page size (%d)\n",
+                        value, os::vm_page_size());
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -79,7 +79,7 @@
   if ((value % PeriodicTask::interval_gran) != 0) {
     JVMFlag::printError(verbose,
                         "BiasedLockingStartupDelay (" INTX_FORMAT ") must be "
-                        "evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
+                        "evenly divisible by PeriodicTask::interval_gran (%d)\n",
                         value, PeriodicTask::interval_gran);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
@@ -123,7 +123,7 @@
   if ((value % PeriodicTask::interval_gran != 0)) {
     JVMFlag::printError(verbose,
                         "PerfDataSamplingInterval (" INTX_FORMAT ") must be "
-                        "evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
+                        "evenly divisible by PeriodicTask::interval_gran (%d)\n",
                         value, PeriodicTask::interval_gran);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
--- a/src/hotspot/share/runtime/globals.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/globals.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -247,9 +247,6 @@
           range(8, 256)                                                     \
           constraint(ObjectAlignmentInBytesConstraintFunc,AtParse)          \
                                                                             \
-  product(bool, AssumeMP, true,                                             \
-          "(Deprecated) Instruct the VM to assume multiple processors are available")\
-                                                                            \
   /* 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)                                         */ \
@@ -830,8 +827,6 @@
   product(intx, MonitorBound, 0, "Bound Monitor population")                \
           range(0, max_jint)                                                \
                                                                             \
-  product(bool, MonitorInUseLists, true, "Track Monitors for Deflation")    \
-                                                                            \
   experimental(intx, MonitorUsedDeflationThreshold, 90,                     \
                 "Percentage of used monitors before triggering cleanup "    \
                 "safepoint which deflates monitors (0 is off). "            \
--- a/src/hotspot/share/runtime/handshake.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/handshake.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -347,6 +347,27 @@
          target->is_ext_suspended();
 }
 
+static bool possibly_vmthread_can_process_handshake(JavaThread* target) {
+  // An externally suspended thread cannot be resumed while the
+  // Threads_lock is held so it is safe.
+  // Note that this method is allowed to produce false positives.
+  assert(Threads_lock->owned_by_self(), "Not holding Threads_lock.");
+  if (target->is_ext_suspended()) {
+    return true;
+  }
+  switch (target->thread_state()) {
+  case _thread_in_native:
+    // native threads are safe if they have no java stack or have walkable stack
+    return !target->has_last_Java_frame() || target->frame_anchor()->walkable();
+
+  case _thread_blocked:
+    return true;
+
+  default:
+    return false;
+  }
+}
+
 bool HandshakeState::claim_handshake_for_vmthread() {
   if (!_semaphore.trywait()) {
     return false;
@@ -366,7 +387,7 @@
     return;
   }
 
-  if (!vmthread_can_process_handshake(target)) {
+  if (!possibly_vmthread_can_process_handshake(target)) {
     // JT is observed in an unsafe state, it must notice the handshake itself
     return;
   }
--- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -79,17 +79,15 @@
  private:
   static void serialize_thread_state_internal(JavaThread* thread, bool needs_exception_handler) {
     // Make sure new state is seen by VM thread
-    if (os::is_MP()) {
-      if (UseMembar) {
-        // Force a fence between the write above and read below
-        OrderAccess::fence();
+    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 {
-        // 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);
-        }
+        os::write_memory_serialize_page(thread);
       }
     }
   }
--- a/src/hotspot/share/runtime/os.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/os.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -1010,6 +1010,15 @@
   return (SafeFetch32(aligned, cafebabe) != cafebabe) || (SafeFetch32(aligned, deadbeef) != deadbeef);
 }
 
+bool os::is_readable_range(const void* from, const void* to) {
+  for (address p = align_down((address)from, min_page_size()); p < to; p += min_page_size()) {
+    if (!is_readable_pointer(p)) {
+      return false;
+    }
+  }
+  return true;
+}
+
 
 // moved from debug.cpp (used to be find()) but still called from there
 // The verbose parameter is only set by the debug code in one case
@@ -1020,99 +1029,48 @@
     st->print_cr("0x0 is NULL");
     return;
   }
+
+  // Check if addr points into a code blob.
   CodeBlob* b = CodeCache::find_blob_unsafe(addr);
   if (b != NULL) {
-    if (b->is_buffer_blob()) {
-      // the interpreter is generated into a buffer blob
-      InterpreterCodelet* i = Interpreter::codelet_containing(addr);
-      if (i != NULL) {
-        st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an Interpreter codelet", p2i(addr), (int)(addr - i->code_begin()));
-        i->print_on(st);
-        return;
-      }
-      if (Interpreter::contains(addr)) {
-        st->print_cr(INTPTR_FORMAT " is pointing into interpreter code"
-                     " (not bytecode specific)", p2i(addr));
-        return;
-      }
-      //
-      if (AdapterHandlerLibrary::contains(b)) {
-        st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an AdapterHandler", p2i(addr), (int)(addr - b->code_begin()));
-        AdapterHandlerLibrary::print_handler_on(st, b);
-      }
-      // the stubroutines are generated into a buffer blob
-      StubCodeDesc* d = StubCodeDesc::desc_for(addr);
-      if (d != NULL) {
-        st->print_cr(INTPTR_FORMAT " is at begin+%d in a stub", p2i(addr), (int)(addr - d->begin()));
-        d->print_on(st);
-        st->cr();
-        return;
-      }
-      if (StubRoutines::contains(addr)) {
-        st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) stub routine", p2i(addr));
-        return;
-      }
-      // the InlineCacheBuffer is using stubs generated into a buffer blob
-      if (InlineCacheBuffer::contains(addr)) {
-        st->print_cr(INTPTR_FORMAT " is pointing into InlineCacheBuffer", p2i(addr));
-        return;
-      }
-      VtableStub* v = VtableStubs::stub_containing(addr);
-      if (v != NULL) {
-        st->print_cr(INTPTR_FORMAT " is at entry_point+%d in a vtable stub", p2i(addr), (int)(addr - v->entry_point()));
-        v->print_on(st);
-        st->cr();
-        return;
-      }
-    }
-    nmethod* nm = b->as_nmethod_or_null();
-    if (nm != NULL) {
-      ResourceMark rm;
-      st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
-                p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
-      if (verbose) {
-        st->print(" for ");
-        nm->method()->print_value_on(st);
-      }
-      st->cr();
-      nm->print_nmethod(verbose);
-      return;
-    }
-    st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - b->code_begin()));
-    b->print_on(st);
+    b->dump_for_addr(addr, st, verbose);
     return;
   }
 
+  // Check if addr points into Java heap.
   if (Universe::heap()->is_in(addr)) {
-    HeapWord* p = Universe::heap()->block_start(addr);
-    bool print = false;
-    // If we couldn't find it it just may mean that heap wasn't parsable
-    // See if we were just given an oop directly
-    if (p != NULL && Universe::heap()->block_is_obj(p)) {
-      print = true;
-    } else if (p == NULL && oopDesc::is_oop(oop(addr))) {
-      p = (HeapWord*) addr;
-      print = true;
-    }
-    if (print) {
-      if (p == (HeapWord*) addr) {
-        st->print_cr(INTPTR_FORMAT " is an oop", p2i(addr));
+    oop o = oopDesc::oop_or_null(addr);
+    if (o != NULL) {
+      if ((HeapWord*)o == (HeapWord*)addr) {
+        st->print(INTPTR_FORMAT " is an oop: ", p2i(addr));
       } else {
-        st->print_cr(INTPTR_FORMAT " is pointing into object: " INTPTR_FORMAT, p2i(addr), p2i(p));
+        st->print(INTPTR_FORMAT " is pointing into object: " , p2i(addr));
       }
-      oop(p)->print_on(st);
+      o->print_on(st);
       return;
     }
-  } else {
-    if (Universe::heap()->is_in_reserved(addr)) {
-      st->print_cr(INTPTR_FORMAT " is an unallocated location "
-                   "in the heap", p2i(addr));
+  } else if (Universe::heap()->is_in_reserved(addr)) {
+    st->print_cr(INTPTR_FORMAT " is an unallocated location in the heap", p2i(addr));
+    return;
+  }
+
+  // Compressed oop needs to be decoded first.
+#ifdef _LP64
+  if (UseCompressedOops && ((uintptr_t)addr &~ (uintptr_t)max_juint) == 0) {
+    narrowOop narrow_oop = (narrowOop)(uintptr_t)addr;
+    oop o = oopDesc::decode_oop_raw(narrow_oop);
+
+    if (oopDesc::is_valid(o)) {
+      st->print(UINT32_FORMAT " is a compressed pointer to object: ", narrow_oop);
+      o->print_on(st);
       return;
     }
   }
+#endif
 
   bool accessible = is_readable_pointer(addr);
 
+  // Check if addr is a JNI handle.
   if (align_down((intptr_t)addr, sizeof(intptr_t)) != 0 && accessible) {
     if (JNIHandles::is_global_handle((jobject) addr)) {
       st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr));
@@ -1131,6 +1089,7 @@
 #endif
   }
 
+  // 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 &&
@@ -1159,9 +1118,12 @@
     }
   }
 
-  // Check if in metaspace and print types that have vptrs (only method now)
+  // Check if in metaspace and print types that have vptrs
   if (Metaspace::contains(addr)) {
-    if (Method::has_method_vptr((const void*)addr)) {
+    if (Klass::is_valid((Klass*)addr)) {
+      st->print_cr(INTPTR_FORMAT " is a pointer to class: ", p2i(addr));
+      ((Klass*)addr)->print_on(st);
+    } else if (Method::is_valid_method((const Method*)addr)) {
       ((Method*)addr)->print_value_on(st);
       st->cr();
     } else {
@@ -1171,6 +1133,20 @@
     return;
   }
 
+  // Compressed klass needs to be decoded first.
+#ifdef _LP64
+  if (UseCompressedClassPointers && ((uintptr_t)addr &~ (uintptr_t)max_juint) == 0) {
+    narrowKlass narrow_klass = (narrowKlass)(uintptr_t)addr;
+    Klass* k = Klass::decode_klass_raw(narrow_klass);
+
+    if (Klass::is_valid(k)) {
+      st->print_cr(UINT32_FORMAT " is a compressed pointer to class: " INTPTR_FORMAT, narrow_klass, p2i((HeapWord*)k));
+      k->print_on(st);
+      return;
+    }
+  }
+#endif
+
   // Try an OS specific find
   if (os::find(addr, st)) {
     return;
--- a/src/hotspot/share/runtime/os.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/os.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -226,8 +226,9 @@
     // the bootstrap routine for the stub generator needs to check
     // the processor count directly and leave the bootstrap routine
     // in place until called after initialization has ocurred.
-    return AssumeMP || (_processor_count != 1);
+    return (_processor_count != 1);
   }
+
   static julong available_memory();
   static julong physical_memory();
   static bool has_allocatable_memory_limit(julong* limit);
@@ -302,6 +303,9 @@
     return _page_sizes[0];
   }
 
+  // Return a lower bound for page sizes. Also works before os::init completed.
+  static size_t min_page_size() { return 4 * K; }
+
   // Methods for tracing page sizes returned by the above method.
   // The region_{min,max}_size parameters should be the values
   // passed to page_size_for_region() and page_size should be the result of that
@@ -414,6 +418,7 @@
 
   // Check if pointer points to readable memory (by 4-byte read access)
   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();
--- a/src/hotspot/share/runtime/signature.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/signature.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -50,7 +50,7 @@
 }
 
 void SignatureIterator::expect(char c) {
-  if (_signature->byte_at(_index) != c) fatal("expecting %c", c);
+  if (_signature->char_at(_index) != c) fatal("expecting %c", c);
   _index++;
 }
 
@@ -61,7 +61,7 @@
   //       work (stack underflow for some tests) - this seems to be a VC++ 6.0
   //       compiler bug (was problem - gri 4/27/2000).
   int size = -1;
-  switch(_signature->byte_at(_index)) {
+  switch(_signature->char_at(_index)) {
     case 'B': do_byte  (); if (_parameter_index < 0 ) _return_type = T_BYTE;
               _index++; size = T_BYTE_size   ; break;
     case 'C': do_char  (); if (_parameter_index < 0 ) _return_type = T_CHAR;
@@ -83,7 +83,7 @@
     case 'L':
       { int begin = ++_index;
         Symbol* sig = _signature;
-        while (sig->byte_at(_index++) != ';') ;
+        while (sig->char_at(_index++) != ';') ;
         do_object(begin, _index);
       }
       if (_parameter_index < 0 ) _return_type = T_OBJECT;
@@ -92,11 +92,11 @@
     case '[':
       { int begin = ++_index;
         Symbol* sig = _signature;
-        while (sig->byte_at(_index) == '[') {
+        while (sig->char_at(_index) == '[') {
           _index++;
         }
-        if (sig->byte_at(_index) == 'L') {
-          while (sig->byte_at(_index++) != ';') ;
+        if (sig->char_at(_index) == 'L') {
+          while (sig->char_at(_index++) != ';') ;
         } else {
           _index++;
         }
@@ -137,7 +137,7 @@
   _index = 0;
   _parameter_index = 0;
   expect('(');
-  while (_signature->byte_at(_index) != ')') _parameter_index += parse_type();
+  while (_signature->char_at(_index) != ')') _parameter_index += parse_type();
   expect(')');
   _parameter_index = 0;
 }
@@ -217,8 +217,8 @@
   // Need to skip over each type in the signature's argument list until a
   // closing ')' is found., then get the return type.  We cannot just scan
   // for the first ')' because ')' is a legal character in a type name.
-  while (sig->byte_at(_index) != ')') {
-    switch(sig->byte_at(_index)) {
+  while (sig->char_at(_index) != ')') {
+    switch(sig->char_at(_index)) {
       case 'B':
       case 'C':
       case 'D':
@@ -234,17 +234,17 @@
         break;
       case 'L':
         {
-          while (sig->byte_at(_index++) != ';') ;
+          while (sig->char_at(_index++) != ';') ;
         }
         break;
       case '[':
         {
           int begin = ++_index;
-          while (sig->byte_at(_index) == '[') {
+          while (sig->char_at(_index) == '[') {
             _index++;
           }
-          if (sig->byte_at(_index) == 'L') {
-            while (sig->byte_at(_index++) != ';') ;
+          if (sig->char_at(_index) == 'L') {
+            while (sig->char_at(_index++) != ';') ;
           } else {
             _index++;
           }
@@ -269,7 +269,7 @@
   _parameter_index = 0;
   _index = 0;
   expect('(');
-  while (_signature->byte_at(_index) != ')') _parameter_index += parse_type();
+  while (_signature->char_at(_index) != ')') _parameter_index += parse_type();
   expect(')');
   // Parse return type
   _parameter_index = -1;
@@ -304,20 +304,20 @@
     case 'L': {
       _type = T_OBJECT;
       Symbol* sig = _signature;
-      while (sig->byte_at(_end++) != ';');
+      while (sig->char_at(_end++) != ';');
       break;
     }
     case '[': {
       _type = T_ARRAY;
       Symbol* sig = _signature;
-      char c = sig->byte_at(_end);
-      while ('0' <= c && c <= '9') c = sig->byte_at(_end++);
-      while (sig->byte_at(_end) == '[') {
+      char c = sig->char_at(_end);
+      while ('0' <= c && c <= '9') c = sig->char_at(_end++);
+      while (sig->char_at(_end) == '[') {
         _end++;
-        c = sig->byte_at(_end);
-        while ('0' <= c && c <= '9') c = sig->byte_at(_end++);
+        c = sig->char_at(_end);
+        while ('0' <= c && c <= '9') c = sig->char_at(_end++);
       }
-      switch(sig->byte_at(_end)) {
+      switch(sig->char_at(_end)) {
         case 'B':
         case 'C':
         case 'D':
@@ -327,7 +327,7 @@
         case 'S':
         case 'Z':_end++; break;
         default: {
-          while (sig->byte_at(_end++) != ';');
+          while (sig->char_at(_end++) != ';');
           break;
         }
       }
@@ -353,8 +353,8 @@
   int begin = _begin;
   int end   = _end;
 
-  if (   _signature->byte_at(_begin) == 'L'
-      && _signature->byte_at(_end-1) == ';') {
+  if (   _signature->char_at(_begin) == 'L'
+      && _signature->char_at(_end-1) == ';') {
     begin++;
     end--;
   }
@@ -394,15 +394,15 @@
   int begin = _begin;
   int end   = _end;
 
-  if (   _signature->byte_at(_begin) == 'L'
-      && _signature->byte_at(_end-1) == ';') {
+  if (   _signature->char_at(_begin) == 'L'
+      && _signature->char_at(_end-1) == ';') {
     begin++;
     end--;
   }
 
   char* buffer = NEW_RESOURCE_ARRAY(char, end - begin);
   for (int index = begin; index < end; index++) {
-    buffer[index - begin] = _signature->byte_at(index);
+    buffer[index - begin] = _signature->char_at(index);
   }
   Symbol* result = SymbolTable::probe(buffer, end - begin);
   return result;
--- a/src/hotspot/share/runtime/signature.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/signature.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -378,7 +378,7 @@
     }
 
     _begin = _end;
-    int t = sig->byte_at(_begin);
+    int t = sig->char_at(_begin);
     switch (t) {
       case 'B': _type = T_BYTE;    break;
       case 'C': _type = T_CHAR;    break;
@@ -405,8 +405,8 @@
   enum FailureMode { ReturnNull, CNFException, NCDFError };
   Klass* as_klass(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS);
   oop as_java_mirror(Handle class_loader, Handle protection_domain, FailureMode failure_mode, TRAPS);
-  const jbyte* raw_bytes()  { return _signature->bytes() + _begin; }
-  int          raw_length() { return _end - _begin; }
+  const u1* raw_bytes()  { return _signature->bytes() + _begin; }
+  int       raw_length() { return _end - _begin; }
 
   // return same as_symbol except allocation of new symbols is avoided.
   Symbol* as_symbol_or_null();
--- a/src/hotspot/share/runtime/sweeper.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/sweeper.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -335,7 +335,6 @@
       VM_MarkActiveNMethods op;
       VMThread::execute(&op);
     }
-    _should_sweep = true;
   }
 }
 
@@ -452,7 +451,7 @@
   // allocations go to the non-profiled heap and we must be make sure that there is
   // enough space.
   double free_percent = 1 / CodeCache::reverse_free_ratio(CodeBlobType::MethodNonProfiled) * 100;
-  if (free_percent <= StartAggressiveSweepingAt) {
+  if (free_percent <= StartAggressiveSweepingAt || forced || _should_sweep) {
     do_stack_scanning();
   }
 
--- a/src/hotspot/share/runtime/synchronizer.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/synchronizer.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -961,28 +961,9 @@
 }
 
 void ObjectSynchronizer::oops_do(OopClosure* f) {
-  if (MonitorInUseLists) {
-    // When using thread local monitor lists, we only scan the
-    // global used list here (for moribund threads), and
-    // the thread-local monitors in Thread::oops_do().
-    global_used_oops_do(f);
-  } else {
-    global_oops_do(f);
-  }
-}
-
-void ObjectSynchronizer::global_oops_do(OopClosure* f) {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
-  PaddedEnd<ObjectMonitor> * block = OrderAccess::load_acquire(&gBlockList);
-  for (; block != NULL; block = next(block)) {
-    assert(block->object() == CHAINMARKER, "must be a block header");
-    for (int i = 1; i < _BLOCKSIZE; i++) {
-      ObjectMonitor* mid = (ObjectMonitor *)&block[i];
-      if (mid->object() != NULL) {
-        f->do_oop((oop*)mid->object_addr());
-      }
-    }
-  }
+  // We only scan the global used list here (for moribund threads), and
+  // the thread-local monitors in Thread::oops_do().
+  global_used_oops_do(f);
 }
 
 void ObjectSynchronizer::global_used_oops_do(OopClosure* f) {
@@ -1078,15 +1059,10 @@
     if (m != NULL) {
       Self->omFreeList = m->FreeNext;
       Self->omFreeCount--;
-      // CONSIDER: set m->FreeNext = BAD -- diagnostic hygiene
       guarantee(m->object() == NULL, "invariant");
-      if (MonitorInUseLists) {
-        m->FreeNext = Self->omInUseList;
-        Self->omInUseList = m;
-        Self->omInUseCount++;
-      } else {
-        m->FreeNext = NULL;
-      }
+      m->FreeNext = Self->omInUseList;
+      Self->omInUseList = m;
+      Self->omInUseCount++;
       return m;
     }
 
@@ -1208,7 +1184,7 @@
   guarantee(m->object() == NULL, "invariant");
   guarantee(((m->is_busy()|m->_recursions) == 0), "freeing in-use monitor");
   // Remove from omInUseList
-  if (MonitorInUseLists && fromPerThreadAlloc) {
+  if (fromPerThreadAlloc) {
     ObjectMonitor* cur_mid_in_use = NULL;
     bool extracted = false;
     for (ObjectMonitor* mid = Self->omInUseList; mid != NULL; cur_mid_in_use = mid, mid = mid->FreeNext) {
@@ -1531,28 +1507,21 @@
 }
 
 
-// Deflate_idle_monitors() is called at all safepoints, immediately
-// after all mutators are stopped, but before any objects have moved.
-// It traverses the list of known monitors, deflating where possible.
-// The scavenged monitor are returned to the monitor free list.
+// We create a list of in-use monitors for each thread.
 //
-// Beware that we scavenge at *every* stop-the-world point.
-// Having a large number of monitors in-circulation negatively
-// impacts the performance of some applications (e.g., PointBase).
-// Broadly, we want to minimize the # of monitors in circulation.
+// deflate_thread_local_monitors() scans a single thread's in-use list, while
+// deflate_idle_monitors() scans only a global list of in-use monitors which
+// is populated only as a thread dies (see omFlush()).
 //
-// We have added a flag, MonitorInUseLists, which creates a list
-// of active monitors for each thread. deflate_idle_monitors()
-// only scans the per-thread in-use lists. omAlloc() puts all
-// assigned monitors on the per-thread list. deflate_idle_monitors()
-// returns the non-busy monitors to the global free list.
-// When a thread dies, omFlush() adds the list of active monitors for
-// that thread to a global gOmInUseList acquiring the
-// global list lock. deflate_idle_monitors() acquires the global
-// list lock to scan for non-busy monitors to the global free list.
-// An alternative could have used a single global in-use list. The
-// downside would have been the additional cost of acquiring the global list lock
-// for every omAlloc().
+// These operations are called at all safepoints, immediately after mutators
+// are stopped, but before any objects have moved. Collectively they traverse
+// the population of in-use monitors, deflating where possible. The scavenged
+// monitors are returned to the monitor free list.
+//
+// Beware that we scavenge at *every* stop-the-world point. Having a large
+// number of monitors in-use could negatively impact performance. We also want
+// to minimize the total # of monitors in circulation, as they incur a small
+// footprint penalty.
 //
 // Perversely, the heap size -- and thus the STW safepoint rate --
 // typically drives the scavenge rate.  Large heaps can mean infrequent GC,
@@ -1671,47 +1640,16 @@
   // See e.g. 6320749
   Thread::muxAcquire(&gListLock, "scavenge - return");
 
-  if (MonitorInUseLists) {
-    // Note: the thread-local monitors lists get deflated in
-    // a separate pass. See deflate_thread_local_monitors().
-
-    // For moribund threads, scan gOmInUseList
-    if (gOmInUseList) {
-      counters->nInCirculation += gOmInUseCount;
-      int deflated_count = deflate_monitor_list((ObjectMonitor **)&gOmInUseList, &freeHeadp, &freeTailp);
-      gOmInUseCount -= deflated_count;
-      counters->nScavenged += deflated_count;
-      counters->nInuse += gOmInUseCount;
-    }
+  // Note: the thread-local monitors lists get deflated in
+  // a separate pass. See deflate_thread_local_monitors().
 
-  } else {
-    PaddedEnd<ObjectMonitor> * block = OrderAccess::load_acquire(&gBlockList);
-    for (; block != NULL; block = next(block)) {
-      // Iterate over all extant monitors - Scavenge all idle monitors.
-      assert(block->object() == CHAINMARKER, "must be a block header");
-      counters->nInCirculation += _BLOCKSIZE;
-      for (int i = 1; i < _BLOCKSIZE; i++) {
-        ObjectMonitor* mid = (ObjectMonitor*)&block[i];
-        oop obj = (oop)mid->object();
-
-        if (obj == NULL) {
-          // The monitor is not associated with an object.
-          // The monitor should either be a thread-specific private
-          // free list or the global free list.
-          // obj == NULL IMPLIES mid->is_busy() == 0
-          guarantee(!mid->is_busy(), "invariant");
-          continue;
-        }
-        deflated = deflate_monitor(mid, obj, &freeHeadp, &freeTailp);
-
-        if (deflated) {
-          mid->FreeNext = NULL;
-          counters->nScavenged++;
-        } else {
-          counters->nInuse++;
-        }
-      }
-    }
+  // For moribund threads, scan gOmInUseList
+  if (gOmInUseList) {
+    counters->nInCirculation += gOmInUseCount;
+    int deflated_count = deflate_monitor_list((ObjectMonitor **)&gOmInUseList, &freeHeadp, &freeTailp);
+    gOmInUseCount -= deflated_count;
+    counters->nScavenged += deflated_count;
+    counters->nInuse += gOmInUseCount;
   }
 
   // Move the scavenged monitors back to the global free list.
@@ -1744,7 +1682,6 @@
 
 void ObjectSynchronizer::deflate_thread_local_monitors(Thread* thread, DeflateMonitorCounters* counters) {
   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
-  if (!MonitorInUseLists) return;
 
   ObjectMonitor * freeHeadp = NULL;  // Local SLL of scavenged monitors
   ObjectMonitor * freeTailp = NULL;
--- a/src/hotspot/share/runtime/synchronizer.hpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/synchronizer.hpp	Fri Oct 05 11:10:27 2018 -0400
@@ -168,8 +168,6 @@
   // count of entries in gOmInUseList
   static int gOmInUseCount;
 
-  // Process oops in all monitors
-  static void global_oops_do(OopClosure* f);
   // Process oops in all global used monitors (i.e. moribund thread's monitors)
   static void global_used_oops_do(OopClosure* f);
   // Process oops in monitors on the given list
--- a/src/hotspot/share/runtime/thread.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/thread.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -851,11 +851,9 @@
   f->do_oop((oop*)&_pending_exception);
   handle_area()->oops_do(f);
 
-  if (MonitorInUseLists) {
-    // When using thread local monitor lists, we scan them here,
-    // and the remaining global monitors in ObjectSynchronizer::oops_do().
-    ObjectSynchronizer::thread_local_used_oops_do(this, f);
-  }
+  // We scan thread local monitor lists here, and the remaining global
+  // monitors in ObjectSynchronizer::oops_do().
+  ObjectSynchronizer::thread_local_used_oops_do(this, f);
 }
 
 void Thread::metadata_handles_do(void f(Metadata*)) {
--- a/src/hotspot/share/runtime/vmStructs.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/runtime/vmStructs.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -329,8 +329,8 @@
   nonstatic_field(ObjArrayKlass,               _bottom_klass,                                 Klass*)                                \
   volatile_nonstatic_field(Symbol,             _length_and_refcount,                          unsigned int)                          \
   nonstatic_field(Symbol,                      _identity_hash,                                short)                                 \
-  unchecked_nonstatic_field(Symbol,            _body,                                         sizeof(jbyte)) /* NOTE: no type */     \
-  nonstatic_field(Symbol,                      _body[0],                                      jbyte)                                 \
+  unchecked_nonstatic_field(Symbol,            _body,                                         sizeof(u1)) /* NOTE: no type */        \
+  nonstatic_field(Symbol,                      _body[0],                                      u1)                                    \
   nonstatic_field(TypeArrayKlass,              _max_length,                                   jint)                                  \
                                                                                                                                      \
   /***********************/                                                                                                          \
--- a/src/hotspot/share/services/heapDumper.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/hotspot/share/services/heapDumper.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -696,7 +696,7 @@
 
 // returns hprof tag for the given type signature
 hprofTag DumperSupport::sig2tag(Symbol* sig) {
-  switch (sig->byte_at(0)) {
+  switch (sig->char_at(0)) {
     case JVM_SIGNATURE_CLASS    : return HPROF_NORMAL_OBJECT;
     case JVM_SIGNATURE_ARRAY    : return HPROF_NORMAL_OBJECT;
     case JVM_SIGNATURE_BYTE     : return HPROF_BYTE;
@@ -821,7 +821,7 @@
   for (FieldStream fld(ik, false, false); !fld.eos(); fld.next()) {
     if (!fld.access_flags().is_static()) {
       Symbol* sig = fld.signature();
-      switch (sig->byte_at(0)) {
+      switch (sig->char_at(0)) {
         case JVM_SIGNATURE_CLASS   :
         case JVM_SIGNATURE_ARRAY   : size += oopSize; break;
 
@@ -889,7 +889,7 @@
       writer->write_u1(sig2tag(sig));       // type
 
       // value
-      dump_field_value(writer, sig->byte_at(0), ik->java_mirror(), fld.offset());
+      dump_field_value(writer, sig->char_at(0), ik->java_mirror(), fld.offset());
     }
   }
 
@@ -925,7 +925,7 @@
   for (FieldStream fld(ik, false, false); !fld.eos(); fld.next()) {
     if (!fld.access_flags().is_static()) {
       Symbol* sig = fld.signature();
-      dump_field_value(writer, sig->byte_at(0), o, fld.offset());
+      dump_field_value(writer, sig->char_at(0), o, fld.offset());
     }
   }
 }
--- a/src/java.base/share/classes/java/lang/Character.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/Character.java	Fri Oct 05 11:10:27 2018 -0400
@@ -5385,7 +5385,7 @@
             0x3260,   // 3260..327E; HANGUL
             0x327F,   // 327F..32CF; COMMON
             0x32D0,   // 32D0..32FE; KATAKANA
-            0x32FF,   // 32FF      ; UNKNOWN
+            0x32FF,   // 32FF      ; COMMON
             0x3300,   // 3300..3357; KATAKANA
             0x3358,   // 3358..33FF; COMMON
             0x3400,   // 3400..4DB5; HAN
@@ -6902,7 +6902,7 @@
             HANGUL,                   // 3260..327E
             COMMON,                   // 327F..32CF
             KATAKANA,                 // 32D0..32FE
-            UNKNOWN,                  // 32FF
+            COMMON,                   // 32FF
             KATAKANA,                 // 3300..3357
             COMMON,                   // 3358..33FF
             HAN,                      // 3400..4DB5
--- a/src/java.base/share/classes/java/lang/Class.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/Class.java	Fri Oct 05 11:10:27 2018 -0400
@@ -64,7 +64,6 @@
 import jdk.internal.loader.BootLoader;
 import jdk.internal.loader.BuiltinClassLoader;
 import jdk.internal.misc.Unsafe;
-import jdk.internal.misc.VM;
 import jdk.internal.module.Resources;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.ConstantPool;
@@ -540,11 +539,9 @@
             checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), false);
         }
 
-        // NOTE: the following code may not be strictly correct under
-        // the current Java memory model.
-
         // Constructor lookup
-        if (cachedConstructor == null) {
+        Constructor<T> tmpConstructor = cachedConstructor;
+        if (tmpConstructor == null) {
             if (this == Class.class) {
                 throw new IllegalAccessException(
                     "Can not call newInstance() on the Class for java.lang.Class"
@@ -555,9 +552,7 @@
                 final Constructor<T> c = getReflectionFactory().copyConstructor(
                     getConstructor0(empty, Member.DECLARED));
                 // Disable accessibility checks on the constructor
-                // since we have to do the security check here anyway
-                // (the stack depth is wrong for the Constructor's
-                // security check to work)
+                // access check is done with the true caller
                 java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction<>() {
                         public Void run() {
@@ -565,32 +560,24 @@
                                 return null;
                             }
                         });
-                cachedConstructor = c;
+                cachedConstructor = tmpConstructor = c;
             } catch (NoSuchMethodException e) {
                 throw (InstantiationException)
                     new InstantiationException(getName()).initCause(e);
             }
         }
-        Constructor<T> tmpConstructor = cachedConstructor;
-        // Security check (same as in java.lang.reflect.Constructor)
-        Class<?> caller = Reflection.getCallerClass();
-        if (newInstanceCallerCache != caller) {
-            int modifiers = tmpConstructor.getModifiers();
-            Reflection.ensureMemberAccess(caller, this, this, modifiers);
-            newInstanceCallerCache = caller;
-        }
-        // Run constructor
+
         try {
-            return tmpConstructor.newInstance((Object[])null);
+            Class<?> caller = Reflection.getCallerClass();
+            return getReflectionFactory().newInstance(tmpConstructor, null, caller);
         } catch (InvocationTargetException e) {
             Unsafe.getUnsafe().throwException(e.getTargetException());
             // Not reached
             return null;
         }
     }
+
     private transient volatile Constructor<T> cachedConstructor;
-    private transient volatile Class<?>       newInstanceCallerCache;
-
 
     /**
      * Determines if the specified {@code Object} is assignment-compatible
--- a/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java	Fri Oct 05 11:10:27 2018 -0400
@@ -37,7 +37,6 @@
 import java.lang.reflect.Modifier;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -578,23 +577,17 @@
             InvokerBytecodeGenerator.maybeDump(classBCName(className), classFile);
             Class<?> speciesCode;
 
-            ClassLoader cl = topClass().getClassLoader();
-            ProtectionDomain pd = null;
-            if (cl != null) {
-                pd = AccessController.doPrivileged(
-                        new PrivilegedAction<>() {
-                            @Override
-                            public ProtectionDomain run() {
-                                return topClass().getProtectionDomain();
-                            }
-                        });
-            }
-            try {
-                speciesCode = UNSAFE.defineClass(className, classFile, 0, classFile.length, cl, pd);
-            } catch (Exception ex) {
-                throw newInternalError(ex);
-            }
-
+            MethodHandles.Lookup lookup = IMPL_LOOKUP.in(topClass());
+            speciesCode = AccessController.doPrivileged(new PrivilegedAction<>() {
+                @Override
+                public Class<?> run() {
+                    try {
+                        return lookup.defineClass(classFile);
+                    } catch (Exception ex) {
+                        throw newInternalError(ex);
+                    }
+                }
+            });
             return speciesCode.asSubclass(topClass());
         }
 
--- a/src/java.base/share/classes/java/lang/invoke/Invokers.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, 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
@@ -505,7 +505,7 @@
          *  => checkcast(A)* & MH.invokeBasic(a*) & checkcast(R)
          * if a big adapter BA can be pulled out of (MT0,MT1)
          *  => BA.invokeBasic(MT0,MH,a*)
-         * if a local adapter LA can cached on static CS0 = new GICS(MT0)
+         * if a local adapter LA can be cached on static CS0 = new GICS(MT0)
          *  => CS0.LA.invokeBasic(MH,a*)
          * else
          *  => MH.asType(MT0).invokeBasic(A*)
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Fri Oct 05 11:10:27 2018 -0400
@@ -384,7 +384,7 @@
  * A method handle can be obtained on a method, constructor, or field
  * which is declared with Java generic types.
  * As with the Core Reflection API, the type of the method handle
- * will constructed from the erasure of the source-level type.
+ * will be constructed from the erasure of the source-level type.
  * When a method handle is invoked, the types of its arguments
  * or the return value cast type may be generic types or type instances.
  * If this occurs, the compiler will replace those
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Fri Oct 05 11:10:27 2018 -0400
@@ -4629,7 +4629,7 @@
      * <li>Examine and collect the suffixes of the step, pred, and fini parameter lists, after removing the iteration variable types.
      * (They must have the form {@code (V... A*)}; collect the {@code (A*)} parts only.)
      * <li>Do not collect suffixes from step, pred, and fini parameter lists that do not begin with all the iteration variable types.
-     * (These types will checked in step 2, along with all the clause function types.)
+     * (These types will be checked in step 2, along with all the clause function types.)
      * <li>Omitted clause functions are ignored.  (Equivalently, they are deemed to have empty parameter lists.)
      * <li>All of the collected parameter lists must be effectively identical.
      * <li>The longest parameter list (which is necessarily unique) is called the "external parameter list" ({@code (A...)}).
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Fri Oct 05 11:10:27 2018 -0400
@@ -100,7 +100,7 @@
  * is {@code String}.  The access mode type for {@code compareAndSet} on this
  * VarHandle instance would be
  * {@code (String[] c1, int c2, String expectedValue, String newValue)boolean}.
- * Such a VarHandle instance may produced by the
+ * Such a VarHandle instance may be produced by the
  * {@link MethodHandles#arrayElementVarHandle(Class) array factory method} and
  * access array elements as follows:
  * <pre> {@code
--- a/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java	Fri Oct 05 11:10:27 2018 -0400
@@ -27,6 +27,7 @@
 
 import java.lang.annotation.Annotation;
 import java.lang.invoke.MethodHandle;
+import java.lang.ref.WeakReference;
 import java.security.AccessController;
 
 import jdk.internal.misc.VM;
@@ -567,21 +568,68 @@
     // Shared access checking logic.
 
     // For non-public members or members in package-private classes,
-    // it is necessary to perform somewhat expensive security checks.
-    // If the security check succeeds for a given class, it will
+    // it is necessary to perform somewhat expensive access checks.
+    // If the access check succeeds for a given class, it will
     // always succeed (it is not affected by the granting or revoking
     // of permissions); we speed up the check in the common case by
     // remembering the last Class for which the check succeeded.
     //
-    // The simple security check for Constructor is to see if
+    // The simple access check for Constructor is to see if
     // the caller has already been seen, verified, and cached.
-    // (See also Class.newInstance(), which uses a similar method.)
     //
-    // A more complicated security check cache is needed for Method and Field
-    // The cache can be either null (empty cache), a 2-array of {caller,targetClass},
+    // A more complicated access check cache is needed for Method and Field
+    // The cache can be either null (empty cache), {caller,targetClass} pair,
     // or a caller (with targetClass implicitly equal to memberClass).
-    // In the 2-array case, the targetClass is always different from the memberClass.
-    volatile Object securityCheckCache;
+    // In the {caller,targetClass} case, the targetClass is always different
+    // from the memberClass.
+    volatile Object accessCheckCache;
+
+    private static class Cache {
+        final WeakReference<Class<?>> callerRef;
+        final WeakReference<Class<?>> targetRef;
+
+        Cache(Class<?> caller, Class<?> target) {
+            this.callerRef = new WeakReference<>(caller);
+            this.targetRef = new WeakReference<>(target);
+        }
+
+        boolean isCacheFor(Class<?> caller, Class<?> refc) {
+            return callerRef.get() == caller && targetRef.get() == refc;
+        }
+
+        static Object protectedMemberCallerCache(Class<?> caller, Class<?> refc) {
+            return new Cache(caller, refc);
+        }
+    }
+
+    /*
+     * Returns true if the previous access check was verified for the
+     * given caller accessing a protected member with an instance of
+     * the given targetClass where the target class is different than
+     * the declaring member class.
+     */
+    private boolean isAccessChecked(Class<?> caller, Class<?> targetClass) {
+        Object cache = accessCheckCache;  // read volatile
+        if (cache instanceof Cache) {
+            return ((Cache) cache).isCacheFor(caller, targetClass);
+        }
+        return false;
+    }
+
+    /*
+     * Returns true if the previous access check was verified for the
+     * given caller accessing a static member or an instance member of
+     * the target class that is the same as the declaring member class.
+     */
+    private boolean isAccessChecked(Class<?> caller) {
+        Object cache = accessCheckCache;  // read volatile
+        if (cache instanceof WeakReference) {
+            @SuppressWarnings("unchecked")
+            WeakReference<Class<?>> ref = (WeakReference<Class<?>>) cache;
+            return ref.get() == caller;
+        }
+        return false;
+    }
 
     final void checkAccess(Class<?> caller, Class<?> memberClass,
                            Class<?> targetClass, int modifiers)
@@ -603,21 +651,13 @@
         if (caller == memberClass) {  // quick check
             return true;             // ACCESS IS OK
         }
-        Object cache = securityCheckCache;  // read volatile
         if (targetClass != null // instance member or constructor
             && Modifier.isProtected(modifiers)
             && targetClass != memberClass) {
-            // Must match a 2-list of { caller, targetClass }.
-            if (cache instanceof Class[]) {
-                Class<?>[] cache2 = (Class<?>[]) cache;
-                if (cache2[1] == targetClass &&
-                    cache2[0] == caller) {
-                    return true;     // ACCESS IS OK
-                }
-                // (Test cache[1] first since range check for [1]
-                // subsumes range check for [0].)
+            if (isAccessChecked(caller, targetClass)) {
+                return true;         // ACCESS IS OK
             }
-        } else if (cache == caller) {
+        } else if (isAccessChecked(caller)) {
             // Non-protected case (or targetClass == memberClass or static member).
             return true;             // ACCESS IS OK
         }
@@ -642,14 +682,9 @@
         Object cache = (targetClass != null
                         && Modifier.isProtected(modifiers)
                         && targetClass != memberClass)
-                        ? new Class<?>[] { caller, targetClass }
-                        : caller;
-
-        // Note:  The two cache elements are not volatile,
-        // but they are effectively final.  The Java memory model
-        // guarantees that the initializing stores for the cache
-        // elements will occur before the volatile write.
-        securityCheckCache = cache;         // write volatile
+                        ? Cache.protectedMemberCallerCache(caller, targetClass)
+                        : new WeakReference<>(caller);
+        accessCheckCache = cache;         // write volatile
         return true;
     }
 
--- a/src/java.base/share/classes/java/lang/reflect/Constructor.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/reflect/Constructor.java	Fri Oct 05 11:10:27 2018 -0400
@@ -476,18 +476,27 @@
         throws InstantiationException, IllegalAccessException,
                IllegalArgumentException, InvocationTargetException
     {
-        if (!override) {
-            Class<?> caller = Reflection.getCallerClass();
+        Class<?> caller = override ? null : Reflection.getCallerClass();
+        return newInstanceWithCaller(initargs, !override, caller);
+    }
+
+    /* package-private */
+    T newInstanceWithCaller(Object[] args, boolean checkAccess, Class<?> caller)
+        throws InstantiationException, IllegalAccessException,
+               InvocationTargetException
+    {
+        if (checkAccess)
             checkAccess(caller, clazz, clazz, modifiers);
-        }
+
         if ((clazz.getModifiers() & Modifier.ENUM) != 0)
             throw new IllegalArgumentException("Cannot reflectively create enum objects");
+
         ConstructorAccessor ca = constructorAccessor;   // read volatile
         if (ca == null) {
             ca = acquireConstructorAccessor();
         }
         @SuppressWarnings("unchecked")
-        T inst = (T) ca.newInstance(initargs);
+        T inst = (T) ca.newInstance(args);
         return inst;
     }
 
--- a/src/java.base/share/classes/java/lang/reflect/Proxy.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/reflect/Proxy.java	Fri Oct 05 11:10:27 2018 -0400
@@ -39,12 +39,11 @@
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 import jdk.internal.loader.BootLoader;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 import jdk.internal.module.Modules;
-import jdk.internal.misc.Unsafe;
 import jdk.internal.misc.VM;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
@@ -468,7 +467,7 @@
      * in which the proxy class will be defined.
      */
     private static final class ProxyBuilder {
-        private static final Unsafe UNSAFE = Unsafe.getUnsafe();
+        private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
 
         // prefix for all proxy class names
         private static final String proxyClassNamePrefix = "$Proxy";
@@ -535,9 +534,8 @@
             byte[] proxyClassFile = ProxyGenerator.generateProxyClass(
                     proxyName, interfaces.toArray(EMPTY_CLASS_ARRAY), accessFlags);
             try {
-                Class<?> pc = UNSAFE.defineClass(proxyName, proxyClassFile,
-                                                 0, proxyClassFile.length,
-                                                 loader, null);
+                Class<?> pc = JLA.defineClass(loader, proxyName, proxyClassFile,
+                                              null, "__dynamic_proxy__");
                 reverseProxyCache.sub(pc).putIfAbsent(loader, Boolean.TRUE);
                 return pc;
             } catch (ClassFormatError e) {
--- a/src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1414,7 +1414,7 @@
      * Generate code to invoke the Class.forName with the name of the given
      * class to get its Class object at runtime.  The code is written to
      * the supplied stream.  Note that the code generated by this method
-     * may caused the checked ClassNotFoundException to be thrown.
+     * may cause the checked ClassNotFoundException to be thrown.
      */
     private void codeClassForName(Class<?> cl, DataOutputStream out)
         throws IOException
--- a/src/java.base/share/classes/java/lang/reflect/ReflectAccess.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/lang/reflect/ReflectAccess.java	Fri Oct 05 11:10:27 2018 -0400
@@ -159,4 +159,10 @@
     public <T extends AccessibleObject> T getRoot(T obj) {
         return (T) obj.getRoot();
     }
+
+    public <T> T newInstance(Constructor<T> ctor, Object[] args, Class<?> caller)
+        throws IllegalAccessException, InstantiationException, InvocationTargetException
+    {
+        return ctor.newInstanceWithCaller(args, true, caller);
+    }
 }
--- a/src/java.base/share/classes/java/nio/channels/Selector.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/nio/channels/Selector.java	Fri Oct 05 11:10:27 2018 -0400
@@ -80,8 +80,8 @@
  * <p> A key is added to its selector's cancelled-key set when it is cancelled,
  * whether by closing its channel or by invoking its {@link SelectionKey#cancel
  * cancel} method.  Cancelling a key will cause its channel to be deregistered
- * during the next selection operation, at which time the key will removed from
- * all of the selector's key sets.
+ * during the next selection operation, at which time the key will be removed
+ * from all of the selector's key sets.
  *
  * <a id="sks"></a><p> Keys are added to the selected-key set by selection
  * operations.  A key may be removed directly from the selected-key set by
--- a/src/java.base/share/classes/java/time/format/DateTimeFormatter.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/time/format/DateTimeFormatter.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1138,9 +1138,12 @@
      * <p>
      * This returns an immutable formatter capable of formatting and parsing
      * the ISO-8601 instant format.
-     * When formatting, the second-of-minute is always output.
+     * When formatting, the instant will always be suffixed by 'Z' to indicate UTC.
+     * The second-of-minute is always output.
      * The nano-of-second outputs zero, three, six or nine digits as necessary.
-     * When parsing, time to at least the seconds field is required.
+     * When parsing, the behaviour of {@link DateTimeFormatterBuilder#appendOffsetId()}
+     * will be used to parse the offset, converting the instant to UTC as necessary.
+     * The time to at least the seconds field is required.
      * Fractional seconds from zero to nine are parsed.
      * The localized decimal style is not used.
      * <p>
--- a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java	Fri Oct 05 11:10:27 2018 -0400
@@ -837,6 +837,10 @@
      * The leap-second time of '23:59:59' is handled to some degree, see
      * {@link DateTimeFormatter#parsedLeapSecond()} for full details.
      * <p>
+     * When formatting, the instant will always be suffixed by 'Z' to indicate UTC.
+     * When parsing, the behaviour of {@link DateTimeFormatterBuilder#appendOffsetId()}
+     * will be used to parse the offset, converting the instant to UTC as necessary.
+     * <p>
      * An alternative to this method is to format/parse the instant as a single
      * epoch-seconds value. That is achieved using {@code appendValue(INSTANT_SECONDS)}.
      *
@@ -3468,7 +3472,7 @@
                     .appendValue(MINUTE_OF_HOUR, 2).appendLiteral(':')
                     .appendValue(SECOND_OF_MINUTE, 2)
                     .appendFraction(NANO_OF_SECOND, minDigits, maxDigits, true)
-                    .appendLiteral('Z')
+                    .appendOffsetId()
                     .toFormatter().toPrinterParser(false);
             DateTimeParseContext newContext = context.copy();
             int pos = parser.parse(newContext, text, position);
@@ -3486,6 +3490,7 @@
             Long nanoVal = newContext.getParsed(NANO_OF_SECOND);
             int sec = (secVal != null ? secVal.intValue() : 0);
             int nano = (nanoVal != null ? nanoVal.intValue() : 0);
+            int offset = newContext.getParsed(OFFSET_SECONDS).intValue();
             int days = 0;
             if (hour == 24 && min == 0 && sec == 0 && nano == 0) {
                 hour = 0;
@@ -3498,7 +3503,7 @@
             long instantSecs;
             try {
                 LocalDateTime ldt = LocalDateTime.of(year, month, day, hour, min, sec, 0).plusDays(days);
-                instantSecs = ldt.toEpochSecond(ZoneOffset.UTC);
+                instantSecs = ldt.toEpochSecond(ZoneOffset.ofTotalSeconds(offset));
                 instantSecs += Math.multiplyExact(yearParsed / 10_000L, SECONDS_PER_10000_YEARS);
             } catch (RuntimeException ex) {
                 return ~position;
--- a/src/java.base/share/classes/javax/net/ssl/SSLEngine.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/javax/net/ssl/SSLEngine.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1013,7 +1013,7 @@
      * an instance of this class, but before the {@code SSLSession} has
      * been completely initialized and made available via {@code getSession}.
      * For example, the list of valid signature algorithms may restrict
-     * the type of certificates that can used during TrustManager
+     * the type of certificates that can be used during TrustManager
      * decisions, or the maximum TLS/DTLS fragment packet sizes can be
      * resized to better support the network environment.
      * <p>
--- a/src/java.base/share/classes/javax/net/ssl/SSLSocket.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/javax/net/ssl/SSLSocket.java	Fri Oct 05 11:10:27 2018 -0400
@@ -421,7 +421,7 @@
      * an instance of this class, but before the {@code SSLSession} has
      * been completely initialized and made available via {@code getSession}.
      * For example, the list of valid signature algorithms may restrict
-     * the type of certificates that can used during TrustManager
+     * the type of certificates that can be used during TrustManager
      * decisions, or the maximum TLS fragment packet sizes can be
      * resized to better support the network environment.
      * <p>
--- a/src/java.base/share/classes/jdk/internal/reflect/ClassDefiner.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/jdk/internal/reflect/ClassDefiner.java	Fri Oct 05 11:10:27 2018 -0400
@@ -27,14 +27,16 @@
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import jdk.internal.misc.Unsafe;
 
-/** Utility class which assists in calling Unsafe.defineClass() by
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+
+/** Utility class which assists in calling defineClass() by
     creating a new class loader which delegates to the one needed in
     order for proper resolution of the given bytecodes to occur. */
 
 class ClassDefiner {
-    static final Unsafe unsafe = Unsafe.getUnsafe();
+    static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
 
     /** <P> We define generated code into a new class loader which
       delegates to the defining loader of the target class. It is
@@ -60,7 +62,7 @@
                         return new DelegatingClassLoader(parentClassLoader);
                     }
                 });
-        return unsafe.defineClass(name, bytes, off, len, newLoader, null);
+        return JLA.defineClass(newLoader, name, bytes, null, "__ClassDefiner__");
     }
 }
 
--- a/src/java.base/share/classes/jdk/internal/reflect/LangReflectAccess.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/jdk/internal/reflect/LangReflectAccess.java	Fri Oct 05 11:10:27 2018 -0400
@@ -118,4 +118,8 @@
 
     /** Gets the root of the given AccessibleObject object; null if arg is the root */
     public <T extends AccessibleObject> T getRoot(T obj);
+
+    /** Returns a new instance created by the given constructor with access check */
+    public <T> T newInstance(Constructor<T> ctor, Object[] args, Class<?> caller)
+        throws IllegalAccessException, InstantiationException, InvocationTargetException;
 }
--- a/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java	Fri Oct 05 11:10:27 2018 -0400
@@ -398,6 +398,12 @@
         return langReflectAccess().getExecutableSharedParameterTypes(ex);
     }
 
+    public <T> T newInstance(Constructor<T> ctor, Object[] args, Class<?> caller)
+        throws IllegalAccessException, InstantiationException, InvocationTargetException
+    {
+        return langReflectAccess().newInstance(ctor, args, caller);
+    }
+
     //--------------------------------------------------------------------------
     //
     // Routines used by serialization
--- a/src/java.base/share/classes/sun/security/provider/DSA.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/sun/security/provider/DSA.java	Fri Oct 05 11:10:27 2018 -0400
@@ -105,7 +105,7 @@
      * Construct a blank DSA object that will use the specified
      * signature format. {@code p1363Format} should be {@code true} to
      * use the IEEE P1363 format. If {@code p1363Format} is {@code false},
-     * the DER-encoded ASN.1 format will used. The DSA object must be
+     * the DER-encoded ASN.1 format will be used. The DSA object must be
      * initialized before being usable for signing or verifying.
      */
     DSA(MessageDigest md, boolean p1363Format) {
--- a/src/java.base/share/classes/sun/security/provider/certpath/IndexedCollectionCertStore.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/sun/security/provider/certpath/IndexedCollectionCertStore.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -49,7 +49,7 @@
  * are as fast (or marginally faster) than for the standard
  * CollectionCertStore. Certificate subjects and CRL issuers
  * were found to be specified in most searches used internally by the
- * CertPath provider. Additional attributes could indexed if there are
+ * CertPath provider. Additional attributes could be indexed if there are
  * queries that justify the effort.
  *
  * <li>Changes to the specified Collection after construction time are
--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Fri Oct 05 11:10:27 2018 -0400
@@ -849,8 +849,7 @@
          *
          * This implementation is somewhat less efficient than possible, but
          * not badly so (redundant copy).  We reuse the read() code to keep
-         * things simpler. Note that SKIP_ARRAY is static and may garbled by
-         * concurrent use, but we are not interested in the data anyway.
+         * things simpler.
          */
         @Override
         public synchronized long skip(long n) throws IOException {
--- a/src/java.base/share/classes/sun/security/x509/OCSPNoCheckExtension.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/share/classes/sun/security/x509/OCSPNoCheckExtension.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 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
@@ -38,8 +38,8 @@
  * lifetime of the responder's certificate. The CA does so by including
  * the extension id-pkix-ocsp-nocheck. This SHOULD be a non-critical
  * extension. The value of the extension should be NULL. CAs issuing
- * such a certificate should realized that a compromise of the
- * responder's key, is as serious as the compromise of a CA key used to
+ * such a certificate should realize that a compromise of the
+ * responder's key is as serious as the compromise of a CA key used to
  * sign CRLs, at least for the validity period of this certificate. CA's
  * may choose to issue this type of certificate with a very short
  * lifetime and renew it frequently.
--- a/src/java.base/unix/native/libjava/Console_md.c	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/unix/native/libjava/Console_md.c	Fri Oct 05 11:10:27 2018 -0400
@@ -56,7 +56,7 @@
         JNU_ThrowIOExceptionWithLastError(env, "tcgetattr failed");
         return !on;
     }
-    old = (tio.c_lflag & ECHO);
+    old = (tio.c_lflag & ECHO) != 0;
     if (on) {
         tio.c_lflag |= ECHO;
     } else {
--- a/src/java.base/unix/native/libjsig/jsig.c	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.base/unix/native/libjsig/jsig.c	Fri Oct 05 11:10:27 2018 -0400
@@ -312,7 +312,7 @@
 }
 
 /* The three functions for the jvm to call into. */
-void JVM_begin_signal_setting() {
+JNIEXPORT void JVM_begin_signal_setting() {
   signal_lock();
   sigemptyset(&jvmsigs);
   jvm_signal_installing = true;
@@ -320,7 +320,7 @@
   signal_unlock();
 }
 
-void JVM_end_signal_setting() {
+JNIEXPORT void JVM_end_signal_setting() {
   signal_lock();
   jvm_signal_installed = true;
   jvm_signal_installing = false;
@@ -328,7 +328,7 @@
   signal_unlock();
 }
 
-struct sigaction *JVM_get_signal_action(int sig) {
+JNIEXPORT struct sigaction *JVM_get_signal_action(int sig) {
   allocate_sact();
   /* Does race condition make sense here? */
   if (sigismember(&jvmsigs, sig)) {
--- a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java	Fri Oct 05 11:10:27 2018 -0400
@@ -337,17 +337,17 @@
         // then reset the timeout.
         if (socket instanceof SSLSocket) {
             SSLSocket sslSocket = (SSLSocket) socket;
-            int socketTimeout = sslSocket.getSoTimeout();
             if (!IS_HOSTNAME_VERIFICATION_DISABLED) {
                 SSLParameters param = sslSocket.getSSLParameters();
                 param.setEndpointIdentificationAlgorithm("LDAPS");
                 sslSocket.setSSLParameters(param);
             }
             if (connectTimeout > 0) {
+                int socketTimeout = sslSocket.getSoTimeout();
                 sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value
+                sslSocket.startHandshake();
+                sslSocket.setSoTimeout(socketTimeout);
             }
-            sslSocket.startHandshake();
-            sslSocket.setSoTimeout(socketTimeout);
         }
         return socket;
     }
--- a/src/java.net.http/share/classes/java/net/http/HttpResponse.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.net.http/share/classes/java/net/http/HttpResponse.java	Fri Oct 05 11:10:27 2018 -0400
@@ -515,7 +515,7 @@
          * @throws IllegalArgumentException if an invalid set of open options
          *          are specified
          * @throws SecurityException If a security manager has been installed
-         *          and it denies {@link SecurityManager#checkWrite(String)
+         *          and it denies {@linkplain SecurityManager#checkWrite(String)
          *          write access} to the file.
          */
         public static BodyHandler<Path> ofFile(Path file, OpenOption... openOptions) {
@@ -541,7 +541,7 @@
          * @param file the file to store the body in
          * @return a response body handler
          * @throws SecurityException If a security manager has been installed
-         *          and it denies {@link SecurityManager#checkWrite(String)
+         *          and it denies {@linkplain SecurityManager#checkWrite(String)
          *          write access} to the file.
          */
         public static BodyHandler<Path> ofFile(Path file) {
@@ -656,7 +656,7 @@
 
         /**
          * Returns a {@code BodyHandler<byte[]>} that returns a
-         * {@link BodySubscriber BodySubscriber}&lt;{@code byte[]}&gt; obtained
+         * {@link BodySubscriber BodySubscriber}{@code <byte[]>} obtained
          * from {@link BodySubscribers#ofByteArray() BodySubscribers.ofByteArray()}.
          *
          * <p> When the {@code HttpResponse} object is returned, the body has
@@ -695,7 +695,7 @@
          * <p> When the {@code HttpResponse} object is returned, the response
          * headers will have been completely read, but the body may not have
          * been fully received yet. The {@link #body()} method returns a
-         * {@link Publisher Publisher<List<ByteBuffer>>} from which the body
+         * {@link Publisher Publisher}{@code <List<ByteBuffer>>} from which the body
          * response bytes can be obtained as they are received. The publisher
          * can and must be subscribed to only once.
          *
@@ -794,7 +794,7 @@
          * {@code CompletableFuture} that completes with the response
          * corresponding to the key's push request. A push request is rejected /
          * cancelled if there is already an entry in the map whose key is
-         * {@link HttpRequest#equals equal} to it. A push request is
+         * {@linkplain HttpRequest#equals equal} to it. A push request is
          * rejected / cancelled if it  does not have the same origin as its
          * initiating request.
          *
@@ -839,7 +839,7 @@
      * Java type {@code T}.
      *
      * <p> The {@link #getBody()} method returns a
-     * {@link CompletionStage}&lt;{@code T}&gt; that provides the response body
+     * {@link CompletionStage}{@code <T>} that provides the response body
      * object. The {@code CompletionStage} must be obtainable at any time. When
      * it completes depends on the nature of type {@code T}. In many cases,
      * when {@code T} represents the entire body after being consumed then
@@ -850,7 +850,7 @@
      *
      * @apiNote To ensure that all resources associated with the corresponding
      * HTTP exchange are properly released, an implementation of {@code
-     * BodySubscriber} should ensure to {@link Flow.Subscription#request
+     * BodySubscriber} should ensure to {@linkplain Flow.Subscription#request
      * request} more data until one of {@link #onComplete() onComplete} or
      * {@link #onError(Throwable) onError} are signalled, or {@link
      * Flow.Subscription#request cancel} its {@linkplain
@@ -1077,7 +1077,7 @@
          * @throws IllegalArgumentException if an invalid set of open options
          *          are specified
          * @throws SecurityException if a security manager has been installed
-         *          and it denies {@link SecurityManager#checkWrite(String)
+         *          and it denies {@linkplain SecurityManager#checkWrite(String)
          *          write access} to the file
          */
         public static BodySubscriber<Path> ofFile(Path file, OpenOption... openOptions) {
@@ -1103,7 +1103,7 @@
          * @param file the file to store the body in
          * @return a body subscriber
          * @throws SecurityException if a security manager has been installed
-         *          and it denies {@link SecurityManager#checkWrite(String)
+         *          and it denies {@linkplain SecurityManager#checkWrite(String)
          *          write access} to the file
          */
         public static BodySubscriber<Path> ofFile(Path file) {
@@ -1160,7 +1160,7 @@
 
         /**
          * Returns a {@code BodySubscriber} which streams the response body as
-         * a {@link Stream Stream<String>}, where each string in the stream
+         * a {@link Stream Stream}{@code <String>}, where each string in the stream
          * corresponds to a line as defined by {@link BufferedReader#lines()}.
          *
          * <p> The {@link HttpResponse} using this subscriber is available
@@ -1178,7 +1178,7 @@
          *
          * @param charset the character set to use when converting bytes to characters
          * @return a body subscriber that streams the response body as a
-         *         {@link Stream Stream<String>}.
+         *         {@link Stream Stream}{@code <String>}.
          *
          * @see BufferedReader#lines()
          */
--- a/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -406,26 +406,37 @@
         case KRB_NT_SRV_HST:
             if (nameParts.length >= 2) {
                 String hostName = nameParts[1];
+                Boolean option;
                 try {
-                    // RFC4120 does not recommend canonicalizing a hostname.
-                    // However, for compatibility reason, we will try
-                    // canonicalize it and see if the output looks better.
-
-                    String canonicalized = (InetAddress.getByName(hostName)).
-                            getCanonicalHostName();
+                    // If true, try canonicalizing and accept it if it starts
+                    // with the short name. Otherwise, never. Default true.
+                    option = Config.getInstance().getBooleanObject(
+                            "libdefaults", "dns_canonicalize_hostname");
+                } catch (KrbException e) {
+                    option = null;
+                }
+                if (option != Boolean.FALSE) {
+                    try {
+                        // RFC4120 does not recommend canonicalizing a hostname.
+                        // However, for compatibility reason, we will try
+                        // canonicalizing it and see if the output looks better.
 
-                    // Looks if canonicalized is a longer format of hostName,
-                    // we accept cases like
-                    //     bunny -> bunny.rabbit.hole
-                    if (canonicalized.toLowerCase(Locale.ENGLISH).startsWith(
-                                hostName.toLowerCase(Locale.ENGLISH)+".")) {
-                        hostName = canonicalized;
+                        String canonicalized = (InetAddress.getByName(hostName)).
+                                getCanonicalHostName();
+
+                        // Looks if canonicalized is a longer format of hostName,
+                        // we accept cases like
+                        //     bunny -> bunny.rabbit.hole
+                        if (canonicalized.toLowerCase(Locale.ENGLISH).startsWith(
+                                hostName.toLowerCase(Locale.ENGLISH) + ".")) {
+                            hostName = canonicalized;
+                        }
+                    } catch (UnknownHostException | SecurityException e) {
+                        // not canonicalized or no permission to do so, use old
                     }
-                } catch (UnknownHostException | SecurityException e) {
-                    // not canonicalized or no permission to do so, use old
-                }
-                if (hostName.endsWith(".")) {
-                    hostName = hostName.substring(0, hostName.length() - 1);
+                    if (hostName.endsWith(".")) {
+                        hostName = hostName.substring(0, hostName.length() - 1);
+                    }
                 }
                 nameParts[1] = hostName.toLowerCase(Locale.ENGLISH);
             }
--- a/src/java.sql/share/classes/java/sql/DriverManager.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/java.sql/share/classes/java/sql/DriverManager.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -652,7 +652,7 @@
          * can be loaded from here.
          */
         ClassLoader callerCL = caller != null ? caller.getClassLoader() : null;
-        if (callerCL == null) {
+        if (callerCL == null || callerCL == ClassLoader.getPlatformClassLoader()) {
             callerCL = Thread.currentThread().getContextClassLoader();
         }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java	Fri Oct 05 11:10:27 2018 -0400
@@ -180,6 +180,7 @@
         UNDERSCORE_IDENTIFIER(MIN, JDK8),
         PRIVATE_INTERFACE_METHODS(JDK9, Fragments.FeaturePrivateIntfMethods, DiagKind.PLURAL),
         LOCAL_VARIABLE_TYPE_INFERENCE(JDK10),
+        VAR_SYNTAX_IMPLICIT_LAMBDAS(JDK11, Fragments.FeatureVarSyntaxInImplicitLambda, DiagKind.PLURAL),
         IMPORT_ON_DEMAND_OBSERVABLE_PACKAGES(JDK1_2, JDK8),
         SWITCH_MULTIPLE_CASE_LABELS(JDK12, Fragments.FeatureMultipleCaseLabels, DiagKind.PLURAL),
         SWITCH_RULE(JDK12, Fragments.FeatureSwitchRules, DiagKind.PLURAL),
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1783,7 +1783,9 @@
                 if (param.vartype != null &&
                         isRestrictedLocalVarTypeName(param.vartype, false) &&
                         param.vartype.hasTag(TYPEARRAY)) {
-                    log.error(DiagnosticFlag.SYNTAX, param.pos, Errors.VarNotAllowedArray);
+                    log.error(DiagnosticFlag.SYNTAX, param.pos,
+                        Feature.VAR_SYNTAX_IMPLICIT_LAMBDAS.allowedInSource(source)
+                            ? Errors.VarNotAllowedArray : Errors.VarNotAllowedHere);
                 }
                 lambdaClassifier.addParameter(param);
                 if (lambdaClassifier.result() == LambdaParameterKind.ERROR) {
@@ -1794,7 +1796,9 @@
                 log.error(DiagnosticFlag.SYNTAX, pos, Errors.InvalidLambdaParameterDeclaration(lambdaClassifier.diagFragment));
             }
             for (JCVariableDecl param: params) {
-                if (param.vartype != null && isRestrictedLocalVarTypeName(param.vartype, true)) {
+                if (param.vartype != null
+                        && isRestrictedLocalVarTypeName(param.vartype, true)) {
+                    checkSourceLevel(param.pos, Feature.VAR_SYNTAX_IMPLICIT_LAMBDAS);
                     param.startPos = TreeInfo.getStartPos(param.vartype);
                     param.vartype = null;
                 }
@@ -1804,9 +1808,9 @@
     }
 
     enum LambdaParameterKind {
-        EXPLICIT(0),
-        IMPLICIT(1),
-        VAR(2),
+        VAR(0),
+        EXPLICIT(1),
+        IMPLICIT(2),
         ERROR(-1);
 
         private final int index;
@@ -1816,11 +1820,11 @@
         }
     }
 
-    private final static Fragment[][] decisionTable = new Fragment[][]{
-        /*              EXPLICIT                         IMPLICIT                         VAR  */
-        /* EXPLICIT */ {null,                            ImplicitAndExplicitNotAllowed,   VarAndExplicitNotAllowed},
-        /* IMPLICIT */ {ImplicitAndExplicitNotAllowed,   null,                            VarAndImplicitNotAllowed},
-        /* VAR      */ {VarAndExplicitNotAllowed,        VarAndImplicitNotAllowed,        null}
+    private final static Fragment[][] decisionTable = new Fragment[][] {
+        /*              VAR                              EXPLICIT                         IMPLICIT  */
+        /* VAR      */ {null,                            VarAndExplicitNotAllowed,        VarAndImplicitNotAllowed},
+        /* EXPLICIT */ {VarAndExplicitNotAllowed,        null,                            ImplicitAndExplicitNotAllowed},
+        /* IMPLICIT */ {VarAndImplicitNotAllowed,        ImplicitAndExplicitNotAllowed,   null},
     };
 
     class LambdaClassifier {
@@ -1849,7 +1853,10 @@
             } else if (kind != newKind && kind != LambdaParameterKind.ERROR) {
                 LambdaParameterKind currentKind = kind;
                 kind = LambdaParameterKind.ERROR;
-                diagFragment = decisionTable[currentKind.index][newKind.index];
+                boolean varIndex = currentKind.index == LambdaParameterKind.VAR.index ||
+                        newKind.index == LambdaParameterKind.VAR.index;
+                diagFragment = Feature.VAR_SYNTAX_IMPLICIT_LAMBDAS.allowedInSource(source) || !varIndex ?
+                        decisionTable[currentKind.index][newKind.index] : null;
             }
         }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Fri Oct 05 11:10:27 2018 -0400
@@ -2832,6 +2832,9 @@
 compiler.misc.feature.raw.string.literals=\
     raw string literals
 
+compiler.misc.feature.var.syntax.in.implicit.lambda=\
+    var syntax in implicit lambdas
+
 compiler.warn.underscore.as.identifier=\
     as of release 9, ''_'' is a keyword, and may not be used as an identifier
 
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Field.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Field.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, 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
@@ -57,7 +57,7 @@
 
     FIXME: among other things, this interface is not sufficient to
     describe fields which are themselves arrays (like Symbol's
-    jbyte _body[1]).  */
+    u1 _body[1]).  */
 public interface Field {
   /** Get the name of this field */
   public String getName();
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java	Fri Oct 05 11:10:27 2018 -0400
@@ -210,6 +210,7 @@
         PlaceholderOutputStream o = getPlaceholderResponseBody();
         tmpout.write (bytes(statusLine, 0), 0, statusLine.length());
         boolean noContentToSend = false; // assume there is content
+        boolean noContentLengthHeader = false; // must not send Content-length is set
         rspHdrs.set ("Date", dateFormat.get().format (new Date()));
 
         /* check for response type that is not allowed to send a body */
@@ -225,6 +226,7 @@
                 logger.log (Level.WARNING, msg);
             }
             contentLen = -1;
+            noContentLengthHeader = (rCode != 304);
         }
 
         if (isHeadRequest() || rCode == 304) {
@@ -253,7 +255,11 @@
                     noContentToSend = true;
                     contentLen = 0;
                 }
-                rspHdrs.set("Content-length", Long.toString(contentLen));
+                if (noContentLengthHeader) {
+                    rspHdrs.remove("Content-length");
+                } else {
+                    rspHdrs.set("Content-length", Long.toString(contentLen));
+                }
                 o.setWrappedStream (new FixedLengthOutputStream (this, ros, contentLen));
             }
         }
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, 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
@@ -108,7 +108,6 @@
      * Otherwise the generated code might be the only reference to the boxed value and since object
      * references from nmethods are weak this can cause GC problems.
      *
-     * @param source
      * @return true if the box is cached
      */
     private static boolean isBoxCached(JavaConstant source) {
@@ -182,13 +181,13 @@
         if (hotspotField.isStatic()) {
             HotSpotResolvedJavaType holder = (HotSpotResolvedJavaType) hotspotField.getDeclaringClass();
             if (holder.isInitialized()) {
-                return memoryAccess.readFieldValue(hotspotField, holder.mirror());
+                return memoryAccess.readFieldValue(hotspotField, holder.mirror(), field.isVolatile());
             }
         } else {
             if (receiver.isNonNull()) {
                 Object object = ((HotSpotObjectConstantImpl) receiver).object();
                 if (hotspotField.isInObject(receiver)) {
-                    return memoryAccess.readFieldValue(hotspotField, object);
+                    return memoryAccess.readFieldValue(hotspotField, object, field.isVolatile());
                 }
             }
         }
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, 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
@@ -208,37 +208,34 @@
         return ret;
     }
 
-    JavaConstant readFieldValue(HotSpotResolvedJavaField field, Object obj) {
+    JavaConstant readFieldValue(HotSpotResolvedJavaField field, Object obj, boolean isVolatile) {
         assert obj != null;
         assert !field.isStatic() || obj instanceof Class;
         long displacement = field.getOffset();
         assert checkRead(field.getJavaKind(), displacement, (HotSpotResolvedObjectType) runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(obj.getClass()), obj,
                         runtime.getHostJVMCIBackend().getMetaAccess());
-        if (field.getJavaKind() == JavaKind.Object) {
-            Object o = UNSAFE.getObject(obj, displacement);
-            return HotSpotObjectConstantImpl.forObject(o);
-        } else {
-            JavaKind kind = field.getJavaKind();
-            switch (kind) {
-                case Boolean:
-                    return JavaConstant.forBoolean(UNSAFE.getBoolean(obj, displacement));
-                case Byte:
-                    return JavaConstant.forByte(UNSAFE.getByte(obj, displacement));
-                case Char:
-                    return JavaConstant.forChar(UNSAFE.getChar(obj, displacement));
-                case Short:
-                    return JavaConstant.forShort(UNSAFE.getShort(obj, displacement));
-                case Int:
-                    return JavaConstant.forInt(UNSAFE.getInt(obj, displacement));
-                case Long:
-                    return JavaConstant.forLong(UNSAFE.getLong(obj, displacement));
-                case Float:
-                    return JavaConstant.forFloat(UNSAFE.getFloat(obj, displacement));
-                case Double:
-                    return JavaConstant.forDouble(UNSAFE.getDouble(obj, displacement));
-                default:
-                    throw new IllegalArgumentException("Unsupported kind: " + kind);
-            }
+        JavaKind kind = field.getJavaKind();
+        switch (kind) {
+            case Boolean:
+                return JavaConstant.forBoolean(isVolatile ? UNSAFE.getBooleanVolatile(obj, displacement) : UNSAFE.getBoolean(obj, displacement));
+            case Byte:
+                return JavaConstant.forByte(isVolatile ? UNSAFE.getByteVolatile(obj, displacement) : UNSAFE.getByte(obj, displacement));
+            case Char:
+                return JavaConstant.forChar(isVolatile ? UNSAFE.getCharVolatile(obj, displacement) : UNSAFE.getChar(obj, displacement));
+            case Short:
+                return JavaConstant.forShort(isVolatile ? UNSAFE.getShortVolatile(obj, displacement) : UNSAFE.getShort(obj, displacement));
+            case Int:
+                return JavaConstant.forInt(isVolatile ? UNSAFE.getIntVolatile(obj, displacement) : UNSAFE.getInt(obj, displacement));
+            case Long:
+                return JavaConstant.forLong(isVolatile ? UNSAFE.getLongVolatile(obj, displacement) : UNSAFE.getLong(obj, displacement));
+            case Float:
+                return JavaConstant.forFloat(isVolatile ? UNSAFE.getFloatVolatile(obj, displacement) : UNSAFE.getFloat(obj, displacement));
+            case Double:
+                return JavaConstant.forDouble(isVolatile ? UNSAFE.getDoubleVolatile(obj, displacement) : UNSAFE.getDouble(obj, displacement));
+            case Object:
+                return HotSpotObjectConstantImpl.forObject(isVolatile ? UNSAFE.getObjectVolatile(obj, displacement) : UNSAFE.getObject(obj, displacement));
+            default:
+                throw new IllegalArgumentException("Unsupported kind: " + kind);
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java	Fri Oct 05 11:10:27 2018 -0400
@@ -399,6 +399,10 @@
         // Utils needs docEnv, safe to init now.
         utils = new Utils(this);
 
+        if (!javafx) {
+            javafx = isJavaFXMode();
+        }
+
         // Once docEnv and Utils have been initialized, others should be safe.
         cmtUtils = new CommentUtils(this);
         workArounds = new WorkArounds(this);
@@ -1347,4 +1351,19 @@
     public synchronized VisibleMemberTable getVisibleMemberTable(TypeElement te) {
         return visibleMemberCache.getVisibleMemberTable(te);
     }
+
+    /**
+     * Determines if JavaFX is available in the compilation environment.
+     * @return true if JavaFX is available
+     */
+    public boolean isJavaFXMode() {
+        TypeElement observable = utils.elementUtils.getTypeElement("javafx.beans.Observable");
+        if (observable != null) {
+            ModuleElement javafxModule = utils.elementUtils.getModuleOf(observable);
+            if (javafxModule == null || javafxModule.isUnnamed() || javafxModule.getQualifiedName().contentEquals("javafx.base")) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
--- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/MessageOutput.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/MessageOutput.java	Fri Oct 05 11:10:27 2018 -0400
@@ -189,8 +189,12 @@
     }
 
     static void printPrompt() {
+        printPrompt(false);
+    }
+
+    static void printPrompt(boolean simple) {
         ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo();
-        if (threadInfo == null) {
+        if (simple || threadInfo == null) {
             System.out.print
                 (MessageOutput.format("jdb prompt with no current thread"));
         } else {
--- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java	Fri Oct 05 11:10:27 2018 -0400
@@ -464,6 +464,8 @@
                         } else if (cmd.equals("resume")) {
                             evaluator.commandResume(t);
                         } else if (cmd.equals("cont")) {
+                            MessageOutput.printPrompt(true);
+                            showPrompt = false;
                             evaluator.commandCont();
                         } else if (cmd.equals("threadgroups")) {
                             evaluator.commandThreadGroups();
@@ -474,10 +476,16 @@
                         } else if (cmd.equals("ignore")) {
                             evaluator.commandIgnoreException(t);
                         } else if (cmd.equals("step")) {
+                            MessageOutput.printPrompt(true);
+                            showPrompt = false;
                             evaluator.commandStep(t);
                         } else if (cmd.equals("stepi")) {
+                            MessageOutput.printPrompt(true);
+                            showPrompt = false;
                             evaluator.commandStepi();
                         } else if (cmd.equals("next")) {
+                            MessageOutput.printPrompt(true);
+                            showPrompt = false;
                             evaluator.commandNext();
                         } else if (cmd.equals("kill")) {
                             evaluator.commandKill(t);
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java	Fri Oct 05 11:10:27 2018 -0400
@@ -70,7 +70,7 @@
         endClass();
         byte[] bytes = classWriter.toByteArray();
         ASMToolkit.logASM(fullClassName, bytes);
-        return SecuritySupport.defineClass(type.getInternalName(), bytes, Event.class.getClassLoader()).asSubclass(Event.class);
+        return SecuritySupport.defineClass(Event.class, bytes).asSubclass(Event.class);
     }
 
     private void endClass() {
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java	Fri Oct 05 11:10:27 2018 -0400
@@ -134,7 +134,7 @@
         buildWriteMethod();
         byte[] bytes = classWriter.toByteArray();
         ASMToolkit.logASM(className, bytes);
-        return SecuritySupport.defineClass(className, bytes, Event.class.getClassLoader()).asSubclass(EventHandler.class);
+        return SecuritySupport.defineClass(EventHandler.class, bytes).asSubclass(EventHandler.class);
     }
 
     public static EventHandler instantiateEventHandler(Class<? extends EventHandler> handlerClass, boolean registered, EventType eventType, EventControl eventControl) throws Error {
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,6 +31,7 @@
 import java.io.InputStream;
 import java.io.RandomAccessFile;
 import java.io.Reader;
+import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -71,6 +72,7 @@
  */
 public final class SecuritySupport {
     private final static Unsafe unsafe = Unsafe.getUnsafe();
+    private final static MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
     private final static Module JFR_MODULE = Event.class.getModule();
     public  final static SafePath JFC_DIRECTORY = getPathInProperty("java.home", "lib/jfr");
 
@@ -381,8 +383,17 @@
         unsafe.ensureClassInitialized(clazz);
     }
 
-    static Class<?> defineClass(String name, byte[] bytes, ClassLoader classLoader) {
-        return unsafe.defineClass(name, bytes, 0, bytes.length, classLoader, null);
+    static Class<?> defineClass(Class<?> lookupClass, byte[] bytes) {
+        return AccessController.doPrivileged(new PrivilegedAction<>() {
+            @Override
+            public Class<?> run() {
+                try {
+                    return MethodHandles.privateLookupIn(lookupClass, LOOKUP).defineClass(bytes);
+                } catch (IllegalAccessException e) {
+                    throw new InternalError(e);
+                }
+            }
+        });
     }
 
     static Thread createThreadWitNoPermissions(String threadName, Runnable runnable) {
--- a/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java	Fri Oct 05 11:10:27 2018 -0400
@@ -206,7 +206,7 @@
 
                 if (option == SO_FLOW_SLA) {
                     assert flowSupported;
-                    SocketFlow flow = checkValueType(value, option.type());
+                    SocketFlow flow = checkValueType(value, SocketFlow.class);
                     setFlowOption(fd, flow);
                 } else if (option == TCP_QUICKACK) {
                     setQuickAckOption(fd, (boolean) value);
@@ -254,7 +254,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    private static <T> T checkValueType(Object value, Class<?> type) {
+    private static <T> T checkValueType(Object value, Class<T> type) {
         if (!type.isAssignableFrom(value.getClass())) {
             String s = "Found: " + value.getClass() + ", Expected: " + type;
             throw new IllegalArgumentException(s);
--- a/src/jdk.pack/share/native/common-unpack/unpack.cpp	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.pack/share/native/common-unpack/unpack.cpp	Fri Oct 05 11:10:27 2018 -0400
@@ -70,6 +70,7 @@
 
 #include "unpack.h"
 
+#define STATIC_ASSERT(COND) typedef char static_assertion[(COND)?1:-1]
 
 // tags, in canonical order:
 static const byte TAGS_IN_ORDER[] = {
@@ -564,14 +565,14 @@
     FIRST_READ  = MAGIC_BYTES + AH_LENGTH_MIN
   };
 
-  assert(AH_LENGTH_MIN    == 15); // # of UNSIGNED5 fields required after archive_magic
+  STATIC_ASSERT(AH_LENGTH_MIN    == 15); // # of UNSIGNED5 fields required after archive_magic
   // An absolute minimum null archive is magic[4], {minver,majver,options}[3],
   // archive_size[0], cp_counts[8], class_counts[4], for a total of 19 bytes.
   // (Note that archive_size is optional; it may be 0..10 bytes in length.)
   // The first read must capture everything up through the options field.
   // This happens to work even if {minver,majver,options} is a pathological
   // 15 bytes long.  Legal pack files limit those three fields to 1+1+2 bytes.
-  assert(FIRST_READ >= MAGIC_BYTES + AH_LENGTH_0 * B_MAX);
+  STATIC_ASSERT(FIRST_READ >= MAGIC_BYTES + AH_LENGTH_0 * B_MAX);
 
   // Up through archive_size, the largest possible archive header is
   // magic[4], {minver,majver,options}[4], archive_size[10].
@@ -581,7 +582,7 @@
   // a byte, we probably will fail to allocate the buffer, since it
   // will be many gigabytes long.  This is a practical, not an
   // architectural limit to Pack200 archive sizes.
-  assert(FIRST_READ >= MAGIC_BYTES + AH_LENGTH_0_MAX + 2*B_MAX);
+  STATIC_ASSERT(FIRST_READ >= MAGIC_BYTES + AH_LENGTH_0_MAX + 2*B_MAX);
 
   bool foreign_buf = (read_input_fn == null);
   byte initbuf[(int)FIRST_READ + (int)C_SLOP + 200];  // 200 is for JAR I/O
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipDirectoryStream.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipDirectoryStream.java	Fri Oct 05 11:10:27 2018 -0400
@@ -41,21 +41,21 @@
 class ZipDirectoryStream implements DirectoryStream<Path> {
 
     private final ZipFileSystem zipfs;
-    private final byte[] path;
+    private final ZipPath dir;
     private final DirectoryStream.Filter<? super Path> filter;
     private volatile boolean isClosed;
     private volatile Iterator<Path> itr;
 
-    ZipDirectoryStream(ZipPath zipPath,
+    ZipDirectoryStream(ZipPath dir,
                        DirectoryStream.Filter<? super java.nio.file.Path> filter)
         throws IOException
     {
-        this.zipfs = zipPath.getFileSystem();
-        this.path = zipPath.getResolvedPath();
+        this.zipfs = dir.getFileSystem();
+        this.dir = dir;
         this.filter = filter;
         // sanity check
-        if (!zipfs.isDirectory(path))
-            throw new NotDirectoryException(zipPath.toString());
+        if (!zipfs.isDirectory(dir.getResolvedPath()))
+            throw new NotDirectoryException(dir.toString());
     }
 
     @Override
@@ -66,7 +66,7 @@
             throw new IllegalStateException("Iterator has already been returned");
 
         try {
-            itr = zipfs.iteratorOf(path, filter);
+            itr = zipfs.iteratorOf(dir, filter);
         } catch (IOException e) {
             throw new IllegalStateException(e);
         }
@@ -98,5 +98,4 @@
         isClosed = true;
     }
 
-
 }
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java	Fri Oct 05 11:10:27 2018 -0400
@@ -399,23 +399,32 @@
     }
 
     // returns the list of child paths of "path"
-    Iterator<Path> iteratorOf(byte[] path,
+    Iterator<Path> iteratorOf(ZipPath dir,
                               DirectoryStream.Filter<? super Path> filter)
         throws IOException
     {
         beginWrite();    // iteration of inodes needs exclusive lock
         try {
             ensureOpen();
+            byte[] path = dir.getResolvedPath();
             IndexNode inode = getInode(path);
             if (inode == null)
                 throw new NotDirectoryException(getString(path));
             List<Path> list = new ArrayList<>();
             IndexNode child = inode.child;
             while (child != null) {
-                // assume all path from zip file itself is "normalized"
-                ZipPath zp = new ZipPath(this, child.name, true);
-                if (filter == null || filter.accept(zp))
-                    list.add(zp);
+                // (1) assume all path from zip file itself is "normalized"
+                // (2) IndexNode.name is absolute. see IndexNode(byte[],int,int)
+                // (3) if parent "dir" is relative when ZipDirectoryStream
+                //     is created, the returned child path needs to be relative
+                //     as well.
+                byte[] cname = child.name;
+                if (!dir.isAbsolute()) {
+                    cname = Arrays.copyOfRange(cname, 1, cname.length);
+                }
+                ZipPath zpath = new ZipPath(this, cname, true);
+                if (filter == null || filter.accept(zpath))
+                    list.add(zpath);
                 child = child.sibling;
             }
             return list.iterator();
--- a/test/TestCommon.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/TestCommon.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -118,7 +118,7 @@
   ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
 endif
 
-# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
+# If unset, set up the PRODUCT_HOME variable to the jdk to test
 ifndef PRODUCT_HOME
   # Try to use images/jdk if it exists
   ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/images/jdk
@@ -145,28 +145,12 @@
   JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH='$(_NT_SYMBOL_PATH)'
 endif
 
-# Expect JPRT to set JPRT_PRODUCT_ARGS (e.g. -server etc.)
-#   Should be passed into 'java' only.
-#   Could include: -d64 -server -client OR any java option
-ifdef JPRT_PRODUCT_ARGS
-  JAVA_ARGS = $(JPRT_PRODUCT_ARGS)
-endif
-
-# Expect JPRT to set JPRT_PRODUCT_VM_ARGS (e.g. -Xcomp etc.)
-#   Should be passed into anything running the vm (java, javac, javadoc, ...).
-ifdef JPRT_PRODUCT_VM_ARGS
-  JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
-endif
-
 ifneq ($(NATIVE_TEST_PATH), )
   # jtreg -nativepath <dir>
   #
-  # Local make tests will be TEST_IMAGE_DIR and JPRT with jprt.use.reg.test.bundle=true
-  # should be JPRT_TESTNATIVE_PATH
+  # Local make tests will be TEST_IMAGE_DIR
   ifdef TEST_IMAGE_DIR
     TESTNATIVE_DIR = $(TEST_IMAGE_DIR)
-  else ifdef JPRT_TESTNATIVE_PATH
-    TESTNATIVE_DIR = $(JPRT_TESTNATIVE_PATH)
   endif
   ifdef TESTNATIVE_DIR
     JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/$(NATIVE_TEST_PATH)")
@@ -208,11 +192,6 @@
   TEST_PREREQS += $(CDS_ARCHIVE_FILE)
 endif
 
-# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
-ifdef JPRT_ARCHIVE_BUNDLE
-  ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
-endif
-
 # How to create the test bundle (pass or fail, we want to create this)
 #   Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
 ifneq ($(ARCHIVE_BUNDLE), )
@@ -340,9 +319,6 @@
 # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
 ifndef JT_HOME
   JT_HOME = $(SLASH_JAVA)/re/jtreg/$(USE_JTREG_VERSION)/promoted/latest/binaries/jtreg
-  ifdef JPRT_JTREG_HOME
-    JT_HOME = $(JPRT_JTREG_HOME)
-  endif
 endif
 
 # Problematic tests to be excluded
@@ -358,7 +334,7 @@
 
 # ------------------------------------------------------------------
 
-# When called from JPRT the TESTDIRS variable is set to the jtreg tests to run
+# The TESTDIRS variable can be used to select the jtreg tests to run
 ifdef TESTDIRS
   TEST_SELECTION = $(TESTDIRS)
 endif
--- a/test/hotspot/jtreg/ProblemList.txt	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/ProblemList.txt	Fri Oct 05 11:10:27 2018 -0400
@@ -59,8 +59,6 @@
 
 compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all
 
-compiler/whitebox/ForceNMethodSweepTest.java 8211129 generic-all
-
 #############################################################################
 
 # :hotspot_gc
@@ -86,7 +84,6 @@
 runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
 runtime/RedefineTests/RedefineRunningMethods.java 8208778 macosx-x64
 runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all
-runtime/XCheckJniJsig/XCheckJSig.java 8211084 macosx-x64
 
 #############################################################################
 
--- a/test/hotspot/jtreg/TEST.groups	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/TEST.groups	Fri Oct 05 11:10:27 2018 -0400
@@ -139,7 +139,8 @@
   -compiler/runtime/Test6826736.java
 
 tier1_compiler_not_xcomp = \
-  compiler/aot
+  compiler/aot \
+  compiler/profiling
 
 tier1_compiler_not_cms = \
   compiler/aot \
@@ -258,7 +259,7 @@
 hotspot_appcds = \
   runtime/appcds/
 
-# A subset of AppCDS tests to be run in JPRT push
+# A subset of AppCDS tests to be run in tier1
 tier1_runtime_appcds = \
   runtime/appcds/HelloTest.java \
   runtime/appcds/sharedStrings/SharedStringsBasic.java \
--- a/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/RedefineTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/RedefineTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -48,7 +48,6 @@
 
 package compiler.jsr292.NonInlinedCall;
 
-import jdk.internal.misc.Unsafe;
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.vm.annotation.DontInline;
@@ -68,13 +67,15 @@
 
 public class RedefineTest {
     static final MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP;
-    static final Unsafe UNSAFE = Unsafe.getUnsafe();
-
     static final String NAME = "compiler/jsr292/NonInlinedCall/RedefineTest$T";
 
     static Class<?> getClass(int r) {
         byte[] classFile = getClassFile(r);
-        return UNSAFE.defineClass(NAME, classFile, 0, classFile.length, null, null);
+        try {
+            return MethodHandles.lookup().defineClass(classFile);
+        } catch (IllegalAccessException e) {
+            throw new Error(e);
+        }
     }
 
     /**
--- a/test/hotspot/jtreg/compiler/profiling/TestSpecTrapClassUnloading.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/compiler/profiling/TestSpecTrapClassUnloading.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 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
@@ -28,6 +28,7 @@
  *
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
  *                   -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
+ *                   -XX:CompileThreshold=10000
  *                   -XX:+UseTypeSpeculation -XX:TypeProfileLevel=222
  *                   -XX:CompileCommand=exclude,java.lang.reflect.Method::invoke
  *                   -XX:CompileCommand=exclude,sun.reflect.DelegatingMethodAccessorImpl::invoke
--- a/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,10 +31,12 @@
   * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
   *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+  *                   -XX:CompileThreshold=10000
   *                   -server -XX:-TieredCompilation -XX:TypeProfileLevel=020
   *                    compiler.profiling.TestTypeProfiling
   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
   *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement
+  *                   -XX:CompileThreshold=10000
   *                   -server -XX:-TieredCompilation -XX:TypeProfileLevel=200
   *                    compiler.profiling.TestTypeProfiling
   */
--- a/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass/Launcher.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass/Launcher.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,6 +32,7 @@
  * @run driver ClassFileInstaller compiler.profiling.spectrapredefineclass.Agent
  * @run driver compiler.profiling.spectrapredefineclass.Launcher
  * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation
+ *                   -XX:CompileThreshold=10000
  *                   -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222
  *                   -XX:ReservedCodeCacheSize=3M -Djdk.attach.allowAttachSelf
  *                   compiler.profiling.spectrapredefineclass.Agent
--- a/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -35,6 +35,7 @@
  * @run driver ClassFileInstaller compiler.profiling.spectrapredefineclass_classloaders.Agent
  * @run driver compiler.profiling.spectrapredefineclass_classloaders.Launcher
  * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation
+ *                   -XX:CompileThreshold=10000
  *                   -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222
  *                   -XX:ReservedCodeCacheSize=3M -Djdk.attach.allowAttachSelf
  *                   compiler.profiling.spectrapredefineclass_classloaders.Agent
--- a/test/hotspot/jtreg/compiler/uncommontrap/TestDeoptOOM.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/compiler/uncommontrap/TestDeoptOOM.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 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
@@ -26,6 +26,7 @@
  * @bug 6898462 8198826
  * @summary failed reallocations of scalar replaced objects during deoptimization causes crash
  *
+ * @requires !vm.graal.enabled
  * @run main/othervm -XX:-BackgroundCompilation -Xmx128M -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack
  *      -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::main
  *      -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::m9_1
--- a/test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,6 +32,9 @@
  *          java.base/jdk.internal.vm.annotation
  *          java.base/jdk.internal.misc
  *
+ * @library ../jsr292/patches
+ * @build java.base/java.lang.invoke.MethodHandleHelper
+ *
  * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions
  *                                 -Xbatch -XX:-TieredCompilation
  *                                 -XX:+FoldStableValues
@@ -64,6 +67,9 @@
 import jdk.test.lib.Asserts;
 import jdk.test.lib.Platform;
 
+import java.lang.invoke.MethodHandleHelper;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -393,8 +399,9 @@
         }
 
         Test generate() {
-            Class<?> c = U.defineClass(className, classFile, 0, classFile.length, THIS_CLASS.getClassLoader(), null);
             try {
+                Lookup lookup = MethodHandleHelper.IMPL_LOOKUP.in(MethodHandles.class);
+                Class<?> c = lookup.defineClass(classFile);
                 return (Test) c.newInstance();
             } catch(Exception e) {
                 throw new Error(e);
--- a/test/hotspot/jtreg/jprt.config	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-#!echo "This is not a shell script"
-#############################################################################
-# 
-# Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-# 
-#############################################################################
-
-#############################################################################
-#
-# JPRT shell configuration for testing.
-#
-# Input environment variables:
-#    Windows Only:
-#      PATH
-#      ROOTDIR
-#
-# Output variable settings:
-#    make    Full path to GNU make
-#
-# Output environment variables:
-#    PATH
-#
-#############################################################################
-
-#############################################################################
-# Error
-error() # message
-{
-  echo "ERROR: $1"
-  exit 6
-}
-# Directory must exist
-dirMustExist() # dir name
-{
-  if [ ! -d "$1" ] ; then
-    error "Directory for $2 does not exist: $1"
-  fi
-}
-# File must exist
-fileMustExist() # dir name
-{
-  if [ ! -f "$1" ] ; then
-    error "File for $2 does not exist: $1"
-  fi
-}
-#############################################################################
-
-# Should be set by JPRT as the 3 basic inputs
-slashjava="${ALT_SLASH_JAVA}"
-if [ "${slashjava}" = "" ] ; then
-  slashjava=/java
-fi
-
-# Check input
-dirMustExist "${slashjava}"  ALT_SLASH_JAVA
-
-# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
-osname=`uname -s`
-case "${osname}" in
-  SunOS )
-    # SOLARIS: Sparc or X86
-    osarch=`uname -p`
-    if [ "${osarch}" = sparc ] ; then
-	solaris_arch=sparc
-    else
-	solaris_arch=i386
-    fi
-
-    # Add basic solaris system paths
-    path4sdk=/usr/bin
-
-    # Find GNU make
-    make=/usr/bin/gmake
-    if [ ! -f ${make} ] ; then
-	make=/usr/gnu/bin/make
-	if [ ! -f ${make} ] ; then
-	    make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
-        fi 
-    fi
-    fileMustExist "${make}" make
-
-    # File creation mask
-    umask 002
-    ;;
-
-  Linux | Darwin )
-    # Add basic paths
-    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
-
-    # Find GNU make
-    make=/usr/bin/make
-    fileMustExist "${make}" make
-
-    umask 002
-    ;;
-
-  FreeBSD | OpenBSD )
-    # Add basic paths
-    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
-
-    # Find GNU make
-    make=/usr/local/bin/gmake
-    fileMustExist "${make}" make
-
-    umask 002
-    ;;
-
-  NetBSD )
-    # Add basic paths
-    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
-
-    # Find GNU make
-    make=/usr/pkg/bin/gmake
-    fileMustExist "${make}" make
-
-    umask 002
-    ;;
-
-  * )
-    # Windows: Differs on CYGWIN vs. MKS.
-   
-    # We need to determine if we are running a CYGWIN shell or an MKS shell
-    #    (if uname isn't available, then it will be unix_toolset=unknown)
-    unix_toolset=unknown
-    if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
-        # We kind of assume ROOTDIR is where MKS is and it's ok
-        unix_toolset=MKS
-        mkshome=`dosname -s "${ROOTDIR}"`
-        # Most unix utilities are in the mksnt directory of ROOTDIR
-        unixcommand_path="${mkshome}/mksnt"
-        path4sdk="${unixcommand_path}"
-	devtools_path="${slashjava}/devtools/win32/bin"
-	path4sdk="${devtools_path};${path4sdk}"
-        # Find GNU make
-        make="${devtools_path}/gnumake.exe"
-        fileMustExist "${make}" make
-    elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
-        # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
-        unix_toolset=CYGWIN
-        # Most unix utilities are in the /usr/bin
-        unixcommand_path="/usr/bin"
-        path4sdk="${unixcommand_path}"
-        # Find GNU make
-        make="${unixcommand_path}/make.exe"
-        fileMustExist "${make}" make
-    else
-      echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
-    fi
-
-    
-    # For windows, it's hard to know where the system is, so we just add this
-    #    to PATH.
-    slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
-    path4sdk="${slash_path};${PATH}"
-    
-    # Convert path4sdk to cygwin style
-    if [ "${unix_toolset}" = CYGWIN ] ; then
-	path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
-    fi
-    ;;
-esac
-
-# Export PATH setting
-PATH="${path4sdk}"
-export PATH
-
--- a/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java	Fri Oct 05 11:10:27 2018 -0400
@@ -45,10 +45,10 @@
 
     // Case 2: Newly obsolete flags should be recognized as newly obsolete (8073989)
     ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder(
-        "-XX:+SafepointSpinBeforeYield", "-version");
+        "-XX:+EmitSync", "-version");
 
     OutputAnalyzer output2 = new OutputAnalyzer(pb2.start());
     output2.shouldContain("Ignoring option").shouldContain("support was removed");
-    output2.shouldContain("SafepointSpinBeforeYield");
+    output2.shouldContain("EmitSync");
   }
 }
--- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java	Fri Oct 05 11:10:27 2018 -0400
@@ -44,7 +44,6 @@
         {"MaxRAMFraction",            "8"},
         {"MinRAMFraction",            "2"},
         {"InitialRAMFraction",        "64"},
-        {"AssumeMP",                  "false"},
         {"UseMembar",                 "true"},
         {"TLABStats",                 "false"},
 
--- a/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java	Fri Oct 05 11:10:27 2018 -0400
@@ -57,11 +57,10 @@
 
   static class Test {
     public static void test() throws Exception {
-      Unsafe unsafe = Unsafe.getUnsafe();
       TestClassLoader classloader = new TestClassLoader();
       ProtectionDomain pd = new ProtectionDomain(null, null);
       byte klassbuf[] = InMemoryJavaCompiler.compile("TestClass", "class TestClass { }");
-      Class klass = unsafe.defineClass(null, klassbuf, 0, klassbuf.length, classloader, pd);
+      Class<?> klass = classloader.defineClass("TestClass", klassbuf, pd);
     }
 
     public static void main(String[] args) throws Exception {
@@ -91,6 +90,10 @@
       public TestClassLoader() {
         super();
       }
+
+      public Class<?> defineClass(String name, byte[] bytes, ProtectionDomain pd) {
+        return defineClass(name, bytes, 0, bytes.length, pd);
+      }
     }
   }
 }
--- a/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -26,9 +26,9 @@
  * @bug 8151486
  * @summary Call Class.forName() on the system classloader from a class loaded
  *          from a custom classloader, using the current class's protection domain.
- * @library /test/jdk/lib/testlibrary
  * @library /test/lib
- * @build jdk.test.lib.Utils JarUtils
+ * @build jdk.test.lib.Utils
+ *        jdk.test.lib.util.JarUtils
  * @build ClassForName ProtectionDomainCacheTest
  * @run main/othervm/policy=test.policy -XX:+UnlockDiagnosticVMOptions -XX:VerifySubSet=dictionary -XX:+VerifyAfterGC -Xlog:gc+verify=debug,protectiondomain=trace,class+unload:gc.log -Djava.security.manager ProtectionDomainCacheTest
  */
@@ -41,6 +41,7 @@
 import java.nio.file.Paths;
 import java.util.List;
 import jdk.test.lib.Utils;
+import jdk.test.lib.util.JarUtils;
 
 /*
  * Create .jar, load ClassForName from .jar using a URLClassLoader
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/ArchiveDoesNotExist.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/ArchiveDoesNotExist.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main ArchiveDoesNotExist
+ * @run driver ArchiveDoesNotExist
  */
 
 import jdk.test.lib.cds.CDSOptions;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @bug 8025642
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main CdsDifferentObjectAlignment
+ * @run driver CdsDifferentObjectAlignment
  */
 
 import jdk.test.lib.cds.CDSTestUtils;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/CdsSameObjectAlignment.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/CdsSameObjectAlignment.java	Fri Oct 05 11:10:27 2018 -0400
@@ -30,7 +30,7 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main CdsSameObjectAlignment
+ * @run driver CdsSameObjectAlignment
  */
 
 import jdk.test.lib.Platform;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSharedDictionary.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSharedDictionary.java	Fri Oct 05 11:10:27 2018 -0400
@@ -28,7 +28,7 @@
  * @requires vm.cds
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
- * @run main DumpSharedDictionary
+ * @run driver DumpSharedDictionary
  */
 
 import jdk.test.lib.cds.CDSTestUtils;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java	Fri Oct 05 11:10:27 2018 -0400
@@ -28,7 +28,7 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main NonBootLoaderClasses
+ * @run driver NonBootLoaderClasses
  */
 
 import jdk.test.lib.cds.CDSOptions;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedBaseAddress.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedBaseAddress.java	Fri Oct 05 11:10:27 2018 -0400
@@ -29,7 +29,7 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main SharedBaseAddress
+ * @run driver SharedBaseAddress
  */
 
 import jdk.test.lib.cds.CDSTestUtils;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedStrings.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedStrings.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  *          java.management
  * @build SharedStringsWb sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller -jar whitebox.jar sun.hotspot.WhiteBox
- * @run main SharedStrings
+ * @run driver SharedStrings
  */
 
 import jdk.test.lib.cds.CDSTestUtils;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedStringsDedup.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedStringsDedup.java	Fri Oct 05 11:10:27 2018 -0400
@@ -28,7 +28,7 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main SharedStringsDedup
+ * @run driver SharedStringsDedup
  */
 
 import jdk.test.lib.cds.CDSTestUtils;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedStringsRunAuto.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedStringsRunAuto.java	Fri Oct 05 11:10:27 2018 -0400
@@ -28,7 +28,7 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main SharedStringsRunAuto
+ * @run driver SharedStringsRunAuto
  */
 
 import jdk.test.lib.cds.CDSTestUtils;
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/TestInterpreterMethodEntries.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/TestInterpreterMethodEntries.java	Fri Oct 05 11:10:27 2018 -0400
@@ -30,7 +30,7 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main TestInterpreterMethodEntries
+ * @run driver TestInterpreterMethodEntries
  */
 
 import java.lang.Math;
--- a/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/XCheckJniJsig/XCheckJSig.java	Fri Oct 05 11:10:27 2018 -0400
@@ -44,29 +44,21 @@
         System.out.println("Regression test for bugs 7051189 and 8023393");
 
         String jdk_path = System.getProperty("test.jdk");
-        String os_arch = Platform.getOsArch();
         String libjsig;
         String env_var;
         if (Platform.isOSX()) {
             env_var = "DYLD_INSERT_LIBRARIES";
-            libjsig = jdk_path + "/jre/lib/libjsig.dylib"; // jdk location
-            if (!(new File(libjsig).exists())) {
-                libjsig = jdk_path + "/lib/libjsig.dylib"; // jre location
-            }
+            libjsig = jdk_path + "/lib/libjsig.dylib"; // jre location
         } else {
             env_var = "LD_PRELOAD";
-            libjsig = jdk_path + "/jre/lib/" + os_arch + "/libjsig.so"; // jdk location
-            if (!(new File(libjsig).exists())) {
-                libjsig = jdk_path + "/lib/" + os_arch + "/libjsig.so"; // jre location
-            }
+            libjsig = jdk_path + "/lib/libjsig.so"; // jre location
         }
         // If this test fails, these might be useful to know.
         System.out.println("libjsig: " + libjsig);
-        System.out.println("osArch: " + os_arch);
 
         // Make sure the libjsig file exists.
         if (!(new File(libjsig).exists())) {
-            throw new jtreg.SkippedException("File " + libjsig + " not found");
+            throw new RuntimeException("File libjsig not found, path: " + libjsig);
         }
 
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-version");
--- a/test/hotspot/jtreg/runtime/appcds/AppendClasspath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/AppendClasspath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
  * @compile test-classes/HelloMore.java
- * @run main AppendClasspath
+ * @run driver AppendClasspath
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/BootClassPathMismatch.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/BootClassPathMismatch.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main BootClassPathMismatch
+ * @run driver BootClassPathMismatch
  */
 
 import jdk.test.lib.cds.CDSOptions;
--- a/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java	Fri Oct 05 11:10:27 2018 -0400
@@ -30,7 +30,7 @@
  * @modules jdk.jfr
  * @build Hello GetFlightRecorder
  * @run driver ClassFileInstaller -jar CDSandJFR.jar Hello GetFlightRecorder GetFlightRecorder$TestEvent GetFlightRecorder$SimpleEvent
- * @run main CDSandJFR
+ * @run driver CDSandJFR
  */
 
 import jdk.test.lib.BuildHelper;
--- a/test/hotspot/jtreg/runtime/appcds/CaseSensitiveClassPath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/CaseSensitiveClassPath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  *          jdk.jartool/sun.tools.jar
  * @requires os.family != "mac"
  * @compile test-classes/Hello.java
- * @run main CaseSensitiveClassPath
+ * @run driver CaseSensitiveClassPath
  */
 
 import java.nio.file.FileAlreadyExistsException;
--- a/test/hotspot/jtreg/runtime/appcds/ClassLoaderTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/ClassLoaderTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -36,7 +36,7 @@
  * @compile test-classes/BootClassPathAppendHelper.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main ClassLoaderTest
+ * @run driver ClassLoaderTest
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/ClassPathAttr.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/ClassPathAttr.java	Fri Oct 05 11:10:27 2018 -0400
@@ -30,7 +30,7 @@
  * @modules java.base/jdk.internal.misc
  *          java.management
  *          jdk.jartool/sun.tools.jar
- * @run main ClassPathAttr
+ * @run driver ClassPathAttr
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main CommandLineFlagComboNegative
+ * @run driver CommandLineFlagComboNegative
  */
 
 import java.util.ArrayList;
--- a/test/hotspot/jtreg/runtime/appcds/DirClasspathTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/DirClasspathTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -28,7 +28,7 @@
  * @requires vm.cds
  * @library /test/lib
  * @compile test-classes/Hello.java
- * @run main DirClasspathTest
+ * @run driver DirClasspathTest
  */
 
 import jdk.test.lib.Platform;
--- a/test/hotspot/jtreg/runtime/appcds/DumpClassList.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/DumpClassList.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/ArrayListTest.java
- * @run main DumpClassList
+ * @run driver DumpClassList
  */
 
 import jdk.test.lib.compiler.InMemoryJavaCompiler;
--- a/test/hotspot/jtreg/runtime/appcds/ExtraSymbols.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/ExtraSymbols.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main ExtraSymbols
+ * @run driver ExtraSymbols
  */
 
 import java.io.*;
--- a/test/hotspot/jtreg/runtime/appcds/FieldAnnotationsTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/FieldAnnotationsTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/FieldAnnotationsApp.java test-classes/MyAnnotation.java
- * @run main FieldAnnotationsTest
+ * @run driver FieldAnnotationsTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/FreeUnusedMetadata.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/FreeUnusedMetadata.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -29,7 +29,7 @@
  * @library /test/lib
  * @modules jdk.jartool/sun.tools.jar
  * @compile test-classes/MethodNoReturn.jasm test-classes/Hello.java
- * @run main FreeUnusedMetadata
+ * @run driver FreeUnusedMetadata
  */
 
 import java.nio.file.Files;
--- a/test/hotspot/jtreg/runtime/appcds/HelloExtTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/HelloExtTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -35,7 +35,7 @@
  * @compile test-classes/HelloExt.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main HelloExtTest
+ * @run driver HelloExtTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/HelloTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/HelloTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main HelloTest
+ * @run driver HelloTest
  */
 
 public class HelloTest {
--- a/test/hotspot/jtreg/runtime/appcds/IgnoreEmptyClassPaths.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/IgnoreEmptyClassPaths.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
  * @compile test-classes/HelloMore.java
- * @run main IgnoreEmptyClassPaths
+ * @run driver IgnoreEmptyClassPaths
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/JvmtiAddPath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/JvmtiAddPath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -35,7 +35,7 @@
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @compile test-classes/Hello.java
  * @compile test-classes/JvmtiApp.java
- * @run main JvmtiAddPath
+ * @run driver JvmtiAddPath
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/MissingSuperTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/MissingSuperTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,7 +32,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/MissingSuper.java
- * @run main MissingSuperTest
+ * @run driver MissingSuperTest
  */
 
 public class MissingSuperTest {
--- a/test/hotspot/jtreg/runtime/appcds/MoveJDKTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/MoveJDKTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main MoveJDKTest
+ * @run driver MoveJDKTest
  */
 
 // This test works only on Linux because it depends on symlinks and the name of the hotspot DLL (libjvm.so).
--- a/test/hotspot/jtreg/runtime/appcds/MultiProcessSharing.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/MultiProcessSharing.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -34,7 +34,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @compile test-classes/MultiProcClass.java
- * @run main MultiProcessSharing
+ * @run driver MultiProcessSharing
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/OldClassTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/OldClassTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,7 +33,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
  * @run build TestCommon JarBuilder
- * @run main OldClassTest
+ * @run driver OldClassTest
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/PackageSealing.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/PackageSealing.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,7 +32,7 @@
  * @compile test-classes/C1.java
  * @compile test-classes/C2.java
  * @compile test-classes/PackageSealingTest.java
- * @run main PackageSealing
+ * @run driver PackageSealing
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/ParallelLoad2.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/ParallelLoad2.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/ParallelLoad.java
  * @compile test-classes/ParallelClasses.java
- * @run main ParallelLoad2
+ * @run driver ParallelLoad2
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/ParallelLoadTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/ParallelLoadTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/ParallelLoad.java
  * @compile test-classes/ParallelClasses.java
- * @run main ParallelLoadTest
+ * @run driver ParallelLoadTest
  */
 
 public class ParallelLoadTest {
--- a/test/hotspot/jtreg/runtime/appcds/ProhibitedPackage.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/ProhibitedPackage.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/ProhibitedHelper.java test-classes/Prohibited.jasm
- * @run main ProhibitedPackage
+ * @run driver ProhibitedPackage
  */
 
 import jdk.test.lib.cds.CDSOptions;
--- a/test/hotspot/jtreg/runtime/appcds/ProtectionDomain.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/ProtectionDomain.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,7 +33,7 @@
  * @compile test-classes/ProtDomain.java
  * @compile test-classes/ProtDomainB.java
  * @compile test-classes/JimageClassProtDomain.java
- * @run main ProtectionDomain
+ * @run driver ProtectionDomain
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/RewriteBytecodesTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/RewriteBytecodesTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -34,7 +34,7 @@
  * @compile test-classes/RewriteBytecodes.java test-classes/Util.java test-classes/Super.java test-classes/Child.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main RewriteBytecodesTest
+ * @run driver RewriteBytecodesTest
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/SharedPackages.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/SharedPackages.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/PackageTest.java
  * @compile test-classes/JimageClassPackage.java
- * @run main SharedPackages
+ * @run driver SharedPackages
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/SignedJar.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/SignedJar.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main SignedJar
+ * @run driver SignedJar
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/SpecifySysLoaderProp.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/SpecifySysLoaderProp.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  * @compile test-classes/TestClassLoader.java
  * @compile test-classes/ReportMyLoader.java
  * @compile test-classes/TrySwitchMyLoader.java
- * @run main SpecifySysLoaderProp
+ * @run driver SpecifySysLoaderProp
  */
 
 import java.io.*;
--- a/test/hotspot/jtreg/runtime/appcds/TestWithProfiler.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/TestWithProfiler.java	Fri Oct 05 11:10:27 2018 -0400
@@ -36,7 +36,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/MyThread.java
  * @compile test-classes/TestWithProfilerHelper.java
- * @run main TestWithProfiler
+ * @run driver TestWithProfiler
  */
 
 import jdk.test.lib.BuildHelper;
--- a/test/hotspot/jtreg/runtime/appcds/TraceLongClasspath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/TraceLongClasspath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main TraceLongClasspath
+ * @run driver TraceLongClasspath
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/WideIloadTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/WideIloadTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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.
  * 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,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Iloadw.jasm
  * @compile test-classes/IloadwMain.java
- * @run main WideIloadTest
+ * @run driver WideIloadTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/WrongClasspath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/WrongClasspath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main WrongClasspath
+ * @run driver WrongClasspath
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/XShareAutoWithChangedJar.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/XShareAutoWithChangedJar.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java
- * @run main XShareAutoWithChangedJar
+ * @run driver XShareAutoWithChangedJar
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/ArchivedIntegerCacheTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/ArchivedIntegerCacheTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @compile CheckIntegerCacheApp.java
  * @run driver ClassFileInstaller -jar integer.jar CheckIntegerCacheApp
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main ArchivedIntegerCacheTest
+ * @run driver ArchivedIntegerCacheTest
  */
 
 import java.nio.file.Files;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/ArchivedModuleComboTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/ArchivedModuleComboTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @compile CheckArchivedModuleApp.java
  * @run driver ClassFileInstaller -jar app.jar CheckArchivedModuleApp
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main ArchivedModuleComboTest
+ * @run driver ArchivedModuleComboTest
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/ArchivedModuleCompareTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/ArchivedModuleCompareTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile PrintSystemModulesApp.java
  * @run driver ClassFileInstaller -jar app.jar PrintSystemModulesApp
- * @run main ArchivedModuleCompareTest
+ * @run driver ArchivedModuleCompareTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @compile CheckArchivedModuleApp.java
  * @run driver ClassFileInstaller -jar app.jar CheckArchivedModuleApp
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main ArchivedModuleWithCustomImageTest
+ * @run driver ArchivedModuleWithCustomImageTest
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/CheckCachedMirrorTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/CheckCachedMirrorTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -37,7 +37,7 @@
  * @run driver ClassFileInstaller -jar app.jar CheckCachedMirrorApp
  * @run driver ClassFileInstaller -jar hello.jar Hello
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main CheckCachedMirrorTest
+ * @run driver CheckCachedMirrorTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/CheckCachedResolvedReferences.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/CheckCachedResolvedReferences.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018 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
@@ -37,7 +37,7 @@
  * @run driver ClassFileInstaller -jar app.jar CheckCachedResolvedReferencesApp
  * @run driver ClassFileInstaller -jar hello.jar Hello
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main CheckCachedResolvedReferences
+ * @run driver CheckCachedResolvedReferences
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/DifferentHeapSizes.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/DifferentHeapSizes.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+ * 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
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/DumpTimeVerifyFailure.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/DumpTimeVerifyFailure.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
  * @compile MyOuter.java MyException.java
- * @run main DumpTimeVerifyFailure
+ * @run driver DumpTimeVerifyFailure
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/GCStressTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/GCStressTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @compile GCStressApp.java
  * @run driver ClassFileInstaller -jar gcstress.jar GCStressApp
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main GCStressTest
+ * @run driver GCStressTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/MirrorWithReferenceFieldsTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/MirrorWithReferenceFieldsTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @compile MirrorWithReferenceFieldsApp.java
  * @run driver ClassFileInstaller -jar app.jar MirrorWithReferenceFieldsApp
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main MirrorWithReferenceFieldsTest
+ * @run driver MirrorWithReferenceFieldsTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/OpenArchiveRegion.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/OpenArchiveRegion.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018 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
@@ -32,7 +32,7 @@
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
  * @compile ../test-classes/Hello.java
- * @run main OpenArchiveRegion
+ * @run driver OpenArchiveRegion
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/PrimitiveTypesTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/PrimitiveTypesTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @compile PrimitiveTypesApp.java
  * @run driver ClassFileInstaller -jar app.jar PrimitiveTypesApp FieldsTest
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main PrimitiveTypesTest
+ * @run driver PrimitiveTypesTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/cacheObject/RedefineClassTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/cacheObject/RedefineClassTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  *        RedefineClassApp
  *        InstrumentationClassFileTransformer
  *        InstrumentationRegisterClassFileTransformer
- * @run main RedefineClassTest
+ * @run driver RedefineClassTest
  */
 
 import com.sun.tools.attach.VirtualMachine;
--- a/test/hotspot/jtreg/runtime/appcds/condy/CondyHelloTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/condy/CondyHelloTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @build sun.hotspot.WhiteBox CondyHelloTest CondyHelloApp
  * @run driver ClassFileInstaller -jar condy_hello.jar CondyHello CondyHelloApp
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main CondyHelloTest
+ * @run driver CondyHelloTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatA.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatA.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -34,7 +34,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java test-classes/CustomLoadee.java test-classes/CustomLoadee2.java
  *          test-classes/CustomInterface2_ia.java test-classes/CustomInterface2_ib.java
- * @run main ClassListFormatA
+ * @run driver ClassListFormatA
  */
 
 public class ClassListFormatA extends ClassListFormatBase {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatB.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatB.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -34,7 +34,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java test-classes/CustomLoadee.java test-classes/CustomLoadee2.java
  *          test-classes/CustomInterface2_ia.java test-classes/CustomInterface2_ib.java
- * @run main ClassListFormatB
+ * @run driver ClassListFormatB
  */
 
 public class ClassListFormatB extends ClassListFormatBase {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatC.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatC.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -34,7 +34,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java test-classes/CustomLoadee.java test-classes/CustomLoadee2.java
  *          test-classes/CustomInterface2_ia.java test-classes/CustomInterface2_ib.java
- * @run main ClassListFormatC
+ * @run driver ClassListFormatC
  */
 
 public class ClassListFormatC extends ClassListFormatBase {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatD.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatD.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -34,7 +34,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java test-classes/CustomLoadee.java test-classes/CustomLoadee2.java
  *          test-classes/CustomInterface2_ia.java test-classes/CustomInterface2_ib.java
- * @run main ClassListFormatD
+ * @run driver ClassListFormatD
  */
 
 public class ClassListFormatD extends ClassListFormatBase {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatE.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatE.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -34,7 +34,7 @@
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/Hello.java test-classes/CustomLoadee.java test-classes/CustomLoadee2.java
  *          test-classes/CustomInterface2_ia.java test-classes/CustomInterface2_ib.java
- * @run main ClassListFormatE
+ * @run driver ClassListFormatE
  */
 
 public class ClassListFormatE extends ClassListFormatBase {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/HelloCustom.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/HelloCustom.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
  * @run driver ClassFileInstaller -jar hello.jar Hello
  * @run driver ClassFileInstaller -jar hello_custom.jar CustomLoadee
  * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
- * @run main HelloCustom
+ * @run driver HelloCustom
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/LoaderSegregationTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/LoaderSegregationTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -41,7 +41,7 @@
  *          ../test-classes/Util.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main LoaderSegregationTest
+ * @run driver LoaderSegregationTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ParallelTestMultiFP.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ParallelTestMultiFP.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,7 +32,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile ../test-classes/ParallelLoad.java ../test-classes/ParallelClasses.java
- * @run main ParallelTestMultiFP
+ * @run driver ParallelTestMultiFP
  */
 
 public class ParallelTestMultiFP extends ParallelTestBase {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ParallelTestSingleFP.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ParallelTestSingleFP.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,7 +32,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile ../test-classes/ParallelLoad.java ../test-classes/ParallelClasses.java
- * @run main ParallelTestSingleFP
+ * @run driver ParallelTestSingleFP
  */
 
 public class ParallelTestSingleFP extends ParallelTestBase {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ProhibitedPackageNamesTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ProhibitedPackageNamesTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -32,7 +32,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile ClassListFormatBase.java test-classes/Hello.java test-classes/InProhibitedPkg.java
- * @run main ProhibitedPackageNamesTest
+ * @run driver ProhibitedPackageNamesTest
  */
 
 public class ProhibitedPackageNamesTest extends ClassListFormatBase {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ProtectionDomain.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ProtectionDomain.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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.
  * 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 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/ProtDomain.java
- * @run main ProtectionDomain
+ * @run driver ProtectionDomain
  */
 
 public class ProtectionDomain {
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/SameNameInTwoLoadersTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/SameNameInTwoLoadersTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -38,7 +38,7 @@
  *     test-classes/SameNameUnrelatedLoaders.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main SameNameInTwoLoadersTest
+ * @run driver SameNameInTwoLoadersTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/UnintendedLoadersTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/UnintendedLoadersTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -34,7 +34,7 @@
  * @compile test-classes/UnintendedLoaders.java test-classes/CustomLoadee.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main UnintendedLoadersTest
+ * @run driver UnintendedLoadersTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/UnloadUnregisteredLoaderTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/UnloadUnregisteredLoaderTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -39,7 +39,7 @@
  * @run driver ClassFileInstaller ClassUnloadCommon
  * @run driver ClassFileInstaller ClassUnloadCommon$1
  * @run driver ClassFileInstaller ClassUnloadCommon$TestFailure
- * @run main UnloadUnregisteredLoaderTest
+ * @run driver UnloadUnregisteredLoaderTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/UnsupportedPlatforms.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/UnsupportedPlatforms.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -31,7 +31,7 @@
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @compile test-classes/SimpleHello.java
- * @run main UnsupportedPlatforms
+ * @run driver UnsupportedPlatforms
  */
 
 import jdk.test.lib.Platform;
--- a/test/hotspot/jtreg/runtime/appcds/javaldr/ArrayTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/javaldr/ArrayTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @compile ArrayTestHelper.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main ArrayTest
+ * @run driver ArrayTest
  */
 
 import java.util.List;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/CheckUnsupportedDumpingOptions.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/CheckUnsupportedDumpingOptions.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  *          jdk.internal.jvmstat/sun.jvmstat.monitor
  * @compile ../test-classes/Hello.java
- * @run main CheckUnsupportedDumpingOptions
+ * @run driver CheckUnsupportedDumpingOptions
  */
 
 import jdk.test.lib.compiler.InMemoryJavaCompiler;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/JigsawOptionsCombo.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/JigsawOptionsCombo.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,7 +33,7 @@
  *          jdk.jartool/sun.tools.jar
  *          jdk.internal.jvmstat/sun.jvmstat.monitor
  * @compile ../test-classes/Hello.java ../test-classes/HelloMore.java
- * @run main JigsawOptionsCombo
+ * @run driver JigsawOptionsCombo
  */
 import jdk.test.lib.compiler.InMemoryJavaCompiler;
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/AppClassInCP.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/AppClassInCP.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @build PatchMain
- * @run main AppClassInCP
+ * @run driver AppClassInCP
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/CustomPackage.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/CustomPackage.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @build PatchMain
- * @run main CustomPackage
+ * @run driver CustomPackage
  */
 
 import jdk.test.lib.compiler.InMemoryJavaCompiler;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/MismatchedPatchModule.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/MismatchedPatchModule.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @build PatchMain
- * @run main MismatchedPatchModule
+ * @run driver MismatchedPatchModule
  */
 
 import jdk.test.lib.compiler.InMemoryJavaCompiler;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/PatchDir.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/PatchDir.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,7 +33,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @build PatchMain
- * @run main PatchDir
+ * @run driver PatchDir
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/PatchJavaBase.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/PatchJavaBase.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @build PatchMain
- * @run main PatchJavaBase
+ * @run driver PatchJavaBase
  */
 
 import jdk.test.lib.compiler.InMemoryJavaCompiler;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/Simple.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/Simple.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @build PatchMain
- * @run main Simple
+ * @run driver Simple
  */
 
 import jdk.test.lib.compiler.InMemoryJavaCompiler;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/SubClassOfPatchedClass.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/SubClassOfPatchedClass.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,7 +33,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @build PatchMain
- * @run main SubClassOfPatchedClass
+ * @run driver SubClassOfPatchedClass
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/TwoJars.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/TwoJars.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  * @modules java.base/jdk.internal.misc
  *          jdk.jartool/sun.tools.jar
  * @build PatchMain
- * @run main TwoJars
+ * @run driver TwoJars
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java	Fri Oct 05 11:10:27 2018 -0400
@@ -35,7 +35,7 @@
  * @compile src/com/sun/tools/javac/MyMain.jasm
  * @compile src/sun/nio/cs/ext/MyClass.java
  * @compile src/sun/nio/cs/ext1/MyClass.java
- * @run main BootAppendTests
+ * @run driver BootAppendTests
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/ClassPathTests.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/ClassPathTests.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @compile src/com/sun/tools/javac/Main.jasm
  * @compile src/com/sun/tools/javac/MyMain.jasm
  * @compile ../../../SharedArchiveFile/javax/annotation/processing/FilerException.jasm
- * @run main ClassPathTests
+ * @run driver ClassPathTests
  * @summary AppCDS tests for testing classpath/package conflicts
  */
 
@@ -52,6 +52,7 @@
  * same name and package.
  */
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -62,6 +63,8 @@
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import jtreg.SkippedException;
+
 
 public class ClassPathTests {
     private static final String TEST_SRC = System.getProperty("test.src");
@@ -83,7 +86,7 @@
     private static String testArchiveName;
 
 
-    public static void main(String[] args) throws Exception {
+    public static void main(String[] args) throws Throwable {
         ClassPathTests tests = new ClassPathTests();
         tests.dumpArchive();
 
@@ -92,7 +95,16 @@
         for (Method m : methods) {
             if (m.getName().startsWith("test")) {
                 System.out.println("About to run test method: " + m.getName());
-                m.invoke(tests);
+                try {
+                    m.invoke(tests);
+                } catch (InvocationTargetException ite) {
+                    Throwable throwable = ite.getCause();
+                    if (throwable instanceof SkippedException) {
+                        throw throwable;
+                    } else {
+                        throw ite;
+                    }
+                }
                 numOfTestMethodsRun++;
             }
         }
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/DummyClassesInBootClassPath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/DummyClassesInBootClassPath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -34,7 +34,7 @@
  * @compile ../../../SharedArchiveFile/javax/annotation/processing/FilerException.jasm
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main DummyClassesInBootClassPath
+ * @run driver DummyClassesInBootClassPath
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -37,7 +37,7 @@
  *          jdk.internal.jvmstat/sun.jvmstat.monitor
  * @compile ../../test-classes/EmptyClassHelper.java
  * @compile ../../test-classes/com/sun/tools/javac/Main.jasm
- * @run main EmptyClassInBootClassPath
+ * @run driver EmptyClassInBootClassPath
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddModules.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddModules.java	Fri Oct 05 11:10:27 2018 -0400
@@ -29,7 +29,7 @@
  * @modules jdk.compiler
  *          jdk.jartool/sun.tools.jar
  *          jdk.jlink
- * @run main AddModules
+ * @run driver AddModules
  * @summary sanity test the --add-modules option
  */
 
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddOpens.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddOpens.java	Fri Oct 05 11:10:27 2018 -0400
@@ -29,7 +29,7 @@
  * @modules jdk.compiler
  *          jdk.jartool/sun.tools.jar
  *          jdk.jlink
- * @run main AddOpens
+ * @run driver AddOpens
  * @summary sanity test the --add-opens option
  */
 
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddReads.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddReads.java	Fri Oct 05 11:10:27 2018 -0400
@@ -29,7 +29,7 @@
  * @modules jdk.compiler
  *          jdk.jartool/sun.tools.jar
  *          jdk.jlink
- * @run main AddReads
+ * @run driver AddReads
  * @summary sanity test the --add-reads option
  */
 
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/ExportModule.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/ExportModule.java	Fri Oct 05 11:10:27 2018 -0400
@@ -29,7 +29,7 @@
  * @modules jdk.compiler
  *          jdk.jartool/sun.tools.jar
  *          jdk.jlink
- * @run main ExportModule
+ * @run driver ExportModule
  * @summary Tests involve exporting a module from the module path to a jar in the -cp.
  */
 
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/JvmtiAddPath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/JvmtiAddPath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,7 +33,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @compile ../../test-classes/JvmtiApp.java
- * @run main JvmtiAddPath
+ * @run driver JvmtiAddPath
  */
 
 import java.io.File;
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/MainModuleOnly.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/MainModuleOnly.java	Fri Oct 05 11:10:27 2018 -0400
@@ -29,7 +29,7 @@
  * @modules jdk.compiler
  *          jdk.jartool/sun.tools.jar
  *          jdk.jlink
- * @run main MainModuleOnly
+ * @run driver MainModuleOnly
  * @summary Test some scenarios with a main modular jar specified in the --module-path and -cp options in the command line.
  */
 
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/ModulePathAndCP.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/ModulePathAndCP.java	Fri Oct 05 11:10:27 2018 -0400
@@ -29,7 +29,7 @@
  * @modules jdk.compiler
  *          jdk.jartool/sun.tools.jar
  *          jdk.jlink
- * @run main ModulePathAndCP
+ * @run driver ModulePathAndCP
  * @summary 2 sets of tests: one with only --module-path in the command line;
  *          another with both -cp and --module-path in the command line.
  */
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/overridetests/OverrideTests.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/overridetests/OverrideTests.java	Fri Oct 05 11:10:27 2018 -0400
@@ -28,7 +28,7 @@
  * @modules java.base/jdk.internal.misc
  * @library ../..
  * @library /test/lib
- * @run main OverrideTests
+ * @run driver OverrideTests
  * @summary AppCDS tests for overriding archived classes with -p and --upgrade-module-path
  */
 
--- a/test/hotspot/jtreg/runtime/appcds/jvmti/parallelLoad/ParallelLoadAndTransformTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jvmti/parallelLoad/ParallelLoadAndTransformTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
  *          jdk.jartool/sun.tools.jar
  *          java.instrument
  * @build TransformUtil TransformerAgent ParallelLoad
- * @run main ParallelLoadAndTransformTest
+ * @run driver ParallelLoadAndTransformTest
  */
 import java.util.List;
 import java.util.stream.Collectors;
--- a/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasicTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasicTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,9 +33,9 @@
  *          jdk.jartool/sun.tools.jar
  *          java.base/jdk.internal.misc
  *          java.management
- * @run main RedefineClassHelper
+ * @run driver RedefineClassHelper
  * @build sun.hotspot.WhiteBox RedefineBasic
- * @run main RedefineBasicTest
+ * @run driver RedefineBasicTest
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
@@ -63,7 +63,7 @@
         OutputAnalyzer output;
         TestCommon.testDump(appJar, sharedClasses, useWb);
 
-        // redefineagent.jar is created by executing "@run main RedefineClassHelper"
+        // redefineagent.jar is created by executing "@run driver RedefineClassHelper"
         // which should be called before executing RedefineBasicTest
         output = TestCommon.exec(appJar, useWb,
                                  "-XX:+UnlockDiagnosticVMOptions",
--- a/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineRunningMethods_Shared.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineRunningMethods_Shared.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,9 +32,9 @@
  * @modules java.compiler
  *          java.instrument
  *          jdk.jartool/sun.tools.jar
- * @run main RedefineClassHelper
+ * @run driver RedefineClassHelper
  * @build sun.hotspot.WhiteBox RedefineRunningMethods_SharedHelper
- * @run main RedefineRunningMethods_Shared
+ * @run driver RedefineRunningMethods_Shared
  */
 
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @build HelloStringGC sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main ExerciseGC
+ * @run driver ExerciseGC
  * @run main/othervm -XX:+UseStringDeduplication ExerciseGC
  * @run main/othervm -XX:-CompactStrings ExerciseGC
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
  * @build HelloString
- * @run main FlagCombo
+ * @run driver FlagCombo
  */
 
 /**
@@ -44,7 +44,7 @@
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
  * @build HelloString
- * @run main FlagCombo noJfr
+ * @run driver FlagCombo noJfr
  */
 
 import jdk.test.lib.BuildHelper;
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,7 +33,7 @@
  * @compile InternStringTest.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main InternSharedString
+ * @run driver InternSharedString
  * @run main/othervm -XX:+UseStringDeduplication InternSharedString
  * @run main/othervm -XX:-CompactStrings InternSharedString
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
  * @build HelloString
- * @run main InvalidFileFormat
+ * @run driver InvalidFileFormat
  * @run main/othervm -XX:+UseStringDeduplication InvalidFileFormat
  * @run main/othervm -XX:-CompactStrings InvalidFileFormat
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
  * @build HelloString
- * @run main LargePages
+ * @run driver LargePages
  * @run main/othervm -XX:+UseStringDeduplication LargePages
  * @run main/othervm -XX:-CompactStrings LargePages
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java	Fri Oct 05 11:10:27 2018 -0400
@@ -33,7 +33,7 @@
  * @compile LockStringTest.java LockStringValueTest.java
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main LockSharedStrings
+ * @run driver LockSharedStrings
  * @run main/othervm -XX:+UseStringDeduplication LockSharedStrings
  * @run main/othervm -XX:-CompactStrings LockSharedStrings
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
  * @build HelloString
- * @run main SharedStringsBasic
+ * @run driver SharedStringsBasic
  * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasic
  * @run main/othervm -XX:-CompactStrings SharedStringsBasic
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @build HelloStringPlus sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main SharedStringsBasicPlus
+ * @run driver SharedStringsBasicPlus
  * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasicPlus
  * @run main/othervm -XX:-CompactStrings SharedStringsBasicPlus
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java	Fri Oct 05 11:10:27 2018 -0400
@@ -29,7 +29,7 @@
  * @library /test/hotspot/jtreg/runtime/appcds /test/lib
  * @modules jdk.jartool/sun.tools.jar
  * @build HelloString
- * @run main SharedStringsStress
+ * @run driver SharedStringsStress
  * @run main/othervm -XX:+UseStringDeduplication SharedStringsStress
  * @run main/othervm -XX:-CompactStrings SharedStringsStress
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -32,7 +32,7 @@
  *          jdk.jartool/sun.tools.jar
  * @build sun.hotspot.WhiteBox SharedStringsWb
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main SharedStringsWbTest
+ * @run driver SharedStringsWbTest
  * @run main/othervm -XX:+UseStringDeduplication SharedStringsWbTest
  * @run main/othervm -XX:-CompactStrings SharedStringsWbTest
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java	Fri Oct 05 11:10:27 2018 -0400
@@ -31,7 +31,7 @@
  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
  * @modules java.base/jdk.internal.misc
  * @modules java.management
- * @run main SysDictCrash
+ * @run driver SysDictCrash
  * @run main/othervm -XX:+UseStringDeduplication SysDictCrash
  * @run main/othervm -XX:-CompactStrings SysDictCrash
  */
--- a/test/jaxp/javax/xml/jaxp/libs/jaxp/library/JarUtils.java	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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 jaxp.library;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-/**
- * This class consists exclusively of static utility methods that are useful
- * for creating and manipulating JAR files.
- */
-
-public final class JarUtils {
-    private JarUtils() { }
-
-    /**
-     * Creates a JAR file.
-     *
-     * Equivalent to {@code jar cfm <jarfile> <manifest> -C <dir> file...}
-     *
-     * The input files are resolved against the given directory. Any input
-     * files that are directories are processed recursively.
-     */
-    public static void createJarFile(Path jarfile, Manifest man, Path dir, Path... file)
-        throws IOException
-    {
-        // create the target directory
-        Path parent = jarfile.getParent();
-        if (parent != null)
-            Files.createDirectories(parent);
-
-        List<Path> entries = new ArrayList<>();
-        for (Path entry : file) {
-            Files.find(dir.resolve(entry), Integer.MAX_VALUE,
-                        (p, attrs) -> attrs.isRegularFile())
-                    .map(e -> dir.relativize(e))
-                    .forEach(entries::add);
-        }
-
-        try (OutputStream out = Files.newOutputStream(jarfile);
-             JarOutputStream jos = new JarOutputStream(out))
-        {
-            if (man != null) {
-                JarEntry je = new JarEntry(JarFile.MANIFEST_NAME);
-                jos.putNextEntry(je);
-                man.write(jos);
-                jos.closeEntry();
-            }
-
-            for (Path entry : entries) {
-                String name = toJarEntryName(entry);
-                jos.putNextEntry(new JarEntry(name));
-                Files.copy(dir.resolve(entry), jos);
-                jos.closeEntry();
-            }
-        }
-    }
-
-    /**
-     * Creates a JAR file.
-     *
-     * Equivalent to {@code jar cf <jarfile>  -C <dir> file...}
-     *
-     * The input files are resolved against the given directory. Any input
-     * files that are directories are processed recursively.
-     */
-    public static void createJarFile(Path jarfile, Path dir, Path... file)
-        throws IOException
-    {
-        createJarFile(jarfile, null, dir, file);
-    }
-
-    /**
-     * Creates a JAR file.
-     *
-     * Equivalent to {@code jar cf <jarfile> -C <dir> file...}
-     *
-     * The input files are resolved against the given directory. Any input
-     * files that are directories are processed recursively.
-     */
-    public static void createJarFile(Path jarfile, Path dir, String... input)
-        throws IOException
-    {
-        Path[] paths = Stream.of(input).map(Paths::get).toArray(Path[]::new);
-        createJarFile(jarfile, dir, paths);
-    }
-
-    /**
-     * Creates a JAR file from the contents of a directory.
-     *
-     * Equivalent to {@code jar cf <jarfile> -C <dir> .}
-     */
-    public static void createJarFile(Path jarfile, Path dir) throws IOException {
-        createJarFile(jarfile, dir, Paths.get("."));
-    }
-
-    /**
-     * Map a file path to the equivalent name in a JAR file
-     */
-    private static String toJarEntryName(Path file) {
-        Path normalized = file.normalize();
-        return normalized.subpath(0, normalized.getNameCount())  // drop root
-                .toString()
-                .replace(File.separatorChar, '/');
-    }
-}
--- a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogFileInputTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogFileInputTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -42,9 +42,11 @@
 import javax.xml.catalog.CatalogFeatures;
 import javax.xml.catalog.CatalogManager;
 import javax.xml.catalog.CatalogResolver;
+
 import static jaxp.library.JAXPTestUtilities.getSystemProperty;
-import jaxp.library.JarUtils;
 import jaxp.library.SimpleHttpServer;
+import jdk.test.lib.util.JarUtils;
+
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -56,10 +58,10 @@
 /*
  * @test
  * @bug 8151154 8171243
- * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
+ * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest /test/lib
  * @run testng/othervm catalog.CatalogFileInputTest
  * @summary Verifies that the Catalog API accepts valid URIs only;
-            Verifies that the CatalogFeatures' builder throws
+ *          Verifies that the CatalogFeatures' builder throws
  *          IllegalArgumentException on invalid file inputs.
  *          This test was splitted from CatalogTest.java due to
  *          JDK-8168968, it has to only run without SecurityManager
--- a/test/jdk/ProblemList-Xcomp.txt	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/ProblemList-Xcomp.txt	Fri Oct 05 11:10:27 2018 -0400
@@ -28,4 +28,4 @@
 #############################################################################
 
 java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all
-java/lang/Class/forName/modules/TestDriver.java 8208212 solaris-all
+java/lang/Class/forName/modules/TestDriver.java 8205526 solaris-all
--- a/test/jdk/ProblemList.txt	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/ProblemList.txt	Fri Oct 05 11:10:27 2018 -0400
@@ -102,7 +102,7 @@
 #  1. Make sure test passes on all platforms with samevm, or mark it othervm
 #  2. Make sure test passes on all platforms when run with it's entire group
 #  3. Make sure both VMs are tested, -server and -client, if possible
-#  4. Use a tool like JPRT or something to verify these results
+#  4. Use your favorite build and test system to verify these results
 #  5. Delete lines in this file, include the changes with your test changes
 #
 # You may need to repeat your testing 2 or even 3 times to verify good
@@ -556,8 +556,6 @@
 
 java/net/DatagramSocket/SendDatagramToBadAddress.java           7143960 macosx-all
 
-java/net/Socket/LingerTest.java                                 8208690 generic-all
-
 ############################################################################
 
 # jdk_nio
--- a/test/jdk/TEST.groups	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/TEST.groups	Fri Oct 05 11:10:27 2018 -0400
@@ -259,11 +259,7 @@
 jdk_native_sanity = \
     native_sanity
 
-# java launcher specific tests, Note: do not include this group into any groups
-# that potentially could be included into a jprt test rule, as the complementary
-# closed  group includes awt SplashScreen and these tests may not run
-# satisfactorily on all platforms and  profiles thus this group must always
-# be a stand-alone group
+# java launcher specific tests.
 jdk_launcher = \
     tools/launcher \
     sun/tools
@@ -407,9 +403,6 @@
 #
 # These groups specify a subset of Serviceability tests that are supposed to
 # guard against breakage of Serviceability features by other component teams.
-# They are added to the "hotspot" testset in JPRT so that they will run on all
-# full-forest pushes through JPRT.
-#
 
 jdk_svc_sanity = \
     :jdk_management_sanity \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/CatchPatternTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,126 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 4671838
+ * @summary TTY: surprising ExceptionSpec.resolveEventRequest() wildcard results
+ * @comment converted from test/jdk/com/sun/jdi/CatchPatternTest.sh
+ *
+ * @library /test/lib
+ * @build CatchPatternTest
+ * @run main/othervm CatchPatternTest
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+class CatchPatternTestTarg {
+    public void bark(int i) {
+        System.out.println(" bark: " + i);
+        switch (i) {
+        case 0:
+            throw new IllegalArgumentException("IllegalArgumentException");
+        case 1:
+            throw new ArithmeticException("ArithmeticException");
+        case 2:
+            throw new IllegalMonitorStateException("IllegalMonitorStateException");
+        case 3:
+            throw new IndexOutOfBoundsException("IndexOutOfBoundsException");
+        default:
+            throw new Error("should not happen");
+        }
+    }
+    public void loop(int max) {
+        for (int i = 0; i <= max; i++) {
+            try {
+                bark(i);
+            } catch(RuntimeException re) {
+                System.out.println(" loop: " + re.getMessage() +
+                       " caught and ignored.");
+            }
+        }
+    }
+    public void partOne() {
+        loop(2);
+        System.out.println("partOne completed");
+    }
+    public void partTwo() {
+        loop(3);
+        System.out.println("partTwo completed");
+    }
+    public static void main(String[] args) {
+        System.out.println("Howdy!");
+        CatchPatternTestTarg my = new CatchPatternTestTarg();
+        my.partOne();
+        my.partTwo();
+        System.out.println("Goodbye from CatchPatternTestTarg!");
+    }
+}
+
+public class CatchPatternTest extends JdbTest {
+    public static void main(String argv[]) {
+        new CatchPatternTest().run();
+    }
+
+    private CatchPatternTest() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = CatchPatternTestTarg.class.getName();
+
+    @Override
+    protected void runCases() {
+        jdb.command(JdbCommand.stopIn(DEBUGGEE_CLASS, "main"));
+        jdb.command(JdbCommand.stopIn(DEBUGGEE_CLASS, "partTwo"));
+        jdb.command(JdbCommand.run());
+
+        jdb.command(JdbCommand.ignore(JdbCommand.ExType.uncaught, "java.lang.Throwable"));
+        // Instead of matching java.lang.I* we use two more specific
+        // patterns here. The reason is to avoid matching IncompatibleClassChangeError
+        // (or the subclass NoSuchMethodError) thrown by the
+        // java.lang.invoke infrastructure.
+        jdb.command(JdbCommand.catch_(JdbCommand.ExType.all, "java.lang.Il*"));
+        jdb.command(JdbCommand.catch_(JdbCommand.ExType.all, "java.lang.Ind*"));
+        jdb.command(JdbCommand.cont());
+        jdb.command(JdbCommand.cont());
+        jdb.command(JdbCommand.cont());
+        jdb.command(JdbCommand.ignore(JdbCommand.ExType.all, "java.lang.Ind*"));
+        jdb.command(JdbCommand.ignore(JdbCommand.ExType.all, "java.lang.Il*"));
+
+        jdb.contToExit(1);
+
+        new OutputAnalyzer(getJdbOutput())
+                .shouldContain("Exception occurred: java.lang.IllegalArgumentException")
+                .shouldContain("Exception occurred: java.lang.IllegalMonitorStateException")
+                .shouldNotContain("Exception occurred: ArithmeticException")
+                .shouldNotContain("Exception occurred: IndexOutOfBoundsException")
+                .shouldNotContain("Exception occurred: IllegalStateException")
+                .shouldNotContain("should not happen");
+        new OutputAnalyzer(getDebuggeeOutput())
+                .shouldContain("partOne completed")
+                .shouldContain("partTwo completed");
+    }
+
+}
--- a/test/jdk/com/sun/jdi/CatchPatternTest.sh	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#  @test
-#  @bug 4671838
-#  @summary TTY: surprising ExceptionSpec.resolveEventRequest() wildcard results
-#  @author Tim Bell
-#
-#  @key intermittent
-#  @run shell CatchPatternTest.sh
-classname=CatchPatternTestTarg
-createJavaFile()
-{
-    cat <<EOF > $classname.java.1
-public class $classname {
-    public void bark(int i) {
-        System.out.println(" bark: " + i);
-        switch (i) {
-        case 0:
-            throw new IllegalArgumentException("IllegalArgumentException");
-        case 1:
-            throw new ArithmeticException("ArithmeticException");
-        case 2:
-            throw new IllegalMonitorStateException("IllegalMonitorStateException");
-        case 3:
-            throw new IndexOutOfBoundsException("IndexOutOfBoundsException");
-        default:
-            throw new Error("should not happen");
-        }
-    }
-    public void loop(int max) {
-        for (int i = 0; i <= max; i++) {
-            try {
-                bark(i);
-            } catch(RuntimeException re) {
-                System.out.println(" loop: " + re.getMessage() +
-                       " caught and ignored.");
-            }
-        }
-    }
-    public void partOne() {
-        loop(2);
-        System.out.println("partOne completed");
-    }
-    public void partTwo() {
-        loop(3);
-        System.out.println("partTwo completed");
-    }
-    public static void main(String[] args) {
-        System.out.println("Howdy!");
-        $classname my = new $classname();
-        my.partOne();
-        my.partTwo();
-        System.out.println("Goodbye from $classname!");
-    }
-}
-EOF
-}
-
-# This is called to feed cmds to jdb.
-dojdbCmds()
-{
-   #set -x
-   cmd stop in ${classname}.main
-   cmd stop in ${classname}.partTwo
-   runToBkpt
-   cmd ignore uncaught java.lang.Throwable
-   # Instead of matching java.lang.I* we use two more specific
-   # patterns here. The reason is to avoid matching IncompatibleClassChangeError
-   # (or the subclass NoSuchMethodError) thrown by the
-   # java.lang.invoke infrastructure.
-   cmd catch all java.lang.Il*
-   cmd catch all java.lang.Ind*
-   cmd cont
-   cmd cont
-   cmd cont
-   cmd ignore all java.lang.I*
-   cmd allowExit cont
-}
-
-mysetup()
-{
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-# You could replace this next line with the contents
-# of ShellScaffold.sh and this script will run just the same.
-mysetup
-
-runit
-#
-jdbFailIfNotPresent "Exception occurred: java.lang.IllegalArgumentException"
-jdbFailIfNotPresent "Exception occurred: java.lang.IllegalMonitorStateException"
-jdbFailIfPresent "Exception occurred: ArithmeticException"
-jdbFailIfPresent "Exception occurred: IndexOutOfBoundsException"
-jdbFailIfPresent "Exception occurred: IllegalStateException"
-jdbFailIfPresent "should not happen"
-debuggeeFailIfNotPresent "partOne completed"
-debuggeeFailIfNotPresent "partTwo completed"
-#
-pass
--- a/test/jdk/com/sun/jdi/ImmutableResourceTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/com/sun/jdi/ImmutableResourceTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 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
@@ -21,18 +21,18 @@
  * questions.
  */
 
-/**
- *
- *
- *  This isn't the test case: ImmutableResourceTest.sh is.
- *  Refer to ImmutableResourceTest.sh when running this test.
+/*
+ * @test
+ * @bug        6287579
+ * @summary    SubClasses of ListResourceBundle should fix getContents()
  *
- *  @bug        6287579
- *  @summary    SubClasses of ListResourceBundle should fix getContents()
+ * @modules jdk.jdi/com.sun.tools.example.debug.tty
+ *
+ * @compile --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED -g ImmutableResourceTest.java
  *
- *  @author Tim Bell
- *
+ * @run main/othervm --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED ImmutableResourceTest
  */
+
 import java.util.ResourceBundle;
 
 public class ImmutableResourceTest {
--- a/test/jdk/com/sun/jdi/ImmutableResourceTest.sh	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-#
-# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# @test
-# @bug        6287579
-# @summary    SubClasses of ListResourceBundle should fix getContents()
-# @author     Tim Bell
-#
-# @modules jdk.jdi/com.sun.tools.example.debug.tty
-#
-# @run shell ImmutableResourceTest.sh
-#
-
-# Beginning of subroutines:
-status=1
-
-#Call this from anywhere to fail the test with an error message
-# usage: fail "reason why the test failed"
-fail()
- { echo "The test failed :-("
-   echo "$*" 1>&2
-   echo "exit status was $status"
-   exit $status
- } #end of fail()
-
-#Call this from anywhere to pass the test with a message
-# usage: pass "reason why the test passed if applicable"
-pass()
- { echo "The test passed!!!"
-   echo "$*" 1>&2
-   exit 0
- } #end of pass()
-
-# end of subroutines
-
-# The beginning of the script proper
-
-OS=`uname -s`
-case "$OS" in
-   SunOS | Linux | Darwin | AIX )
-      PATHSEP=":"
-      ;;
-
-   Windows* | CYGWIN*)
-      PATHSEP=";"
-      ;;
-
-   # catch all other OSs
-   * )
-      echo "Unrecognized system!  $OS"
-      fail "Unrecognized system!  $OS"
-      ;;
-esac
-
-TARGETCLASS="ImmutableResourceTest"
-if [ -z "${TESTJAVA}" ] ; then
-   # TESTJAVA is not set, so the test is running stand-alone.
-   # TESTJAVA holds the path to the root directory of the build of the JDK
-   # to be tested.  That is, any java files run explicitly in this shell
-   # should use TESTJAVA in the path to the java interpreter.
-   # So, we'll set this to the JDK spec'd on the command line.  If none
-   # is given on the command line, tell the user that and use a default.
-   # THIS IS THE JDK BEING TESTED.
-   if [ -n "$1" ] ; then
-          TESTJAVA=$1
-      else
-          TESTJAVA=$JAVA_HOME
-   fi
-   TESTSRC=.
-   TESTCLASSES=.
-   #Deal with .class files:
-fi
-#
-echo "JDK under test is: $TESTJAVA"
-#
-CP="-classpath ${TESTCLASSES}"
-#
-env
-#
-set -vx
-#
-# Compile test class
-${TESTJAVA}/bin/javac --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \
-   -d "${TESTCLASSES}" ${CP} -g "${TESTSRC}"/"${TARGETCLASS}".java
-#
-# Run the test class, again with the classpath we need:
-${TESTJAVA}/bin/java --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \
-    ${CP} ${TARGETCLASS}
-status=$?
-echo "test status was: $status"
-if [ $status -eq "0" ];
-   then pass ""
-
-   else fail "unspecified test failure"
-fi
--- a/test/jdk/com/sun/jdi/JITDebug.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/com/sun/jdi/JITDebug.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -22,37 +22,27 @@
  */
 
 /*
- *  Note 1: JITDebug.java is no longer a standalone regression test,
- *  due to chronic test failures on win32 platforms.  When testing,
- *  use the wrapper script (JITDebug.sh) instead, which will in turn
- *  invoke this program.
- *
- *  The problems are related to inconsistent use of "SystemRoot"
- *  versus "SYSTEMROOT" environment variables in different win32 O/S
- *  installations.  Refer to the Comments and Evaluation on bugs
- *  4522770 and 4461673 for more information.
+ * Note: What seems to be an excessive use of System.xxx.flush();
+ * is actually necessary to combat lost output on win32 systems.
  *
- *  Undefined SystemRoot in a win32 environment causes the O/S socket()
- *  layer to fail with WSAEPROVIDERFAILEDINIT.  The workaround used by
- *  JITDebug.sh and JITDebug.java is to select the dt_shmem transport
- *  on any win32 platform where SystemRoot is not found.
- *
- *  Note 2: What seems to be an excessive use of System.xxx.flush();
- *  is actually necessary to combat lost output on win32 systems.
+ * @test
+ * @bug 4291701 4376819 4422312 4522770
+ * @summary Test JIT debugging -
+ * assure that launching on uncaught exception works
  *
- *  @t e s t
- *  @bug 4291701 4376819 4422312 4522770
- *  @summary Test JIT debugging -
- *  assure that launching on uncaught exception works
+ * @library /test/lib
  *
- *  @author Robert Field
- *  @run driver JITDebug
+ * @author Robert Field
+ * @run main/othervm JITDebug
  */
 
 import com.sun.jdi.*;
 import com.sun.jdi.connect.*;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.Utils;
+import jdk.test.lib.process.ProcessTools;
+
 import java.util.*;
-import java.io.*;
 
 /*
  * This class implements three separate small programs, each
@@ -97,7 +87,13 @@
             }
         case 3:
             if (args[0].equals("DEBUGGER")) {
-                trivialDebugger(args[2]);
+                // launched by using "-agentlib:" "launch" sub-option:
+                // The following strings are appended to the string given in this argument (space-delimited).
+                // They can aid the launched debugger in establishing a connection with this VM.
+                // The resulting string is executed.
+                // - The value of the transport sub-option.
+                // - The value of the address sub-option (or the generated address if one is not given)
+                trivialDebugger(args[1], args[2]);
                 return true;
             } else {
                 return false;
@@ -108,70 +104,24 @@
     }
 
     void testLaunch() {
-        class DisplayOutput extends Thread {
-            InputStream in;
-
-            DisplayOutput(InputStream in) {
-                this.in = in;
-            }
-
-            public void run() {
-                try {
-                    transfer();
-                } catch (IOException exc) {
-                    new RuntimeException("Unexpected exception: " + exc);
-                }
-            }
-
-            void transfer() throws IOException {
-                int ch;
-                while ((ch = in.read()) != -1) {
-                    System.out.print((char)ch);
-                }
-                in.close();
-            }
-        }
-        String transportMethod = System.getProperty("TRANSPORT_METHOD");
-        if (transportMethod == null) {
-            transportMethod = "dt_socket"; //Default to socket transport.
-        }
-        String javaExe = System.getProperty("java.home") +
-                         File.separator + "bin" + File.separator +"java";
-        List largs = new ArrayList();
-        largs.add(javaExe);
-        largs.add("-agentlib:jdwp=transport=" + transportMethod + ",server=y,onuncaught=y," +
-                  "launch=" +
-                  javaExe + " -DTRANSPORT_METHOD=" + transportMethod + " " +
-                  this.getClass().getName() + " DEBUGGER ");
-        largs.add("JITDebug");
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true);
+        List largs = pb.command();
+        largs.add("-classpath");
+        largs.add(Utils.TEST_CLASSES);
+        String javaExe = JDKToolFinder.getJDKTool("java");
+        largs.add("-agentlib:jdwp=transport=dt_socket,server=y,onuncaught=y," +
+                  "launch=" + javaExe + " " + this.getClass().getName() + " DEBUGGER ");
+        largs.add(this.getClass().getName());
         largs.add("TARGET");
-        System.out.println("Launching: " + largs);
-        String[] sargs = (String[])largs.toArray(new String[largs.size()]);
-        Runtime rt = Runtime.getRuntime();
         try {
-            Process proc = rt.exec(VMConnection.insertDebuggeeVMOptions(sargs));
-            DisplayOutput inThread = new DisplayOutput(proc.getInputStream());
-            DisplayOutput erThread = new DisplayOutput(proc.getErrorStream());
-            inThread.start();  // transfer all in&err
-            erThread.start();
-            inThread.join();  // make sure they are done
-            erThread.join();
-            int exitValue = proc.waitFor();
-            if (exitValue != 0) {
-                throw new RuntimeException("Failure exit status: " +
-                                           exitValue);
-            }
-        } catch (Exception exc) {
+            ProcessTools.executeCommand(pb)
+                    .shouldHaveExitValue(0);
+        } catch (Throwable exc) {
             throw new RuntimeException("Unexpected exception: " + exc);
         }
         System.out.println("JIT Debugging test PASSED");
     }
 
-    void displayOutput(InputStream in) throws IOException {
-
-    }
-
-
     // Target VM code
     void debugTarget() {
         System.out.flush();
@@ -180,9 +130,8 @@
         throw new RuntimeException("Start-up onuncaught handling");
     }
 
-    void trivialDebugger(String transportAddress) {
+    void trivialDebugger(String transportMethod, String transportAddress) {
         System.out.println("trivial debugger started");
-        String transportMethod = System.getProperty("TRANSPORT_METHOD");
         String connectorName = null;
         if ("dt_shmem".equals(transportMethod)) {
             connectorName = "com.sun.jdi.SharedMemoryAttach";
@@ -209,7 +158,7 @@
     }
 
     void doAttach(String connectorName, AttachingConnector conn, String transportAddress) {
-        Map connArgs = conn.defaultArguments();
+        Map<String, Connector.Argument> connArgs = conn.defaultArguments();
         if ("com.sun.jdi.SharedMemoryAttach".equals(connectorName)) {
             Connector.Argument portArg = (Connector.Argument)connArgs.get("name");
             portArg.setValue(transportAddress);
@@ -234,7 +183,7 @@
     void hang() {
         try {
             // ten minute nap
-            Thread.currentThread().sleep(10 * 60 * 1000);
+            Thread.sleep(10 * 60 * 1000);
         } catch (InterruptedException exc) {
             // shouldn't happen
         }
--- a/test/jdk/com/sun/jdi/JITDebug.sh	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-#!/bin/ksh -p
-
-#
-# Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# @test       JITDebug.sh 1.7 03/09/05
-# @bug        4291701 4376819 4422312 4522770 4913748
-# @summary    Test JIT debugging - assure that launching on
-#             uncaught exception works
-# @author     Tim Bell
-# Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh
-#
-# @run build TestScaffold VMConnection TargetListener TargetAdapter
-# @run compile -g JITDebug.java
-# @run shell JITDebug.sh
-
-# Beginning of subroutines:
-status=1
-
-#Call this from anywhere to fail the test with an error message
-# usage: fail "reason why the test failed"
-fail()
- { echo "The test failed :-("
-   echo "$*" 1>&2
-   echo "exit status was $status"
-   exit $status
- } #end of fail()
-
-#Call this from anywhere to pass the test with a message
-# usage: pass "reason why the test passed if applicable"
-pass()
- { echo "The test passed!!!"
-   echo "$*" 1>&2
-   exit 0
- } #end of pass()
-
-# end of subroutines
-
-
-# The beginning of the script proper
-
-OS=`uname -s`
-export TRANSPORT_METHOD
-case "$OS" in
-   SunOS | Linux | Darwin | AIX )
-      PATHSEP=":"
-      TRANSPORT_METHOD=dt_socket
-      ;;
-
-   Windows* | CYGWIN*)
-      PATHSEP=";"
-      TRANSPORT_METHOD=dt_shmem
-      ;;
-
-   # catch all other OSs
-   * )
-      echo "Unrecognized system!  $OS"
-      fail "Unrecognized system!  $OS"
-      ;;
-esac
-#
-# Want this test to run standalone as well as in the harness, so do the
-#  following to copy the test's directory into the harness's scratch directory
-#  and set all appropriate variables:
-
-if [ -z "${TESTJAVA}" ] ; then
-   # TESTJAVA is not set, so the test is running stand-alone.
-   # TESTJAVA holds the path to the root directory of the build of the JDK
-   # to be tested.  That is, any java files run explicitly in this shell
-   # should use TESTJAVA in the path to the java interpreter.
-   # So, we'll set this to the JDK spec'd on the command line.  If none
-   # is given on the command line, tell the user that and use a default.
-   # THIS IS THE JDK BEING TESTED.
-   if [ -n "$1" ] ; then
-          TESTJAVA=$1
-      else
-          TESTJAVA=$JAVA_HOME
-   fi
-   TESTSRC=.
-   TESTCLASSES=.
-   #Deal with .class files:
-   #if running standalone (no test harness of any kind), compile the
-   #support files and the test case
-   ${TESTJAVA}/bin/javac -d ${TESTCLASSES} \
-            -classpath "${TESTSRC}" \
-            TestScaffold.java VMConnection.java TargetListener.java TargetAdapter.java
-   ${TESTJAVA}/bin/javac  -d ${TESTCLASSES} \
-            -classpath "${TESTSRC}" -g \
-            JITDebug.java
-fi
-echo "JDK under test is: $TESTJAVA"
-#
-CLASSPATH="${TESTCLASSES}"
-export CLASSPATH
-CP="-classpath \"${CLASSPATH}\""
-#
-TARGETCLASS=JITDebug
-RUNFLAGS='-showversion -DTRANSPORT_METHOD="${TRANSPORT_METHOD}"'
-RUNFLAGS="-Dtest.classes=${TESTCLASSES} ${RUNFLAGS}"
-#
-echo ""
-echo "Environment variable definitions are:"
-echo ""
-env | sort
-echo ""
-echo ""
-#
-echo "Starting test:"
-echo ${TESTJAVA}/bin/java -DHANGINGJAVA_DEB ${RUNFLAGS} ${CP} ${TARGETCLASS}
-eval ${TESTJAVA}/bin/java -DHANGINGJAVA_DEB ${RUNFLAGS} ${CP} ${TARGETCLASS}
-status=$?
-if [ $status -ne "0" ];
-then fail "test failed for class=$TARGETCLASS!"
-fi
-#
-# pass or fail the test based on status of the command
-if [ $status -eq "0" ];
-   then pass ""
-
-   else fail "unspecified test failure"
-fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/PrivateTransportTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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 6225664 6220618
+ * @summary Test for when private transport library outside jdk
+ * @comment converted from test/jdk/com/sun/jdi/PrivateTransportTest.sh
+ *
+ * @library /test/lib
+ * @run compile -g HelloWorld.java
+ * @build PrivateTransportTest
+ * @run main/othervm PrivateTransportTest
+ */
+
+import jdk.test.lib.Utils;
+import jdk.test.lib.process.ProcessTools;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Stream;
+
+public class PrivateTransportTest {
+
+    public static void main(String argv[]) throws Throwable {
+        new PrivateTransportTest()
+                .test();
+    }
+
+    private final Path transportLib;
+    private final String pathEnvVar;
+    private final String pathSep;
+
+    private static boolean isTransportLib(Path path) {
+        String fileName = path.getFileName().toString().toLowerCase();
+        return fileName.equals("dt_socket.dll")
+                || fileName.equals("libdt_socket.so")
+                || fileName.equals("libdt_socket.dylib");
+    }
+
+    private PrivateTransportTest() throws IOException {
+        Path jdkRoot = Paths.get(Utils.TEST_JDK);
+        try (Stream<Path> files = Files.find(jdkRoot, 5, (path, attr) -> isTransportLib(path.getFileName()))) {
+            Optional<Path> foundLib = files.findAny();
+            if (!foundLib.isPresent()) {
+                throw new RuntimeException("cannot find dt_socket lib");
+            }
+            transportLib = foundLib.get();
+        }
+        if (System.getProperty("os.name").startsWith("Windows")) {
+            pathSep = ";";
+            pathEnvVar = "PATH";
+        } else {
+            pathSep = ":";
+            if (System.getProperty("os.name").equals("AIX")) {
+                pathEnvVar = "LIBPATH";
+            } else {
+                pathEnvVar = "LD_LIBRARY_PATH";
+            }
+        }
+    }
+
+    private void test() throws Throwable {
+        // copy existing dt_socket lib to <CLASSES>/private_dt_socket
+        String libName = transportLib.getFileName().toString().replace("dt_socket", "private_dt_socket");
+        Files.copy(transportLib, Paths.get(Utils.TEST_CLASSES).resolve(libName));
+
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
+                "-agentlib:jdwp=transport=private_dt_socket,server=y,suspend=n",
+                "-classpath", Utils.TEST_CLASSES,
+                "HelloWorld");
+        Map<String, String> env = pb.environment();
+        String pathValue = env.get(pathEnvVar);
+        if (pathValue == null) {
+            pathValue = Utils.TEST_CLASSES;
+        } else {
+            pathValue = pathValue + pathSep + Utils.TEST_CLASSES;
+        }
+        env.put(pathEnvVar, pathValue);
+
+        ProcessTools.executeCommand(pb)
+                .shouldHaveExitValue(0);
+    }
+}
--- a/test/jdk/com/sun/jdi/PrivateTransportTest.sh	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-#!/bin/ksh -p
-
-#
-# Copyright (c) 2005, 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       PrivateTransportTest.sh
-#   @bug        6225664 6220618
-#   @summary    Test for when private transport library outside jdk
-#   @author     Kelly O'Hair
-#
-#   @run compile -g HelloWorld.java
-#   @run shell PrivateTransportTest.sh
-#
-
-# Beginning of subroutines:
-status=1
-
-#Call this from anywhere to fail the test with an error message
-# usage: fail "reason why the test failed"
-fail() 
- { echo "The test failed :-("
-   echo "$*" 1>&2
-   echo "exit status was $status"
-   exit $status
- } #end of fail()
-
-#Call this from anywhere to pass the test with a message
-# usage: pass "reason why the test passed if applicable"
-pass() 
- { echo "The test passed!!!"
-   echo "$*" 1>&2
-   exit 0
- } #end of pass()
-
-# end of subroutines
-
-# The beginning of the script proper
-
-TARGETCLASS="HelloWorld"
-if [ -z "${TESTJAVA}" ] ; then
-   # TESTJAVA is not set, so the test is running stand-alone.
-   # TESTJAVA holds the path to the root directory of the build of the JDK
-   # to be tested.  That is, any java files run explicitly in this shell
-   # should use TESTJAVA in the path to the java interpreter.
-   # So, we'll set this to the JDK spec'd on the command line.  If none
-   # is given on the command line, tell the user that and use a default.
-   # THIS IS THE JDK BEING TESTED.
-   if [ -n "$1" ] ; then
-         TESTJAVA=$1
-      else
-         TESTJAVA=$JAVA_HOME
-   fi
-   TESTSRC=.
-   TESTCLASSES=.
-   #Deal with .class files:
-   ${TESTJAVA}/bin/javac -d ${TESTCLASSES} \
-            -classpath "${TESTCLASSES}" -g \
-            ${TARGETCLASS}.java
-fi
-#
-echo "JDK under test is: $TESTJAVA"
-
-# Get flags being sent to debuggee
-DEBUGGEEFLAGS=$TESTVMOPTS $TESTJAVAOPTS
-
-# Figure out what the libarch path is
-os=`uname -s`
-
-jreloc=${TESTJAVA}/jre
-if [ ! -d ${jreloc} ] ; then
-    jreloc=${TESTJAVA}
-fi
-
-libdir=${TESTCLASSES}
-
-is_windows=false
-is_cygwin=false
-case `uname -s` in 
-  SunOS|Linux|AIX)
-    xx=`find ${jreloc}/lib -name libdt_socket.so`
-    libloc=`dirname ${xx}`
-    ;;
-  Darwin)
-    libloc=${jreloc}/lib
-    ;;
-  Windows*)
-    is_windows=true
-    libloc=${jreloc}/bin
-    sep=';'
-    ;;
-  CYGWIN*)
-    is_windows=true
-    is_cygwin=true
-    libloc=${jreloc}/bin
-    sep=':'
-
-    # This is going onto PATH and cygwin needs the form
-    # /cygdrive/j/x..... for that.
-    libdir=`cygpath -u "$TESTCLASSES"`
-    ;;
-  *)
-    echo "FAILURE:  Unknown uname -s: " `uname -s`
-    exit 1
-    ;;
-esac
-
-# Create private transport library
-echo "Setup private transport library by copying an existing one and renaming"
-private_transport=private_dt_socket
-if [ -f ${libloc}/dt_socket.dll ] ; then
-    fullpath=${libdir}/${private_transport}.dll
-    rm -f ${fullpath}
-    echo cp ${libloc}/dt_socket.dll ${fullpath}
-    cp ${libloc}/dt_socket.dll ${fullpath}
-    # make sure we can find libraries in current directory
-    PATH="${PATH}${sep}${libdir}"
-    export PATH
-    echo PATH=${PATH}
-elif [ -f ${libloc}/libdt_socket.dylib ]; then
-    fullpath=${libdir}/lib${private_transport}.dylib
-    rm -f ${fullpath}
-    echo cp ${libloc}/libdt_socket.dylib ${fullpath}
-    cp ${libloc}/libdt_socket.dylib ${fullpath}
-    # make sure we can find libraries in current directory
-    if [ "${LD_LIBRARY_PATH}" = "" ] ; then
-        LD_LIBRARY_PATH=${libdir}
-    else
-        LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${libdir}
-    fi
-    export LD_LIBRARY_PATH
-    echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
-elif [ -f ${libloc}/libdt_socket.so ] ; then
-    fullpath=${libdir}/lib${private_transport}.so
-    rm -f ${fullpath}
-    echo cp ${libloc}/libdt_socket.so ${fullpath}
-    cp ${libloc}/libdt_socket.so ${fullpath}
-    # make sure we can find libraries in current directory
-    if [ "$os" = "AIX" ] ; then
-        if [ "${LIBPATH}" = "" ] ; then
-            LIBPATH=${libdir}
-        else
-            LIBPATH=${LIBPATH}:${libdir}
-        fi
-        export LIBPATH
-        echo LIBPATH=${LIBPATH}
-    else
-        if [ "${LD_LIBRARY_PATH}" = "" ] ; then
-            LD_LIBRARY_PATH=${libdir}
-        else
-            LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${libdir}
-        fi
-        export LD_LIBRARY_PATH
-        echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
-    fi
-else 
-    echo "cannot find dt_socket in ${libloc} for ${private_transport}"
-    fail "cannot find dt_socket in ${libloc} for ${private_transport}"
-fi
-
-#
-CP="-classpath \"${TESTCLASSES}\""
-#
-if [ "$is_windows" = "true" ]; then
-    if [ "$is_cygwin" = "true" ]; then
-        win_fullpath=`cygpath -m "$fullpath" \
-            | sed -e 's#/#\\\\\\\\#g' -e 's/\.dll//'`
-    else
-        win_fullpath=`echo "$fullpath" \
-            | sed -e 's#/#\\\\\\\\#g' -e 's/\.dll//'`
-    fi
-    DEBUGGEEFLAGS="$DEBUGGEEFLAGS -agentlib:jdwp=transport=${win_fullpath},server=y,suspend=n"
-else
-    DEBUGGEEFLAGS="$DEBUGGEEFLAGS -agentlib:jdwp=transport=${private_transport},server=y,suspend=n"
-fi
-               
-echo ${TESTJAVA}/bin/java ${DEBUGGEEFLAGS} ${CP} ${TARGETCLASS}
-eval ${TESTJAVA}/bin/java ${DEBUGGEEFLAGS} ${CP} ${TARGETCLASS}
-status=$?
-echo "test status for ${DEBUGGERFLAGS} was: $status"
-if [ $status -ne 0 ] ; then 
-    fail "unspecified test failure"
-    exit 1
-fi
-
-pass "found private transport library"
-exit 0
-
--- a/test/jdk/com/sun/jdi/cds/CDSJDITest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/com/sun/jdi/cds/CDSJDITest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -46,7 +46,7 @@
             // These first three properties are setup by jtreg, and must be passed
             // to the JDI test subprocess because it needs them in order to
             // pass them to the subprocess it will create for the debuggee. This
-            // is how the JPRT -javaopts are passed to the debggee. See
+            // is how the -javaopts are passed to the debuggee. See
             // VMConnection.getDebuggeeVMOptions().
             getPropOpt("test.classes"),
             getPropOpt("test.java.opts"),
--- a/test/jdk/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,22 +22,49 @@
  */
 
 /*
+ * @test
+ * @bug 5055681
+ * @summary Test loading JDI classes via custom class loader
+ *
+ * @library /test/lib
+ * @build JdiLoadedByCustomLoader
+ * @run main/othervm JdiLoadedByCustomLoader
+ */
+
+/*
  * Creates a URLClassLoader from a file URL. The file URL
  * is constructed from the given argument. Once created the test
  * attempts to load another test case (ListConnectors)
  * using the class loader and then it invokes the list()
  * method.
  */
+import jdk.test.lib.Utils;
+import jdk.test.lib.compiler.CompilerUtils;
+
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.io.File;
 import java.lang.reflect.Method;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 
 public class JdiLoadedByCustomLoader {
 
     public static void main(String args[]) throws Exception {
+        // Compile the list connectors class into a directory that isn't on
+        // any class path.
+        Path src = Paths.get(Utils.TEST_SRC).toAbsolutePath().resolve("ListConnectors.java");
+        Path newClassDir = Paths.get(Utils.TEST_CLASSES).toAbsolutePath().resolve("someotherdir");
+        if (!CompilerUtils.compile(src, newClassDir, false, "-classpath", Utils.TEST_CLASSES)) {
+            throw new RuntimeException("failed to compile " + src);
+        }
+
+        test(newClassDir.toString());
+    }
+
+    private static void test(String classPath) throws Exception {
         // create files from given arguments and tools.jar
-        File f1 = new File(args[0]);
+        File f1 = new File(classPath);
 
         // create class loader
         URL[] urls = { f1.toURL() };
--- a/test/jdk/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-#
-# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @bug 5055681
-# @summary Test loading JDI classes via custom class loader
-
-if [ "${TESTJAVA}" = "" ]
-then
-  echo "TESTJAVA not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-if [ "${TESTSRC}" = "" ]
-then
-  echo "TESTSRC not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-if [ "${TESTCLASSES}" = "" ]
-then
-  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
-  exit 1
-fi
-
-OS=`uname -s`
-case "$OS" in
-  SunOS | Linux | Darwin | AIX )
-    PS=":"
-    ;;
-  Windows* | CYGWIN*)
-    PS=";"
-    ;;
-  * )
-    echo "Unrecognized system!"
-    exit 1;
-    ;;
-esac
-
-JAVAC="${TESTJAVA}"/bin/javac
-JAVA="${TESTJAVA}"/bin/java
-SOMEOTHERDIR="${TESTCLASSES}"/someotherdir
-
-# Compile test into the classes directory
-# Compile the list connectors class into a directory that isn't on
-# any class path.
-
-$JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/JdiLoadedByCustomLoader.java
-
-mkdir "${SOMEOTHERDIR}"
-$JAVAC -d "${SOMEOTHERDIR}" -classpath "${TESTSRC}" \
-    "${TESTSRC}"/ListConnectors.java
-
-# Run the test
-
-"${JAVA}" -classpath "${TESTCLASSES}" JdiLoadedByCustomLoader \
-    "${SOMEOTHERDIR}"
--- a/test/jdk/com/sun/jdi/redefine/RedefineSetUp.sh	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-
-#
-#
-#
-
-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}"
-
-JAVAC="${TESTJAVA}/bin/javac -g"
-
-cp ${TESTSRC}/Different_RedefineSubTarg.java RedefineSubTarg.java
-${JAVAC} RedefineSubTarg.java
-mv RedefineSubTarg.class Different_RedefineSubTarg.class
-rm -f RedefineSubTarg.java
-
-cp ${TESTSRC}/SchemaChange_RedefineSubTarg.java RedefineSubTarg.java
-${JAVAC} RedefineSubTarg.java
-mv RedefineSubTarg.class SchemaChange_RedefineSubTarg.class
-rm -f RedefineSubTarg.java
-
-cp ${TESTSRC}/RedefineSubTarg.java RedefineSubTarg.java
-${JAVAC} RedefineSubTarg.java
-rm -f RedefineSubTarg.java
--- a/test/jdk/com/sun/jdi/redefine/RedefineTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/com/sun/jdi/redefine/RedefineTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, 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
@@ -31,15 +31,22 @@
  * @author Robert Field
  *
  * @library ..
+ * @library /test/lib
  *
  * @run build TestScaffold VMConnection TargetListener TargetAdapter
  * @run compile -g RedefineTest.java
- * @run shell RedefineSetUp.sh
  * @run driver RedefineTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
 import com.sun.jdi.request.*;
+import jdk.test.lib.Utils;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
+
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.*;
 import java.io.*;
 
@@ -268,9 +275,25 @@
         return;
     }
 
+    // prepares .class file for redefined RedefineSubTarg class:
+    // - compiles <fileName>.java from test source dir;
+    // - saves compiled class <fileName>.class.
+    protected void prepareRedefinedClass(String fileName) throws Exception {
+        Path srcJavaFile = Paths.get(Utils.TEST_SRC).resolve(fileName + ".java");
+        Path dstClassFile = Paths.get(".").resolve(fileName + ".class");
+        byte[] compiledData = InMemoryJavaCompiler.compile("RedefineSubTarg",
+                new String(Files.readAllBytes(srcJavaFile), StandardCharsets.UTF_8),
+                "-g");
+        Files.write(dstClassFile, compiledData);
+    }
+
     /********** test core **********/
 
     protected void runTests() throws Exception {
+        // prepare redefined .class files
+        prepareRedefinedClass("Different_RedefineSubTarg");
+        prepareRedefinedClass("SchemaChange_RedefineSubTarg");
+        prepareRedefinedClass("RedefineSubTarg");
 
         BreakpointEvent bpe = startToMain("RedefineTarg");
         targetClass = bpe.location().declaringType();
--- a/test/jdk/com/sun/jdi/redefineMethod/RedefineSetUp.sh	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-
-#
-#
-#
-
-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}"
-
-JAVAC="${TESTJAVA}/bin/javac"
-
-cp ${TESTSRC}/Different_RedefineSubTarg.java RedefineSubTarg.java
-${JAVAC} -g RedefineSubTarg.java
-mv RedefineSubTarg.class Different_RedefineSubTarg.class
-rm -f RedefineSubTarg.java
-
-cp ${TESTSRC}/RedefineSubTarg.java RedefineSubTarg.java
-${JAVAC} -g RedefineSubTarg.java
-rm -f RedefineSubTarg.java
--- a/test/jdk/com/sun/jdi/redefineMethod/RedefineTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/com/sun/jdi/redefineMethod/RedefineTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -28,16 +28,23 @@
  * @author Robert Field
  *
  * @library ..
+ * @library /test/lib
  *
  * @run build TestScaffold VMConnection TargetListener TargetAdapter
  * @run compile -g RedefineTest.java
- * @run shell RedefineSetUp.sh
  * @run driver RedefineTest -repeat 3
  * @run driver RedefineTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
 import com.sun.jdi.request.*;
+import jdk.test.lib.Utils;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
+
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.*;
 import java.io.*;
 
@@ -205,15 +212,9 @@
     }
 
 
-    void doRedefine(String fileName) throws Exception {
-        File phyl = new File(fileName);
-        byte[] bytes = new byte[(int)phyl.length()];
-        InputStream in = new FileInputStream(phyl);
-        in.read(bytes);
-        in.close();
-
+    void doRedefine(byte[] compiledClass) throws Exception {
         Map map = new HashMap();
-        map.put(findReferenceType("RedefineSubTarg"), bytes);
+        map.put(findReferenceType("RedefineSubTarg"), compiledClass);
 
         try {
             for (int i = 0; i < redefineRepeat; ++i) {
@@ -240,9 +241,18 @@
         }
     }
 
+    private byte[] compileRedefinedClass(String srcJavaFile) throws Exception {
+        Path src = Paths.get(Utils.TEST_SRC).resolve(srcJavaFile);
+        return InMemoryJavaCompiler.compile("RedefineSubTarg",
+                new String(Files.readAllBytes(src), StandardCharsets.UTF_8),
+                "-g", "-classpath", Utils.TEST_CLASSES);
+    }
+
     /********** test core **********/
 
     protected void runTests() throws Exception {
+        byte[] compiled_Different_RedefineSubTarg = compileRedefinedClass("Different_RedefineSubTarg.java");
+        byte[] compiled_RedefineSubTarg = compileRedefinedClass("RedefineSubTarg.java");
 
         startToMain("RedefineTarg");
 
@@ -252,7 +262,7 @@
         checkFrames(thread, before);
 
         println("------ After Redefine ------");
-        doRedefine("Different_RedefineSubTarg.class");
+        doRedefine(compiled_Different_RedefineSubTarg);
         checkFrames(thread, after);
 
         println("------ Static 2 ------");
@@ -268,7 +278,7 @@
         checkFrames(thread, refresh);
 
         println("------ Breakpoints ------");
-        doRedefine("RedefineSubTarg.class");
+        doRedefine(compiled_RedefineSubTarg);
         for (int i = 0; i < bps.length; ++i) {
             setBP(bps[i]);
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/net/httpserver/bugs/B8211420.java	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,108 @@
+/*
+ * 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 8211420
+ * @run main/othervm B8211420
+ * @summary
+ */
+
+import com.sun.net.httpserver.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.logging.*;
+import java.io.*;
+import java.net.*;
+
+public class B8211420 {
+
+    public static void main (String[] args) throws Exception {
+        Logger logger = Logger.getLogger ("com.sun.net.httpserver");
+        ConsoleHandler c = new ConsoleHandler();
+        c.setLevel (Level.WARNING);
+        logger.addHandler (c);
+        logger.setLevel (Level.WARNING);
+        Handler handler = new Handler();
+        InetSocketAddress addr = new InetSocketAddress (0);
+        HttpServer server = HttpServer.create (addr, 0);
+        HttpContext ctx = server.createContext ("/test", handler);
+        ExecutorService executor = Executors.newCachedThreadPool();
+        server.setExecutor (executor);
+        server.start ();
+
+        URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
+        HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+        try {
+            InputStream is = urlc.getInputStream();
+            while (is.read()!= -1) ;
+            is.close ();
+            String prop = urlc.getHeaderField("Content-length");
+                System.out.println ("Content-length = " + prop + " should be null");
+            if (prop != null)
+                throw new RuntimeException("Content-length was present");
+
+            urlc = (HttpURLConnection)url.openConnection();
+            is = urlc.getInputStream();
+            while (is.read()!= -1) ;
+            is.close ();
+            if (urlc.getResponseCode() != 304) // expected for 2nd test
+                throw new RuntimeException("wrong response code");
+            String clen = urlc.getHeaderField("Content-length");
+            System.out.println ("Content-length = " + clen + " should be 99");
+            System.out.println ("len = " + clen.length());
+            if (clen == null || !clen.equals("99"))
+                throw new RuntimeException("Content-length not present or has wrong value");
+            System.out.println ("OK");
+        } finally {
+            server.stop(2);
+            executor.shutdown();
+        }
+    }
+
+    public static boolean error = false;
+
+    static class Handler implements HttpHandler {
+        volatile int invocation = 1;
+        public void handle (HttpExchange t)
+            throws IOException
+        {
+            InputStream is = t.getRequestBody();
+            Headers map = t.getRequestHeaders();
+            Headers rmap = t.getResponseHeaders();
+            while (is.read () != -1) ;
+            is.close();
+            if (invocation++ == 1) {
+                // send a 204 response with no body
+                t.sendResponseHeaders(204, -1);
+                t.close();
+            } else {
+                // send a 304 response with no body but with content - length
+                rmap.add("Content-length", "99");
+                t.sendResponseHeaders(304, -1);
+                t.close();
+            }
+        }
+    }
+}
--- a/test/jdk/java/io/FilePermission/ReadFileOnPath.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/io/FilePermission/ReadFileOnPath.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8164705
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          jdk.compiler
  * @build jdk.test.lib.compiler.CompilerUtils
@@ -34,12 +34,14 @@
  *        jdk.test.lib.JDKToolLauncher
  *        jdk.test.lib.Platform
  *        jdk.test.lib.process.*
+ *        jdk.test.lib.util.JarUtils
  * @run main ReadFileOnPath
  * @summary Still able to read file on the same path
  */
 
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.JarUtils;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
--- a/test/jdk/java/io/Serializable/packageAccess/PackageAccessTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/io/Serializable/packageAccess/PackageAccessTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 4765255
- * @library /lib/testlibrary
- * @build JarUtils A B C D PackageAccessTest
+ * @library /test/lib
+ * @build jdk.test.lib.util.JarUtils A B C D PackageAccessTest
  * @run main PackageAccessTest
  * @summary Verify proper functioning of package equality checks used to
  *          determine accessibility of superclass constructor and inherited
@@ -46,6 +46,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.util.JarUtils;
+
 public class PackageAccessTest {
 
     static Class bcl;
--- a/test/jdk/java/io/Serializable/resolveClass/consTest/ConsTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/io/Serializable/resolveClass/consTest/ConsTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 4413434
- * @library /lib/testlibrary
- * @build JarUtils SetupJar Boot
+ * @library /test/lib
+ * @build jdk.test.lib.util.JarUtils SetupJar Boot
  * @run driver SetupJar
  * @run main/othervm -Xbootclasspath/a:boot.jar ConsTest
  * @summary Verify that generated java.lang.reflect implementation classes do
@@ -39,6 +39,8 @@
 import java.io.Serializable;
 import java.lang.reflect.Constructor;
 
+import jdk.test.lib.util.JarUtils;
+
 public class ConsTest implements Serializable {
     public static void main(String[] args) throws Exception {
         Constructor cons = Boot.class.getConstructor(
--- a/test/jdk/java/io/Serializable/resolveClass/consTest/SetupJar.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/io/Serializable/resolveClass/consTest/SetupJar.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,6 +24,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.util.JarUtils;
+
 public class SetupJar {
 
     public static void main(String args[]) throws Exception {
--- a/test/jdk/java/io/Serializable/resolveClass/deserializeButton/DeserializeButtonTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/io/Serializable/resolveClass/deserializeButton/DeserializeButtonTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 4413434
- * @library /lib/testlibrary
- * @build JarUtils Foo
+ * @library /test/lib
+ * @build jdk.test.lib.util.JarUtils Foo
  * @run main DeserializeButtonTest
  * @summary Verify that class loaded outside of application class loader is
  *          correctly resolved during deserialization when read in by custom
@@ -38,6 +38,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.util.JarUtils;
+
 public class DeserializeButtonTest {
     public static void main(String[] args) throws Exception {
         setup();
--- a/test/jdk/java/io/Serializable/superclassDataLoss/SuperclassDataLossTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/io/Serializable/superclassDataLoss/SuperclassDataLossTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 4325590
- * @library /lib/testlibrary
- * @build JarUtils A B
+ * @library /test/lib
+ * @build jdk.test.lib.util.JarUtils A B
  * @run main SuperclassDataLossTest
  * @summary Verify that superclass data is not lost when incoming superclass
  *          descriptor is matched with local class that is not a superclass of
@@ -47,6 +47,8 @@
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 
+import jdk.test.lib.util.JarUtils;
+
 class MixedSuperclassStream extends ObjectInputStream {
     private boolean ldr12A;
     private URLClassLoader ldr1;
--- a/test/jdk/java/lang/Character/Scripts.txt	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/Character/Scripts.txt	Fri Oct 05 11:10:27 2018 -0400
@@ -402,6 +402,7 @@
 328A..32B0    ; Common # So  [39] CIRCLED IDEOGRAPH MOON..CIRCLED IDEOGRAPH NIGHT
 32B1..32BF    ; Common # No  [15] CIRCLED NUMBER THIRTY SIX..CIRCLED NUMBER FIFTY
 32C0..32CF    ; Common # So  [16] IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY..LIMITED LIABILITY SIGN
+32FF          ; Common # So       SQUARE ERA NAME NEWERA
 3358..33FF    ; Common # So [168] IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ZERO..SQUARE GAL
 4DC0..4DFF    ; Common # So  [64] HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION
 A700..A716    ; Common # Sk  [23] MODIFIER LETTER CHINESE TONE YIN PING..MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR
--- a/test/jdk/java/lang/Character/UnicodeData.txt	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/Character/UnicodeData.txt	Fri Oct 05 11:10:27 2018 -0400
@@ -11729,6 +11729,7 @@
 32FC;CIRCLED KATAKANA WI;So;0;L;<circle> 30F0;;;;N;;;;;
 32FD;CIRCLED KATAKANA WE;So;0;L;<circle> 30F1;;;;N;;;;;
 32FE;CIRCLED KATAKANA WO;So;0;L;<circle> 30F2;;;;N;;;;;
+32FF;SQUARE ERA NAME NEWERA;So;0;L;<square> 5143 53F7;;;;N;SQUARED TWO IDEOGRAPHS ERA NAME NEWERA;;;;
 3300;SQUARE APAATO;So;0;L;<square> 30A2 30D1 30FC 30C8;;;;N;SQUARED APAATO;;;;
 3301;SQUARE ARUHUA;So;0;L;<square> 30A2 30EB 30D5 30A1;;;;N;SQUARED ARUHUA;;;;
 3302;SQUARE ANPEA;So;0;L;<square> 30A2 30F3 30DA 30A2;;;;N;SQUARED ANPEA;;;;
Binary file test/jdk/java/lang/Character/charprop00.bin has changed
--- a/test/jdk/java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java	Fri Oct 05 11:10:27 2018 -0400
@@ -26,9 +26,9 @@
  * @bug 8151486
  * @summary Call Class.forName() on the system classloader from a class loaded
  *          from a custom classloader.
- * @library /lib/testlibrary
  * @library /test/lib
- * @build jdk.test.lib.Utils JarUtils
+ * @build jdk.test.lib.Utils
+ *        jdk.test.lib.util.JarUtils
  * @build ClassForName ClassForNameLeak
  * @run main/othervm/policy=test.policy -Djava.security.manager ClassForNameLeak
  */
@@ -49,7 +49,9 @@
 import java.util.concurrent.Future;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
+
 import jdk.test.lib.Utils;
+import jdk.test.lib.util.JarUtils;
 
 /*
  * Create .jar, load ClassForName from .jar using a URLClassLoader
--- a/test/jdk/java/lang/ClassLoader/getResource/automaticmodules/Driver.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/ClassLoader/getResource/automaticmodules/Driver.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,8 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary /test/lib
- * @build Driver Main JarUtils
+ * @library /test/lib
+ * @build Driver Main
+ *        jdk.test.lib.util.JarUtils
  * @run main Driver
  * @summary Test ClassLoader.getResourceXXX to locate resources in an automatic
  *          module
@@ -39,6 +40,7 @@
 import java.util.jar.Manifest;
 
 import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.JarUtils;
 
 /**
  * The driver creates a JAR file containing p/Foo.class, p/foo.properties,
--- a/test/jdk/java/lang/ClassLoader/securityManager/ClassLoaderTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/ClassLoader/securityManager/ClassLoaderTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -26,10 +26,9 @@
  * @bug 8168423
  * @summary Different types of ClassLoader running with(out) SecurityManager and
  *          (in)valid security policy file.
- * @library /lib/testlibrary
  * @library /test/lib
  * @modules java.base/jdk.internal.module
- * @build JarUtils
+ * @build jdk.test.lib.util.JarUtils
  * @build TestClassLoader TestClient
  * @run main ClassLoaderTest -noPolicy
  * @run main ClassLoaderTest -validPolicy
@@ -51,6 +50,7 @@
 import java.util.List;
 import jdk.internal.module.ModuleInfoWriter;
 import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.JarUtils;
 
 public class ClassLoaderTest {
 
--- a/test/jdk/java/lang/Package/IsCompatibleWithDriver.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/Package/IsCompatibleWithDriver.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,10 +25,9 @@
  * @test
  * @bug 4227825 4785473
  * @summary Test behaviour of Package.isCompatibleWith().
- * @library /lib/testlibrary
  * @library /test/lib
  * @build A IsCompatibleWith
- *        JarUtils
+ *        jdk.test.lib.util.JarUtils
  *        jdk.test.lib.process.*
  * @run main IsCompatibleWithDriver
  */
@@ -44,6 +43,7 @@
 
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.util.JarUtils;
 
 public class IsCompatibleWithDriver {
     public static void main(String args[]) throws Throwable {
--- a/test/jdk/java/lang/Package/PackageFromManifest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/Package/PackageFromManifest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -27,7 +27,6 @@
  * @summary The test will create JAR file(s) with the manifest file
  *          that customized package versioning information (different info for
  *          same package if multiple jars). Then verify package versioning info
- * @library /lib/testlibrary
  * @library /test/lib
  * @modules jdk.compiler
  * @run main PackageFromManifest setup test
@@ -42,6 +41,7 @@
 import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.util.FileUtils;
+import jdk.test.lib.util.JarUtils;
 
 import java.io.File;
 import java.io.IOException;
--- a/test/jdk/java/lang/StackWalker/ReflectionFrames.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/StackWalker/ReflectionFrames.java	Fri Oct 05 11:10:27 2018 -0400
@@ -48,6 +48,16 @@
 
 public class ReflectionFrames {
     final static boolean verbose = false;
+    final static Class<?> REFLECT_ACCESS = findClass("java.lang.reflect.ReflectAccess");
+    final static Class<?> REFLECTION_FACTORY = findClass("jdk.internal.reflect.ReflectionFactory");
+
+    private static Class<?> findClass(String cn) {
+        try {
+            return Class.forName(cn);
+        } catch (ClassNotFoundException e) {
+            throw new AssertionError(e);
+        }
+    }
 
     /**
      * This test invokes new StackInspector() directly from
@@ -327,6 +337,8 @@
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
                              Constructor.class.getName()
+                                 +"::newInstanceWithCaller",
+                             Constructor.class.getName()
                                  +"::newInstance",
                              StackInspector.Caller.class.getName()
                                  +"::create",
@@ -355,6 +367,8 @@
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
                              Constructor.class.getName()
+                                 +"::newInstanceWithCaller",
+                             Constructor.class.getName()
                                  +"::newInstance",
                              StackInspector.Caller.class.getName()
                                  +"::create",
@@ -387,6 +401,8 @@
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
                              Constructor.class.getName()
+                                 +"::newInstanceWithCaller",
+                             Constructor.class.getName()
                                  +"::newInstance",
                              StackInspector.Caller.class.getName()
                                  +"::create",
@@ -436,15 +452,19 @@
         assertEquals(obj.collectedFrames,
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
+                             REFLECT_ACCESS.getName()
+                                 +"::newInstance",
+                             REFLECTION_FACTORY.getName()
+                                 +"::newInstance",
                              Class.class.getName()
                                  +"::newInstance",
                              StackInspector.Caller.class.getName()
                                  +"::create",
                              ReflectionFrames.class.getName()
                                  +"::testNewInstance"));
-        // Because Class.newInstance is not filtered, then the
-        // caller is Class.class
-        assertEquals(obj.cls, Class.class);
+        // Because implementation frames are not filtered, then the
+        // caller is ReflectAccess.class
+        assertEquals(obj.cls, REFLECT_ACCESS);
         assertEquals(obj.filtered, 0);
 
         // Calls the StackInspector.reflect method through reflection
@@ -464,6 +484,10 @@
         assertEquals(obj.collectedFrames,
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
+                             REFLECT_ACCESS.getName()
+                                 +"::newInstance",
+                             REFLECTION_FACTORY.getName()
+                                 +"::newInstance",
                              Class.class.getName()
                                  +"::newInstance",
                              StackInspector.Caller.class.getName()
@@ -473,9 +497,9 @@
                              ReflectionFrames.class.getName()
                                  +"::testNewInstance"));
 
-        // Because Class.newInstance is not filtered, then the
-        // caller is Class.class
-        assertEquals(obj.cls, Class.class);
+        // Because implementation frames are not filtered, then the
+        // caller is ReflectAccess.class
+        assertEquals(obj.cls, REFLECT_ACCESS);
         assertEquals(obj.filtered, 0);
 
         // Calls the StackInspector.handle method through reflection
@@ -495,6 +519,10 @@
         assertEquals(obj.collectedFrames,
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
+                             REFLECT_ACCESS.getName()
+                                 +"::newInstance",
+                             REFLECTION_FACTORY.getName()
+                                 +"::newInstance",
                              Class.class.getName()
                                  +"::newInstance",
                              StackInspector.Caller.class.getName()
@@ -504,9 +532,9 @@
                              ReflectionFrames.class.getName()
                                  +"::testNewInstance"));
 
-        // Because Class.newInstance is not filtered, then the
-        // caller is Class.class
-        assertEquals(obj.cls, Class.class);
+        // Because implementation frames are not filtered, then the
+        // caller is ReflectAccess.class
+        assertEquals(obj.cls, REFLECT_ACCESS);
         assertEquals(obj.filtered, 0);
 
         // Sets a non-default walker configured to show
@@ -529,6 +557,8 @@
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
                              Constructor.class.getName()
+                                 +"::newInstanceWithCaller",
+                             REFLECT_ACCESS.getName()
                                  +"::newInstance",
                              Class.class.getName()
                                  +"::newInstance",
@@ -538,9 +568,9 @@
                                  +"::invoke",
                              ReflectionFrames.class.getName()
                                  +"::testNewInstance"));
-        // Because Class.newInstance is not filtered, then the
-        // caller is Class.class
-        assertEquals(obj.cls, Class.class);
+        // Because implementation frames are not filtered, then the
+        // caller is ReflectAccess.class
+        assertEquals(obj.cls, REFLECT_ACCESS);
         assertNotEquals(obj.filtered, 0);
 
         // Calls the StackInspector.reflect method through reflection
@@ -557,10 +587,13 @@
         obj = ((StackInspector)StackInspector.Caller.class
                              .getMethod("reflect", How.class)
                              .invoke(null, How.CLASS));
+        System.out.println(obj.collectedFrames);
         assertEquals(obj.collectedFrames,
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
                              Constructor.class.getName()
+                                 +"::newInstanceWithCaller",
+                             REFLECT_ACCESS.getName()
                                  +"::newInstance",
                              Class.class.getName()
                                  +"::newInstance",
@@ -575,9 +608,9 @@
                              ReflectionFrames.class.getName()
                                  +"::testNewInstance"));
 
-        // Because Class.newInstance is not filtered, then the
-        // caller is Class.class
-        assertEquals(obj.cls, Class.class);
+        // Because implementation frames are not filtered, then the
+        // caller is ReflectAccess.class
+        assertEquals(obj.cls, REFLECT_ACCESS);
         assertNotEquals(obj.filtered, 0);
 
         // Calls the StackInspector.handle method through reflection
@@ -598,6 +631,8 @@
                      List.of(StackInspector.class.getName()
                                  +"::<init>",
                              Constructor.class.getName()
+                                 +"::newInstanceWithCaller",
+                             REFLECT_ACCESS.getName()
                                  +"::newInstance",
                              Class.class.getName()
                                  +"::newInstance",
@@ -611,9 +646,9 @@
                              ReflectionFrames.class.getName()
                                  +"::testNewInstance"));
 
-        // Because Class.newInstance is not filtered, then the
-        // caller is Class.class
-        assertEquals(obj.cls, Class.class);
+        // Because implementation frames are not filtered, then the
+        // caller is ReflectAccess.class
+        assertEquals(obj.cls, REFLECT_ACCESS);
         assertNotEquals(obj.filtered, 0);
     }
 
--- a/test/jdk/java/lang/String/CompactString/CompactString.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/String/CompactString/CompactString.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -275,8 +275,7 @@
     }
 
     /*
-     * Because right now system default charset in JPRT environment is only
-     * guaranteed to support ASCII characters in log, so we escape them.
+     * Escape non-ASCII characters since not all systems support them.
      */
     protected String escapeNonASCIIs(String str) {
         StringBuilder sb = new StringBuilder();
@@ -292,8 +291,7 @@
     }
 
     /*
-     * Because right now system default charset in JPRT environment is only
-     * guaranteed to support ASCII characters in log, so we escape them.
+     * Escape non-ASCII characters since not all systems support them.
      */
     protected String escapeNonASCII(char c) {
         StringBuilder sb = new StringBuilder();
--- a/test/jdk/java/lang/StringBuffer/CompactStringBuffer.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/StringBuffer/CompactStringBuffer.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -471,8 +471,7 @@
     }
 
     /*
-     * Because right now system default charset in JPRT environment is only
-     * guaranteed to support ASCII characters in log, so we escape them.
+     * Escape non-ASCII characters since not all systems support them.
      */
     private String escapeNonASCIIs(String str) {
         StringBuilder sb = new StringBuilder();
--- a/test/jdk/java/lang/StringBuilder/CompactStringBuilder.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/StringBuilder/CompactStringBuilder.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -396,8 +396,7 @@
     }
 
     /*
-     * Because right now system default charset in JPRT environment is only
-     * guaranteed to support ASCII characters in log, so we escape them.
+     * Escape non-ASCII characters since not all systems support them.
      */
     private String escapeNonASCIIs(String str) {
         StringBuilder sb = new StringBuilder();
--- a/test/jdk/java/lang/instrument/executableJAR/ExecJarWithAgent.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/instrument/executableJAR/ExecJarWithAgent.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
  * @library /test/lib
- * @build ExecJarWithAgent Main Agent AgentHelper JarUtils jdk.testlibrary.*
+ * @build ExecJarWithAgent Main Agent AgentHelper
+ *        jdk.test.lib.util.JarUtils
  * @run testng ExecJarWithAgent
  * @summary Test starting agents in executable JAR files
  */
@@ -41,6 +41,7 @@
 
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.util.JarUtils;
 
 @Test
 public class ExecJarWithAgent {
--- a/test/jdk/java/lang/module/AutomaticModulesTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/module/AutomaticModulesTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,8 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
- * @build AutomaticModulesTest ModuleUtils JarUtils
+ * @library /lib/testlibrary /test/lib
+ * @build AutomaticModulesTest ModuleUtils
+ *        jdk.test.lib.util.JarUtils
  * @run testng AutomaticModulesTest
  * @summary Basic tests for automatic modules
  */
@@ -48,6 +49,8 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import jdk.test.lib.util.JarUtils;
+
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
--- a/test/jdk/java/lang/module/ModuleReader/ModuleReaderTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/module/ModuleReader/ModuleReaderTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,11 +23,13 @@
 
 /**
  * @test
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules java.base/jdk.internal.module
  *          jdk.compiler
  *          jdk.jlink
- * @build ModuleReaderTest jdk.test.lib.compiler.CompilerUtils JarUtils
+ * @build ModuleReaderTest
+ *        jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.util.JarUtils
  * @run testng ModuleReaderTest
  * @summary Basic tests for java.lang.module.ModuleReader
  */
@@ -55,6 +57,7 @@
 
 import jdk.internal.module.ModulePath;
 import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.JarUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/test/jdk/java/lang/module/MultiReleaseJarTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/module/MultiReleaseJarTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /test/lib
  * @modules java.base/jdk.internal.module
- * @build MultiReleaseJarTest JarUtils
+ * @build MultiReleaseJarTest jdk.test.lib.util.JarUtils
  * @run testng MultiReleaseJarTest
  * @run testng/othervm -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarTest
  * @summary Basic test of modular JARs as multi-release JARs
@@ -55,6 +55,7 @@
 import java.util.jar.Manifest;
 
 import jdk.internal.module.ModuleInfoWriter;
+import jdk.test.lib.util.JarUtils;
 
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
--- a/test/jdk/java/lang/module/customfs/ModulesInCustomFileSystem.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/module/customfs/ModulesInCustomFileSystem.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,8 +24,9 @@
 /**
  * @test
  * @modules jdk.zipfs
- * @library /lib/testlibrary
- * @build ModulesInCustomFileSystem JarUtils m1/* m2/*
+ * @library /test/lib
+ * @build ModulesInCustomFileSystem m1/* m2/*
+ *        jdk.test.lib.util.JarUtils
  * @run testng/othervm ModulesInCustomFileSystem
  * @summary Test ModuleFinder to find modules in a custom file system
  */
@@ -43,6 +44,8 @@
 import java.nio.file.Paths;
 import java.util.Set;
 
+import jdk.test.lib.util.JarUtils;
+
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
--- a/test/jdk/java/lang/reflect/callerCache/AccessTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/reflect/callerCache/AccessTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -149,4 +149,11 @@
             super("privateStaticFinalField");
         }
     }
+
+    public static class NewInstance implements Callable<Object> {
+        public Object call() throws Exception {
+            return Members.class.newInstance();
+        }
+    }
+
 }
--- a/test/jdk/java/lang/reflect/callerCache/ReflectionCallerCacheTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/lang/reflect/callerCache/ReflectionCallerCacheTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -77,7 +77,8 @@
             { "AccessTest$PublicFinalField"},
             { "AccessTest$PrivateFinalField"},
             { "AccessTest$PublicStaticFinalField"},
-            { "AccessTest$PrivateStaticFinalField"}
+            { "AccessTest$PrivateStaticFinalField"},
+            { "AccessTest$NewInstance"}
         };
     }
 
--- a/test/jdk/java/net/Socket/LingerTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/net/Socket/LingerTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -109,38 +109,45 @@
         Socket s2 = ss.accept();
 
         // setup conditions for untransmitted data and lengthy
-            // linger interval
-            s1.setSendBufferSize(128*1024);
+        // linger interval
+        s1.setSendBufferSize(128*1024);
         s1.setSoLinger(true, 30);
         s2.setReceiveBufferSize(1*1024);
 
         // start sender
-            Thread thr = new Thread(new Sender(s1));
-        thr.start();
+        Thread senderThread = new Thread(new Sender(s1));
+        senderThread.start();
 
         // other thread that will connect after 5 seconds.
-            Other other = new Other(ss.getLocalPort(), 5000);
-        thr = new Thread(other);
-        thr.start();
+        Other other = new Other(ss.getLocalPort(), 5000);
+        Thread otherThread = new Thread(other);
+        otherThread.start();
 
         // give sender time to queue the data
-            System.out.println ("Main sleep 1000");
-            Thread.sleep(1000);
-            System.out.println ("Main continue");
+        System.out.println ("Main sleep 1000");
+        Thread.sleep(1000);
+        System.out.println ("Main continue");
 
         // close the socket asynchronously
-            (new Thread(new Closer(s1))).start();
+        Thread closerThread = new Thread(new Closer(s1));
+        closerThread.start();
 
-            System.out.println ("Main sleep 15000");
+        System.out.println ("Main sleep 15000");
         // give other time to run
-            Thread.sleep(15000);
-            System.out.println ("Main closing serversocket");
+        Thread.sleep(15000);
+        System.out.println ("Main closing serversocket");
 
         ss.close();
         // check that other is done
-            if (!other.connected()) {
+        if (!other.connected()) {
             throw new RuntimeException("Other thread is blocked");
         }
+
+        // await termination of all test related threads
+        senderThread.join(60_000);
+        otherThread.join(60_000);
+        closerThread.join(60_000);
+
         System.out.println ("Main ends");
     }
 }
--- a/test/jdk/java/net/URLClassLoader/closetest/CloseTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/net/URLClassLoader/closetest/CloseTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -28,12 +28,12 @@
  *          jdk.httpserver
  *          jdk.compiler
  * @library ../../../../com/sun/net/httpserver
- *          /lib/testlibrary
  *          /test/lib
  * @build jdk.test.lib.compiler.CompilerUtils
  *        jdk.test.lib.util.FileUtils
+ *        jdk.test.lib.util.JarUtils
  *        jdk.test.lib.Platform
- *        FileServerHandler JarUtils
+ *        FileServerHandler
  * @run main/othervm CloseTest
  * @summary URL-downloaded jar files can consume all available file descriptors
  */
@@ -49,6 +49,7 @@
 import java.nio.file.Paths;
 
 import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.JarUtils;
 
 import com.sun.net.httpserver.HttpContext;
 import com.sun.net.httpserver.HttpServer;
--- a/test/jdk/java/net/URLClassLoader/closetest/GetResourceAsStream.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/net/URLClassLoader/closetest/GetResourceAsStream.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,12 +24,12 @@
 /**
  * @test
  * @bug 6899919
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
  * @build jdk.test.lib.compiler.CompilerUtils
  *        jdk.test.lib.util.FileUtils
+ *        jdk.test.lib.util.JarUtils
  *        jdk.test.lib.Platform
- *        JarUtils
  * @run main/othervm GetResourceAsStream
  */
 
@@ -44,6 +44,7 @@
 import java.nio.file.StandardCopyOption;
 import java.nio.file.StandardOpenOption;
 import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.JarUtils;
 
 public class GetResourceAsStream extends Common {
     private static  final String WORK_DIR = System.getProperty("user.dir");
--- a/test/jdk/java/nio/channels/AsynchronousChannelGroup/AsExecutor.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/nio/channels/AsynchronousChannelGroup/AsExecutor.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,8 +25,9 @@
  * @test
  * @bug 4607272
  * @summary tests tasks can be submitted to a channel group's thread pool.
- * @library /lib/testlibrary bootlib
- * @build JarUtils PrivilegedThreadFactory Attack
+ * @library /test/lib bootlib
+ * @build PrivilegedThreadFactory Attack
+ *        jdk.test.lib.util.JarUtils
  * @run driver SetupJar
  * @run main/othervm -Xbootclasspath/a:privileged.jar AsExecutor
  */
--- a/test/jdk/java/nio/channels/AsynchronousChannelGroup/SetupJar.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/nio/channels/AsynchronousChannelGroup/SetupJar.java	Fri Oct 05 11:10:27 2018 -0400
@@ -26,6 +26,8 @@
 import java.nio.file.Paths;
 import java.util.stream.Stream;
 
+import jdk.test.lib.util.JarUtils;
+
 public class SetupJar {
     public static void main(String args[]) throws Exception {
         String cp = System.getProperty("test.class.path");
--- a/test/jdk/java/nio/charset/spi/CharsetProviderBasicTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/nio/charset/spi/CharsetProviderBasicTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -26,14 +26,13 @@
  * @bug 4429040 4591027 4814743
  * @summary Unit test for charset providers
  * @library /test/lib
- *          /lib/testlibrary
  * @build jdk.test.lib.Utils
  *        jdk.test.lib.Asserts
  *        jdk.test.lib.JDKToolFinder
  *        jdk.test.lib.JDKToolLauncher
  *        jdk.test.lib.Platform
  *        jdk.test.lib.process.*
- *        JarUtils
+ *        jdk.test.lib.util.JarUtils
  *        FooCharset FooProvider CharsetTest
  * @run driver SetupJar
  * @run testng CharsetProviderBasicTest
--- a/test/jdk/java/nio/charset/spi/SetupJar.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/nio/charset/spi/SetupJar.java	Fri Oct 05 11:10:27 2018 -0400
@@ -28,6 +28,8 @@
 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
 import static java.nio.file.StandardOpenOption.CREATE;
 
+import jdk.test.lib.util.JarUtils;
+
 public class SetupJar {
 
     private static final String PROVIDER
--- a/test/jdk/java/rmi/module/ModuleTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/rmi/module/ModuleTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,9 +23,11 @@
 
 /**
  * @test
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @build jdk.test.lib.process.ProcessTools
- *        ModuleTest jdk.test.lib.compiler.CompilerUtils JarUtils
+ *        jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.util.JarUtils
+ *        ModuleTest
  * @run testng ModuleTest
  * @summary Basic tests for using rmi in module world
  */
@@ -37,6 +39,7 @@
 import java.io.File;
 import java.nio.file.Paths;
 import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.JarUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/test/jdk/java/security/Provider/SecurityProviderModularTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/security/Provider/SecurityProviderModularTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -40,6 +40,7 @@
 import java.lang.module.ModuleDescriptor.Builder;
 import jdk.internal.module.ModuleInfoWriter;
 import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.JarUtils;
 
 
 /*
@@ -47,9 +48,9 @@
  * @bug 8130360 8183310
  * @summary Test security provider in different combination of modular option
  *          defined with(out) service description.
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules java.base/jdk.internal.module
- * @build JarUtils TestProvider TestClient
+ * @build jdk.test.lib.util.JarUtils TestProvider TestClient
  * @run main SecurityProviderModularTest CL true
  * @run main SecurityProviderModularTest CL false
  * @run main SecurityProviderModularTest SL true
--- a/test/jdk/java/sql/testng/util/StubConnection.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/sql/testng/util/StubConnection.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 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
@@ -43,6 +43,8 @@
 
 public class StubConnection implements Connection {
 
+    private boolean autoCommit = false;
+
     @Override
     public Statement createStatement() throws SQLException {
         throw new UnsupportedOperationException("Not supported yet.");
@@ -65,12 +67,14 @@
 
     @Override
     public void setAutoCommit(boolean autoCommit) throws SQLException {
-        throw new UnsupportedOperationException("Not supported yet.");
+        System.out.println("**** in StubConnection.setAutoCommit");
+        this.autoCommit = autoCommit;
     }
 
     @Override
     public boolean getAutoCommit() throws SQLException {
-        throw new UnsupportedOperationException("Not supported yet.");
+        System.out.println("*** in StubConnection.getAutoCommit");
+        return autoCommit;
     }
 
     @Override
--- a/test/jdk/java/time/tck/java/time/format/TCKInstantPrinterParser.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/time/tck/java/time/format/TCKInstantPrinterParser.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
@@ -69,12 +69,18 @@
 import java.time.ZoneOffset;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatterBuilder;
+import java.time.format.DateTimeParseException;
 import java.time.format.ResolverStyle;
 import java.time.temporal.TemporalAccessor;
 
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
+/*
+ * @test
+ * @bug 8166138
+ */
+
 /**
  * Test DateTimeFormatterBuilder.appendInstant().
  */
@@ -200,7 +206,10 @@
                 {0, 0, "1970-01-01T00:00:00Z"},
                 {0, 0, "1970-01-01T00:00:00.0Z"},
                 {0, 0, "1970-01-01T00:00:00.000Z"},
-                {0, 0, "1970-01-01T00:00:00.000000000Z"},
+
+                {0, 0, "1970-01-01T00:00:00+00:00"},
+                {0, 0, "1970-01-01T05:30:00+05:30"},
+                {0, 0, "1970-01-01T01:00:00.0+01:00"},
 
                 {-1, 0, "1969-12-31T23:59:59Z"},
                 {1, 0, "1970-01-01T00:00:01Z"},
@@ -208,16 +217,22 @@
                 {3600, 0, "1970-01-01T01:00:00Z"},
                 {86400, 0, "1970-01-02T00:00:00Z"},
 
+                {-1, 0, "1969-12-31T23:59:59+00:00"},
+                {1, 0, "1970-01-01T05:30:01+05:30"},
+                {60, 0, "1969-12-31T19:01:00-05:00"},
+                {3600, 0, "1970-01-01T06:30:00+05:30"},
+                {86400, 0, "1970-01-01T19:00:00-05:00"},
+
                 {182, 234000000, "1970-01-01T00:03:02.234Z"},
                 {182, 234000000, "1970-01-01T00:03:02.2340Z"},
                 {182, 234000000, "1970-01-01T00:03:02.23400Z"},
                 {182, 234000000, "1970-01-01T00:03:02.234000Z"},
-                {182, 234000000, "1970-01-01T00:03:02.234000000Z"},
 
-                {((23 * 60) + 59) * 60 + 59, 123456789, "1970-01-01T23:59:59.123456789Z"},
+                {182, 234000000, "1970-01-01T00:03:02.234+00:00"},
+                {182, 234000000, "1970-01-01T05:33:02.2340+05:30"},
+                {182, 234000000, "1969-12-31T19:03:02.23400-05:00"},
+                {182, 234000000, "1970-01-01T00:03:02.234000+00:00"},
 
-                {Instant.MAX.getEpochSecond(), 999999999, "+1000000000-12-31T23:59:59.999999999Z"},
-                {Instant.MIN.getEpochSecond(), 0, "-1000000000-01-01T00:00:00.000000000Z"},
         };
     }
 
@@ -230,22 +245,46 @@
         assertEquals(f.parse(input).query(DateTimeFormatter.parsedLeapSecond()), Boolean.FALSE);
     }
 
-    @Test(dataProvider="parseDigits")
+    @DataProvider(name="parseNineDigits")
+    Object[][] data_parse_ninedigits() {
+        return new Object[][] {
+                {0, 0, "1970-01-01T00:00:00.000000000Z"},
+                {0, 0, "1970-01-01T05:30:00.000000000+05:30"},
+
+                {182, 234000000, "1970-01-01T00:03:02.234000000Z"},
+                {182, 234000000, "1970-01-01T01:03:02.234000000+01:00"},
+
+                {((23 * 60) + 59) * 60 + 59, 123456789, "1970-01-01T23:59:59.123456789Z"},
+                {((23 * 60) + 59) * 60 + 59, 123456789, "1970-01-02T05:29:59.123456789+05:30"},
+
+                {Instant.MAX.getEpochSecond(), 999999999, "+1000000000-12-31T23:59:59.999999999Z"},
+                {Instant.MIN.getEpochSecond(), 0, "-1000000000-01-01T00:00:00.000000000Z"},
+                {Instant.MAX.getEpochSecond(), 999999999, "+1000000000-12-31T23:59:59.999999999+00:00"},
+                {Instant.MIN.getEpochSecond(), 0, "-1000000000-01-01T00:00:00.000000000+00:00"},
+        };
+    }
+
+    @Test(dataProvider="parseNineDigits")
     public void test_parse_digitsNine(long instantSecs, int nano, String input) {
         DateTimeFormatter f = new DateTimeFormatterBuilder().appendInstant(9).toFormatter();
-        if (input.charAt(input.length() - 11) == '.') {
-            Instant expected = Instant.ofEpochSecond(instantSecs, nano);
-            assertEquals(f.parse(input, Instant::from), expected);
-            assertEquals(f.parse(input).query(DateTimeFormatter.parsedExcessDays()), Period.ZERO);
-            assertEquals(f.parse(input).query(DateTimeFormatter.parsedLeapSecond()), Boolean.FALSE);
-        } else {
-            try {
-                f.parse(input, Instant::from);
-                fail();
-            } catch (DateTimeException ex) {
-                // expected
-            }
-        }
+        Instant expected = Instant.ofEpochSecond(instantSecs, nano);
+        assertEquals(f.parse(input, Instant::from), expected);
+        assertEquals(f.parse(input).query(DateTimeFormatter.parsedExcessDays()), Period.ZERO);
+        assertEquals(f.parse(input).query(DateTimeFormatter.parsedLeapSecond()), Boolean.FALSE);
+    }
+
+    @DataProvider(name="parseMaxMinInstant")
+    Object[][] data_parse_MaxMinInstant() {
+        return new Object[][] {
+                {"+1000000000-12-31T23:59:59.999999999-01:00"},
+                {"-1000000000-01-01T00:00:00.000000000+01:00"}
+        };
+    }
+
+    @Test(dataProvider="parseMaxMinInstant", expectedExceptions=DateTimeParseException.class)
+    public void test_invalid_Instant(String input) {
+        DateTimeFormatter f = new DateTimeFormatterBuilder().appendInstant(-1).toFormatter();
+        f.parse(input, Instant::from);
     }
 
     @Test
@@ -283,4 +322,12 @@
         new DateTimeFormatterBuilder().appendInstant(10);
     }
 
+    //------------------------------------------------------------------------
+    @Test
+    public void test_equality() {
+        Instant instant1 = Instant.parse("2018-09-12T22:15:51+05:30");
+        Instant instant2 = Instant.parse("2018-09-12T16:45:51Z");
+        assertEquals(instant2, instant1);
+    }
+
 }
--- a/test/jdk/java/util/ServiceLoader/ModulesTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/util/ServiceLoader/ModulesTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -24,9 +24,9 @@
 /**
  * @test
  * @modules java.scripting
- * @library modules /lib/testlibrary
+ * @library modules /test/lib
  * @build bananascript/*
- * @build JarUtils
+ * @build jdk.test.lib.util.JarUtils
  * @compile classpath/pearscript/org/pear/PearScriptEngineFactory.java
  *          classpath/pearscript/org/pear/PearScript.java
  * @run testng/othervm ModulesTest
@@ -53,6 +53,8 @@
 import java.util.stream.Stream;
 import javax.script.ScriptEngineFactory;
 
+import jdk.test.lib.util.JarUtils;
+
 import org.testng.annotations.Test;
 import org.testng.annotations.BeforeTest;
 import static org.testng.Assert.*;
--- a/test/jdk/java/util/ServiceLoader/basic/ServiceLoaderBasicTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/java/util/ServiceLoader/basic/ServiceLoaderBasicTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,8 +25,9 @@
  * @test
  * @bug 4640520 6354623 7198496
  * @summary Unit test for java.util.ServiceLoader
- * @library /lib/testlibrary /test/lib
- * @build JarUtils jdk.test.lib.process.*
+ * @library /test/lib
+ * @build jdk.test.lib.process.*
+ *        jdk.test.lib.util.JarUtils
  *        Basic Load FooService FooProvider1 FooProvider2 FooProvider3 BarProvider
  * @run testng ServiceLoaderBasicTest
  */
@@ -41,6 +42,7 @@
 import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.Utils;
 import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.JarUtils;
 
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/javax/security/auth/login/modules/JaasModularClientTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/javax/security/auth/login/modules/JaasModularClientTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -37,15 +37,15 @@
 import java.util.stream.Stream;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
-
+import jdk.test.lib.util.JarUtils;
 
 /*
  * @test
  * @bug 8078813 8183310
  * @summary Test custom JAAS login module with all possible modular option.
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules java.base/jdk.internal.module
- * @build JarUtils
+ * @build jdk.test.lib.util.JarUtils
  * @build TestLoginModule JaasClient
  * @run main JaasModularClientTest false
  * @run main JaasModularClientTest true
--- a/test/jdk/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -36,14 +36,15 @@
 import java.util.stream.Stream;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.util.JarUtils;
 
 /*
  * @test
  * @bug 8151654 8183310
  * @summary Test default callback handler with all possible modular option.
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules java.base/jdk.internal.module
- * @build JarUtils
+ * @build jdk.test.lib.util.JarUtils
  * @build TestCallbackHandler TestLoginModule JaasClientWithDefaultHandler
  * @run main JaasModularDefaultHandlerTest
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/sql/testng/test/rowset/jdbcrowset/JdbcRowSetDriverManagerTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+package test.rowset.jdbcrowset;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import javax.sql.rowset.JdbcRowSet;
+import javax.sql.rowset.RowSetFactory;
+import javax.sql.rowset.RowSetProvider;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubDriver;
+
+public class JdbcRowSetDriverManagerTest extends BaseTest {
+
+    // URL that the StubDriver recognizes
+    private final static String StubDriverURL = "jdbc:tennis:boy";
+
+    /**
+     * Validate that JDBCRowSetImpl can connect to a JDBC driver that is
+     * register by DriverManager.
+     */
+    @Test(enabled = true)
+    public void test0000() throws SQLException {
+
+        DriverManager.registerDriver(new StubDriver());
+
+        // Show that the StubDriver is loaded and then call setAutoCommit on
+        // the returned Connection
+        dumpRegisteredDrivers();
+        Connection con = DriverManager.getConnection(StubDriverURL, "userid", "password");
+        con.setAutoCommit(true);
+
+        // Have com.sun.rowset.JdbcRowSetImpl create a Connection and
+        // then call setAutoCommit
+        RowSetFactory rsf = RowSetProvider.newFactory();
+        JdbcRowSet jrs = rsf.createJdbcRowSet();
+        jrs.setUrl(StubDriverURL);
+        jrs.setUsername("userid");
+        jrs.setPassword("password");
+
+        jrs.setAutoCommit(true);
+    }
+
+    private static void dumpRegisteredDrivers() {
+        System.out.println("+++ Loaded Drivers +++");
+        System.out.println("++++++++++++++++++++++++");
+        DriverManager.drivers()
+                .forEach(d
+                        -> System.out.println("+++ Driver:" + d + " "
+                        + d.getClass().getClassLoader()));
+        System.out.println("++++++++++++++++++++++++");
+
+    }
+}
--- a/test/jdk/jdk/jfr/event/compiler/TestAllocInNewTLAB.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/jfr/event/compiler/TestAllocInNewTLAB.java	Fri Oct 05 11:10:27 2018 -0400
@@ -43,14 +43,12 @@
  * @requires vm.hasJFR
  * @library /test/lib
  * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 jdk.jfr.event.compiler.TestAllocInNewTLAB
- * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 -XX:-FastTLABRefill jdk.jfr.event.compiler.TestAllocInNewTLAB
  * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 -Xint jdk.jfr.event.compiler.TestAllocInNewTLAB
  */
 
 /**
  * Test that when an object is allocated in a new Thread Local Allocation Buffer (TLAB)
- * an event will be triggered. The test is done for C1-compiler,
- * C2-compiler (-XX:-FastTLABRefill) and interpreted mode (-Xint).
+ * an event will be triggered. The test is done for default and interpreted mode (-Xint).
  *
  * To force objects to be allocated in a new TLAB:
  *      the size of TLAB is set to 100k (-XX:TLABSize=100k);
--- a/test/jdk/jdk/jfr/event/compiler/TestAllocOutsideTLAB.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/jfr/event/compiler/TestAllocOutsideTLAB.java	Fri Oct 05 11:10:27 2018 -0400
@@ -42,15 +42,13 @@
  * @key jfr
  * @requires vm.hasJFR
  * @library /test/lib
- * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB
- * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB
- * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 -Xint jdk.jfr.event.compiler.TestAllocOutsideTLAB
+ * @run main/othervm -XX:+UseTLAB -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB
+ * @run main/othervm -XX:+UseTLAB -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 -Xint jdk.jfr.event.compiler.TestAllocOutsideTLAB
  */
 
 /**
  * Test that an event is triggered when an object is allocated outside a
- * Thread Local Allocation Buffer (TLAB). The test is done for C1-compiler,
- * C2-compiler (-XX:-FastTLABRefill) and interpreted mode (-Xint).
+ * Thread Local Allocation Buffer (TLAB). The test is done for default interpreted mode (-Xint).
  *
  * To force objects to be allocated outside TLAB:
  *      the size of TLAB is set to 90k (-XX:TLABSize=90k);
--- a/test/jdk/jdk/jfr/event/oldobject/TestAllocationTime.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/jfr/event/oldobject/TestAllocationTime.java	Fri Oct 05 11:10:27 2018 -0400
@@ -44,7 +44,7 @@
  * @requires vm.gc == "null"
  * @library /test/lib /test/jdk
  * @modules jdk.jfr/jdk.jfr.internal.test
- * @run main/othervm  -XX:TLABSize=2k -XX:-FastTLABRefill jdk.jfr.event.oldobject.TestAllocationTime
+ * @run main/othervm  -XX:TLABSize=2k jdk.jfr.event.oldobject.TestAllocationTime
  */
 public class TestAllocationTime {
 
--- a/test/jdk/jdk/jfr/event/oldobject/TestLargeRootSet.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/jfr/event/oldobject/TestLargeRootSet.java	Fri Oct 05 11:10:27 2018 -0400
@@ -45,7 +45,7 @@
  * @requires vm.gc == "null"
  * @library /test/lib /test/jdk
  * @modules jdk.jfr/jdk.jfr.internal.test
- * @run main/othervm -XX:TLABSize=2k -XX:-FastTLABRefill jdk.jfr.event.oldobject.TestLargeRootSet
+ * @run main/othervm -XX:TLABSize=2k jdk.jfr.event.oldobject.TestLargeRootSet
  */
 public class TestLargeRootSet {
 
--- a/test/jdk/jdk/jfr/event/oldobject/TestLastKnownHeapUsage.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/jfr/event/oldobject/TestLastKnownHeapUsage.java	Fri Oct 05 11:10:27 2018 -0400
@@ -44,7 +44,7 @@
  * @requires vm.gc == "null"
  * @library /test/lib /test/jdk
  * @modules jdk.jfr/jdk.jfr.internal.test
- * @run main/othervm -XX:TLABSize=2k -XX:-FastTLABRefill jdk.jfr.event.oldobject.TestLastKnownHeapUsage
+ * @run main/othervm -XX:TLABSize=2k jdk.jfr.event.oldobject.TestLastKnownHeapUsage
  */
 public class TestLastKnownHeapUsage {
 
--- a/test/jdk/jdk/jfr/startupargs/TestOldObjectQueueSize.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/jfr/startupargs/TestOldObjectQueueSize.java	Fri Oct 05 11:10:27 2018 -0400
@@ -42,9 +42,9 @@
  * @library /test/lib
  * @key jfr
  *
- * @run main/othervm -XX:TLABSize=2k -XX:-FastTLABRefill -XX:FlightRecorderOptions=old-object-queue-size=0 jdk.jfr.startupargs.TestOldObjectQueueSize off
- * @run main/othervm -XX:TLABSize=2k -Xlog:gc+tlab=trace -XX:-FastTLABRefill -XX:FlightRecorderOptions=old-object-queue-size=10000 jdk.jfr.startupargs.TestOldObjectQueueSize many
- * @run main/othervm -XX:TLABSize=2k -Xlog:gc+tlab=trace -XX:-FastTLABRefill -XX:FlightRecorderOptions=old-object-queue-size=1000000 jdk.jfr.startupargs.TestOldObjectQueueSize many
+ * @run main/othervm -XX:TLABSize=2k -XX:FlightRecorderOptions=old-object-queue-size=0 jdk.jfr.startupargs.TestOldObjectQueueSize off
+ * @run main/othervm -XX:TLABSize=2k -Xlog:gc+tlab=trace -XX:FlightRecorderOptions=old-object-queue-size=10000 jdk.jfr.startupargs.TestOldObjectQueueSize many
+ * @run main/othervm -XX:TLABSize=2k -Xlog:gc+tlab=trace -XX:FlightRecorderOptions=old-object-queue-size=1000000 jdk.jfr.startupargs.TestOldObjectQueueSize many
  */
 public class TestOldObjectQueueSize {
 
--- a/test/jdk/jdk/modules/open/Basic.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/modules/open/Basic.java	Fri Oct 05 11:10:27 2018 -0400
@@ -98,6 +98,9 @@
         ctor.setAccessible(true);
         ctor.newInstance();
 
+        // Class::newInstance
+        clazz.newInstance();
+
         // method handles
         findNoArgConstructorAndInvoke(clazz, MethodHandles.publicLookup());
         findNoArgConstructorAndInvoke(clazz, MethodHandles.lookup());
@@ -122,6 +125,12 @@
         ctor.setAccessible(true);
         ctor.newInstance();
 
+        // Class::newInstance
+        try {
+            clazz.newInstance();
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
         // method handles
         try {
             findNoArgConstructorAndInvoke(clazz, MethodHandles.publicLookup());
@@ -150,6 +159,9 @@
         ctor.setAccessible(true);
         ctor.newInstance();
 
+        // Class::newInstance
+        clazz.newInstance();
+
         // method handles
         findNoArgConstructorAndInvoke(clazz, MethodHandles.publicLookup());
         findNoArgConstructorAndInvoke(clazz, MethodHandles.lookup());
@@ -174,6 +186,12 @@
         ctor.setAccessible(true);
         ctor.newInstance();
 
+        // Class::newInstance
+        try {
+            clazz.newInstance();
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
         // method handles
         try {
             findNoArgConstructorAndInvoke(clazz, MethodHandles.publicLookup());
@@ -200,6 +218,7 @@
         // core reflection
         Class<?> clazz = q.PublicType.class;
         clazz.getConstructor().newInstance();
+        clazz.newInstance();
 
         // method handles
         findNoArgConstructorAndInvoke(clazz, MethodHandles.publicLookup());
@@ -226,6 +245,12 @@
         ctor.setAccessible(true);
         ctor.newInstance();
 
+        // Class::newInstance
+        try {
+            clazz.newInstance();
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
         // method handles
         try {
             findNoArgConstructorAndInvoke(clazz, MethodHandles.publicLookup());
@@ -256,6 +281,12 @@
             assertTrue(false);
         } catch (InaccessibleObjectException expected) { }
 
+        // Class::newInstance
+        try {
+            clazz.newInstance();
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
         // method handles
         try {
             findNoArgConstructorAndInvoke(clazz, MethodHandles.publicLookup());
@@ -288,6 +319,12 @@
             assertTrue(false);
         } catch (InaccessibleObjectException expected) { }
 
+        // Class::newInstance
+        try {
+            clazz.newInstance();
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
         // method handles
         try {
             findNoArgConstructorAndInvoke(clazz, MethodHandles.publicLookup());
--- a/test/jdk/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,11 +23,13 @@
 
 /**
  * @test
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
  *          java.scripting
  *          jdk.zipfs
- * @build RunWithAutomaticModules jdk.test.lib.compiler.CompilerUtils JarUtils
+ * @build RunWithAutomaticModules
+ *        jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.util.JarUtils
  *        jdk.test.lib.process.ProcessTools
  * @run testng RunWithAutomaticModules
  * @summary Runs tests that make use of automatic modules
@@ -38,6 +40,7 @@
 import java.nio.file.Paths;
 
 import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.JarUtils;
 import static jdk.test.lib.process.ProcessTools.*;
 
 import org.testng.annotations.Test;
--- a/test/jdk/jdk/nio/zipfs/Basic.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/jdk/nio/zipfs/Basic.java	Fri Oct 05 11:10:27 2018 -0400
@@ -43,7 +43,7 @@
 import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
 /**
  * @test
- * @bug 8038500 8040059 8150366 8150496 8147539
+ * @bug 8038500 8040059 8150366 8150496 8147539 8211385
  * @summary Basic test for zip provider
  *
  * @modules jdk.zipfs
@@ -89,16 +89,30 @@
 
         // Test: DirectoryStream
         found = false;
+
         try (DirectoryStream<Path> stream = Files.newDirectoryStream(fs.getPath("/"))) {
             for (Path entry: stream) {
                 found = entry.toString().equals("/META-INF");
                 if (found) break;
             }
         }
-
         if (!found)
             throw new RuntimeException("Expected file not found");
 
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(fs.getPath("META-INF"))) {
+            for (Path entry: stream) {
+                if (entry.toString().equals("/META-INF/services"))
+                    throw new RuntimeException("child path should be relative");
+            }
+        }
+
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(fs.getPath("/META-INF"))) {
+            for (Path entry: stream) {
+                if (entry.toString().equals("META-INF/services"))
+                    throw new RuntimeException("child path should be absolute");
+            }
+        }
+
         // Test: copy file from zip file to current (scratch) directory
         Path source = fs.getPath("/META-INF/services/java.nio.file.spi.FileSystemProvider");
         if (Files.exists(source)) {
@@ -133,6 +147,8 @@
         try {
             fs.provider().checkAccess(fs.getPath("/missing"), AccessMode.READ);
         } catch (ClosedFileSystemException x) { }
+
+        Files.deleteIfExists(jarFile);
     }
 
     // FileVisitor that pretty prints a file tree
--- a/test/jdk/jprt.config	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-#!echo "This is not a shell script"
-#############################################################################
-# Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#############################################################################
-#
-# JPRT shell configuration for testing.
-#
-# Input environment variables:
-#    Windows Only:
-#      PATH
-#      ROOTDIR
-#
-# Output variable settings:
-#    make    Full path to GNU make
-#
-# Output environment variables:
-#    PATH
-#
-#############################################################################
-
-#############################################################################
-# Error
-error() # message
-{
-  echo "ERROR: $1"
-  exit 6
-}
-# Directory must exist
-dirMustExist() # dir name
-{
-  if [ ! -d "$1" ] ; then
-    error "Directory for $2 does not exist: $1"
-  fi
-}
-# File must exist
-fileMustExist() # dir name
-{
-  if [ ! -f "$1" ] ; then
-    error "File for $2 does not exist: $1"
-  fi
-}
-#############################################################################
-
-# Should be set by JPRT as the 3 basic inputs
-slashjava="${ALT_SLASH_JAVA}"
-if [ "${slashjava}" = "" ] ; then
-  slashjava=/java
-fi
-
-# Check input
-dirMustExist "${slashjava}"  ALT_SLASH_JAVA
-
-# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
-osname=`uname -s`
-if [ "${osname}" = SunOS ] ; then
-   
-    # SOLARIS: Sparc or X86
-    osarch=`uname -p`
-    if [ "${osarch}" = sparc ] ; then
-	solaris_arch=sparc
-    else
-	solaris_arch=i386
-    fi
-
-    # Add basic solaris system paths
-    path4sdk=/usr/bin:/usr/gnu/bin
-
-    # Find GNU make
-    make=/usr/bin/gmake
-    if [ ! -f ${make} ] ; then
-	make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
-    fi
-    fileMustExist "${make}" make
-
-    # File creation mask
-    umask 002
-
-elif [ "${osname}" = Linux ] ; then
-   
-    # Add basic paths
-    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
-
-    # Find GNU make
-    make=/usr/bin/make
-    fileMustExist "${make}" make
-
-    umask 002
-
-else
-
-    # Windows: Differs on CYGWIN vs. MKS.
-   
-    # We need to determine if we are running a CYGWIN shell or an MKS shell
-    #    (if uname isn't available, then it will be unix_toolset=unknown)
-    unix_toolset=unknown
-    if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
-        # We kind of assume ROOTDIR is where MKS is and it's ok
-        unix_toolset=MKS
-        mkshome=`dosname -s "${ROOTDIR}"`
-        # Most unix utilities are in the mksnt directory of ROOTDIR
-        unixcommand_path="${mkshome}/mksnt"
-        path4sdk="${unixcommand_path}"
-	devtools_path="${slashjava}/devtools/win32/bin"
-	path4sdk="${devtools_path};${path4sdk}"
-        # Find GNU make
-        make="${devtools_path}/gnumake.exe"
-        fileMustExist "${make}" make
-    elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
-        # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
-        unix_toolset=CYGWIN
-        # Most unix utilities are in the /usr/bin
-        unixcommand_path="/usr/bin"
-        path4sdk="${unixcommand_path}"
-        # Find GNU make
-        make="${unixcommand_path}/make.exe"
-        fileMustExist "${make}" make
-    else
-      echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
-    fi
-
-    
-    # For windows, it's hard to know where the system is, so we just add this
-    #    to PATH.
-    slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
-    path4sdk="${slash_path};${PATH}"
-    
-    # Convert path4sdk to cygwin style
-    if [ "${unix_toolset}" = CYGWIN ] ; then
-	path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
-    fi
-
-fi
-
-# Export PATH setting
-PATH="${path4sdk}"
-export PATH
-
--- a/test/jdk/lib/security/CheckBlacklistedCerts.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/lib/security/CheckBlacklistedCerts.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, 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
@@ -59,8 +59,7 @@
         // All certs in the pem files
         Set<Certificate> blacklisted = new HashSet<>();
 
-        // Hopefully src comes with test, but it might be missing if doing
-        // a -testonly JPRT job.
+        // Assumes the full src is available
         File[] blacklists = {
             new File(System.getProperty("test.src"),
                 "../../../make/data/blacklistedcertsconverter/blacklisted.certs.pem"),
--- a/test/jdk/lib/testlibrary/JarUtils.java	Mon Oct 01 09:04:49 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-/**
- * This class consists exclusively of static utility methods that are useful
- * for creating and manipulating JAR files.
- */
-
-public final class JarUtils {
-    private JarUtils() { }
-
-    /**
-     * Creates a JAR file.
-     *
-     * Equivalent to {@code jar cfm <jarfile> <manifest> -C <dir> file...}
-     *
-     * The input files are resolved against the given directory. Any input
-     * files that are directories are processed recursively.
-     */
-    public static void createJarFile(Path jarfile, Manifest man, Path dir, Path... file)
-        throws IOException
-    {
-        // create the target directory
-        Path parent = jarfile.getParent();
-        if (parent != null)
-            Files.createDirectories(parent);
-
-        List<Path> entries = new ArrayList<>();
-        for (Path entry : file) {
-            Files.find(dir.resolve(entry), Integer.MAX_VALUE,
-                        (p, attrs) -> attrs.isRegularFile())
-                    .map(e -> dir.relativize(e))
-                    .forEach(entries::add);
-        }
-
-        try (OutputStream out = Files.newOutputStream(jarfile);
-             JarOutputStream jos = new JarOutputStream(out))
-        {
-            if (man != null) {
-                JarEntry je = new JarEntry(JarFile.MANIFEST_NAME);
-                jos.putNextEntry(je);
-                man.write(jos);
-                jos.closeEntry();
-            }
-
-            for (Path entry : entries) {
-                String name = toJarEntryName(entry);
-                jos.putNextEntry(new JarEntry(name));
-                Files.copy(dir.resolve(entry), jos);
-                jos.closeEntry();
-            }
-        }
-    }
-
-    /**
-     * Creates a JAR file.
-     *
-     * Equivalent to {@code jar cf <jarfile>  -C <dir> file...}
-     *
-     * The input files are resolved against the given directory. Any input
-     * files that are directories are processed recursively.
-     */
-    public static void createJarFile(Path jarfile, Path dir, Path... file)
-        throws IOException
-    {
-        createJarFile(jarfile, null, dir, file);
-    }
-
-    /**
-     * Creates a JAR file.
-     *
-     * Equivalent to {@code jar cf <jarfile> -C <dir> file...}
-     *
-     * The input files are resolved against the given directory. Any input
-     * files that are directories are processed recursively.
-     */
-    public static void createJarFile(Path jarfile, Path dir, String... input)
-        throws IOException
-    {
-        Path[] paths = Stream.of(input).map(Paths::get).toArray(Path[]::new);
-        createJarFile(jarfile, dir, paths);
-    }
-
-    /**
-     * Creates a JAR file from the contents of a directory.
-     *
-     * Equivalent to {@code jar cf <jarfile> -C <dir> .}
-     */
-    public static void createJarFile(Path jarfile, Path dir) throws IOException {
-        createJarFile(jarfile, dir, Paths.get("."));
-    }
-
-    /**
-     * Update a JAR file.
-     *
-     * Equivalent to {@code jar uf <jarfile> -C <dir> file...}
-     *
-     * The input files are resolved against the given directory. Any input
-     * files that are directories are processed recursively.
-     */
-    public static void updateJarFile(Path jarfile, Path dir, Path... file)
-        throws IOException
-    {
-        List<Path> entries = new ArrayList<>();
-        for (Path entry : file) {
-            Files.find(dir.resolve(entry), Integer.MAX_VALUE,
-                    (p, attrs) -> attrs.isRegularFile())
-                    .map(e -> dir.relativize(e))
-                    .forEach(entries::add);
-        }
-
-        Set<String> names = entries.stream()
-                .map(JarUtils::toJarEntryName)
-                .collect(Collectors.toSet());
-
-        Path tmpfile = Files.createTempFile("jar", "jar");
-
-        try (OutputStream out = Files.newOutputStream(tmpfile);
-             JarOutputStream jos = new JarOutputStream(out))
-        {
-            // copy existing entries from the original JAR file
-            try (JarFile jf = new JarFile(jarfile.toString())) {
-                Enumeration<JarEntry> jentries = jf.entries();
-                while (jentries.hasMoreElements()) {
-                    JarEntry jentry = jentries.nextElement();
-                    if (!names.contains(jentry.getName())) {
-                        jos.putNextEntry(jentry);
-                        jf.getInputStream(jentry).transferTo(jos);
-                    }
-                }
-            }
-
-            // add the new entries
-            for (Path entry : entries) {
-                String name = toJarEntryName(entry);
-                jos.putNextEntry(new JarEntry(name));
-                Files.copy(dir.resolve(entry), jos);
-            }
-        }
-
-        // replace the original JAR file
-        Files.move(tmpfile, jarfile, StandardCopyOption.REPLACE_EXISTING);
-    }
-
-    /**
-     * Update a JAR file.
-     *
-     * Equivalent to {@code jar uf <jarfile> -C <dir> .}
-     */
-    public static void updateJarFile(Path jarfile, Path dir) throws IOException {
-        updateJarFile(jarfile, dir, Paths.get("."));
-    }
-
-
-    /**
-     * Map a file path to the equivalent name in a JAR file
-     */
-    private static String toJarEntryName(Path file) {
-        Path normalized = file.normalize();
-        return normalized.subpath(0, normalized.getNameCount())  // drop root
-                .toString()
-                .replace(File.separatorChar, '/');
-    }
-}
--- a/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/DefaultDriverInstaller.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/DefaultDriverInstaller.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
  */
 package org.netbeans.jemmy.drivers;
 
+import javax.swing.UIManager;
+
 import org.netbeans.jemmy.ClassReference;
 import org.netbeans.jemmy.JemmyException;
 import org.netbeans.jemmy.JemmyProperties;
@@ -50,6 +52,7 @@
 import org.netbeans.jemmy.drivers.windows.DefaultFrameDriver;
 import org.netbeans.jemmy.drivers.windows.DefaultInternalFrameDriver;
 import org.netbeans.jemmy.drivers.windows.DefaultWindowDriver;
+import org.netbeans.jemmy.drivers.windows.InternalFramePopupMenuDriver;
 
 /**
  * Installs all necessary drivers for Jemmy operators except low-level drivers
@@ -119,9 +122,9 @@
                     new ChoiceDriver(),
                     new DefaultFrameDriver(),
                     new DefaultWindowDriver(),
-                    new DefaultInternalFrameDriver(),
-                    new DefaultInternalFrameDriver(),
-                    new DefaultInternalFrameDriver(),
+                    "Motif".equals(UIManager.getLookAndFeel().getID())? new InternalFramePopupMenuDriver(): new DefaultInternalFrameDriver(),
+                    "Motif".equals(UIManager.getLookAndFeel().getID())? new InternalFramePopupMenuDriver(): new DefaultInternalFrameDriver(),
+                    "Motif".equals(UIManager.getLookAndFeel().getID())? new InternalFramePopupMenuDriver(): new DefaultInternalFrameDriver(),
                     new APIFocusDriver(),
                     new MouseFocusDriver(),
                     (shortcutEvents ? new QueueJMenuDriver() : new DefaultJMenuDriver()),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/windows/InternalFramePopupMenuDriver.java	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,87 @@
+/*
+ * 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 org.netbeans.jemmy.drivers.windows;
+
+import javax.swing.UIManager;
+
+import org.netbeans.jemmy.operators.ComponentOperator;
+import org.netbeans.jemmy.operators.JInternalFrameOperator;
+import org.netbeans.jemmy.operators.JMenuItemOperator;
+import org.netbeans.jemmy.operators.JPopupMenuOperator;
+
+/**
+ * InternalFrameDriver to do Close, Minimize, Maximize, and Restore actions
+ * using popup menus.
+ */
+public class InternalFramePopupMenuDriver extends DefaultInternalFrameDriver {
+
+    @Override
+    public void requestClose(ComponentOperator oper) {
+        checkSupported(oper);
+        pushMenuItem(oper, UIManager.getString(
+                "InternalFrameTitlePane.closeButtonText"));
+    }
+
+    @Override
+    public void iconify(ComponentOperator oper) {
+        checkSupported(oper);
+        pushMenuItem(oper, UIManager.getString(
+                "InternalFrameTitlePane.minimizeButtonText"));
+    }
+
+    @Override
+    public void maximize(ComponentOperator oper) {
+        checkSupported(oper);
+        if (!((JInternalFrameOperator) oper).isMaximum()) {
+            if (!((JInternalFrameOperator) oper).isSelected()) {
+                activate(oper);
+            }
+            pushMenuItem(oper, UIManager.getString(
+                    "InternalFrameTitlePane.maximizeButtonText"));
+        }
+    }
+
+    @Override
+    public void demaximize(ComponentOperator oper) {
+        checkSupported(oper);
+        if (((JInternalFrameOperator) oper).isMaximum()) {
+            if (!((JInternalFrameOperator) oper).isSelected()) {
+                activate(oper);
+            }
+            pushMenuItem(oper, UIManager.getString(
+                    "InternalFrameTitlePane.restoreButtonText"));
+        }
+    }
+
+    private void pushMenuItem(ComponentOperator oper,
+            String menuText) {
+        ((JInternalFrameOperator) oper).getPopupButton().push();
+        JPopupMenuOperator popupMenu = new JPopupMenuOperator();
+        JMenuItemOperator menuItem =
+                new JMenuItemOperator(popupMenu, menuText);
+        menuItem.push();
+    }
+}
\ No newline at end of file
--- a/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/JInternalFrameOperator.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/JInternalFrameOperator.java	Fri Oct 05 11:10:27 2018 -0400
@@ -170,6 +170,8 @@
      */
     protected JButtonOperator closeOper = null;
 
+    protected JButtonOperator popupButtonOper = null;
+
     /**
      * A title operator.
      */
@@ -202,9 +204,8 @@
      * @param index an index between appropriate ones.
      */
     public JInternalFrameOperator(ContainerOperator<?> cont, ComponentChooser chooser, int index) {
-        this((JInternalFrame) cont.
-                waitSubComponent(new JInternalFrameFinder(chooser),
-                        index));
+        this(waitJInternalFrame((Container)cont.getSource(),
+                chooser, index));
         copyEnvironment(cont);
     }
 
@@ -255,7 +256,7 @@
      *
      */
     public JInternalFrameOperator(ContainerOperator<?> cont, int index) {
-        this((JInternalFrame) waitComponent(cont,
+        this(waitJInternalFrame((Container)cont.getSource(),
                 new JInternalFrameFinder(),
                 index));
         copyEnvironment(cont);
@@ -667,6 +668,11 @@
         return closeOper;
     }
 
+    public JButtonOperator getPopupButton() {
+        initOperators();
+        return popupButtonOper;
+    }
+
     /**
      * Waits for the title pane.
      *
@@ -1413,21 +1419,27 @@
                         return "JInternalFrameOperator.initOperators.ComponentChooser{description = " + getDescription() + '}';
                     }
                 }) != null) {
-                    minOper = new JButtonOperator(titleOperator,
+                    if("Motif".equals(UIManager.getLookAndFeel().getID())) {
+                        popupButtonOper = new JButtonOperator(titleOperator, 0);
+                    } else {
+                        minOper = new JButtonOperator(titleOperator,
                             new JComponentByTipFinder(MINIMIZE_BUTTON_TOOLTIP));
-                    if (((JInternalFrame) getSource()).isMaximizable()) {
-                        maxOper = new JButtonOperator(titleOperator,
+                        if (((JInternalFrame) getSource()).isMaximizable()) {
+                            maxOper = new JButtonOperator(titleOperator,
                                 new JComponentByTipFinder(MAXIMIZE_BUTTON_TOOLTIP));
-                    } else {
-                        maxOper = null;
+                        } else {
+                            maxOper = null;
+                        }
                     }
                 } else {
                     minOper = null;
                     maxOper = null;
                 }
                 if (isClosable()) {
-                    closeOper = new JButtonOperator(titleOperator,
+                    if(!"Motif".equals(UIManager.getLookAndFeel().getID())) {
+                        closeOper = new JButtonOperator(titleOperator,
                             new JComponentByTipFinder(CLOSE_BUTTON_TOOLTIP));
+                    }
                 } else {
                     closeOper = null;
                 }
@@ -1588,23 +1600,24 @@
         }
 
         /**
-         * Creates an operator for the correspondent intenal frame.
+         * Creates an operator for the correspondent internal frame.
          *
          * @return an operator.
          */
         public JInternalFrame getInternalFrame() {
-            return ((JInternalFrame) getEventDispatcher().
-                    invokeExistingMethod("getInternalFrame",
-                            null,
-                            null,
-                            output));
+            return (runMapping(new MapAction<JInternalFrame>("getInternalFrame") {
+                @Override
+                public JInternalFrame map() {
+                    return ((JInternalFrame.JDesktopIcon) getSource()).getInternalFrame();
+                }
+            }));
         }
 
         /**
          * Pushs the deiconifying button.
          */
         public void pushButton() {
-            new JButtonOperator(this).push();
+            this.clickMouse(2);
         }
     }
 
--- a/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/version_info	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/version_info	Fri Oct 05 11:10:27 2018 -0400
@@ -1,6 +1,6 @@
 Manifest-version: 1.0
 Main-Class: org.netbeans.jemmy.JemmyProperties
 Jemmy-MajorVersion: 3.0
-Jemmy-MinorVersion: 4.0
+Jemmy-MinorVersion: 5.0
 Jemmy-Build: @BUILD_NUMBER@
 
--- a/test/jdk/sun/net/www/protocol/jar/jarbug/TestDriver.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/sun/net/www/protocol/jar/jarbug/TestDriver.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,7 +25,6 @@
  * @test
  * @bug 4361044 4388202 4418643 4523159 4730642
  * @library /test/lib
- *          /lib/testlibrary
  * @modules jdk.compiler
  * @build jdk.test.lib.compiler.CompilerUtils
  *        jdk.test.lib.Utils
@@ -34,7 +33,8 @@
  *        jdk.test.lib.JDKToolLauncher
  *        jdk.test.lib.Platform
  *        jdk.test.lib.process.*
- *        src.test.src.TestDriver JarUtils
+ *        jdk.test.lib.util.JarUtils
+ *        src.test.src.TestDriver
  * @summary various resource and classloading bugs related to jar files
  * @run main/othervm TestDriver
  */
@@ -42,6 +42,7 @@
 import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.JarUtils;
 
 import java.io.File;
 import java.nio.file.Files;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/krb5/auto/DnsCanonicalizeHostname.java	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,81 @@
+/*
+ * 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 jdk.test.lib.Asserts;
+import sun.security.krb5.PrincipalName;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+
+/*
+ * @test
+ * @bug 8210821
+ * @summary Support dns_canonicalize_hostname in krb5.conf
+ * @library /test/lib
+ * @compile -XDignore.symbol.file DnsCanonicalizeHostname.java
+ * @run main jdk.test.lib.FileInstaller dns_canonicalize_hostname.hosts hosts
+ * @run main/othervm -Djdk.net.hosts.file=hosts DnsCanonicalizeHostname none
+ * @run main/othervm -Djdk.net.hosts.file=hosts DnsCanonicalizeHostname true
+ * @run main/othervm -Djdk.net.hosts.file=hosts DnsCanonicalizeHostname false
+ */
+public class DnsCanonicalizeHostname {
+
+    // In dns_canonicalize_hostname.hosts, all "dummy.example.com", "dummy",
+    // and "bogus" are resolved to 127.0.0.1. Since "dummy.example.com" is on
+    // the first line, it is returned at the reverse lookup.
+
+    public static void main(String[] args) throws Exception {
+
+        Files.write(Path.of("krb5.conf"), List.of(
+                "[libdefaults]",
+                "default_realm = R",
+                args[0].equals("none")
+                        ? "# empty line"
+                        : "dns_canonicalize_hostname = " + args[0],
+                "",
+                "[realms]",
+                "R = {",
+                "    kdc = 127.0.0.1",
+                "}"
+        ));
+        System.setProperty("java.security.krb5.conf", "krb5.conf");
+
+        String n1 = new PrincipalName("host/dummy", PrincipalName.KRB_NT_SRV_HST)
+                .getNameStrings()[1];
+        String n2 = new PrincipalName("host/bogus", PrincipalName.KRB_NT_SRV_HST)
+                .getNameStrings()[1];
+
+        switch (args[0]) {
+            case "none":
+            case "true":
+                Asserts.assertEQ(n1, "dummy.example.com");
+                Asserts.assertEQ(n2, "bogus");
+                break;
+            case "false":
+                Asserts.assertEQ(n1, "dummy");
+                Asserts.assertEQ(n2, "bogus");
+                break;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/krb5/auto/dns_canonicalize_hostname.hosts	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,8 @@
+# The preferred name at reverse lookup
+127.0.0.1 dummy.example.com
+
+# The short name
+127.0.0.1 dummy
+
+# The strange name
+127.0.0.1 bogus
--- a/test/jdk/tools/jimage/JImageTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/jimage/JImageTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -93,9 +93,9 @@
         }
 
         File jdkHome = new File(System.getProperty("test.jdk"));
-        // JPRT not yet ready for jmods
         Helper helper = Helper.newHelper();
         if (helper == null) {
+            // Skip test if the jmods directory is missing (e.g. exploded image)
             System.err.println("Test not run, NO jmods directory");
             return;
         }
--- a/test/jdk/tools/jlink/basic/BasicTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/jlink/basic/BasicTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,13 +25,14 @@
  * @test
  * @summary Basic test of jlink to create jmods and images
  * @author Andrei Eremeev
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules java.base/jdk.internal.module
  *          jdk.jlink
  *          jdk.compiler
  * @build jdk.test.lib.process.ProcessTools
  *        jdk.test.lib.process.OutputAnalyzer
- *        JarUtils jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.util.JarUtils
  * @run main BasicTest
  */
 
@@ -48,6 +49,7 @@
 import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.JarUtils;
 
 public class BasicTest {
     static final ToolProvider JMOD_TOOL = ToolProvider.findFirst("jmod")
--- a/test/jdk/tools/jlink/plugins/StringSharingPluginTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/jlink/plugins/StringSharingPluginTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -67,9 +67,9 @@
     private static int strID = 1;
 
     public static void main(String[] args) throws Exception {
-        // JPRT not yet ready for jmods
         Helper helper = Helper.newHelper();
         if (helper == null) {
+            // Skip test if the jmods directory is missing (e.g. exploded image)
             System.err.println("Test not run, NO jmods directory");
             return;
         }
--- a/test/jdk/tools/jlink/plugins/StripDebugPluginTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/jlink/plugins/StripDebugPluginTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -68,9 +68,9 @@
     }
 
     public void test() throws Exception {
-        // JPRT not yet ready for jmods
         Helper helper = Helper.newHelper();
         if (helper == null) {
+            // Skip test if the jmods directory is missing (e.g. exploded image)
             System.err.println("Test not run, NO jmods directory");
             return;
         }
--- a/test/jdk/tools/launcher/modules/addexports/manifest/AddExportsAndOpensInManifest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/launcher/modules/addexports/manifest/AddExportsAndOpensInManifest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,10 +23,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
  * @library /test/lib
  * @modules jdk.compiler
- * @build AddExportsAndOpensInManifest Test2 JarUtils jdk.testlibrary.*
+ * @build AddExportsAndOpensInManifest Test2
+ *        jdk.test.lib.util.JarUtils
  * @compile --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED Test1.java
  * @run testng AddExportsAndOpensInManifest
  * @summary Basic test for Add-Exports and Add-Opens attributes in the
@@ -42,6 +42,7 @@
 
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.JarUtils;
 
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
--- a/test/jdk/tools/launcher/modules/addreads/AddReadsTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/launcher/modules/addreads/AddReadsTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,10 +23,11 @@
 
 /**
  * @test
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
- * @build AddReadsTest JarUtils
+ * @build AddReadsTest
  *        jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.util.JarUtils
  * @run testng AddReadsTest
  * @summary Basic tests for java --add-reads
  */
@@ -36,6 +37,7 @@
 
 import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.util.JarUtils;
 import static jdk.test.lib.process.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/tools/launcher/modules/illegalaccess/IllegalAccessTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/launcher/modules/illegalaccess/IllegalAccessTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -26,9 +26,10 @@
  * @requires vm.compMode != "Xcomp"
  * @modules java.base/jdk.internal.misc
  *          java.base/sun.security.x509
- * @library /test/lib /lib/testlibrary modules
- * @build IllegalAccessTest TryAccess JarUtils
+ * @library /test/lib modules
+ * @build IllegalAccessTest TryAccess
  *        jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.util.JarUtils
  * @build m/*
  * @run testng/othervm/timeout=180 IllegalAccessTest
  * @summary Basic test for java --illegal-access=$VALUE
@@ -46,6 +47,7 @@
 import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.util.JarUtils;
 
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
--- a/test/jdk/tools/launcher/modules/patch/basic/PatchTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/launcher/modules/patch/basic/PatchTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,11 +23,12 @@
 
 /**
  * @test
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
  *          jdk.naming.dns
- * @build PatchTest JarUtils
+ * @build PatchTest
  *        jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.util.JarUtils
  * @run testng PatchTest
  * @summary Basic test for --patch-module
  */
@@ -40,6 +41,7 @@
 import java.util.stream.Stream;
 
 import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.JarUtils;
 import static jdk.test.lib.process.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/tools/launcher/modules/patch/basic/PatchTestWarningError.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/launcher/modules/patch/basic/PatchTestWarningError.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,10 +25,11 @@
  * @test
  * @bug 8168836
  * @summary Basic argument validation for --patch-module
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
- * @build PatchTestWarningError JarUtils
+ * @build PatchTestWarningError
  *        jdk.test.lib.compiler.CompilerUtils
+ *        jdk.test.lib.util.JarUtils
  * @run testng PatchTestWarningError
  */
 
@@ -40,6 +41,7 @@
 import java.util.stream.Stream;
 
 import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.JarUtils;
 import static jdk.test.lib.process.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/tools/launcher/modules/validate/ValidateModulesTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/launcher/modules/validate/ValidateModulesTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @bug 8178380 8194937
  * @modules java.xml
- * @library src /lib/testlibrary /test/lib
- * @build ValidateModulesTest hello/* JarUtils
+ * @library src /test/lib
+ * @build ValidateModulesTest hello/* jdk.test.lib.util.JarUtils
  * @run testng ValidateModulesTest
  * @summary Basic test for java --validate-modules
  */
@@ -38,6 +38,7 @@
 
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.util.JarUtils;
 
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
--- a/test/jdk/tools/lib/tests/Helper.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/lib/tests/Helper.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -67,8 +67,8 @@
 
     public static Helper newHelper() throws IOException {
         Path jdkHome = Paths.get(System.getProperty("test.jdk"));
-        // JPRT not yet ready for jmods
         if (!Files.exists(jdkHome.resolve("jmods"))) {
+            // Skip test if the jmods directory is missing (e.g. exploded image)
             System.err.println("Test not run, NO jmods directory");
             return null;
         }
--- a/test/jdk/tools/pack200/Pack200Test.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/pack200/Pack200Test.java	Fri Oct 05 11:10:27 2018 -0400
@@ -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
@@ -133,7 +133,7 @@
      */
     public static void main(String[] args) throws Exception {
         // select the jars carefully, adding more jars will increase the
-        // testing time, especially for jprt.
+        // testing time.
         jarList.add(Utils.createRtJar());
         jarList.add(Utils.getGoldenJar());
         System.out.println(jarList);
--- a/test/jdk/tools/pack200/TestExceptions.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/jdk/tools/pack200/TestExceptions.java	Fri Oct 05 11:10:27 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, 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
@@ -110,7 +110,7 @@
                     ti.checkException(e);
                 }
             }
-        } finally { // keep jprt happy
+        } finally { // clean up
             for (TestInput ti : tlist) {
                 if (ti != null) {
                     ti.close();
@@ -143,7 +143,7 @@
                     ti.checkException(e);
                 }
             }
-        } finally { // keep jprt happy
+        } finally { // clean up
             for (PackTestJarInputStream ti : tlist) {
                 if (ti != null) {
                     ti.close();
@@ -177,7 +177,7 @@
                     ti.checkException(e);
                 }
             }
-        } finally { // keep jprt happy
+        } finally { // clean up
             for (TestInput ti : tlist) {
                 if (ti != null) {
                     ti.close();
@@ -210,7 +210,7 @@
                     ti.checkException(e);
                 }
             }
-        } finally { // keep jprt happy
+        } finally { // clean up
             for (TestInput ti : tlist) {
                 if (ti != null) {
                     ti.close();
--- a/test/langtools/Makefile	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/langtools/Makefile	Fri Oct 05 11:10:27 2018 -0400
@@ -12,10 +12,6 @@
 # build, and set TESTBOOTCLASSPATH to the compiled langtools classes --
 # for example build/classes or dist/lib/classes.jar.
 
-# JPRT
-# JPRT may invoke this Makefile directly, as part of a langtools build,
-# or indirectly, via FOREST/test/Makefile, as part of a control build.
-
 # Get OS/ARCH specifics
 OSNAME = $(shell uname -s)
 ifeq ($(OSNAME), SunOS)
@@ -71,12 +67,6 @@
 # Root of this test area (important to use full paths in some places)
 TEST_ROOT := $(shell pwd $(CYGPATH) )
 
-# Default bundle of all test results (passed or not) (JPRT only)
-ifdef JPRT_JOB_ID
-  JPRT_CLEAN = clean
-  JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip
-endif
-
 ifeq ($(PLATFORM), windows)
   SLASH_JAVA = J:
 else
@@ -85,9 +75,7 @@
 
 # Default JTREG to run
 ifndef JTREG_HOME
-  ifdef JPRT_JTREG_HOME
-    JTREG_HOME = $(JPRT_JTREG_HOME)
-  else ifdef JT_HOME
+  ifdef JT_HOME
     JTREG_HOME = $(JT_HOME)
   else
     JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.2/promoted/latest/
@@ -108,11 +96,7 @@
 
 # Default JCK to run
 ifndef JCK_HOME
-  ifdef JPRT_JCK_HOME
-    JCK_HOME = $(JPRT_JCK_HOME)
-  else
-    JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries
-  endif
+  JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries
 endif
 
 # Default JDK for JTREG and JCK
@@ -120,21 +104,13 @@
 # JT_JAVA is the version of java used to run jtreg/JCK. 
 #
 ifndef JT_JAVA
-  ifdef JPRT_JAVA_HOME
-    JT_JAVA = $(JPRT_JAVA_HOME)
-  else
-    JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
-  endif
+  JT_JAVA = $(SLASH_JAVA)/re/jdk/1.9.0/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
 endif
 
 # Default JDK to test
-ifdef JPRT_IMPORT_PRODUCT_HOME
-  TESTJAVA = $(JPRT_IMPORT_PRODUCT_HOME)
-else
-  TESTJAVA = $(SLASH_JAVA)/re/jdk/1.9.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
-endif
+TESTJAVA = $(SLASH_JAVA)/re/jdk/1.9.0/promoted/latest/binaries/$(PLATFORM)-$(ARCH)
 
-# PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from
+# PRODUCT_HOME is a variable pointing to a directory containing the output from
 # make/Makefile
 # For langtools, this is a directory containing build and dist
 # For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image
@@ -199,12 +175,7 @@
 ###    -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE)
 endif
 
-# Timeouts -- by default, increase test timeouts when running on JPRT
-ifdef JPRT_JOB_ID
-  ifndef JTREG_TIMEOUT_FACTOR
-    JTREG_TIMEOUT_FACTOR = 3
-  endif
-endif
+# Timeouts
 ifdef JTREG_TIMEOUT_FACTOR
   JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR)
 endif
@@ -266,16 +237,16 @@
 endif
 
 # Default make rule -- warning, may take a while
-all: $(JPRT_CLEAN) jtreg-tests jck-compiler-tests jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) all-summary
+all: jtreg-tests jck-compiler-tests jck-runtime-tests all-summary
 	@echo "Testing completed successfully"
 
-jtreg apt javac javadoc javah javap jdeps: $(JPRT_CLEAN) jtreg-tests $(JPRT_ARCHIVE_BUNDLE) jtreg-summary
+jtreg apt javac javadoc javah javap jdeps: jtreg-tests jtreg-summary
 	@echo "Testing completed successfully"
 
-jck-compiler: $(JPRT_CLEAN) jck-compiler-tests $(JPRT_ARCHIVE_BUNDLE) jck-compiler-summary
+jck-compiler: jck-compiler-tests jck-compiler-summary
 	@echo "Testing completed successfully"
 
-jck-runtime: $(JPRT_CLEAN) jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) jck-runtime-summary
+jck-runtime: jck-runtime-tests jck-runtime-summary
 	@echo "Testing completed successfully"
 
 # a way to select tests from outside
@@ -286,7 +257,7 @@
   JCK_RUNTIME_TESTDIRS = $(TEST_SELECTION)
 endif
 
-# for use with JPRT -testrule
+# convenience targets
 all:		JTREG_TESTDIRS = .
 jtreg:		JTREG_TESTDIRS ?= .
 apt:		JTREG_TESTDIRS = tools/apt
@@ -476,15 +447,8 @@
 	    $(EXIT) 1
 	fi
 
-# Bundle up the results
-$(JPRT_ARCHIVE_BUNDLE): FRC
-	@rm -f $@
-	@mkdir -p $(@D)
-	( cd $(TEST_OUTPUT_DIR) && zip -q -r $@ . )
-
 # Cleanup
 clean:
-	rm -f $(JPRT_ARCHIVE_BUNDLE)
 
 # Used to force a target rules to run
 FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFxMode.java	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,98 @@
+/*
+ * 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 8208531
+ * @summary -javafx mode should be on by default when JavaFX is available.
+ * @library /tools/lib ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build JavadocTester
+ * @run main TestJavaFxMode
+ */
+
+import toolbox.ToolBox;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class TestJavaFxMode extends JavadocTester {
+
+    final ToolBox tb;
+
+    public static void main(String... args) throws Exception {
+        TestJavaFxMode tester = new TestJavaFxMode();
+        if (tester.sanity()) {
+            tester.runTests(m -> new Object[]{Paths.get(m.getName())});
+        }
+    }
+
+    TestJavaFxMode() {
+        tb = new ToolBox();
+    }
+
+    // Check if FX modules are available.
+    boolean sanity() {
+        try {
+            Class.forName("javafx.beans.Observable");
+        } catch (ClassNotFoundException cnfe) {
+            System.out.println("Note: javafx.beans.Observable: not found, test passes vacuously");
+            return false;
+        }
+        return true;
+    }
+
+    @Test
+    void test(Path base) throws Exception {
+        Path src = base.resolve("src");
+        createTestClass(src);
+        Path outDir = base.resolve("out");
+
+        javadoc("-d", outDir.toString(),
+                "-sourcepath", src.toString(),
+                "pkg");
+
+        checkExit(Exit.OK);
+        checkOrder("pkg/A.html",
+                "Property Summary",
+                "javafx.beans.property.Property", "<a href=\"#propProperty\">prop</a>",
+                "Field Summary",
+                "javafx.beans.property.Property", "<a href=\"#prop\">prop</a></span>",
+                "Method Summary",
+                "<a href=\"#getProp()\">getProp</a>", "Gets the value of the property prop.",
+                "<a href=\"#propProperty()\">propProperty</a>", "Sets the value of the property prop.");
+    }
+
+    void createTestClass(Path src) throws Exception {
+        tb.writeJavaFiles(src,
+                "package pkg;\n"
+                + "import javafx.beans.property.Property;\n"
+                + "public class A {\n"
+                + "    public Property prop;\n"
+                + "    public Property propProperty(){return null;}\n"
+                + "    public Property getProp(){return null;}\n"
+                + "    public void setProp(Property prop){}\n"
+                + "}");
+    }
+
+}
--- a/test/langtools/tools/javac/T8152616.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/langtools/tools/javac/T8152616.java	Fri Oct 05 11:10:27 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @bug 8152616
  * @summary Unit test for corner case of PrettyPrinting when SourceOutput is false
- * @run compile --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED T8152616.java
- * @run main T8152616
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.tree
  */
 
 import java.io.File;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/diags/examples/VarInImplicitLambda.java	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+// key: compiler.misc.feature.var.syntax.in.implicit.lambda
+// key: compiler.err.feature.not.supported.in.source.plural
+// options: -source 10 -Xlint:-options
+
+import java.util.function.*;
+
+class VarInImplicitLambda {
+    IntBinaryOperator f2 = (var x, y) -> x + y;
+}
--- a/test/langtools/tools/javac/lambda/LambdaParserTest.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/langtools/tools/javac/lambda/LambdaParserTest.java	Fri Oct 05 11:10:27 2018 -0400
@@ -107,8 +107,8 @@
     }
 
     enum SourceKind {
-        SOURCE_9("9"),
-        SOURCE_10("10");
+        SOURCE_10("10"),
+        SOURCE_11("11");
 
         String sourceNumber;
 
@@ -121,9 +121,9 @@
 
         IMPLICIT_1("", ExplicitKind.IMPLICIT),
         IMPLICIT_2("var", ExplicitKind.IMPLICIT_VAR),
-        EXPLIICT_SIMPLE("A", ExplicitKind.EXPLICIT),
-        EXPLIICT_SIMPLE_ARR1("A[]", ExplicitKind.EXPLICIT),
-        EXPLIICT_SIMPLE_ARR2("A[][]", ExplicitKind.EXPLICIT),
+        EXPLICIT_SIMPLE("A", ExplicitKind.EXPLICIT),
+        EXPLICIT_SIMPLE_ARR1("A[]", ExplicitKind.EXPLICIT),
+        EXPLICIT_SIMPLE_ARR2("A[][]", ExplicitKind.EXPLICIT),
         EXPLICIT_VARARGS("A...", ExplicitKind.EXPLICIT),
         EXPLICIT_GENERIC1("A<X>", ExplicitKind.EXPLICIT),
         EXPLICIT_GENERIC2("A<? extends X, ? super Y>", ExplicitKind.EXPLICIT),
@@ -157,13 +157,7 @@
         }
 
         ExplicitKind explicitKind(SourceKind sk) {
-            switch (explicitKind) {
-                case IMPLICIT_VAR:
-                    return (sk == SourceKind.SOURCE_9) ?
-                            ExplicitKind.EXPLICIT : ExplicitKind.IMPLICIT_VAR;
-                default:
-                    return explicitKind;
-            }
+            return explicitKind;
         }
     }
 
@@ -299,6 +293,15 @@
         errorExpected |= pn == LambdaParameterName.UNDERSCORE &&
                 lk.arity() > 0;
 
+        for (int i = 0; i < lk.arity(); i++) {
+            if (!lk.isShort() &&
+                    pks[i].explicitKind(sk) == LambdaParameterKind.ExplicitKind.IMPLICIT_VAR &&
+                    sk == SourceKind.SOURCE_10) {
+                errorExpected = true;
+                break;
+            }
+        }
+
         if (errorExpected != res.hasErrors()) {
             fail("invalid diagnostics for source:\n" +
                 res.compilationInfo() +
--- a/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01.java	Fri Oct 05 11:10:27 2018 -0400
@@ -3,6 +3,7 @@
  * @bug 8198512 8199327
  * @summary compiler support for local-variable syntax for lambda parameters
  * @compile/fail/ref=VarInImplicitLambdaNegTest01.out -XDrawDiagnostics VarInImplicitLambdaNegTest01.java
+ * @compile/fail/ref=VarInImplicitLambdaNegTest01_source10.out -source 10 -XDrawDiagnostics VarInImplicitLambdaNegTest01.java
  */
 
 import java.util.function.*;
--- a/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01.out	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01.out	Fri Oct 05 11:10:27 2018 -0400
@@ -1,6 +1,6 @@
-VarInImplicitLambdaNegTest01.java:11:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.var.and.implicit.not.allowed)
 VarInImplicitLambdaNegTest01.java:12:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.var.and.implicit.not.allowed)
-VarInImplicitLambdaNegTest01.java:13:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.var.and.explicit.not.allowed)
-VarInImplicitLambdaNegTest01.java:14:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.implicit.and.explicit.not.allowed)
-VarInImplicitLambdaNegTest01.java:16:52: compiler.err.var.not.allowed.array
+VarInImplicitLambdaNegTest01.java:13:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.var.and.implicit.not.allowed)
+VarInImplicitLambdaNegTest01.java:14:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.var.and.explicit.not.allowed)
+VarInImplicitLambdaNegTest01.java:15:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.implicit.and.explicit.not.allowed)
+VarInImplicitLambdaNegTest01.java:17:52: compiler.err.var.not.allowed.array
 5 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01_source10.out	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,6 @@
+- compiler.warn.source.no.bootclasspath: 10
+VarInImplicitLambdaNegTest01.java:12:36: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.var.syntax.in.implicit.lambda), 10, 11
+VarInImplicitLambdaNegTest01.java:15:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.implicit.and.explicit.not.allowed)
+VarInImplicitLambdaNegTest01.java:17:52: compiler.err.var.not.allowed.here
+3 errors
+1 warning
--- a/test/lib/jdk/test/lib/util/JarUtils.java	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/lib/jdk/test/lib/util/JarUtils.java	Fri Oct 05 11:10:27 2018 -0400
@@ -23,31 +23,173 @@
 
 package jdk.test.lib.util;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.nio.file.Files;
 import java.nio.file.InvalidPathException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
- * Common library for various test jar file utility functions.
+ * This class consists exclusively of static utility methods that are useful
+ * for creating and manipulating JAR files.
  */
 public final class JarUtils {
+    private JarUtils() { }
+
+    /**
+     * Creates a JAR file.
+     *
+     * Equivalent to {@code jar cfm <jarfile> <manifest> -C <dir> file...}
+     *
+     * The input files are resolved against the given directory. Any input
+     * files that are directories are processed recursively.
+     */
+    public static void createJarFile(Path jarfile, Manifest man, Path dir, Path... files)
+            throws IOException
+    {
+        // create the target directory
+        Path parent = jarfile.getParent();
+        if (parent != null) {
+            Files.createDirectories(parent);
+        }
+
+        List<Path> entries = findAllRegularFiles(dir, files);
+
+        try (OutputStream out = Files.newOutputStream(jarfile);
+             JarOutputStream jos = new JarOutputStream(out)) {
+            if (man != null) {
+                JarEntry je = new JarEntry(JarFile.MANIFEST_NAME);
+                jos.putNextEntry(je);
+                man.write(jos);
+                jos.closeEntry();
+            }
+
+            for (Path entry : entries) {
+                String name = toJarEntryName(entry);
+                jos.putNextEntry(new JarEntry(name));
+                Files.copy(dir.resolve(entry), jos);
+                jos.closeEntry();
+            }
+        }
+    }
+
+    /**
+     * Creates a JAR file.
+     *
+     * Equivalent to {@code jar cf <jarfile>  -C <dir> file...}
+     *
+     * The input files are resolved against the given directory. Any input
+     * files that are directories are processed recursively.
+     */
+    public static void createJarFile(Path jarfile, Path dir, Path... files)
+            throws IOException
+    {
+        createJarFile(jarfile, null, dir, files);
+    }
+
+    /**
+     * Creates a JAR file from the contents of a directory.
+     *
+     * Equivalent to {@code jar cf <jarfile> -C <dir> .}
+     */
+    public static void createJarFile(Path jarfile, Path dir) throws IOException {
+        createJarFile(jarfile, dir, Paths.get("."));
+    }
+
+
+    /**
+     * Creates a JAR file.
+     *
+     * Equivalent to {@code jar cf <jarfile> -C <dir> file...}
+     *
+     * The input files are resolved against the given directory. Any input
+     * files that are directories are processed recursively.
+     */
+    public static void createJarFile(Path jarfile, Path dir, String... input)
+            throws IOException
+    {
+        Path[] paths = Stream.of(input).map(Paths::get).toArray(Path[]::new);
+        createJarFile(jarfile, dir, paths);
+    }
+
+    /**
+     * Updates a JAR file.
+     *
+     * Equivalent to {@code jar uf <jarfile> -C <dir> file...}
+     *
+     * The input files are resolved against the given directory. Any input
+     * files that are directories are processed recursively.
+     */
+    public static void updateJarFile(Path jarfile, Path dir, Path... files)
+            throws IOException
+    {
+        List<Path> entries = findAllRegularFiles(dir, files);
+
+        Set<String> names = entries.stream()
+                                   .map(JarUtils::toJarEntryName)
+                                   .collect(Collectors.toSet());
+
+        Path tmpfile = Files.createTempFile("jar", "jar");
+
+        try (OutputStream out = Files.newOutputStream(tmpfile);
+             JarOutputStream jos = new JarOutputStream(out)) {
+            // copy existing entries from the original JAR file
+            try (JarFile jf = new JarFile(jarfile.toString())) {
+                Enumeration<JarEntry> jentries = jf.entries();
+                while (jentries.hasMoreElements()) {
+                    JarEntry jentry = jentries.nextElement();
+                    if (!names.contains(jentry.getName())) {
+                        jos.putNextEntry(jentry);
+                        jf.getInputStream(jentry).transferTo(jos);
+                    }
+                }
+            }
+
+            // add the new entries
+            for (Path entry : entries) {
+                String name = toJarEntryName(entry);
+                jos.putNextEntry(new JarEntry(name));
+                Files.copy(dir.resolve(entry), jos);
+            }
+        }
+
+        // replace the original JAR file
+        Files.move(tmpfile, jarfile, StandardCopyOption.REPLACE_EXISTING);
+    }
+
+    /**
+     * Updates a JAR file.
+     *
+     * Equivalent to {@code jar uf <jarfile> -C <dir> .}
+     */
+    public static void updateJarFile(Path jarfile, Path dir) throws IOException {
+        updateJarFile(jarfile, dir, Paths.get("."));
+    }
+
 
     /**
      * Create jar file with specified files. If a specified file does not exist,
      * a new jar entry will be created with the file name itself as the content.
      */
+    @Deprecated
     public static void createJar(String dest, String... files)
             throws IOException {
         try (JarOutputStream jos = new JarOutputStream(
@@ -81,6 +223,7 @@
      *              will be removed. If no "-" exists, all files belong to
      *              the 1st group.
      */
+    @Deprecated
     public static void updateJar(String src, String dest, String... files)
             throws IOException {
         Map<String,Object> changes = new HashMap<>();
@@ -118,6 +261,7 @@
      *                Existing entries in src not a key is unmodified.
      * @throws IOException
      */
+    @Deprecated
     public static void updateJar(String src, String dest,
                                  Map<String,Object> changes)
             throws IOException {
@@ -172,4 +316,26 @@
             }
         }
     }
+
+    /**
+     * Maps a file path to the equivalent name in a JAR file
+     */
+    private static String toJarEntryName(Path file) {
+        Path normalized = file.normalize();
+        return normalized.subpath(0, normalized.getNameCount())  // drop root
+                         .toString()
+                         .replace(File.separatorChar, '/');
+    }
+
+    private static List<Path> findAllRegularFiles(Path dir, Path[] files) throws IOException {
+        List<Path> entries = new ArrayList<>();
+        for (Path file : files) {
+            try (Stream<Path> stream = Files.find(dir.resolve(file), Integer.MAX_VALUE,
+                    (p, attrs) -> attrs.isRegularFile())) {
+                stream.map(dir::relativize)
+                      .forEach(entries::add);
+            }
+        }
+        return entries;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/make/TestCompileCommands.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -0,0 +1,54 @@
+
+# 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.
+#
+
+include $(SPEC)
+include MakeBase.gmk
+
+default: all
+
+COMPILE_COMMANDS := $(OUTPUTDIR)/compile_commands.json
+
+# Perform basic compile_commands.json validation:
+#  - should start with [ and end with ]
+#  - should contain at least one entry (opening {)
+#  - last entry should not have a trailing comma (end with })
+verify-compile-commands-json:
+	$(HEAD) -n 1 $(COMPILE_COMMANDS) | $(GREP) -q -e "^\[$$"
+	$(TAIL) -1 $(COMPILE_COMMANDS) | $(GREP) -q -e "^\]$$"
+	$(HEAD) -n 2 $(COMPILE_COMMANDS) | $(GREP) -q -e "{"
+	$(TAIL) -2 $(COMPILE_COMMANDS) | $(GREP) -q -e "}$$"
+
+# Ensure that no native shared library for hotspot was created during the
+# build. Checking hotspot only since on Windows the jdk folders are prepopulated
+# with CRT DLLs. Also note that this test requires a clean build folder.
+verify-no-shared-libraries:
+	$(FIND) $(OUTPUTDIR)/hotspot -type f -name "*$(SHARED_LIBRARY_SUFFIX)" \
+	    -exec false {} +
+
+TEST_TARGETS += verify-compile-commands-json verify-no-shared-libraries
+
+all: $(TEST_TARGETS)
+
+.PHONY: default all verify-compile-commands
--- a/test/make/TestMake.gmk	Mon Oct 01 09:04:49 2018 -0400
+++ b/test/make/TestMake.gmk	Fri Oct 05 11:10:27 2018 -0400
@@ -39,7 +39,10 @@
 test-idea:
 	+$(MAKE) -f TestIdea.gmk $(TEST_SUBTARGET)
 
+test-compile-commands:
+	+$(MAKE) -f TestCompileCommands.gmk $(TEST_SUBTARGET)
+
 
 all: make-base java-compilation copy-files test-idea
 
-.PHONY: default all make-base java-compilation copy-files test-idea
+.PHONY: default all make-base java-compilation copy-files test-idea test-compile-commands