changeset 52166:032c1c1379ab

Merge
author bobv
date Tue, 16 Oct 2018 09:55:30 -0400
parents 89f3b013ab8f f53671e05660
children 435467bce14e
files test/jdk/lib/security/CheckBlacklistedCerts.java test/jdk/lib/security/cacerts/VerifyCACerts.java test/jdk/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java test/jdk/lib/testlibrary/jdk/testlibrary/testkeys
diffstat 300 files changed, 6026 insertions(+), 1633 deletions(-) [+]
line wrap: on
line diff
--- a/make/Help.gmk	Tue Oct 16 09:54:28 2018 -0400
+++ b/make/Help.gmk	Tue Oct 16 09:55:30 2018 -0400
@@ -119,7 +119,7 @@
 run-test-prebuilt:
 	@( cd $(topdir) && \
 	    $(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
-	    run-test-prebuilt TEST="$(TEST)" )
+	    run-test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
 
 ALL_GLOBAL_TARGETS := help print-configurations run-test-prebuilt
 
--- a/make/RunTests.gmk	Tue Oct 16 09:54:28 2018 -0400
+++ b/make/RunTests.gmk	Tue Oct 16 09:55:30 2018 -0400
@@ -45,8 +45,8 @@
 endif
 
 $(eval $(call ParseKeywordVariable, TEST_OPTS, \
-    KEYWORDS := JOBS TIMEOUT, \
-    STRING_KEYWORDS := VM_OPTIONS, \
+    SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR, \
+    STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
 ))
 
 # Helper function to propagate TEST_OPTS values.
@@ -104,22 +104,50 @@
 GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS)))
 
 ################################################################################
+# Setup global test running parameters
+################################################################################
+
+# Each factor variable comes in 3 variants. The first one is reserved for users
+# to use on command line. The other two are for predifined configurations in JDL
+# and for machine specific configurations respectively.
+TEST_JOBS_FACTOR ?= 1
+TEST_JOBS_FACTOR_JDL ?= 1
+TEST_JOBS_FACTOR_MACHINE ?= 1
+
+ifeq ($(TEST_JOBS), 0)
+  # Concurrency based on min(cores / 2, 12) * TEST_JOBS_FACTOR
+  TEST_JOBS := $(shell $(AWK) \
+    'BEGIN { \
+      c = $(NUM_CORES) / 2; \
+      if (c > 12) c = 12; \
+      c = c * $(TEST_JOBS_FACTOR); \
+      c = c * $(TEST_JOBS_FACTOR_JDL); \
+      c = c * $(TEST_JOBS_FACTOR_MACHINE); \
+      if (c < 1) c = 1; \
+      printf "%.0f", c; \
+    }')
+endif
+
+################################################################################
 # Parse control variables
 ################################################################################
 
 ifneq ($(TEST_OPTS), )
   # Inform the user
   $(info Running tests using TEST_OPTS control variable '$(TEST_OPTS)')
-
-  $(eval $(call SetTestOpt,VM_OPTIONS,JTREG))
-  $(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
-
-  $(eval $(call SetTestOpt,JOBS,JTREG))
-  $(eval $(call SetTestOpt,TIMEOUT,JTREG))
 endif
 
+$(eval $(call SetTestOpt,VM_OPTIONS,JTREG))
+$(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG))
+$(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
+$(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
+
+$(eval $(call SetTestOpt,JOBS,JTREG))
+$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
+
 $(eval $(call ParseKeywordVariable, JTREG, \
-    KEYWORDS := JOBS TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM, \
+    SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \
+        EXTRA_PROBLEM_LISTS KEYWORDS, \
     STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
 ))
 
@@ -129,8 +157,8 @@
 endif
 
 $(eval $(call ParseKeywordVariable, GTEST, \
-    KEYWORDS := REPEAT, \
-    STRING_KEYWORDS := OPTIONS VM_OPTIONS, \
+    SINGLE_KEYWORDS := REPEAT, \
+    STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
 ))
 
 ifneq ($(GTEST), )
@@ -143,17 +171,6 @@
 # Component-specific Jtreg settings
 ################################################################################
 
-ifeq ($(TEST_JOBS), 0)
-  # If TEST_JOBS is not specified, hotspot fallback default is
-  # min(num_cores / 2, 12).
-  hotspot_JTREG_JOBS := $(shell $(EXPR) $(NUM_CORES) / 2)
-  ifeq ($(hotspot_JTREG_JOBS), 0)
-    hotspot_JTREG_JOBS := 1
-  else ifeq ($(shell $(EXPR) $(hotspot_JTREG_JOBS) \> 12), 1)
-    hotspot_JTREG_JOBS := 12
-  endif
-endif
-
 hotspot_JTREG_MAX_MEM := 0
 hotspot_JTREG_ASSERT := false
 hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native
@@ -165,6 +182,8 @@
 nashorn_JTREG_PROBLEM_LIST += $(TOPDIR)/test/nashorn/ProblemList.txt
 hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
 
+langtools_JTREG_MAX_MEM := 768m
+
 ################################################################################
 # Parse test selection
 #
@@ -368,15 +387,16 @@
     $1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
   endif
 
-  run-test-$1:
+  run-test-$1: $(TEST_PREREQS)
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
 	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
 	    $$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
-	         -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
-	         --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
-	         $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
+	        -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
+	        --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
+	        $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
+	        $$($1_GTEST_JAVA_OPTIONS) \
 	        > >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \
 	    && $$(ECHO) $$$$? > $$($1_EXITCODE) \
 	    || $$(ECHO) $$$$? > $$($1_EXITCODE) \
@@ -447,12 +467,11 @@
 
   $1_TEST_NAME := $$(strip $$(patsubst jtreg:%, %, $$($1_TEST)))
 
-  $1_COMPONENT := \
+  $1_TEST_ROOT := \
       $$(strip $$(foreach root, $$(JTREG_TESTROOTS), \
-        $$(if $$(filter $$(root)%, $$(JTREG_TOPDIR)/$$($1_TEST_NAME)), \
-          $$(lastword $$(subst /, $$(SPACE), $$(root))) \
-        ) \
+        $$(if $$(filter $$(root)%, $$(JTREG_TOPDIR)/$$($1_TEST_NAME)), $$(root)) \
       ))
+  $1_COMPONENT := $$(lastword $$(subst /, $$(SPACE), $$($1_TEST_ROOT)))
   # This will work only as long as just hotspot has the additional "jtreg" directory
   ifeq ($$($1_COMPONENT), jtreg)
     $1_COMPONENT := hotspot
@@ -475,11 +494,12 @@
   $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
   $$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
 
+  # Only the problem list for the current test root should be used.
+  $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
+
   ifneq ($(TEST_JOBS), 0)
-    # User has specified TEST_JOBS, use that as fallback default
     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
   else
-    # Use JOBS as default (except for hotspot)
     $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
   endif
 
@@ -487,7 +507,7 @@
   # we may end up with a lot of JVM's
   $1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
 
-  JTREG_TIMEOUT ?= 4
+  JTREG_TIMEOUT_FACTOR ?= 4
   JTREG_VERBOSE ?= fail,error,summary
   JTREG_RETAIN ?= fail,error
 
@@ -498,10 +518,10 @@
 
   $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
       -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
-      -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT) \
+      -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
       -vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
 
-  $1_JTREG_BASIC_OPTIONS += -automatic -keywords:\!ignore -ignore:quiet
+  $1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
 
   # Make it possible to specify the JIB_DATA_DIR for tests using the
   # JIB Artifact resolver
@@ -531,6 +551,14 @@
     $1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$($1_JTREG_PROBLEM_LIST))
   endif
 
+  ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
+    # Accept both absolute paths as well as relative to the current test root.
+    $1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$(wildcard \
+        $$(JTREG_EXTRA_PROBLEM_LISTS) \
+        $$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_EXTRA_PROBLEM_LISTS)) \
+    ))
+  endif
+
   ifneq ($$(JIB_HOME), )
     $1_JTREG_BASIC_OPTIONS += -e:JIB_HOME=$$(JIB_HOME)
   endif
@@ -541,10 +569,21 @@
     $1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
   endif
 
+  ifneq ($$(JTREG_KEYWORDS), )
+    # The keywords string may contain problematic characters and may be quoted
+    # already when it arrives here. Remove any existing quotes and replace them
+    # with one set of single quotes.
+    $1_JTREG_KEYWORDS := \
+        $$(strip $$(subst $$(SQUOTE),,$$(subst $$(DQUOTE),,$$(JTREG_KEYWORDS))))
+    ifneq ($$($1_JTREG_KEYWORDS), )
+      $1_JTREG_BASIC_OPTIONS += -k:'$$($1_JTREG_KEYWORDS)'
+    endif
+  endif
+
   clean-workdir-$1:
 	$$(RM) -r $$($1_TEST_SUPPORT_DIR)
 
-  run-test-$1: clean-workdir-$1
+  run-test-$1: clean-workdir-$1 $(TEST_PREREQS)
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
@@ -631,7 +670,7 @@
     $$(error Invalid special test specification: $$($1_TEST_NAME))
   endif
 
-  run-test-$1:
+  run-test-$1: $(TEST_PREREQS)
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
--- a/make/RunTestsPrebuilt.gmk	Tue Oct 16 09:54:28 2018 -0400
+++ b/make/RunTestsPrebuilt.gmk	Tue Oct 16 09:55:30 2018 -0400
@@ -49,10 +49,11 @@
 # given.
 # Note: No spaces are allowed around the arguments.
 #
-# $1: The name of the argument
+# $1: The name of the variable
 # $2: The default value, if any, or OPTIONAL (do not provide a default but
 #     do not exit if it is missing)
 # $3: If NO_CHECK, disable checking for target file/directory existence
+#     If MKDIR, create the default directory
 define SetupVariable
   ifeq ($$($1), )
     ifeq ($2, )
@@ -75,10 +76,17 @@
   endif
   # If $1 has a value (is not optional), and $3 is not set (to NO_CHECK),
   # and if wildcard is empty, then complain that the file is missing.
-  ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1)) $3), )
-    $$(info Error: Prebuilt variable $1 points to missing file/directory:)
-    $$(info '$$($1)')
-    $$(error Cannot continue.)
+  ifeq ($3, MKDIR)
+    ifneq ($$(findstring $$(LOG), info debug trace), )
+      $$(info Creating directory for $1)
+    endif
+    $$(shell mkdir -p $$($1))
+  else ifneq ($3, NO_CHECK)
+    ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1))), )
+      $$(info Error: Prebuilt variable $1 points to missing file/directory:)
+      $$(info '$$($1)')
+      $$(error Cannot continue.)
+    endif
   endif
 endef
 
@@ -106,14 +114,14 @@
 # Verify that user has given correct additional input.
 
 # These variables are absolutely necessary
-$(eval $(call SetupVariable,OUTPUTDIR))
+$(eval $(call SetupVariable,OUTPUTDIR,$(TOPDIR)/build/run-test-prebuilt,MKDIR))
 $(eval $(call SetupVariable,BOOT_JDK))
 $(eval $(call SetupVariable,JT_HOME))
 
 # These can have default values based on the ones above
 $(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
 $(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
-$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols))
+$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols,NO_CHECK))
 
 # Provide default values for tools that we need
 $(eval $(call SetupVariable,MAKE,make,NO_CHECK))
@@ -202,8 +210,8 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
   ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
-    $$(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
-    $$(error Cannot continue.)
+    $(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
+    $(error Cannot continue.)
   endif
   FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
   PATH_SEP:=;
@@ -214,15 +222,17 @@
 
 # Check number of cores
 ifeq ($(OPENJDK_TARGET_OS), linux)
-    NUM_CORES := $(shell $(CAT) /proc/cpuinfo  | $(GREP) -c processor)
+  NUM_CORES := $(shell $(CAT) /proc/cpuinfo  | $(GREP) -c processor)
 else ifeq ($(OPENJDK_TARGET_OS), macosx)
-    NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
+  NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
 else ifeq ($(OPENJDK_TARGET_OS), solaris)
-    NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
+  NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
 else ifeq ($(OPENJDK_TARGET_OS), windows)
-    NUM_CORES := $(NUMBER_OF_PROCESSORS)
-else
-    NUM_CORES := 1
+  NUM_CORES := $(NUMBER_OF_PROCESSORS)
+endif
+ifeq ($(NUM_CORES), )
+  $(warn Could not find number of CPUs, assuming 1)
+  NUM_CORES := 1
 endif
 
 ################################################################################
@@ -276,9 +286,6 @@
 	@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
 	@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
 	    TEST="$(TEST)"
-	@if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
-	  exit 1 ; \
-	fi
 
 all: run-test-prebuilt
 
--- a/make/RunTestsPrebuiltSpec.gmk	Tue Oct 16 09:54:28 2018 -0400
+++ b/make/RunTestsPrebuiltSpec.gmk	Tue Oct 16 09:55:30 2018 -0400
@@ -124,7 +124,7 @@
 JMOD := $(FIXPATH) $(JMOD_CMD)
 JARSIGNER := $(FIXPATH) $(JARSIGNER_CMD)
 
-BUILD_JAVA := $(JAVA)
+BUILD_JAVA := $(JDK_IMAGE_DIR)/bin/JAVA
 ################################################################################
 # Some common tools. Assume most common name and no path.
 AWK := awk
@@ -172,3 +172,13 @@
 EXPR := expr
 FILE := file
 HG := hg
+
+# On Solaris gnu versions of some tools are required.
+ifeq ($(OPENJDK_BUILD_OS), solaris)
+  AWK := gawk
+  GREP := ggrep
+  EGREP := ggrep -E
+  FGREP := grep -F
+  SED := gsed
+  TAR := gtar
+endif
--- a/make/common/MakeBase.gmk	Tue Oct 16 09:54:28 2018 -0400
+++ b/make/common/MakeBase.gmk	Tue Oct 16 09:55:30 2018 -0400
@@ -842,7 +842,7 @@
 # Parameter 1 is the name of the rule, and is also the name of the variable.
 #
 # Remaining parameters are named arguments. These include:
-#   KEYWORDS          A list of valid keywords
+#   SINGLE_KEYWORDS   A list of valid keywords with single string values
 #   STRING_KEYWORDS   A list of valid keywords, processed as string. This means
 #       that '%20' will be replaced by ' ' to allow for multi-word strings.
 #
@@ -856,7 +856,7 @@
       $$(eval mangled_part_eval := $$(call DoubleDollar, $$(mangled_part))) \
       $$(eval part := $$$$(subst ||||,$$$$(SPACE),$$$$(mangled_part_eval))) \
       $$(eval $1_NO_MATCH := true) \
-      $$(foreach keyword, $$($1_KEYWORDS), \
+      $$(foreach keyword, $$($1_SINGLE_KEYWORDS), \
         $$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
         $$(if $$(filter $$(keyword)=%, $$(part)), \
           $$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part)))) \
@@ -871,11 +871,11 @@
         ) \
       ) \
       $$(if $$($1_NO_MATCH), \
-        $$(if $$(filter $$(part), $$($1_KEYWORDS) $$($1_STRING_KEYWORDS)), \
+        $$(if $$(filter $$(part), $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS)), \
           $$(info Keyword $$(part) for $1 needs to be assigned a value.) \
         , \
           $$(info $$(part) is not a valid keyword for $1.) \
-          $$(info Valid keywords: $$($1_KEYWORDS) $$($1_STRING_KEYWORDS).) \
+          $$(info Valid keywords: $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS).) \
         ) \
         $$(error Cannot continue) \
       ) \
--- a/make/common/NativeCompilation.gmk	Tue Oct 16 09:54:28 2018 -0400
+++ b/make/common/NativeCompilation.gmk	Tue Oct 16 09:55:30 2018 -0400
@@ -67,7 +67,6 @@
 # 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))
@@ -76,8 +75,7 @@
       "directory": "$(strip $2)"$(COMMA) \
       "file": "$(strip $3)"$(COMMA) \
       "command": "$(strip $(subst $(DQUOTE),\$(DQUOTE),$(subst \,\\,\
-        $(subst $(FIXPATH),,$4))))"$(COMMA) \
-      "output": "$(strip $5)" \
+        $(subst $(FIXPATH),,$4))))" \
     }$(COMMA), \
     $1)
 endef
@@ -331,7 +329,7 @@
 
     $$($1_OBJ_JSON): $$($1_OBJ_DEPS)
 	$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$($1_SRC_FILE), \
-	    $$($1_COMPILER) $$($1_COMPILE_OPTIONS), $$($1_OBJ))
+	    $$($1_COMPILER) $$($1_COMPILE_OPTIONS))
 
     $$($1_OBJ): $$($1_OBJ_DEPS) | $$($$($1_BASE)_BUILD_INFO)
 	$$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME)))
@@ -744,7 +742,7 @@
 
         $$($1_PCH_FILE_JSON): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
 		$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$<, \
-		    $$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE), $$($1_PCH_FILE))
+		    $$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE))
       endif
     endif
   endif
--- a/make/conf/jib-profiles.js	Tue Oct 16 09:54:28 2018 -0400
+++ b/make/conf/jib-profiles.js	Tue Oct 16 09:55:30 2018 -0400
@@ -755,16 +755,15 @@
         "run-test-prebuilt": {
             target_os: input.build_os,
             target_cpu: input.build_cpu,
+            dependencies: [ "jtreg", "gnumake", "boot_jdk", "jib", testedProfile + ".jdk",
+                testedProfile + ".test"
+            ],
             src: "src.conf",
-            dependencies: [ "jtreg", "gnumake", "boot_jdk", "jib", testedProfile + ".jdk",
-                testedProfile + ".test", "src.full"
-            ],
-            work_dir: input.get("src.full", "install_path") + "/test",
+            make_args: [ "run-test-prebuilt", "LOG_CMDLINES=true" ],
             environment: {
-                "JT_JAVA": common.boot_jdk_home,
-                "PRODUCT_HOME": input.get(testedProfile + ".jdk", "home_path"),
-                "TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path"),
-                "TEST_OUTPUT_DIR": input.src_top_dir
+                "BOOT_JDK": common.boot_jdk_home,
+                "JDK_IMAGE_DIR": input.get(testedProfile + ".jdk", "home_path"),
+                "TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path")
             },
             labels: "test"
         }
@@ -802,13 +801,34 @@
         windowsRunTestPrebuiltExtra = {
             dependencies: [ testedProfile + ".jdk_symbols" ],
             environment: {
-                "PRODUCT_SYMBOLS_HOME": input.get(testedProfile + ".jdk_symbols", "home_path"),
+                "SYMBOLS_IMAGE_DIR": input.get(testedProfile + ".jdk_symbols", "home_path"),
             }
         };
         profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
             windowsRunTestPrebuiltExtra);
     }
 
+    // The profile run-test-prebuilt defines src.conf as the src bundle. When
+    // running in Mach 5, this reduces the time it takes to populate the
+    // considerably. But with just src.conf, we cannot actually run any tests,
+    // so if running from a workspace with just src.conf in it, we need to also
+    // get src.full as a dependency, and define the work_dir (where make gets
+    // run) to be in the src.full install path. By running in the install path,
+    // the same cached installation of the full src can be reused for multiple
+    // test tasks. Care must however be taken not to polute that work dir by
+    // setting the appropriate make variables to control output directories.
+    //
+    // Use the existance of the top level README as indication of if this is
+    // the full source or just src.conf.
+    if (!new java.io.File(__DIR__, "../../README").exists()) {
+        var runTestPrebuiltSrcFullExtra = {
+            dependencies: "src.full",
+            work_dir: input.get("src.full", "install_path"),
+        }
+        profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
+            runTestPrebuiltSrcFullExtra);
+    }
+
     // Generate the missing platform attributes
     profiles = generatePlatformAttributes(profiles);
     profiles = generateDefaultMakeTargetsConfigureArg(common, profiles);
@@ -835,7 +855,7 @@
                     : "gcc7.3.0-Fedora27+1.0"),
         linux_arm: (input.profile != null && input.profile.indexOf("hflt") >= 0
                     ? "gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0"
-                    : (input.profile.indexOf("arm32") >= 0
+                    : (input.profile != null && input.profile.indexOf("arm32") >= 0
                        ? "gcc7.3.0-Fedora27+1.0"
                        : "arm-linaro-4.7+1.0"
                        )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+  ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+  ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+  ShouldNotReachHere();
+  return false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/arm/gc/shared/barrierSetNMethod_arm.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+  ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+  ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+  ShouldNotReachHere();
+  return false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetNMethod_ppc.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+  ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+  ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+  ShouldNotReachHere();
+  return false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+  ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+  ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+  ShouldNotReachHere();
+  return false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/sparc/gc/shared/barrierSetNMethod_sparc.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+  ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+  ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+  ShouldNotReachHere();
+  return false;
+}
--- a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -26,6 +26,8 @@
 #include "c1/c1_MacroAssembler.hpp"
 #include "c1/c1_Runtime1.hpp"
 #include "classfile/systemDictionary.hpp"
+#include "gc/shared/barrierSet.hpp"
+#include "gc/shared/barrierSetAssembler.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "interpreter/interpreter.hpp"
 #include "oops/arrayOop.hpp"
@@ -330,6 +332,9 @@
   }
 #endif // TIERED
   decrement(rsp, frame_size_in_bytes); // does not emit code for frame_size == 0
+
+  BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  bs->nmethod_entry_barrier(this);
 }
 
 
--- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,7 +23,9 @@
  */
 
 #include "precompiled.hpp"
+#include "gc/shared/barrierSet.hpp"
 #include "gc/shared/barrierSetAssembler.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "interpreter/interp_masm.hpp"
 #include "runtime/jniHandles.hpp"
@@ -322,3 +324,22 @@
   __ adcl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())+4), 0);
 #endif
 }
+
+void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) {
+  BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+  if (bs_nm == NULL) {
+    return;
+  }
+#ifndef _LP64
+  ShouldNotReachHere();
+#else
+  Label continuation;
+  Register thread = LP64_ONLY(r15_thread);
+  Address disarmed_addr(thread, in_bytes(bs_nm->thread_disarmed_offset()));
+  __ align(8);
+  __ cmpl(disarmed_addr, 0);
+  __ jcc(Assembler::equal, continuation);
+  __ call(RuntimeAddress(StubRoutines::x86::method_entry_barrier()));
+  __ bind(continuation);
+#endif
+}
--- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -83,6 +83,8 @@
                              Label& slow_case);
 
   virtual void barrier_stubs_init() {}
+
+  virtual void nmethod_entry_barrier(MacroAssembler* masm);
 };
 
 #endif // CPU_X86_GC_SHARED_BARRIERSETASSEMBLER_X86_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetNMethod_x86.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nativeInst.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "logging/log.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/align.hpp"
+#include "utilities/debug.hpp"
+
+class NativeNMethodCmpBarrier: public NativeInstruction {
+public:
+  enum Intel_specific_constants {
+    instruction_code        = 0x81,
+    instruction_size        = 8,
+    imm_offset              = 4,
+    instruction_rex_prefix  = Assembler::REX | Assembler::REX_B,
+    instruction_modrm       = 0x7f  // [r15 + offset]
+  };
+
+  address instruction_address() const { return addr_at(0); }
+  address immediate_address() const { return addr_at(imm_offset); }
+
+  jint get_immedate() const { return int_at(imm_offset); }
+  void set_immediate(jint imm) { set_int_at(imm_offset, imm); }
+  void verify() const;
+};
+
+void NativeNMethodCmpBarrier::verify() const {
+  if (((uintptr_t) instruction_address()) & 0x7) {
+    fatal("Not properly aligned");
+  }
+
+  int prefix = ubyte_at(0);
+  if (prefix != instruction_rex_prefix) {
+    tty->print_cr("Addr: " INTPTR_FORMAT " Prefix: 0x%x", p2i(instruction_address()),
+        prefix);
+    fatal("not a cmp barrier");
+  }
+
+  int inst = ubyte_at(1);
+  if (inst != instruction_code) {
+    tty->print_cr("Addr: " INTPTR_FORMAT " Code: 0x%x", p2i(instruction_address()),
+        inst);
+    fatal("not a cmp barrier");
+  }
+
+  int modrm = ubyte_at(2);
+  if (modrm != instruction_modrm) {
+    tty->print_cr("Addr: " INTPTR_FORMAT " mod/rm: 0x%x", p2i(instruction_address()),
+        modrm);
+    fatal("not a cmp barrier");
+  }
+}
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+  /*
+   * [ callers frame          ]
+   * [ callers return address ] <- callers rsp
+   * [ callers rbp            ] <- callers rbp
+   * [ callers frame slots    ]
+   * [ return_address         ] <- return_address_ptr
+   * [ cookie ]                 <- used to write the new rsp (callers rsp)
+   * [ stub rbp ]
+   * [ stub stuff             ]
+   */
+
+  address* stub_rbp = return_address_ptr - 2;
+  address* callers_rsp = return_address_ptr + nm->frame_size(); /* points to callers return_address now */
+  address* callers_rbp = callers_rsp - 1; // 1 to move to the callers return address, 1 more to move to the rbp
+  address* cookie = return_address_ptr - 1;
+
+  LogTarget(Trace, nmethod, barrier) out;
+  if (out.is_enabled()) {
+    Thread* thread = Thread::current();
+    assert(thread->is_Java_thread(), "must be JavaThread");
+    JavaThread* jth = (JavaThread*) thread;
+    ResourceMark mark;
+    log_trace(nmethod, barrier)("deoptimize(nmethod: %p, return_addr: %p, osr: %d, thread: %p(%s), making rsp: %p) -> %p",
+                               nm, (address *) return_address_ptr, nm->is_osr_method(), jth,
+                               jth->get_thread_name(), callers_rsp, nm->verified_entry_point());
+  }
+
+  assert(nm->frame_size() >= 3, "invariant");
+  assert(*cookie == (address) -1, "invariant");
+
+  // Preserve caller rbp.
+  *stub_rbp = *callers_rbp;
+
+  // At the cookie address put the callers rsp.
+  *cookie = (address) callers_rsp; // should point to the return address
+
+  // In the slot that used to be the callers rbp we put the address that our stub needs to jump to at the end.
+  // Overwriting the caller rbp should be okay since our stub rbp has the same value.
+  address* jmp_addr_ptr = callers_rbp;
+  *jmp_addr_ptr = SharedRuntime::get_handle_wrong_method_stub();
+}
+
+// This is the offset of the entry barrier from where the frame is completed.
+// If any code changes between the end of the verified entry where the entry
+// barrier resides, and the completion of the frame, then
+// NativeNMethodCmpBarrier::verify() will immediately complain when it does
+// not find the expected native instruction at this offset, which needs updating.
+// Note that this offset is invariant of PreserveFramePointer.
+static const int entry_barrier_offset = -19;
+
+static NativeNMethodCmpBarrier* native_nmethod_barrier(nmethod* nm) {
+  address barrier_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset;
+  NativeNMethodCmpBarrier* barrier = reinterpret_cast<NativeNMethodCmpBarrier*>(barrier_address);
+  debug_only(barrier->verify());
+  return barrier;
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+  if (!supports_entry_barrier(nm)) {
+    return;
+  }
+
+  NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
+  cmp->set_immediate(disarmed_value());
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+  if (!supports_entry_barrier(nm)) {
+    return false;
+  }
+
+  NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
+  return (disarmed_value() != cmp->get_immedate());
+}
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -5453,7 +5453,7 @@
 #endif // _LP64
 
 // C2 compiled method's prolog code.
-void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b) {
+void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b, bool is_stub) {
 
   // WARNING: Initial instruction MUST be 5 bytes or longer so that
   // NativeJump::patch_verified_entry will be able to patch out the entry
@@ -5535,6 +5535,10 @@
   }
 #endif
 
+  if (!is_stub) {
+    BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+    bs->nmethod_entry_barrier(this);
+  }
 }
 
 // clear memory of size 'cnt' qwords, starting at 'base' using XMM/YMM registers
--- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -1588,7 +1588,7 @@
   void movl2ptr(Register dst, Register src) { LP64_ONLY(movslq(dst, src)) NOT_LP64(if (dst != src) movl(dst, src)); }
 
   // C2 compiled method's prolog code.
-  void verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b);
+  void verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b, bool is_stub);
 
   // clear memory of size 'cnt' qwords, starting at 'base';
   // if 'is_large' is set, do not try to produce short loop
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -2160,6 +2160,9 @@
   // -2 because return address is already present and so is saved rbp
   __ subptr(rsp, stack_size - 2*wordSize);
 
+  BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  bs->nmethod_entry_barrier(masm);
+
   // Frame is now completed as far as size and linkage.
   int frame_complete = ((intptr_t)__ pc()) - start;
 
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -28,6 +28,7 @@
 #include "ci/ciUtilities.hpp"
 #include "gc/shared/barrierSet.hpp"
 #include "gc/shared/barrierSetAssembler.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
 #include "interpreter/interpreter.hpp"
 #include "nativeInst_x86.hpp"
 #include "oops/instanceOop.hpp"
@@ -5194,6 +5195,83 @@
     return start;
   }
 
+  address generate_method_entry_barrier() {
+    __ align(CodeEntryAlignment);
+    StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier");
+
+    Label deoptimize_label;
+
+    address start = __ pc();
+
+    __ push(-1); // cookie, this is used for writing the new rsp when deoptimizing
+
+    BLOCK_COMMENT("Entry:");
+    __ enter(); // save rbp
+
+    // save c_rarg0, because we want to use that value.
+    // We could do without it but then we depend on the number of slots used by pusha
+    __ push(c_rarg0);
+
+    __ lea(c_rarg0, Address(rsp, wordSize * 3)); // 1 for cookie, 1 for rbp, 1 for c_rarg0 - this should be the return address
+
+    __ pusha();
+
+    // The method may have floats as arguments, and we must spill them before calling
+    // the VM runtime.
+    assert(Argument::n_float_register_parameters_j == 8, "Assumption");
+    const int xmm_size = wordSize * 2;
+    const int xmm_spill_size = xmm_size * Argument::n_float_register_parameters_j;
+    __ subptr(rsp, xmm_spill_size);
+    __ movdqu(Address(rsp, xmm_size * 7), xmm7);
+    __ movdqu(Address(rsp, xmm_size * 6), xmm6);
+    __ movdqu(Address(rsp, xmm_size * 5), xmm5);
+    __ movdqu(Address(rsp, xmm_size * 4), xmm4);
+    __ movdqu(Address(rsp, xmm_size * 3), xmm3);
+    __ movdqu(Address(rsp, xmm_size * 2), xmm2);
+    __ movdqu(Address(rsp, xmm_size * 1), xmm1);
+    __ movdqu(Address(rsp, xmm_size * 0), xmm0);
+
+    __ call_VM_leaf(CAST_FROM_FN_PTR(address, static_cast<int (*)(address*)>(BarrierSetNMethod::nmethod_stub_entry_barrier)), 1);
+
+    __ movdqu(xmm0, Address(rsp, xmm_size * 0));
+    __ movdqu(xmm1, Address(rsp, xmm_size * 1));
+    __ movdqu(xmm2, Address(rsp, xmm_size * 2));
+    __ movdqu(xmm3, Address(rsp, xmm_size * 3));
+    __ movdqu(xmm4, Address(rsp, xmm_size * 4));
+    __ movdqu(xmm5, Address(rsp, xmm_size * 5));
+    __ movdqu(xmm6, Address(rsp, xmm_size * 6));
+    __ movdqu(xmm7, Address(rsp, xmm_size * 7));
+    __ addptr(rsp, xmm_spill_size);
+
+    __ cmpl(rax, 1); // 1 means deoptimize
+    __ jcc(Assembler::equal, deoptimize_label);
+
+    __ popa();
+    __ pop(c_rarg0);
+
+    __ leave();
+
+    __ addptr(rsp, 1 * wordSize); // cookie
+    __ ret(0);
+
+
+    __ BIND(deoptimize_label);
+
+    __ popa();
+    __ pop(c_rarg0);
+
+    __ leave();
+
+    // this can be taken out, but is good for verification purposes. getting a SIGSEGV
+    // here while still having a correct stack is valuable
+    __ testptr(rsp, Address(rsp, 0));
+
+    __ movptr(rsp, Address(rsp, 0)); // new rsp was written in the barrier
+    __ jmp(Address(rsp, -1 * wordSize)); // jmp target should be callers verified_entry_point
+
+    return start;
+  }
+
    /**
    *  Arguments:
    *
@@ -5831,6 +5909,11 @@
     generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry,
                                                        &StubRoutines::_safefetchN_fault_pc,
                                                        &StubRoutines::_safefetchN_continuation_pc);
+
+    BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+    if (bs_nm != NULL) {
+      StubRoutines::x86::_method_entry_barrier = generate_method_entry_barrier();
+    }
 #ifdef COMPILER2
     if (UseMultiplyToLenIntrinsic) {
       StubRoutines::_multiplyToLen = generate_multiplyToLen();
--- a/src/hotspot/cpu/x86/stubRoutines_x86.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -55,8 +55,14 @@
   static address _double_sign_mask;
   static address _double_sign_flip;
 
+  static address _method_entry_barrier;
+
  public:
 
+  static address method_entry_barrier() {
+    return _method_entry_barrier;
+  }
+
   static address get_previous_fp_entry() {
     return _get_previous_fp_entry;
   }
--- a/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -42,3 +42,4 @@
 address StubRoutines::x86::_float_sign_flip = NULL;
 address StubRoutines::x86::_double_sign_mask = NULL;
 address StubRoutines::x86::_double_sign_flip = NULL;
+address StubRoutines::x86::_method_entry_barrier = NULL;
--- a/src/hotspot/cpu/x86/x86_64.ad	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/x86_64.ad	Tue Oct 16 09:55:30 2018 -0400
@@ -890,6 +890,15 @@
     st->print("# stack alignment check");
 #endif
   }
+  if (C->stub_function() != NULL && BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
+    st->print("\n\t");
+    st->print("cmpl    [r15_thread + #disarmed_offset], #disarmed_value\t");
+    st->print("\n\t");
+    st->print("je      fast_entry\t");
+    st->print("\n\t");
+    st->print("call    #nmethod_entry_barrier_stub\t");
+    st->print("\n\tfast_entry:");
+  }
   st->cr();
 }
 #endif
@@ -901,7 +910,7 @@
   int framesize = C->frame_size_in_bytes();
   int bangsize = C->bang_size_in_bytes();
 
-  __ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, false);
+  __ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, false, C->stub_function() != NULL);
 
   C->set_frame_complete(cbuf.insts_size());
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/zero/gc/shared/barrierSetNMethod_zero.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+  ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+  ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+  ShouldNotReachHere();
+  return false;
+}
--- a/src/hotspot/share/classfile/classLoaderData.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderData.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -139,7 +139,7 @@
   // it from being unloaded during parsing of the unsafe anonymous class.
   // The null-class-loader should always be kept alive.
   _keep_alive((is_unsafe_anonymous || h_class_loader.is_null()) ? 1 : 0),
-  _claimed(0),
+  _claim(0),
   _handles(),
   _klasses(NULL), _packages(NULL), _modules(NULL), _unnamed_module(NULL), _dictionary(NULL),
   _jmethod_ids(NULL),
@@ -268,12 +268,17 @@
 }
 #endif // PRODUCT
 
-bool ClassLoaderData::claim() {
-  if (_claimed == 1) {
-    return false;
+bool ClassLoaderData::try_claim(int claim) {
+  for (;;) {
+    int old_claim = Atomic::load(&_claim);
+    if ((old_claim & claim) == claim) {
+      return false;
+    }
+    int new_claim = old_claim | claim;
+    if (Atomic::cmpxchg(new_claim, &_claim, old_claim) == old_claim) {
+      return true;
+    }
   }
-
-  return (int) Atomic::cmpxchg(1, &_claimed, 0) == 0;
 }
 
 // Unsafe anonymous classes have their own ClassLoaderData that is marked to keep alive
@@ -295,8 +300,8 @@
   }
 }
 
-void ClassLoaderData::oops_do(OopClosure* f, bool must_claim, bool clear_mod_oops) {
-  if (must_claim && !claim()) {
+void ClassLoaderData::oops_do(OopClosure* f, int claim_value, bool clear_mod_oops) {
+  if (claim_value != ClassLoaderData::_claim_none && !try_claim(claim_value)) {
     return;
   }
 
--- a/src/hotspot/share/classfile/classLoaderData.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderData.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -128,9 +128,8 @@
                            // loader. _keep_alive does not need to be volatile or
                            // atomic since there is one unique CLD per unsafe anonymous class.
 
-  volatile int _claimed;   // true if claimed, for example during GC traces.
-                           // To avoid applying oop closure more than once.
-                           // Has to be an int because we cas it.
+  volatile int _claim; // non-zero if claimed, for example during GC traces.
+                       // To avoid applying oop closure more than once.
   ChunkedHandleList _handles; // Handles to constant pool arrays, Modules, etc, which
                               // have the same life cycle of the corresponding ClassLoader.
 
@@ -200,11 +199,22 @@
   Dictionary* create_dictionary();
 
   void initialize_name(Handle class_loader);
+
  public:
   // GC interface.
-  void clear_claimed() { _claimed = 0; }
-  bool claimed() const { return _claimed == 1; }
-  bool claim();
+
+  // The "claim" is typically used to check if oops_do needs to be applied on
+  // the CLD or not. Most GCs only perform strong marking during the marking phase.
+  enum {
+    _claim_none        = 0,
+    _claim_finalizable = 2,
+    _claim_strong      = 3
+  };
+  void clear_claim() { _claim = 0; }
+  bool claimed() const { return _claim != 0; }
+  bool try_claim(int claim);
+  int get_claim() const { return _claim; }
+  void set_claim(int claim) { _claim = claim; }
 
   // Computes if the CLD is alive or not. This is safe to call in concurrent
   // contexts.
@@ -264,7 +274,7 @@
 
   void initialize_holder(Handle holder);
 
-  void oops_do(OopClosure* f, bool must_claim, bool clear_modified_oops = false);
+  void oops_do(OopClosure* f, int claim_value, bool clear_modified_oops = false);
 
   void classes_do(KlassClosure* klass_closure);
   Klass* klasses() { return _klasses; }
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -48,7 +48,7 @@
 
 void ClassLoaderDataGraph::clear_claimed_marks() {
   for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
-    cld->clear_claimed();
+    cld->clear_claim();
   }
 }
 
@@ -231,14 +231,14 @@
 }
 
 void ClassLoaderDataGraph::cld_do(CLDClosure* cl) {
-  assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
+  assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
   for (ClassLoaderData* cld = _head;  cld != NULL; cld = cld->_next) {
     cl->do_cld(cld);
   }
 }
 
 void ClassLoaderDataGraph::cld_unloading_do(CLDClosure* cl) {
-  assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
+  assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
   // Only walk the head until any clds not purged from prior unloading
   // (CMS doesn't purge right away).
   for (ClassLoaderData* cld = _unloading; cld != _saved_unloading; cld = cld->next()) {
@@ -248,7 +248,7 @@
 }
 
 void ClassLoaderDataGraph::roots_cld_do(CLDClosure* strong, CLDClosure* weak) {
-  assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
+  assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
   for (ClassLoaderData* cld = _head;  cld != NULL; cld = cld->_next) {
     CLDClosure* closure = cld->keep_alive() ? strong : weak;
     if (closure != NULL) {
@@ -258,7 +258,7 @@
 }
 
 void ClassLoaderDataGraph::always_strong_cld_do(CLDClosure* cl) {
-  assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
+  assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
   if (ClassUnloading) {
     roots_cld_do(cl, NULL);
   } else {
--- a/src/hotspot/share/code/codeBlob.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/code/codeBlob.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -186,6 +186,7 @@
   bool contains(address addr) const              { return content_begin()      <= addr && addr < content_end();    }
   bool is_frame_complete_at(address addr) const  { return _frame_complete_offset != CodeOffsets::frame_never_safe &&
                                                           code_contains(addr) && addr >= code_begin() + _frame_complete_offset; }
+  int frame_complete_offset() const              { return _frame_complete_offset; }
 
   // CodeCache support: really only used by the nmethods, but in order to get
   // asserts and certain bookkeeping to work in the CodeCache they are defined
--- a/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -41,8 +41,7 @@
 }
 
 inline void MetadataVisitingOopsInGenClosure::do_cld(ClassLoaderData* cld) {
-  bool claim = true;  // Must claim the class loader data before processing.
-  cld->oops_do(this, claim);
+  cld->oops_do(this, ClassLoaderData::_claim_strong);
 }
 
 // Decode the oop and call do_oop on it.
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -2398,7 +2398,7 @@
  public:
   VerifyCLDOopsCLDClosure(CMSBitMap* bitmap) : _oop_closure(bitmap) {}
   void do_cld(ClassLoaderData* cld) {
-    cld->oops_do(&_oop_closure, false, false);
+    cld->oops_do(&_oop_closure, ClassLoaderData::_claim_none, false);
   }
 };
 
@@ -2413,7 +2413,7 @@
   // Mark from roots one level into CMS
   MarkRefsIntoVerifyClosure notOlder(_span, verification_mark_bm(),
                                      markBitMap());
-  CLDToOopClosure cld_closure(&notOlder, true);
+  CLDToOopClosure cld_closure(&notOlder, ClassLoaderData::_claim_strong);
 
   heap->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
 
@@ -2886,7 +2886,7 @@
       }
     } else {
       // The serial version.
-      CLDToOopClosure cld_closure(&notOlder, true);
+      CLDToOopClosure cld_closure(&notOlder, ClassLoaderData::_claim_strong);
       heap->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
 
       StrongRootsScope srs(1);
@@ -4269,7 +4269,7 @@
   _timer.reset();
   _timer.start();
 
-  CLDToOopClosure cld_closure(&par_mri_cl, true);
+  CLDToOopClosure cld_closure(&par_mri_cl, ClassLoaderData::_claim_strong);
 
   heap->cms_process_roots(_strong_roots_scope,
                           false,     // yg was scanned above
@@ -4331,7 +4331,7 @@
 class RemarkCLDClosure : public CLDClosure {
   CLDToOopClosure _cm_closure;
  public:
-  RemarkCLDClosure(OopClosure* oop_closure) : _cm_closure(oop_closure) {}
+  RemarkCLDClosure(OopClosure* oop_closure) : _cm_closure(oop_closure, ClassLoaderData::_claim_strong) {}
   void do_cld(ClassLoaderData* cld) {
     // Check if we have modified any oops in the CLD during the concurrent marking.
     if (cld->has_accumulated_modified_oops()) {
--- a/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -40,6 +40,7 @@
           make_barrier_set_assembler<BarrierSetAssembler>(),
           make_barrier_set_c1<BarrierSetC1>(),
           make_barrier_set_c2<BarrierSetC2>(),
+          NULL /* barrier_set_nmethod */,
           BarrierSet::FakeRtti(BarrierSet::EpsilonBarrierSet)) {};
 
 void EpsilonBarrierSet::on_thread_create(Thread *thread) {
--- a/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -108,7 +108,7 @@
   AlwaysTrueClosure always_alive;
   _weak_proc_task.work(worker_id, &always_alive, &_adjust);
 
-  CLDToOopClosure adjust_cld(&_adjust);
+  CLDToOopClosure adjust_cld(&_adjust, ClassLoaderData::_claim_strong);
   CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);
   _root_processor.process_all_roots(
       &_adjust,
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/classLoaderData.hpp"
 #include "gc/g1/g1FullGCMarker.inline.hpp"
 #include "gc/shared/referenceProcessor.hpp"
 #include "memory/iterator.inline.hpp"
@@ -36,7 +37,7 @@
     _mark_closure(worker_id, this, G1CollectedHeap::heap()->ref_processor_stw()),
     _verify_closure(VerifyOption_G1UseFullMarking),
     _stack_closure(this),
-    _cld_closure(mark_closure()) {
+    _cld_closure(mark_closure(), ClassLoaderData::_claim_strong) {
   _oop_stack.initialize();
   _objarray_stack.initialize();
 }
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -170,10 +170,10 @@
  public:
   VerifyCLDClosure(G1CollectedHeap* g1h, OopClosure* cl) : _young_ref_counter_closure(g1h), _oop_closure(cl) {}
   void do_cld(ClassLoaderData* cld) {
-    cld->oops_do(_oop_closure, false);
+    cld->oops_do(_oop_closure, ClassLoaderData::_claim_none);
 
     _young_ref_counter_closure.reset_count();
-    cld->oops_do(&_young_ref_counter_closure, false);
+    cld->oops_do(&_young_ref_counter_closure, ClassLoaderData::_claim_none);
     if (_young_ref_counter_closure.count() > 0) {
       guarantee(cld->has_modified_oops(), "CLD " PTR_FORMAT ", has young %d refs but is not dirty.", p2i(cld), _young_ref_counter_closure.count());
     }
--- a/src/hotspot/share/gc/g1/g1OopClosures.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1OopClosures.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -52,7 +52,7 @@
 
     // Clean the cld since we're going to scavenge all the metadata.
     // Clear modified oops only if this cld is claimed.
-    cld->oops_do(_closure, _must_claim, /*clear_modified_oops*/true);
+    cld->oops_do(_closure, _claim, /*clear_modified_oops*/true);
 
     _closure->set_scanned_cld(NULL);
 
--- a/src/hotspot/share/gc/g1/g1OopClosures.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1OopClosures.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -160,12 +160,12 @@
 class G1CLDScanClosure : public CLDClosure {
   G1ParCopyHelper* _closure;
   bool             _process_only_dirty;
-  bool             _must_claim;
+  int              _claim;
   int              _count;
 public:
   G1CLDScanClosure(G1ParCopyHelper* closure,
-                   bool process_only_dirty, bool must_claim)
-  : _closure(closure), _process_only_dirty(process_only_dirty), _must_claim(must_claim), _count(0) {}
+                   bool process_only_dirty, int claim_value)
+  : _closure(closure), _process_only_dirty(process_only_dirty), _claim(claim_value), _count(0) {}
   void do_cld(ClassLoaderData* cld);
 };
 
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -201,11 +201,11 @@
                                                   HeapWord * const obj_ptr) const {
   PLAB* alloc_buf = _plab_allocator->alloc_buffer(dest_state);
   if (alloc_buf->contains(obj_ptr)) {
-    _g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old->klass(), word_sz, age,
+    _g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old->klass(), word_sz * HeapWordSize, age,
                                                              dest_state.value() == InCSetState::Old,
                                                              alloc_buf->word_sz());
   } else {
-    _g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old->klass(), word_sz, age,
+    _g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old->klass(), word_sz * HeapWordSize, age,
                                                               dest_state.value() == InCSetState::Old);
   }
 }
--- a/src/hotspot/share/gc/g1/g1RootClosures.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1RootClosures.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -35,7 +35,7 @@
   G1EvacuationClosures(G1CollectedHeap* g1h,
                        G1ParScanThreadState* pss,
                        bool in_young_gc) :
-      _closures(g1h, pss, in_young_gc, /* must_claim_cld */ false) {}
+      _closures(g1h, pss, in_young_gc, /* cld_claim */ ClassLoaderData::_claim_none) {}
 
   OopClosure* weak_oops()   { return &_closures._oops; }
   OopClosure* strong_oops() { return &_closures._oops; }
@@ -73,8 +73,8 @@
 public:
   G1InitialMarkClosures(G1CollectedHeap* g1h,
                         G1ParScanThreadState* pss) :
-      _strong(g1h, pss, /* process_only_dirty_klasses */ false, /* must_claim_cld */ true),
-      _weak(g1h, pss,   /* process_only_dirty_klasses */ false, /* must_claim_cld */ true) {}
+      _strong(g1h, pss, /* process_only_dirty_klasses */ false, /* cld_claim */ ClassLoaderData::_claim_strong),
+      _weak(g1h, pss,   /* process_only_dirty_klasses */ false, /* cld_claim */ ClassLoaderData::_claim_strong) {}
 
   OopClosure* weak_oops()   { return &_weak._oops; }
   OopClosure* strong_oops() { return &_strong._oops; }
--- a/src/hotspot/share/gc/g1/g1SharedClosures.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1SharedClosures.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -39,9 +39,9 @@
   G1CLDScanClosure                _clds;
   G1CodeBlobClosure               _codeblobs;
 
-  G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty, bool must_claim_cld) :
+  G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty, int cld_claim) :
     _oops(g1h, pss),
     _oops_in_cld(g1h, pss),
-    _clds(&_oops_in_cld, process_only_dirty, must_claim_cld),
+    _clds(&_oops_in_cld, process_only_dirty, cld_claim),
     _codeblobs(&_oops) {}
 };
--- a/src/hotspot/share/gc/parallel/pcTasks.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/parallel/pcTasks.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -110,7 +110,7 @@
       break;
 
     case class_loader_data: {
-        CLDToOopClosure cld_closure(&mark_and_push_closure);
+        CLDToOopClosure cld_closure(&mark_and_push_closure, ClassLoaderData::_claim_strong);
         ClassLoaderDataGraph::always_strong_cld_do(&cld_closure);
       }
       break;
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -2213,7 +2213,7 @@
   Management::oops_do(&oop_closure);
   JvmtiExport::oops_do(&oop_closure);
   SystemDictionary::oops_do(&oop_closure);
-  CLDToOopClosure cld_closure(&oop_closure);
+  CLDToOopClosure cld_closure(&oop_closure, ClassLoaderData::_claim_strong);
   ClassLoaderDataGraph::cld_do(&cld_closure);
 
   // Now adjust pointers in remaining weak roots.  (All of which should
--- a/src/hotspot/share/gc/serial/defNewGeneration.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/serial/defNewGeneration.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -137,7 +137,7 @@
     _scavenge_closure->set_scanned_cld(cld);
 
     // Clean the cld since we're going to scavenge all the metadata.
-    cld->oops_do(_scavenge_closure, false, /*clear_modified_oops*/true);
+    cld->oops_do(_scavenge_closure, ClassLoaderData::_claim_none, /*clear_modified_oops*/true);
 
     _scavenge_closure->set_scanned_cld(NULL);
   }
--- a/src/hotspot/share/gc/serial/markSweep.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/serial/markSweep.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -58,9 +58,9 @@
 
 MarkSweep::FollowRootClosure  MarkSweep::follow_root_closure;
 
-MarkAndPushClosure            MarkSweep::mark_and_push_closure;
-CLDToOopClosure               MarkSweep::follow_cld_closure(&mark_and_push_closure);
-CLDToOopClosure               MarkSweep::adjust_cld_closure(&adjust_pointer_closure);
+MarkAndPushClosure MarkSweep::mark_and_push_closure;
+CLDToOopClosure    MarkSweep::follow_cld_closure(&mark_and_push_closure, ClassLoaderData::_claim_strong);
+CLDToOopClosure    MarkSweep::adjust_cld_closure(&adjust_pointer_closure, ClassLoaderData::_claim_strong);
 
 template <class T> inline void MarkSweep::KeepAliveClosure::do_oop_work(T* p) {
   mark_and_push(p);
--- a/src/hotspot/share/gc/shared/barrierSet.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/barrierSet.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -36,6 +36,7 @@
 class BarrierSetAssembler;
 class BarrierSetC1;
 class BarrierSetC2;
+class BarrierSetNMethod;
 class JavaThread;
 
 // This class provides the interface between a barrier implementation and
@@ -72,6 +73,7 @@
   BarrierSetAssembler* _barrier_set_assembler;
   BarrierSetC1* _barrier_set_c1;
   BarrierSetC2* _barrier_set_c2;
+  BarrierSetNMethod* _barrier_set_nmethod;
 
 public:
   // Metafunction mapping a class derived from BarrierSet to the
@@ -95,11 +97,13 @@
   BarrierSet(BarrierSetAssembler* barrier_set_assembler,
              BarrierSetC1* barrier_set_c1,
              BarrierSetC2* barrier_set_c2,
+             BarrierSetNMethod* barrier_set_nmethod,
              const FakeRtti& fake_rtti) :
     _fake_rtti(fake_rtti),
     _barrier_set_assembler(barrier_set_assembler),
     _barrier_set_c1(barrier_set_c1),
-    _barrier_set_c2(barrier_set_c2) {}
+    _barrier_set_c2(barrier_set_c2),
+    _barrier_set_nmethod(barrier_set_nmethod) {}
   ~BarrierSet() { }
 
   template <class BarrierSetAssemblerT>
@@ -156,6 +160,10 @@
     return _barrier_set_c2;
   }
 
+  BarrierSetNMethod* barrier_set_nmethod() {
+    return _barrier_set_nmethod;
+  }
+
   // The AccessBarrier of a BarrierSet subclass is called by the Access API
   // (cf. oops/access.hpp) to perform decorated accesses. GC implementations
   // may override these default access operations by declaring an
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shared/barrierSetNMethod.cpp	Tue Oct 16 09:55:30 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "gc/shared/barrierSet.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "logging/log.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/debug.hpp"
+
+int BarrierSetNMethod::disarmed_value() const {
+  char* disarmed_addr = reinterpret_cast<char*>(Thread::current());
+  disarmed_addr += in_bytes(thread_disarmed_offset());
+  return *reinterpret_cast<int*>(disarmed_addr);
+}
+
+bool BarrierSetNMethod::supports_entry_barrier(nmethod* nm) {
+  if (nm->method()->is_method_handle_intrinsic()) {
+    return false;
+  }
+
+  if (!nm->is_native_method() && !nm->is_compiled_by_c2() && !nm->is_compiled_by_c1()) {
+    return false;
+  }
+
+  return true;
+}
+
+int BarrierSetNMethod::nmethod_stub_entry_barrier(address* return_address_ptr) {
+  address return_address = *return_address_ptr;
+  CodeBlob* cb = CodeCache::find_blob(return_address);
+  assert(cb != NULL, "invariant");
+
+  nmethod* nm = cb->as_nmethod();
+  BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+
+  if (!bs_nm->is_armed(nm)) {
+    return 0;
+  }
+
+  assert(!nm->is_osr_method(), "Should not reach here");
+  // Called upon first entry after being armed
+  bool may_enter = bs_nm->nmethod_entry_barrier(nm);
+  if (!may_enter) {
+    log_trace(nmethod, barrier)("Deoptimizing nmethod: " PTR_FORMAT, p2i(nm));
+    bs_nm->deoptimize(nm, return_address_ptr);
+  }
+  return may_enter ? 0 : 1;
+}
+
+bool BarrierSetNMethod::nmethod_osr_entry_barrier(nmethod* nm) {
+  // This check depends on the invariant that all nmethods that are deoptimized / made not entrant
+  // are NOT disarmed.
+  // This invariant is important because a method can be deoptimized after the method have been
+  // resolved / looked up by OSR by another thread. By not deoptimizing them we guarantee that
+  // a deoptimized method will always hit the barrier and come to the same conclusion - deoptimize
+  if (!is_armed(nm)) {
+    return true;
+  }
+
+  assert(nm->is_osr_method(), "Should not reach here");
+  log_trace(nmethod, barrier)("Running osr nmethod entry barrier: " PTR_FORMAT, p2i(nm));
+  return nmethod_entry_barrier(nm);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shared/barrierSetNMethod.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ *
+ */
+
+#ifndef SHARE_CODE_NMETHOD_BARRIER_HPP
+#define SHARE_CODE_NMETHOD_BARRIER_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/sizes.hpp"
+
+class nmethod;
+
+class BarrierSetNMethod: public CHeapObj<mtGC> {
+  bool supports_entry_barrier(nmethod* nm);
+  void deoptimize(nmethod* nm, address* return_addr_ptr);
+
+protected:
+  virtual int disarmed_value() const;
+  virtual bool nmethod_entry_barrier(nmethod* nm) = 0;
+
+public:
+  virtual ByteSize thread_disarmed_offset() const = 0;
+
+  static int nmethod_stub_entry_barrier(address* return_address_ptr);
+  bool nmethod_osr_entry_barrier(nmethod* nm);
+  bool is_armed(nmethod* nm);
+  void disarm(nmethod* nm);
+};
+
+
+#endif // SHARE_CODE_NMETHOD_BARRIER_HPP
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -445,6 +445,15 @@
   CollectedHeap::fill_with_object(start, end, zap);
 }
 
+size_t CollectedHeap::min_dummy_object_size() const {
+  return oopDesc::header_size();
+}
+
+size_t CollectedHeap::tlab_alloc_reserve() const {
+  size_t min_size = min_dummy_object_size();
+  return min_size > (size_t)MinObjAlignment ? align_object_size(min_size) : 0;
+}
+
 HeapWord* CollectedHeap::allocate_new_tlab(size_t min_size,
                                            size_t requested_size,
                                            size_t* actual_size) {
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -309,6 +309,8 @@
   }
 
   virtual void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
+  virtual size_t min_dummy_object_size() const;
+  size_t tlab_alloc_reserve() const;
 
   // Return the address "addr" aligned by "alignment_in_bytes" if such
   // an address is below "end".  Return NULL otherwise.
--- a/src/hotspot/share/gc/shared/memAllocator.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/memAllocator.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -187,7 +187,7 @@
   // support for JVMTI VMObjectAlloc event (no-op if not enabled)
   JvmtiExport::vm_object_alloc_event_collector(obj());
 
-  if (!ThreadHeapSampler::enabled()) {
+  if (!JvmtiExport::should_post_sampled_object_alloc()) {
     // Sampling disabled
     return;
   }
@@ -282,7 +282,7 @@
   HeapWord* mem = NULL;
   ThreadLocalAllocBuffer& tlab = _thread->tlab();
 
-  if (ThreadHeapSampler::enabled()) {
+  if (JvmtiExport::should_post_sampled_object_alloc()) {
     // Try to allocate the sampled object from TLAB, it is possible a sample
     // point was put and the TLAB still has space.
     tlab.set_back_allocation_end();
--- a/src/hotspot/share/gc/shared/modRefBarrierSet.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/modRefBarrierSet.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -39,6 +39,7 @@
     : BarrierSet(barrier_set_assembler,
                  barrier_set_c1,
                  barrier_set_c2,
+                 NULL /* barrier_set_nmethod */,
                  fake_rtti.add_tag(BarrierSet::ModRef)) { }
   ~ModRefBarrierSet() { }
 
--- a/src/hotspot/share/gc/shared/plab.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/plab.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -27,7 +27,6 @@
 #include "gc/shared/plab.inline.hpp"
 #include "gc/shared/threadLocalAllocBuffer.hpp"
 #include "logging/log.hpp"
-#include "oops/arrayOop.hpp"
 #include "oops/oop.inline.hpp"
 
 size_t PLAB::min_size() {
@@ -43,8 +42,7 @@
   _word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL),
   _end(NULL), _hard_end(NULL), _allocated(0), _wasted(0), _undo_wasted(0)
 {
-  // ArrayOopDesc::header_size depends on command line initialization.
-  AlignmentReserve = oopDesc::header_size() > MinObjAlignment ? align_object_size(arrayOopDesc::header_size(T_INT)) : 0;
+  AlignmentReserve = Universe::heap()->tlab_alloc_reserve();
   assert(min_size() > AlignmentReserve,
          "Minimum PLAB size " SIZE_FORMAT " must be larger than alignment reserve " SIZE_FORMAT " "
          "to be able to contain objects", min_size(), AlignmentReserve);
--- a/src/hotspot/share/gc/shared/taskqueue.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/taskqueue.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -370,6 +370,8 @@
 public:
   // Returns "true" if some TaskQueue in the set contains a task.
   virtual bool peek() = 0;
+  // Tasks in queue
+  virtual uint tasks() const = 0;
 };
 
 template <MEMFLAGS F> class TaskQueueSetSuperImpl: public CHeapObj<F>, public TaskQueueSetSuper {
@@ -399,6 +401,7 @@
   bool steal(uint queue_num, E& t);
 
   bool peek();
+  uint tasks() const;
 
   uint size() const { return _n; }
 };
@@ -424,6 +427,15 @@
   return false;
 }
 
+template<class T, MEMFLAGS F>
+uint GenericTaskQueueSet<T, F>::tasks() const {
+  uint n = 0;
+  for (uint j = 0; j < _n; j++) {
+    n += _queues[j]->size();
+  }
+  return n;
+}
+
 // When to terminate from the termination protocol.
 class TerminatorTerminator: public CHeapObj<mtInternal> {
 public:
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/threadLocalAllocBuffer.inline.hpp"
 #include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
@@ -461,3 +462,8 @@
     _perf_max_slow_allocations    ->set_value(_max_slow_allocations);
   }
 }
+
+size_t ThreadLocalAllocBuffer::end_reserve() {
+  size_t reserve_size = Universe::heap()->tlab_alloc_reserve();
+  return MAX2(reserve_size, (size_t)_reserve_for_allocation_prefetch);
+}
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -26,7 +26,6 @@
 #define SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_HPP
 
 #include "gc/shared/gcUtil.hpp"
-#include "oops/typeArrayOop.hpp"
 #include "runtime/perfData.hpp"
 #include "runtime/vm_version.hpp"
 
@@ -138,10 +137,7 @@
   inline HeapWord* allocate(size_t size);
 
   // Reserve space at the end of TLAB
-  static size_t end_reserve() {
-    int reserve_size = typeArrayOopDesc::header_size(T_INT);
-    return MAX2(reserve_size, _reserve_for_allocation_prefetch);
-  }
+  static size_t end_reserve();
   static size_t alignment_reserve()              { return align_object_size(end_reserve()); }
   static size_t alignment_reserve_in_bytes()     { return alignment_reserve() * HeapWordSize; }
 
--- a/src/hotspot/share/gc/z/zBarrierSet.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zBarrierSet.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -43,6 +43,7 @@
     BarrierSet(make_barrier_set_assembler<ZBarrierSetAssembler>(),
                make_barrier_set_c1<ZBarrierSetC1>(),
                make_barrier_set_c2<ZBarrierSetC2>(),
+               NULL /* barrier_set_nmethod */,
                BarrierSet::FakeRtti(BarrierSet::ZBarrierSet)) {}
 
 ZBarrierSetAssembler* ZBarrierSet::assembler() {
--- a/src/hotspot/share/gc/z/zCollectedHeap.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/gcHeapSummary.hpp"
+#include "gc/shared/suspendibleThreadSet.hpp"
 #include "gc/z/zCollectedHeap.hpp"
 #include "gc/z/zGlobals.hpp"
 #include "gc/z/zHeap.inline.hpp"
@@ -295,6 +296,14 @@
                              reserved_region().start() + max_capacity_in_words);
 }
 
+void ZCollectedHeap::safepoint_synchronize_begin() {
+  SuspendibleThreadSet::synchronize();
+}
+
+void ZCollectedHeap::safepoint_synchronize_end() {
+  SuspendibleThreadSet::desynchronize();
+}
+
 void ZCollectedHeap::prepare_for_verify() {
   // Does nothing
 }
--- a/src/hotspot/share/gc/z/zCollectedHeap.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zCollectedHeap.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -117,6 +117,9 @@
 
   virtual VirtualSpaceSummary create_heap_space_summary();
 
+  virtual void safepoint_synchronize_begin();
+  virtual void safepoint_synchronize_end();
+
   virtual void print_on(outputStream* st) const;
   virtual void print_on_error(outputStream* st) const;
   virtual void print_extended_on(outputStream* st) const;
--- a/src/hotspot/share/gc/z/zDriver.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zDriver.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -336,7 +336,7 @@
   // Phase 2: Concurrent Mark
   {
     ZStatTimer timer(ZPhaseConcurrentMark);
-    ZHeap::heap()->mark();
+    ZHeap::heap()->mark(true /* initial */);
   }
 
   // Phase 3: Pause Mark End
@@ -345,7 +345,7 @@
     while (!vm_operation(&cl)) {
       // Phase 3.5: Concurrent Mark Continue
       ZStatTimer timer(ZPhaseConcurrentMarkContinue);
-      ZHeap::heap()->mark();
+      ZHeap::heap()->mark(false /* initial */);
     }
   }
 
--- a/src/hotspot/share/gc/z/zHeap.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zHeap.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -296,8 +296,8 @@
   ZStatHeap::set_at_mark_start(capacity(), used());
 }
 
-void ZHeap::mark() {
-  _mark.mark();
+void ZHeap::mark(bool initial) {
+  _mark.mark(initial);
 }
 
 void ZHeap::mark_flush_and_free(Thread* thread) {
--- a/src/hotspot/share/gc/z/zHeap.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zHeap.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -133,7 +133,7 @@
   bool is_object_strongly_live(uintptr_t addr) const;
   template <bool finalizable, bool publish> void mark_object(uintptr_t addr);
   void mark_start();
-  void mark();
+  void mark(bool initial);
   void mark_flush_and_free(Thread* thread);
   bool mark_end();
 
--- a/src/hotspot/share/gc/z/zHeapIterator.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zHeapIterator.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -29,7 +29,6 @@
 #include "gc/z/zOop.inline.hpp"
 #include "gc/z/zRootsIterator.hpp"
 #include "memory/iterator.inline.hpp"
-#include "oops/oop.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 #include "utilities/stack.inline.hpp"
 
@@ -54,19 +53,18 @@
 class ZHeapIteratorRootOopClosure : public ZRootsIteratorClosure {
 private:
   ZHeapIterator* const _iter;
-  ObjectClosure* const _cl;
 
 public:
-  ZHeapIteratorRootOopClosure(ZHeapIterator* iter, ObjectClosure* cl) :
-      _iter(iter),
-      _cl(cl) {}
+  ZHeapIteratorRootOopClosure(ZHeapIterator* iter) :
+      _iter(iter) {}
 
   virtual void do_oop(oop* p) {
     // Load barrier needed here for the same reason we
-    // need fixup_partial_loads() in ZHeap::mark_end()
+    // need fixup_partial_loads() in ZHeap::mark_end().
+    // This barrier is also needed here in case we're
+    // treating the JVMTI weak tag map as strong roots.
     const oop obj = ZBarrier::load_barrier_on_oop_field(p);
     _iter->push(obj);
-    _iter->drain(_cl);
   }
 
   virtual void do_oop(narrowOop* p) {
@@ -74,19 +72,13 @@
   }
 };
 
-class ZHeapIteratorPushOopClosure : public BasicOopIterateClosure {
+class ZHeapIteratorOopClosure : public BasicOopIterateClosure {
 private:
   ZHeapIterator* const _iter;
   const oop            _base;
   const bool           _visit_referents;
 
-public:
-  ZHeapIteratorPushOopClosure(ZHeapIterator* iter, oop base) :
-      _iter(iter),
-      _base(base),
-      _visit_referents(iter->visit_referents()) {}
-
-  oop load_oop(oop* p) {
+  oop load_oop(oop* p) const {
     if (_visit_referents) {
       return HeapAccess<ON_UNKNOWN_OOP_REF>::oop_load_at(_base, _base->field_offset(p));
     } else {
@@ -94,6 +86,12 @@
     }
   }
 
+public:
+  ZHeapIteratorOopClosure(ZHeapIterator* iter, oop base, bool visit_referents) :
+      _iter(iter),
+      _base(base),
+      _visit_referents(visit_referents) {}
+
   virtual ReferenceIterationMode reference_iteration_mode() {
     return _visit_referents ? DO_FIELDS : DO_FIELDS_EXCEPT_REFERENT;
   }
@@ -126,11 +124,11 @@
   }
 }
 
-size_t ZHeapIterator::object_index_max() const {
+static size_t object_index_max() {
   return ZPageSizeMin >> ZObjectAlignmentSmallShift;
 }
 
-size_t ZHeapIterator::object_index(oop obj) const {
+static size_t object_index(oop obj) {
   const uintptr_t addr = ZOop::to_address(obj);
   const uintptr_t offset = ZAddress::offset(addr);
   const uintptr_t mask = (1 << ZPageSizeMinShift) - 1;
@@ -165,7 +163,22 @@
   _visit_stack.push(obj);
 }
 
-void ZHeapIterator::drain(ObjectClosure* cl) {
+void ZHeapIterator::objects_do(ObjectClosure* cl) {
+  // Push roots onto stack
+  {
+    // Note that we also visit the JVMTI weak tag map as if they were
+    // strong roots to make sure we visit all tagged objects, even
+    // those that might now have become unreachable. If we didn't do
+    // this the user would have expected to see ObjectFree events for
+    // unreachable objects in the tag map.
+    ZRootsIterator roots;
+    ZConcurrentRootsIterator concurrent_roots(false /* marking */);
+    ZHeapIteratorRootOopClosure root_cl(this);
+    roots.oops_do(&root_cl, true /* visit_jvmti_weak_export */);
+    concurrent_roots.oops_do(&root_cl);
+  }
+
+  // Drain stack
   while (!_visit_stack.is_empty()) {
     const oop obj = _visit_stack.pop();
 
@@ -173,23 +186,7 @@
     cl->do_object(obj);
 
     // Push members to visit
-    ZHeapIteratorPushOopClosure push_cl(this, obj);
+    ZHeapIteratorOopClosure push_cl(this, obj, _visit_referents);
     obj->oop_iterate(&push_cl);
   }
 }
-
-bool ZHeapIterator::visit_referents() const {
-  return _visit_referents;
-}
-
-void ZHeapIterator::objects_do(ObjectClosure* cl) {
-  ZHeapIteratorRootOopClosure root_cl(this, cl);
-  ZRootsIterator roots;
-
-  // Follow roots. Note that we also visit the JVMTI weak tag map
-  // as if they were strong roots to make sure we visit all tagged
-  // objects, even those that might now have become unreachable.
-  // If we didn't do this the user would have expected to see
-  // ObjectFree events for unreachable objects in the tag map.
-  roots.oops_do(&root_cl, true /* visit_jvmti_weak_export */);
-}
--- a/src/hotspot/share/gc/z/zHeapIterator.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zHeapIterator.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -33,7 +33,7 @@
 
 class ZHeapIterator : public StackObj {
   friend class ZHeapIteratorRootOopClosure;
-  friend class ZHeapIteratorPushOopClosure;
+  friend class ZHeapIteratorOopClosure;
 
 private:
   typedef ZAddressRangeMap<ZHeapIteratorBitMap*, ZPageSizeMinShift>         ZVisitMap;
@@ -44,14 +44,8 @@
   ZVisitMap   _visit_map;
   const bool  _visit_referents;
 
-  size_t object_index_max() const;
-  size_t object_index(oop obj) const;
   ZHeapIteratorBitMap* object_map(oop obj);
-
   void push(oop obj);
-  void drain(ObjectClosure* cl);
-
-  bool visit_referents() const;
 
 public:
   ZHeapIterator(bool visit_referents);
--- a/src/hotspot/share/gc/z/zMark.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zMark.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -615,6 +615,34 @@
   stacks->free(&_allocator);
 }
 
+class ZMarkConcurrentRootsIteratorClosure : public ZRootsIteratorClosure {
+public:
+  virtual void do_oop(oop* p) {
+    ZBarrier::mark_barrier_on_oop_field(p, false /* finalizable */);
+  }
+
+  virtual void do_oop(narrowOop* p) {
+    ShouldNotReachHere();
+  }
+};
+
+
+class ZMarkConcurrentRootsTask : public ZTask {
+private:
+  ZConcurrentRootsIterator            _roots;
+  ZMarkConcurrentRootsIteratorClosure _cl;
+
+public:
+  ZMarkConcurrentRootsTask(ZMark* mark) :
+      ZTask("ZMarkConcurrentRootsTask"),
+      _roots(true /* marking */),
+      _cl() {}
+
+  virtual void work() {
+    _roots.oops_do(&_cl);
+  }
+};
+
 class ZMarkTask : public ZTask {
 private:
   ZMark* const   _mark;
@@ -637,7 +665,12 @@
   }
 };
 
-void ZMark::mark() {
+void ZMark::mark(bool initial) {
+  if (initial) {
+    ZMarkConcurrentRootsTask task(this);
+    _workers->run_concurrent(&task);
+  }
+
   ZMarkTask task(this);
   _workers->run_concurrent(&task);
 }
--- a/src/hotspot/share/gc/z/zMark.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zMark.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -108,7 +108,7 @@
   template <bool finalizable, bool publish> void mark_object(uintptr_t addr);
 
   void start();
-  void mark();
+  void mark(bool initial);
   bool end();
 
   void flush_and_free();
--- a/src/hotspot/share/gc/z/zRootsIterator.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zRootsIterator.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -28,6 +28,7 @@
 #include "code/codeCache.hpp"
 #include "compiler/oopMap.hpp"
 #include "gc/shared/oopStorageParState.inline.hpp"
+#include "gc/shared/suspendibleThreadSet.hpp"
 #include "gc/z/zGlobals.hpp"
 #include "gc/z/zNMethodTable.hpp"
 #include "gc/z/zOopClosures.inline.hpp"
@@ -52,16 +53,20 @@
 static const ZStatSubPhase ZSubPhasePauseRoots("Pause Roots");
 static const ZStatSubPhase ZSubPhasePauseRootsTeardown("Pause Roots Teardown");
 static const ZStatSubPhase ZSubPhasePauseRootsUniverse("Pause Roots Universe");
-static const ZStatSubPhase ZSubPhasePauseRootsJNIHandles("Pause Roots JNIHandles");
 static const ZStatSubPhase ZSubPhasePauseRootsObjectSynchronizer("Pause Roots ObjectSynchronizer");
 static const ZStatSubPhase ZSubPhasePauseRootsManagement("Pause Roots Management");
 static const ZStatSubPhase ZSubPhasePauseRootsJVMTIExport("Pause Roots JVMTIExport");
 static const ZStatSubPhase ZSubPhasePauseRootsJVMTIWeakExport("Pause Roots JVMTIWeakExport");
 static const ZStatSubPhase ZSubPhasePauseRootsSystemDictionary("Pause Roots SystemDictionary");
-static const ZStatSubPhase ZSubPhasePauseRootsClassLoaderDataGraph("Pause Roots ClassLoaderDataGraph");
 static const ZStatSubPhase ZSubPhasePauseRootsThreads("Pause Roots Threads");
 static const ZStatSubPhase ZSubPhasePauseRootsCodeCache("Pause Roots CodeCache");
 
+static const ZStatSubPhase ZSubPhaseConcurrentRootsSetup("Concurrent Roots Setup");
+static const ZStatSubPhase ZSubPhaseConcurrentRoots("Concurrent Roots");
+static const ZStatSubPhase ZSubPhaseConcurrentRootsTeardown("Concurrent Roots Teardown");
+static const ZStatSubPhase ZSubPhaseConcurrentRootsJNIHandles("Concurrent Roots JNIHandles");
+static const ZStatSubPhase ZSubPhaseConcurrentRootsClassLoaderDataGraph("Concurrent Roots ClassLoaderDataGraph");
+
 static const ZStatSubPhase ZSubPhasePauseWeakRootsSetup("Pause Weak Roots Setup");
 static const ZStatSubPhase ZSubPhasePauseWeakRoots("Pause Weak Roots");
 static const ZStatSubPhase ZSubPhasePauseWeakRootsTeardown("Pause Weak Roots Teardown");
@@ -128,21 +133,17 @@
 }
 
 ZRootsIterator::ZRootsIterator() :
-    _jni_handles_iter(JNIHandles::global_handles()),
     _universe(this),
     _object_synchronizer(this),
     _management(this),
     _jvmti_export(this),
     _jvmti_weak_export(this),
     _system_dictionary(this),
-    _jni_handles(this),
-    _class_loader_data_graph(this),
     _threads(this),
     _code_cache(this) {
   assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
   ZStatTimer timer(ZSubPhasePauseRootsSetup);
   Threads::change_thread_claim_parity();
-  ClassLoaderDataGraph::clear_claimed_marks();
   COMPILER2_PRESENT(DerivedPointerTable::clear());
   CodeCache::gc_prologue();
   ZNMethodTable::gc_prologue();
@@ -163,11 +164,6 @@
   Universe::oops_do(cl);
 }
 
-void ZRootsIterator::do_jni_handles(ZRootsIteratorClosure* cl) {
-  ZStatTimer timer(ZSubPhasePauseRootsJNIHandles);
-  _jni_handles_iter.oops_do(cl);
-}
-
 void ZRootsIterator::do_object_synchronizer(ZRootsIteratorClosure* cl) {
   ZStatTimer timer(ZSubPhasePauseRootsObjectSynchronizer);
   ObjectSynchronizer::oops_do(cl);
@@ -194,12 +190,6 @@
   SystemDictionary::oops_do(cl);
 }
 
-void ZRootsIterator::do_class_loader_data_graph(ZRootsIteratorClosure* cl) {
-  ZStatTimer timer(ZSubPhasePauseRootsClassLoaderDataGraph);
-  CLDToOopClosure cld_cl(cl);
-  ClassLoaderDataGraph::cld_do(&cld_cl);
-}
-
 void ZRootsIterator::do_threads(ZRootsIteratorClosure* cl) {
   ZStatTimer timer(ZSubPhasePauseRootsThreads);
   ResourceMark rm;
@@ -218,8 +208,6 @@
   _management.oops_do(cl);
   _jvmti_export.oops_do(cl);
   _system_dictionary.oops_do(cl);
-  _jni_handles.oops_do(cl);
-  _class_loader_data_graph.oops_do(cl);
   _threads.oops_do(cl);
   _code_cache.oops_do(cl);
   if (visit_jvmti_weak_export) {
@@ -227,6 +215,43 @@
   }
 }
 
+ZConcurrentRootsIterator::ZConcurrentRootsIterator(bool marking) :
+    _marking(marking),
+    _sts_joiner(marking /* active */),
+    _jni_handles_iter(JNIHandles::global_handles()),
+    _jni_handles(this),
+    _class_loader_data_graph(this) {
+  ZStatTimer timer(ZSubPhaseConcurrentRootsSetup);
+  if (_marking) {
+    ClassLoaderDataGraph_lock->lock();
+    ClassLoaderDataGraph::clear_claimed_marks();
+  }
+}
+
+ZConcurrentRootsIterator::~ZConcurrentRootsIterator() {
+  ZStatTimer timer(ZSubPhaseConcurrentRootsTeardown);
+  if (_marking) {
+    ClassLoaderDataGraph_lock->unlock();
+  }
+}
+
+void ZConcurrentRootsIterator::do_jni_handles(ZRootsIteratorClosure* cl) {
+  ZStatTimer timer(ZSubPhaseConcurrentRootsJNIHandles);
+  _jni_handles_iter.oops_do(cl);
+}
+
+void ZConcurrentRootsIterator::do_class_loader_data_graph(ZRootsIteratorClosure* cl) {
+  ZStatTimer timer(ZSubPhaseConcurrentRootsClassLoaderDataGraph);
+  CLDToOopClosure cld_cl(cl, _marking ? ClassLoaderData::_claim_strong : ClassLoaderData::_claim_none);
+  ClassLoaderDataGraph::cld_do(&cld_cl);
+}
+
+void ZConcurrentRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
+  ZStatTimer timer(ZSubPhaseConcurrentRoots);
+  _jni_handles.oops_do(cl);
+  _class_loader_data_graph.oops_do(cl);
+}
+
 ZWeakRootsIterator::ZWeakRootsIterator() :
     _jvmti_weak_export(this),
     _jfr_weak(this) {
--- a/src/hotspot/share/gc/z/zRootsIterator.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zRootsIterator.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -25,6 +25,7 @@
 #define SHARE_GC_Z_ZROOTSITERATOR_HPP
 
 #include "gc/shared/oopStorageParState.hpp"
+#include "gc/shared/suspendibleThreadSet.hpp"
 #include "memory/allocation.hpp"
 #include "memory/iterator.hpp"
 #include "runtime/thread.hpp"
@@ -37,8 +38,7 @@
   }
 };
 
-typedef OopStorage::ParState<false /* concurrent */, false /* is_const */> ZOopStorageIterator;
-typedef OopStorage::ParState<true /* concurrent */, false /* is_const */>  ZConcurrentOopStorageIterator;
+typedef OopStorage::ParState<true /* concurrent */, false /* is_const */> ZOopStorageIterator;
 
 template <typename T, void (T::*F)(ZRootsIteratorClosure*)>
 class ZSerialOopsDo {
@@ -86,29 +86,23 @@
 
 class ZRootsIterator {
 private:
-  ZOopStorageIterator _jni_handles_iter;
-
   void do_universe(ZRootsIteratorClosure* cl);
-  void do_jni_handles(ZRootsIteratorClosure* cl);
   void do_object_synchronizer(ZRootsIteratorClosure* cl);
   void do_management(ZRootsIteratorClosure* cl);
   void do_jvmti_export(ZRootsIteratorClosure* cl);
   void do_jvmti_weak_export(ZRootsIteratorClosure* cl);
   void do_system_dictionary(ZRootsIteratorClosure* cl);
-  void do_class_loader_data_graph(ZRootsIteratorClosure* cl);
   void do_threads(ZRootsIteratorClosure* cl);
   void do_code_cache(ZRootsIteratorClosure* cl);
 
-  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_universe>                  _universe;
-  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_object_synchronizer>       _object_synchronizer;
-  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_management>                _management;
-  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_export>              _jvmti_export;
-  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_weak_export>         _jvmti_weak_export;
-  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_system_dictionary>         _system_dictionary;
-  ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_jni_handles>             _jni_handles;
-  ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_class_loader_data_graph> _class_loader_data_graph;
-  ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_threads>                 _threads;
-  ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_code_cache>              _code_cache;
+  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_universe>            _universe;
+  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_object_synchronizer> _object_synchronizer;
+  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_management>          _management;
+  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_export>        _jvmti_export;
+  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_weak_export>   _jvmti_weak_export;
+  ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_system_dictionary>   _system_dictionary;
+  ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_threads>           _threads;
+  ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_code_cache>        _code_cache;
 
 public:
   ZRootsIterator();
@@ -117,6 +111,25 @@
   void oops_do(ZRootsIteratorClosure* cl, bool visit_jvmti_weak_export = false);
 };
 
+class ZConcurrentRootsIterator {
+private:
+  const bool                 _marking;
+  SuspendibleThreadSetJoiner _sts_joiner;
+  ZOopStorageIterator        _jni_handles_iter;
+
+  void do_jni_handles(ZRootsIteratorClosure* cl);
+  void do_class_loader_data_graph(ZRootsIteratorClosure* cl);
+
+  ZParallelOopsDo<ZConcurrentRootsIterator, &ZConcurrentRootsIterator::do_jni_handles>             _jni_handles;
+  ZParallelOopsDo<ZConcurrentRootsIterator, &ZConcurrentRootsIterator::do_class_loader_data_graph> _class_loader_data_graph;
+
+public:
+  ZConcurrentRootsIterator(bool marking);
+  ~ZConcurrentRootsIterator();
+
+  void oops_do(ZRootsIteratorClosure* cl);
+};
+
 class ZWeakRootsIterator {
 private:
   void do_jvmti_weak_export(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl);
@@ -135,9 +148,9 @@
 
 class ZConcurrentWeakRootsIterator {
 private:
-  ZConcurrentOopStorageIterator _vm_weak_handles_iter;
-  ZConcurrentOopStorageIterator _jni_weak_handles_iter;
-  ZConcurrentOopStorageIterator _string_table_iter;
+  ZOopStorageIterator _vm_weak_handles_iter;
+  ZOopStorageIterator _jni_weak_handles_iter;
+  ZOopStorageIterator _string_table_iter;
 
   void do_vm_weak_handles(ZRootsIteratorClosure* cl);
   void do_jni_weak_handles(ZRootsIteratorClosure* cl);
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -29,6 +29,7 @@
 #include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "compiler/disassembler.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
@@ -1045,6 +1046,13 @@
     Method* method =  last_frame.method();
     int bci = method->bci_from(last_frame.bcp());
     nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false);
+    BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+    if (nm != NULL && bs_nm != NULL) {
+      // in case the transition passed a safepoint we need to barrier this again
+      if (!bs_nm->nmethod_osr_entry_barrier(nm)) {
+        nm = NULL;
+      }
+    }
   }
   if (nm != NULL && thread->is_interp_only_mode()) {
     // Normally we never get an nm if is_interp_only_mode() is true, because
@@ -1081,6 +1089,13 @@
   nmethod* osr_nm = CompilationPolicy::policy()->event(method, method, branch_bci, bci, CompLevel_none, NULL, thread);
   assert(!HAS_PENDING_EXCEPTION, "Event handler should not throw any exceptions");
 
+  BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+  if (osr_nm != NULL && bs_nm != NULL) {
+    if (!bs_nm->nmethod_osr_entry_barrier(osr_nm)) {
+      osr_nm = NULL;
+    }
+  }
+
   if (osr_nm != NULL) {
     // We may need to do on-stack replacement which requires that no
     // monitors in the activation are biased because their
--- a/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -92,7 +92,7 @@
   SaveRestoreCLDClaimBits save_restore_cld_claim_bits;
   RootSetClosureMarkScope mark_scope;
 
-  CLDToOopClosure cldt_closure(closure);
+  CLDToOopClosure cldt_closure(closure, ClassLoaderData::_claim_strong);
   ClassLoaderDataGraph::always_strong_cld_do(&cldt_closure);
   CodeBlobToOopClosure blobs(closure, false);
   Threads::oops_do(closure, &blobs);
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -128,7 +128,7 @@
 bool ReferenceToRootClosure::do_cldg_roots() {
   assert(!complete(), "invariant");
   ReferenceLocateClosure rlc(_callback, OldObjectRoot::_class_loader_data, OldObjectRoot::_type_undetermined, NULL);
-  CLDToOopClosure cldt_closure(&rlc);
+  CLDToOopClosure cldt_closure(&rlc, ClassLoaderData::_claim_strong);
   ClassLoaderDataGraph::always_strong_cld_do(&cldt_closure);
   return rlc.complete();
 }
--- a/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -69,12 +69,12 @@
 
 CLDClaimContext::CLDClaimContext(ClassLoaderData* cld) : _cld(cld) {
   assert(_cld->claimed(), "invariant");
-  _cld->clear_claimed();
+  _cld->clear_claim();
 }
 
 CLDClaimContext::~CLDClaimContext() {
   if (_cld != NULL) {
-    _cld->claim();
+    _cld->try_claim(ClassLoaderData::_claim_strong);
     assert(_cld->claimed(), "invariant");
   }
 }
--- a/src/hotspot/share/memory/filemap.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/memory/filemap.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -1088,8 +1088,8 @@
 }
 
 bool FileMapInfo::verify_mapped_heap_regions(int first, int num) {
-  for (int i = first;
-           i <= first + num; i++) {
+  assert(num > 0, "sanity");
+  for (int i = first; i < first + num; i++) {
     if (!verify_region_checksum(i)) {
       return false;
     }
--- a/src/hotspot/share/memory/iterator.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/memory/iterator.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -32,7 +32,7 @@
 DoNothingClosure do_nothing_cl;
 
 void CLDToOopClosure::do_cld(ClassLoaderData* cld) {
-  cld->oops_do(_oop_closure, _must_claim_cld);
+  cld->oops_do(_oop_closure, _cld_claim);
 }
 
 void ObjectToOopClosure::do_object(oop obj) {
--- a/src/hotspot/share/memory/iterator.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/memory/iterator.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -127,12 +127,13 @@
 
 class CLDToOopClosure : public CLDClosure {
   OopClosure*       _oop_closure;
-  bool              _must_claim_cld;
+  int               _cld_claim;
 
  public:
-  CLDToOopClosure(OopClosure* oop_closure, bool must_claim_cld = true) :
+  CLDToOopClosure(OopClosure* oop_closure,
+                  int cld_claim) :
       _oop_closure(oop_closure),
-      _must_claim_cld(must_claim_cld) {}
+      _cld_claim(cld_claim) {}
 
   void do_cld(ClassLoaderData* cld);
 };
--- a/src/hotspot/share/memory/iterator.inline.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/memory/iterator.inline.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -39,8 +39,7 @@
 #include "utilities/debug.hpp"
 
 inline void MetadataVisitingOopIterateClosure::do_cld(ClassLoaderData* cld) {
-  bool claim = true;  // Must claim the class loader data before processing.
-  cld->oops_do(this, claim);
+  cld->oops_do(this, ClassLoaderData::_claim_strong);
 }
 
 inline void MetadataVisitingOopIterateClosure::do_klass(Klass* k) {
--- a/src/hotspot/share/opto/cfgnode.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/opto/cfgnode.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -714,10 +714,151 @@
     }
   }
 
+  if (can_reshape) {
+    modified |= optimize_trichotomy(phase->is_IterGVN());
+  }
+
   return modified ? this : NULL;
 }
 
-
+//------------------------------optimize_trichotomy--------------------------
+// Optimize nested comparisons of the following kind:
+//
+// int compare(int a, int b) {
+//   return (a < b) ? -1 : (a == b) ? 0 : 1;
+// }
+//
+// Shape 1:
+// if (compare(a, b) == 1) { ... } -> if (a > b) { ... }
+//
+// Shape 2:
+// if (compare(a, b) == 0) { ... } -> if (a == b) { ... }
+//
+// Above code leads to the following IR shapes where both Ifs compare the
+// same value and two out of three region inputs idx1 and idx2 map to
+// the same value and control flow.
+//
+// (1)   If                 (2)   If
+//      /  \                     /  \
+//   Proj  Proj               Proj  Proj
+//     |      \                |      \
+//     |       If              |      If                      If
+//     |      /  \             |     /  \                    /  \
+//     |   Proj  Proj          |  Proj  Proj      ==>     Proj  Proj
+//     |   /      /            \    |    /                  |    /
+//    Region     /              \   |   /                   |   /
+//         \    /                \  |  /                    |  /
+//         Region                Region                    Region
+//
+// The method returns true if 'this' is modified and false otherwise.
+bool RegionNode::optimize_trichotomy(PhaseIterGVN* igvn) {
+  int idx1 = 1, idx2 = 2;
+  Node* region = NULL;
+  if (req() == 3 && in(1) != NULL && in(2) != NULL) {
+    // Shape 1: Check if one of the inputs is a region that merges two control
+    // inputs and has no other users (especially no Phi users).
+    region = in(1)->isa_Region() ? in(1) : in(2)->isa_Region();
+    if (region == NULL || region->outcnt() != 2 || region->req() != 3) {
+      return false; // No suitable region input found
+    }
+  } else if (req() == 4) {
+    // Shape 2: Check if two control inputs map to the same value of the unique phi
+    // user and treat these as if they would come from another region (shape (1)).
+    PhiNode* phi = has_unique_phi();
+    if (phi == NULL) {
+      return false; // No unique phi user
+    }
+    if (phi->in(idx1) != phi->in(idx2)) {
+      idx2 = 3;
+      if (phi->in(idx1) != phi->in(idx2)) {
+        idx1 = 2;
+        if (phi->in(idx1) != phi->in(idx2)) {
+          return false; // No equal phi inputs found
+        }
+      }
+    }
+    assert(phi->in(idx1) == phi->in(idx2), "must be"); // Region is merging same value
+    region = this;
+  }
+  if (region == NULL || region->in(idx1) == NULL || region->in(idx2) == NULL) {
+    return false; // Region does not merge two control inputs
+  }
+  // At this point we know that region->in(idx1) and region->(idx2) map to the same
+  // value and control flow. Now search for ifs that feed into these region inputs.
+  ProjNode* proj1 = region->in(idx1)->isa_Proj();
+  ProjNode* proj2 = region->in(idx2)->isa_Proj();
+  if (proj1 == NULL || proj1->outcnt() != 1 ||
+      proj2 == NULL || proj2->outcnt() != 1) {
+    return false; // No projection inputs with region as unique user found
+  }
+  assert(proj1 != proj2, "should be different projections");
+  IfNode* iff1 = proj1->in(0)->isa_If();
+  IfNode* iff2 = proj2->in(0)->isa_If();
+  if (iff1 == NULL || iff1->outcnt() != 2 ||
+      iff2 == NULL || iff2->outcnt() != 2) {
+    return false; // No ifs found
+  }
+  if (iff1 == iff2) {
+    igvn->add_users_to_worklist(iff1); // Make sure dead if is eliminated
+    igvn->replace_input_of(region, idx1, iff1->in(0));
+    igvn->replace_input_of(region, idx2, igvn->C->top());
+    return (region == this); // Remove useless if (both projections map to the same control/value)
+  }
+  BoolNode* bol1 = iff1->in(1)->isa_Bool();
+  BoolNode* bol2 = iff2->in(1)->isa_Bool();
+  if (bol1 == NULL || bol2 == NULL) {
+    return false; // No bool inputs found
+  }
+  Node* cmp1 = bol1->in(1);
+  Node* cmp2 = bol2->in(1);
+  bool commute = false;
+  if (!cmp1->is_Cmp() || !cmp2->is_Cmp()) {
+    return false; // No comparison
+  } else if (cmp1->Opcode() == Op_CmpF || cmp1->Opcode() == Op_CmpD ||
+             cmp2->Opcode() == Op_CmpF || cmp2->Opcode() == Op_CmpD ||
+             cmp1->Opcode() == Op_CmpP || cmp1->Opcode() == Op_CmpN ||
+             cmp2->Opcode() == Op_CmpP || cmp2->Opcode() == Op_CmpN) {
+    // Floats and pointers don't exactly obey trichotomy. To be on the safe side, don't transform their tests.
+    return false;
+  } else if (cmp1 != cmp2) {
+    if (cmp1->in(1) == cmp2->in(2) &&
+        cmp1->in(2) == cmp2->in(1)) {
+      commute = true; // Same but swapped inputs, commute the test
+    } else {
+      return false; // Ifs are not comparing the same values
+    }
+  }
+  proj1 = proj1->other_if_proj();
+  proj2 = proj2->other_if_proj();
+  if (!((proj1->unique_ctrl_out() == iff2 &&
+         proj2->unique_ctrl_out() == this) ||
+        (proj2->unique_ctrl_out() == iff1 &&
+         proj1->unique_ctrl_out() == this))) {
+    return false; // Ifs are not connected through other projs
+  }
+  // Found 'iff -> proj -> iff -> proj -> this' shape where all other projs are merged
+  // through 'region' and map to the same value. Merge the boolean tests and replace
+  // the ifs by a single comparison.
+  BoolTest test1 = (proj1->_con == 1) ? bol1->_test : bol1->_test.negate();
+  BoolTest test2 = (proj2->_con == 1) ? bol2->_test : bol2->_test.negate();
+  test1 = commute ? test1.commute() : test1;
+  // After possibly commuting test1, if we can merge test1 & test2, then proj2/iff2/bol2 are the nodes to refine.
+  BoolTest::mask res = test1.merge(test2);
+  if (res == BoolTest::illegal) {
+    return false; // Unable to merge tests
+  }
+  // Adjust iff1 to always pass (only iff2 will remain)
+  igvn->replace_input_of(iff1, 1, igvn->intcon(proj1->_con));
+  if (res == BoolTest::never) {
+    // Merged test is always false, adjust iff2 to always fail
+    igvn->replace_input_of(iff2, 1, igvn->intcon(1 - proj2->_con));
+  } else {
+    // Replace bool input of iff2 with merged test
+    BoolNode* new_bol = new BoolNode(bol2->in(1), res);
+    igvn->replace_input_of(iff2, 1, igvn->transform((proj2->_con == 1) ? new_bol : new_bol->negate(igvn)));
+  }
+  return false;
+}
 
 const RegMask &RegionNode::out_RegMask() const {
   return RegMask::Empty;
--- a/src/hotspot/share/opto/cfgnode.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/opto/cfgnode.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -96,6 +96,7 @@
   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
   virtual const RegMask &out_RegMask() const;
   bool try_clean_mem_phi(PhaseGVN *phase);
+  bool optimize_trichotomy(PhaseIterGVN* igvn);
 };
 
 //------------------------------JProjNode--------------------------------------
--- a/src/hotspot/share/opto/subnode.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/opto/subnode.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -1252,6 +1252,24 @@
   st->print("%s", msg[_test]);
 }
 
+// Returns the logical AND of two tests (or 'never' if both tests can never be true).
+// For example, a test for 'le' followed by a test for 'lt' is equivalent with 'lt'.
+BoolTest::mask BoolTest::merge(BoolTest other) const {
+  const mask res[illegal+1][illegal+1] = {
+    // eq,      gt,      of,      lt,      ne,      le,      nof,     ge,      never,   illegal
+      {eq,      never,   illegal, never,   never,   eq,      illegal, eq,      never,   illegal},  // eq
+      {never,   gt,      illegal, never,   gt,      never,   illegal, gt,      never,   illegal},  // gt
+      {illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal, never,   illegal},  // of
+      {never,   never,   illegal, lt,      lt,      lt,      illegal, never,   never,   illegal},  // lt
+      {never,   gt,      illegal, lt,      ne,      lt,      illegal, gt,      never,   illegal},  // ne
+      {eq,      never,   illegal, lt,      lt,      le,      illegal, eq,      never,   illegal},  // le
+      {illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal, never,   illegal},  // nof
+      {eq,      gt,      illegal, never,   gt,      eq,      illegal, ge,      never,   illegal},  // ge
+      {never,   never,   never,   never,   never,   never,   never,   never,   never,   illegal},  // never
+      {illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal}}; // illegal
+  return res[_test][other._test];
+}
+
 //=============================================================================
 uint BoolNode::hash() const { return (Node::hash() << 3)|(_test._test+1); }
 uint BoolNode::size_of() const { return sizeof(BoolNode); }
--- a/src/hotspot/share/opto/subnode.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/opto/subnode.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -280,7 +280,7 @@
 // We pick the values as 3 bits; the low order 2 bits we compare against the
 // condition codes, the high bit flips the sense of the result.
 struct BoolTest {
-  enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, illegal = 8 };
+  enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, never = 8, illegal = 9 };
   mask _test;
   BoolTest( mask btm ) : _test(btm) {}
   const Type *cc2logical( const Type *CC ) const;
@@ -293,6 +293,7 @@
   bool is_less( )  const { return _test == BoolTest::lt || _test == BoolTest::le; }
   bool is_greater( ) const { return _test == BoolTest::gt || _test == BoolTest::ge; }
   void dump_on(outputStream *st) const;
+  mask merge(BoolTest other) const;
 };
 
 //------------------------------BoolNode---------------------------------------
--- a/src/hotspot/share/prims/jvmtiEnv.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -540,13 +540,6 @@
       record_class_file_load_hook_enabled();
     }
 
-    if (event_type == JVMTI_EVENT_SAMPLED_OBJECT_ALLOC) {
-      if (enabled) {
-        ThreadHeapSampler::enable();
-      } else {
-        ThreadHeapSampler::disable();
-      }
-    }
     JvmtiEventController::set_user_enabled(this, (JavaThread*) NULL, event_type, enabled);
   } else {
     // We have a specified event_thread.
--- a/src/hotspot/share/runtime/mutexLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/runtime/mutexLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -133,8 +133,6 @@
 Monitor* PeriodicTask_lock            = NULL;
 Monitor* RedefineClasses_lock         = NULL;
 
-Mutex*   ThreadHeapSampler_lock       = NULL;
-
 #if INCLUDE_JFR
 Mutex*   JfrStacktrace_lock           = NULL;
 Monitor* JfrMsg_lock                  = NULL;
@@ -168,6 +166,16 @@
   fatal("must own lock %s", lock->name());
 }
 
+// a weaker assertion than the above
+void assert_locked_or_safepoint_weak(const Monitor * lock) {
+  if (IgnoreLockingAssertions) return;
+  assert(lock != NULL, "Need non-NULL lock");
+  if (lock->is_locked()) return;
+  if (SafepointSynchronize::is_at_safepoint()) return;
+  if (!Universe::is_fully_initialized()) return;
+  fatal("must own lock %s", lock->name());
+}
+
 // a stronger assertion than the above
 void assert_lock_strong(const Monitor * lock) {
   if (IgnoreLockingAssertions) return;
@@ -301,8 +309,6 @@
   def(PeriodicTask_lock            , PaddedMonitor, nonleaf+5,   true,  Monitor::_safepoint_check_sometimes);
   def(RedefineClasses_lock         , PaddedMonitor, nonleaf+5,   true,  Monitor::_safepoint_check_always);
 
-  def(ThreadHeapSampler_lock       , PaddedMutex,   nonleaf,     false, Monitor::_safepoint_check_never);
-
   if (WhiteBoxAPI) {
     def(Compilation_lock           , PaddedMonitor, leaf,        false, Monitor::_safepoint_check_never);
   }
--- a/src/hotspot/share/runtime/mutexLocker.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/runtime/mutexLocker.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -132,7 +132,6 @@
 extern Monitor* Service_lock;                    // a lock used for service thread operation
 extern Monitor* PeriodicTask_lock;               // protects the periodic task structure
 extern Monitor* RedefineClasses_lock;            // locks classes from parallel redefinition
-extern Mutex*   ThreadHeapSampler_lock;          // protects the static data for initialization.
 
 #if INCLUDE_JFR
 extern Mutex*   JfrStacktrace_lock;              // used to guard access to the JFR stacktrace table
@@ -200,9 +199,11 @@
 // for debugging: check that we're already owning this lock (or are at a safepoint)
 #ifdef ASSERT
 void assert_locked_or_safepoint(const Monitor * lock);
+void assert_locked_or_safepoint_weak(const Monitor * lock);
 void assert_lock_strong(const Monitor * lock);
 #else
 #define assert_locked_or_safepoint(lock)
+#define assert_locked_or_safepoint_weak(lock)
 #define assert_lock_strong(lock)
 #endif
 
--- a/src/hotspot/share/runtime/threadHeapSampler.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/runtime/threadHeapSampler.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -29,22 +29,29 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/threadHeapSampler.hpp"
 
-// Cheap random number generator
+// Cheap random number generator.
 uint64_t ThreadHeapSampler::_rnd;
 // Default is 512kb.
-int ThreadHeapSampler::_sampling_interval = 512 * 1024;
-int ThreadHeapSampler::_enabled;
+volatile int ThreadHeapSampler::_sampling_interval = 512 * 1024;
 
-// Statics for the fast log
-static const int FastLogNumBits = 10;
-static const int FastLogMask = (1 << FastLogNumBits) - 1;
-static double log_table[1<<FastLogNumBits];  // Constant
-static bool log_table_initialized;
+// Ordering here is important: _log_table first, _log_table_initialized second.
+double ThreadHeapSampler::_log_table[1 << ThreadHeapSampler::FastLogNumBits] = {};
+
+// Force initialization of the log_table.
+bool ThreadHeapSampler::_log_table_initialized = init_log_table();
+
+bool ThreadHeapSampler::init_log_table() {
+  for (int i = 0; i < (1 << FastLogNumBits); i++) {
+    _log_table[i] = (log(1.0 + static_cast<double>(i+0.5) / (1 << FastLogNumBits))
+                    / log(2.0));
+  }
+  return true;
+}
 
 // Returns the next prng value.
 // pRNG is: aX+b mod c with a = 0x5DEECE66D, b =  0xB, c = 1<<48
 // This is the lrand64 generator.
-static uint64_t next_random(uint64_t rnd) {
+uint64_t ThreadHeapSampler::next_random(uint64_t rnd) {
   const uint64_t PrngMult = 0x5DEECE66DLL;
   const uint64_t PrngAdd = 0xB;
   const uint64_t PrngModPower = 48;
@@ -54,7 +61,7 @@
   return (PrngMult * rnd + PrngAdd) & PrngModMask;
 }
 
-static double fast_log2(const double & d) {
+double ThreadHeapSampler::fast_log2(const double& d) {
   assert(d>0, "bad value passed to assert");
   uint64_t x = 0;
   assert(sizeof(d) == sizeof(x),
@@ -64,7 +71,9 @@
   assert(FastLogNumBits <= 20, "FastLogNumBits should be less than 20.");
   const uint32_t y = x_high >> (20 - FastLogNumBits) & FastLogMask;
   const int32_t exponent = ((x_high >> 20) & 0x7FF) - 1023;
-  return exponent + log_table[y];
+
+  assert(_log_table_initialized, "log table should be initialized");
+  return exponent + _log_table[y];
 }
 
 // Generates a geometric variable with the specified mean (512K by default).
@@ -134,36 +143,6 @@
   pick_next_sample(overflow_bytes);
 }
 
-void ThreadHeapSampler::init_log_table() {
-  MutexLockerEx mu(ThreadHeapSampler_lock, Mutex::_no_safepoint_check_flag);
-
-  if (log_table_initialized) {
-    return;
-  }
-
-  for (int i = 0; i < (1 << FastLogNumBits); i++) {
-    log_table[i] = (log(1.0 + static_cast<double>(i+0.5) / (1 << FastLogNumBits))
-                    / log(2.0));
-  }
-
-  log_table_initialized = true;
-}
-
-void ThreadHeapSampler::enable() {
-  // Done here to be done when things have settled. This adds a mutex lock but
-  // presumably, users won't be enabling and disabling all the time.
-  init_log_table();
-  OrderAccess::release_store(&_enabled, 1);
-}
-
-int ThreadHeapSampler::enabled() {
-  return OrderAccess::load_acquire(&_enabled);
-}
-
-void ThreadHeapSampler::disable() {
-  OrderAccess::release_store(&_enabled, 0);
-}
-
 int ThreadHeapSampler::get_sampling_interval() {
   return OrderAccess::load_acquire(&_sampling_interval);
 }
--- a/src/hotspot/share/runtime/threadHeapSampler.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/runtime/threadHeapSampler.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -30,16 +30,24 @@
 
 class ThreadHeapSampler {
  private:
+  // Statics for the fast log
+  static const int FastLogNumBits = 10;
+  static const int FastLogMask = (1 << FastLogNumBits) - 1;
+
   size_t _bytes_until_sample;
   // Cheap random number generator
   static uint64_t _rnd;
+  static bool _log_table_initialized;
+
+  static double _log_table[1<<FastLogNumBits];  // Constant
+  static volatile int _sampling_interval;
 
   void pick_next_geometric_sample();
   void pick_next_sample(size_t overflowed_bytes = 0);
-  static int _enabled;
-  static int _sampling_interval;
 
-  static void init_log_table();
+  static double fast_log2(const double& d);
+  static bool init_log_table();
+  uint64_t next_random(uint64_t rnd);
 
  public:
   ThreadHeapSampler() : _bytes_until_sample(0) {
@@ -54,10 +62,6 @@
 
   void check_for_sampling(oop obj, size_t size_in_bytes, size_t bytes_allocated_before);
 
-  static int enabled();
-  static void enable();
-  static void disable();
-
   static void set_sampling_interval(int sampling_interval);
   static int get_sampling_interval();
 };
--- a/src/java.base/share/classes/java/util/Locale.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/java.base/share/classes/java/util/Locale.java	Tue Oct 16 09:55:30 2018 -0400
@@ -2246,22 +2246,26 @@
 
     /**
      * @serialField language    String
-     *      language subtag in lower case. (See <a href="java/util/Locale.html#getLanguage()">getLanguage()</a>)
+     *      language subtag in lower case.
+     *      (See <a href="java.base/java/util/Locale.html#getLanguage()">getLanguage()</a>)
      * @serialField country     String
-     *      country subtag in upper case. (See <a href="java/util/Locale.html#getCountry()">getCountry()</a>)
+     *      country subtag in upper case.
+     *      (See <a href="java.base/java/util/Locale.html#getCountry()">getCountry()</a>)
      * @serialField variant     String
-     *      variant subtags separated by LOWLINE characters. (See <a href="java/util/Locale.html#getVariant()">getVariant()</a>)
+     *      variant subtags separated by LOWLINE characters.
+     *      (See <a href="java.base/java/util/Locale.html#getVariant()">getVariant()</a>)
      * @serialField hashcode    int
      *      deprecated, for forward compatibility only
      * @serialField script      String
-     *      script subtag in title case (See <a href="java/util/Locale.html#getScript()">getScript()</a>)
+     *      script subtag in title case
+     *      (See <a href="java.base/java/util/Locale.html#getScript()">getScript()</a>)
      * @serialField extensions  String
      *      canonical representation of extensions, that is,
      *      BCP47 extensions in alphabetical order followed by
      *      BCP47 private use subtags, all in lower case letters
      *      separated by HYPHEN-MINUS characters.
-     *      (See <a href="java/util/Locale.html#getExtensionKeys()">getExtensionKeys()</a>,
-     *      <a href="java/util/Locale.html#getExtension(char)">getExtension(char)</a>)
+     *      (See <a href="java.base/java/util/Locale.html#getExtensionKeys()">getExtensionKeys()</a>,
+     *      <a href="java.base/java/util/Locale.html#getExtension(char)">getExtension(char)</a>)
      */
     private static final ObjectStreamField[] serialPersistentFields = {
         new ObjectStreamField("language", String.class),
--- a/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,7 @@
  * <p>
  * <a id="formatting">
  * <b>Configuration:</b></a>
- * The {@code SimpleFormatter} is initialized with the
- * <a href="../Formatter.html#syntax">format string</a>
+ * The {@code SimpleFormatter} is initialized with the format string
  * specified in the {@code java.util.logging.SimpleFormatter.format}
  * property to {@linkplain #format(LogRecord) format} the log messages.
  * This property can be defined
@@ -69,8 +68,7 @@
     /**
      * Format the given LogRecord.
      * <p>
-     * The formatting can be customized by specifying the
-     * <a href="../Formatter.html#syntax">format string</a>
+     * The formatting can be customized by specifying the format string
      * in the <a href="#formatting">
      * {@code java.util.logging.SimpleFormatter.format}</a> property.
      * The given {@code LogRecord} will be formatted as if by calling:
--- a/src/java.security.jgss/share/native/libj2gss/NativeUtil.c	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/java.security.jgss/share/native/libj2gss/NativeUtil.c	Tue Oct 16 09:55:30 2018 -0400
@@ -145,7 +145,7 @@
     return JNI_ERR;
   }
   CLS_GSSNameElement = (*env)->NewGlobalRef(env, cls);
-  if (CLS_GSSException == NULL) {
+  if (CLS_GSSNameElement == NULL) {
     return JNI_ERR;
   }
   cls = (*env)->FindClass(env, "sun/security/jgss/wrapper/GSSCredElement");
--- a/src/java.xml/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/java.xml/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,15 +39,19 @@
  * @author Santiago PericasGeertsen
  */
 public class ThreadLocalBufferAllocator {
-   private static ThreadLocal<SoftReference<BufferAllocator>> tlba = new ThreadLocal<>();
+    private static final ThreadLocal<SoftReference<BufferAllocator>> TL = new ThreadLocal<>();
 
-   public static BufferAllocator getBufferAllocator() {
-        SoftReference<BufferAllocator> bAllocatorRef = tlba.get();
-        if (bAllocatorRef == null || bAllocatorRef.get() == null) {
-            bAllocatorRef = new SoftReference<>(new BufferAllocator());
-            tlba.set(bAllocatorRef);
+    public static BufferAllocator getBufferAllocator() {
+        BufferAllocator ba = null;
+        SoftReference<BufferAllocator> sr = TL.get();
+        if (sr != null) {
+            ba = sr.get();
         }
-
-        return bAllocatorRef.get();
-   }
+        if (ba == null) {
+            ba = new BufferAllocator();
+            sr = new SoftReference<>(ba);
+            TL.set(sr);
+        }
+        return ba;
+    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java	Tue Oct 16 09:55:30 2018 -0400
@@ -30,6 +30,8 @@
 import java.net.URI;
 import java.text.CollationKey;
 import java.text.Collator;
+import java.text.ParseException;
+import java.text.RuleBasedCollator;
 import java.util.*;
 import java.util.AbstractMap.SimpleEntry;
 import java.util.Map.Entry;
@@ -1588,7 +1590,7 @@
         private final Collator instance;
         private final int MAX_SIZE = 1000;
         private DocCollator(Locale locale, int strength) {
-            instance = Collator.getInstance(locale);
+            instance = createCollator(locale);
             instance.setStrength(strength);
 
             keys = new LinkedHashMap<String, CollationKey>(MAX_SIZE + 1, 0.75f, true) {
@@ -1607,6 +1609,21 @@
         public int compare(String s1, String s2) {
             return getKey(s1).compareTo(getKey(s2));
         }
+
+        private Collator createCollator(Locale locale) {
+            Collator baseCollator = Collator.getInstance(locale);
+            if (baseCollator instanceof RuleBasedCollator) {
+                // Extend collator to sort signatures with additional args and var-args in a well-defined order:
+                // () < (int) < (int, int) < (int...)
+                try {
+                    return new RuleBasedCollator(((RuleBasedCollator) baseCollator).getRules()
+                            + "& ')' < ',' < '.','['");
+                } catch (ParseException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+            return baseCollator;
+        }
     }
 
     private Comparator<Element> moduleComparator = null;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/codegen/TestTrichotomyExpressions.java	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,2519 @@
+/*
+ * 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 8210215
+ * @summary Test that C2 correctly optimizes trichotomy expressions.
+ * @library /test/lib
+ * @run main/othervm -XX:-TieredCompilation -Xbatch
+ *                   -XX:CompileCommand=dontinline,compiler.codegen.TestTrichotomyExpressions::test*
+ *                   compiler.codegen.TestTrichotomyExpressions
+ * @run main/othervm -XX:-TieredCompilation -Xcomp
+ *                   -XX:CompileCommand=dontinline,compiler.codegen.TestTrichotomyExpressions::test*
+ *                   compiler.codegen.TestTrichotomyExpressions
+ */
+
+package compiler.codegen;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Method;
+import java.util.Random;
+
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
+
+enum Operation { SMALLER, SMALLER_EQUAL, EQUAL, GREATER_EQUAL, GREATER, ALWAYS_FALSE }
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@interface Test {
+    Operation op();
+}
+
+public class TestTrichotomyExpressions {
+
+    public static int compare1(int a, int b) {
+        return (a < b) ? -1 : (a == b) ? 0 : 1;
+    }
+
+    public static int compare2(int a, int b) {
+        return (a < b) ? -1 : (a <= b) ? 0 : 1;
+    }
+
+    public static int compare3(int a, int b) {
+        return (a < b) ? -1 : (a > b) ? 1 : 0;
+    }
+
+    public static int compare4(int a, int b) {
+        return (a < b) ? -1 : (a != b) ? 1 : 0;
+    }
+
+    public static int compare5(int a, int b) {
+        return (a > b) ? 1 : (a < b) ? -1 : 0;
+    }
+
+    public static int compare6(int a, int b) {
+        return (a > b) ? 1 : (a == b) ? 0 : -1;
+    }
+
+    public static int compare7(int a, int b) {
+        return (a > b) ? 1 : (a >= b) ? 0 : -1;
+    }
+
+    public static int compare8(int a, int b) {
+        return (a > b) ? 1 : (a != b) ? -1 : 0;
+    }
+
+    public static int compare9(int a, int b) {
+        return (a == b) ? 0 : (a < b) ? -1 : 1;
+    }
+
+    public static int compare10(int a, int b) {
+        return (a == b) ? 0 : (a <= b) ? -1 : 1;
+    }
+
+    public static int compare11(int a, int b) {
+        return (a == b) ? 0 : (a > b) ? 1 : -1;
+    }
+
+    public static int compare12(int a, int b) {
+        return (a == b) ? 0 : (a >= b) ? 1 : -1;
+    }
+
+    public static int compare13(int a, int b) {
+        return (a <= b) ? ((a == b) ? 0 : -1) : 1;
+    }
+
+    public static int compare14(int a, int b) {
+        return (a <= b) ? ((a < b) ? -1 : 0) : 1;
+    }
+
+    public static int compare15(int a, int b) {
+        return (a <= b) ? ((a >= b) ? 0 : -1) : 1;
+    }
+
+    public static int compare16(int a, int b) {
+        return (a <= b) ? ((a != b) ? -1 : 0) : 1;
+    }
+
+    public static int compare17(int a, int b) {
+        return (a >= b) ? ((a <= b) ? 0 : 1) : -1;
+    }
+
+    public static int compare18(int a, int b) {
+        return (a >= b) ? ((a == b) ? 0 : 1) : -1;
+    }
+
+    public static int compare19(int a, int b) {
+        return (a >= b) ? ((a > b) ? 1 : 0) : -1;
+    }
+
+    public static int compare20(int a, int b) {
+        return (a >= b) ? ((a != b) ? 1 : 0) : -1;
+    }
+
+    public static int compare21(int a, int b) {
+        return (a != b) ? ((a < b) ? -1 : 1) : 0;
+    }
+
+    public static int compare22(int a, int b) {
+        return (a != b) ? ((a <= b) ? -1 : 1) : 0;
+    }
+
+    public static int compare23(int a, int b) {
+        return (a != b) ? ((a > b) ? 1 : -1) : 0;
+    }
+
+    public static int compare24(int a, int b) {
+        return (a != b) ? ((a >= b) ? 1 : -1) : 0;
+    }
+
+    public static int compare25(int a, int b) {
+        return (a < b) ? -1 : (b == a) ? 0 : 1;
+    }
+
+    public static int compare26(int a, int b) {
+        return (a < b) ? -1 : (b >= a) ? 0 : 1;
+    }
+
+    public static int compare27(int a, int b) {
+        return (a < b) ? -1 : (b < a) ? 1 : 0;
+    }
+
+    public static int compare28(int a, int b) {
+        return (a < b) ? -1 : (b != a) ? 1 : 0;
+    }
+
+    public static int compare29(int a, int b) {
+        return (a > b) ? 1 : (b > a) ? -1 : 0;
+    }
+
+    public static int compare30(int a, int b) {
+        return (a > b) ? 1 : (b == a) ? 0 : -1;
+    }
+
+    public static int compare31(int a, int b) {
+        return (a > b) ? 1 : (b <= a) ? 0 : -1;
+    }
+
+    public static int compare32(int a, int b) {
+        return (a > b) ? 1 : (b != a) ? -1 : 0;
+    }
+
+    public static int compare33(int a, int b) {
+        return (a == b) ? 0 : (b > a) ? -1 : 1;
+    }
+
+    public static int compare34(int a, int b) {
+        return (a == b) ? 0 : (b >= a) ? -1 : 1;
+    }
+
+    public static int compare35(int a, int b) {
+        return (a == b) ? 0 : (b < a) ? 1 : -1;
+    }
+
+    public static int compare36(int a, int b) {
+        return (a == b) ? 0 : (b <= a) ? 1 : -1;
+    }
+
+    public static int compare37(int a, int b) {
+        return (a <= b) ? ((b == a) ? 0 : -1) : 1;
+    }
+
+    public static int compare38(int a, int b) {
+        return (a <= b) ? ((b > a) ? -1 : 0) : 1;
+    }
+
+    public static int compare39(int a, int b) {
+        return (a <= b) ? ((b <= a) ? 0 : -1) : 1;
+    }
+
+    public static int compare40(int a, int b) {
+        return (a <= b) ? ((b != a) ? -1 : 0) : 1;
+    }
+
+    public static int compare41(int a, int b) {
+        return (a >= b) ? ((b >= a) ? 0 : 1) : -1;
+    }
+
+    public static int compare42(int a, int b) {
+        return (a >= b) ? ((b == a) ? 0 : 1) : -1;
+    }
+
+    public static int compare43(int a, int b) {
+        return (a >= b) ? ((b < a) ? 1 : 0) : -1;
+    }
+
+    public static int compare44(int a, int b) {
+        return (a >= b) ? ((b != a) ? 1 : 0) : -1;
+    }
+
+    public static int compare45(int a, int b) {
+        return (a != b) ? ((b > a) ? -1 : 1) : 0;
+    }
+
+    public static int compare46(int a, int b) {
+        return (a != b) ? ((b >= a) ? -1 : 1) : 0;
+    }
+
+    public static int compare47(int a, int b) {
+        return (a != b) ? ((b < a) ? 1 : -1) : 0;
+    }
+
+    public static int compare48(int a, int b) {
+        return (a != b) ? ((b <= a) ? 1 : -1) : 0;
+    }
+
+
+    public static int compareAlwaysFalse1(int a, int b) {
+        return (a >= b) ? 1 : (a > b) ? 2 : -1;
+    }
+
+    public static int compareAlwaysFalse2(int a, int b) {
+        return (a <= b) ? 1 : (a < b) ? 2 : -1;
+    }
+
+    public static int compareAlwaysFalse3(int a, int b) {
+        return (a == b) ? 1 : (a == b) ? 2 : -1;
+    }
+
+    public static int compareAlwaysFalse4(int a, int b) {
+        return (a != b) ? 1 : (a < b) ? 2 : -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller1(int a, int b) {
+        return compare1(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller2(int a, int b) {
+        return compare1(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller3(int a, int b) {
+        return compare1(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller4(int a, int b) {
+        return compare2(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller5(int a, int b) {
+        return compare2(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller6(int a, int b) {
+        return compare2(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller7(int a, int b) {
+        return compare3(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller8(int a, int b) {
+        return compare3(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller9(int a, int b) {
+        return compare3(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller10(int a, int b) {
+        return compare4(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller11(int a, int b) {
+        return compare4(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller12(int a, int b) {
+        return compare4(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller13(int a, int b) {
+        return compare5(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller14(int a, int b) {
+        return compare5(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller15(int a, int b) {
+        return compare5(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller16(int a, int b) {
+        return compare6(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller17(int a, int b) {
+        return compare6(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller18(int a, int b) {
+        return compare6(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller19(int a, int b) {
+        return compare7(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller20(int a, int b) {
+        return compare7(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller21(int a, int b) {
+        return compare7(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller22(int a, int b) {
+        return compare8(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller23(int a, int b) {
+        return compare8(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller24(int a, int b) {
+        return compare8(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller25(int a, int b) {
+        return compare9(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller26(int a, int b) {
+        return compare9(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller27(int a, int b) {
+        return compare9(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller28(int a, int b) {
+        return compare10(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller29(int a, int b) {
+        return compare10(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller30(int a, int b) {
+        return compare10(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller31(int a, int b) {
+        return compare11(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller32(int a, int b) {
+        return compare11(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller33(int a, int b) {
+        return compare11(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller34(int a, int b) {
+        return compare12(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller35(int a, int b) {
+        return compare12(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller36(int a, int b) {
+        return compare12(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller37(int a, int b) {
+        return compare13(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller38(int a, int b) {
+        return compare13(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller39(int a, int b) {
+        return compare13(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller40(int a, int b) {
+        return compare14(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller41(int a, int b) {
+        return compare14(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller42(int a, int b) {
+        return compare14(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller43(int a, int b) {
+        return compare15(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller44(int a, int b) {
+        return compare15(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller45(int a, int b) {
+        return compare15(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller46(int a, int b) {
+        return compare16(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller47(int a, int b) {
+        return compare16(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller48(int a, int b) {
+        return compare16(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller49(int a, int b) {
+        return compare17(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller50(int a, int b) {
+        return compare17(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller51(int a, int b) {
+        return compare17(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller52(int a, int b) {
+        return compare18(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller53(int a, int b) {
+        return compare18(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller54(int a, int b) {
+        return compare18(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller55(int a, int b) {
+        return compare19(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller56(int a, int b) {
+        return compare19(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller57(int a, int b) {
+        return compare19(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller58(int a, int b) {
+        return compare20(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller59(int a, int b) {
+        return compare20(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller60(int a, int b) {
+        return compare20(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller61(int a, int b) {
+        return compare21(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller62(int a, int b) {
+        return compare21(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller63(int a, int b) {
+        return compare21(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller64(int a, int b) {
+        return compare22(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller65(int a, int b) {
+        return compare22(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller66(int a, int b) {
+        return compare22(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller67(int a, int b) {
+        return compare23(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller68(int a, int b) {
+        return compare23(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller69(int a, int b) {
+        return compare23(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller70(int a, int b) {
+        return compare24(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller71(int a, int b) {
+        return compare24(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller72(int a, int b) {
+        return compare24(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller73(int a, int b) {
+        return compare25(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller74(int a, int b) {
+        return compare25(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller75(int a, int b) {
+        return compare25(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller76(int a, int b) {
+        return compare26(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller77(int a, int b) {
+        return compare26(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller78(int a, int b) {
+        return compare26(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller79(int a, int b) {
+        return compare27(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller80(int a, int b) {
+        return compare27(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller81(int a, int b) {
+        return compare27(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller82(int a, int b) {
+        return compare28(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller83(int a, int b) {
+        return compare28(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller84(int a, int b) {
+        return compare28(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller85(int a, int b) {
+        return compare29(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller86(int a, int b) {
+        return compare29(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller87(int a, int b) {
+        return compare29(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller88(int a, int b) {
+        return compare30(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller89(int a, int b) {
+        return compare30(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller90(int a, int b) {
+        return compare30(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller91(int a, int b) {
+        return compare31(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller92(int a, int b) {
+        return compare31(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller93(int a, int b) {
+        return compare31(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller94(int a, int b) {
+        return compare32(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller95(int a, int b) {
+        return compare32(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller96(int a, int b) {
+        return compare32(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller97(int a, int b) {
+        return compare33(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller98(int a, int b) {
+        return compare33(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller99(int a, int b) {
+        return compare33(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller100(int a, int b) {
+        return compare34(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller101(int a, int b) {
+        return compare34(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller102(int a, int b) {
+        return compare34(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller103(int a, int b) {
+        return compare35(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller104(int a, int b) {
+        return compare35(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller105(int a, int b) {
+        return compare35(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller106(int a, int b) {
+        return compare36(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller107(int a, int b) {
+        return compare36(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller108(int a, int b) {
+        return compare36(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller109(int a, int b) {
+        return compare37(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller110(int a, int b) {
+        return compare37(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller111(int a, int b) {
+        return compare37(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller112(int a, int b) {
+        return compare38(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller113(int a, int b) {
+        return compare38(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller114(int a, int b) {
+        return compare38(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller115(int a, int b) {
+        return compare39(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller116(int a, int b) {
+        return compare39(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller117(int a, int b) {
+        return compare39(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller118(int a, int b) {
+        return compare40(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller119(int a, int b) {
+        return compare40(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller120(int a, int b) {
+        return compare40(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller121(int a, int b) {
+        return compare41(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller122(int a, int b) {
+        return compare41(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller123(int a, int b) {
+        return compare41(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller124(int a, int b) {
+        return compare42(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller125(int a, int b) {
+        return compare42(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller126(int a, int b) {
+        return compare42(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller127(int a, int b) {
+        return compare43(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller128(int a, int b) {
+        return compare43(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller129(int a, int b) {
+        return compare43(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller130(int a, int b) {
+        return compare44(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller131(int a, int b) {
+        return compare44(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller132(int a, int b) {
+        return compare44(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller133(int a, int b) {
+        return compare45(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller134(int a, int b) {
+        return compare45(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller135(int a, int b) {
+        return compare45(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller136(int a, int b) {
+        return compare46(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller137(int a, int b) {
+        return compare46(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller138(int a, int b) {
+        return compare46(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller139(int a, int b) {
+        return compare47(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller140(int a, int b) {
+        return compare47(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller141(int a, int b) {
+        return compare47(a, b) <= -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller142(int a, int b) {
+        return compare48(a, b) == -1;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller143(int a, int b) {
+        return compare48(a, b) < 0;
+    }
+
+    @Test(op = Operation.SMALLER)
+    public static boolean testSmaller144(int a, int b) {
+        return compare48(a, b) <= -1;
+    }
+
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual1(int a, int b) {
+        return compare1(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual2(int a, int b) {
+        return compare2(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual3(int a, int b) {
+        return compare3(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual4(int a, int b) {
+        return compare4(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual5(int a, int b) {
+        return compare5(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual6(int a, int b) {
+        return compare6(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual7(int a, int b) {
+        return compare7(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual8(int a, int b) {
+        return compare8(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual9(int a, int b) {
+        return compare9(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual10(int a, int b) {
+        return compare10(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual11(int a, int b) {
+        return compare11(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual12(int a, int b) {
+        return compare12(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual13(int a, int b) {
+        return compare13(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual14(int a, int b) {
+        return compare14(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual15(int a, int b) {
+        return compare15(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual16(int a, int b) {
+        return compare16(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual17(int a, int b) {
+        return compare17(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual18(int a, int b) {
+        return compare18(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual19(int a, int b) {
+        return compare19(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual20(int a, int b) {
+        return compare20(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual21(int a, int b) {
+        return compare21(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual22(int a, int b) {
+        return compare22(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual23(int a, int b) {
+        return compare23(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual24(int a, int b) {
+        return compare24(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual25(int a, int b) {
+        return compare2(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual26(int a, int b) {
+        return compare26(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual27(int a, int b) {
+        return compare27(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual28(int a, int b) {
+        return compare28(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual29(int a, int b) {
+        return compare29(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual30(int a, int b) {
+        return compare30(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual31(int a, int b) {
+        return compare31(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual32(int a, int b) {
+        return compare32(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual33(int a, int b) {
+        return compare33(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual34(int a, int b) {
+        return compare34(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual35(int a, int b) {
+        return compare35(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual36(int a, int b) {
+        return compare36(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual37(int a, int b) {
+        return compare37(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual38(int a, int b) {
+        return compare38(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual39(int a, int b) {
+        return compare39(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual40(int a, int b) {
+        return compare40(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual41(int a, int b) {
+        return compare41(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual42(int a, int b) {
+        return compare42(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual43(int a, int b) {
+        return compare43(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual44(int a, int b) {
+        return compare44(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual45(int a, int b) {
+        return compare45(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual46(int a, int b) {
+        return compare46(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual47(int a, int b) {
+        return compare47(a, b) <= 0;
+    }
+
+    @Test(op = Operation.SMALLER_EQUAL)
+    public static boolean testSmallerEqual48(int a, int b) {
+        return compare48(a, b) <= 0;
+    }
+
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual1(int a, int b) {
+        return compare1(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual2(int a, int b) {
+        return compare2(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual3(int a, int b) {
+        return compare3(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual4(int a, int b) {
+        return compare4(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual5(int a, int b) {
+        return compare5(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual6(int a, int b) {
+        return compare6(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual7(int a, int b) {
+        return compare7(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual8(int a, int b) {
+        return compare8(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual9(int a, int b) {
+        return compare9(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual10(int a, int b) {
+        return compare10(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual11(int a, int b) {
+        return compare11(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual12(int a, int b) {
+        return compare12(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual13(int a, int b) {
+        return compare13(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual14(int a, int b) {
+        return compare14(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual15(int a, int b) {
+        return compare15(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual16(int a, int b) {
+        return compare16(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual17(int a, int b) {
+        return compare17(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual18(int a, int b) {
+        return compare18(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual19(int a, int b) {
+        return compare19(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual20(int a, int b) {
+        return compare20(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual21(int a, int b) {
+        return compare21(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual22(int a, int b) {
+        return compare22(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual23(int a, int b) {
+        return compare23(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual24(int a, int b) {
+        return compare24(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual25(int a, int b) {
+        return compare25(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual26(int a, int b) {
+        return compare26(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual27(int a, int b) {
+        return compare27(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual28(int a, int b) {
+        return compare28(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual29(int a, int b) {
+        return compare29(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual30(int a, int b) {
+        return compare30(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual31(int a, int b) {
+        return compare31(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual32(int a, int b) {
+        return compare32(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual33(int a, int b) {
+        return compare33(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual34(int a, int b) {
+        return compare34(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual35(int a, int b) {
+        return compare35(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual36(int a, int b) {
+        return compare36(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual37(int a, int b) {
+        return compare37(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual38(int a, int b) {
+        return compare38(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual39(int a, int b) {
+        return compare39(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual40(int a, int b) {
+        return compare40(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual41(int a, int b) {
+        return compare41(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual42(int a, int b) {
+        return compare42(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual43(int a, int b) {
+        return compare43(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual44(int a, int b) {
+        return compare44(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual45(int a, int b) {
+        return compare45(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual46(int a, int b) {
+        return compare46(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual47(int a, int b) {
+        return compare47(a, b) == 0;
+    }
+
+    @Test(op = Operation.EQUAL)
+    public static boolean testEqual48(int a, int b) {
+        return compare48(a, b) == 0;
+    }
+
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual1(int a, int b) {
+        return compare1(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual2(int a, int b) {
+        return compare2(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual3(int a, int b) {
+        return compare3(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual4(int a, int b) {
+        return compare4(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual5(int a, int b) {
+        return compare5(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual6(int a, int b) {
+        return compare6(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual7(int a, int b) {
+        return compare7(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual8(int a, int b) {
+        return compare8(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual9(int a, int b) {
+        return compare9(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual10(int a, int b) {
+        return compare10(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual11(int a, int b) {
+        return compare11(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual12(int a, int b) {
+        return compare12(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual13(int a, int b) {
+        return compare13(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual14(int a, int b) {
+        return compare14(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual15(int a, int b) {
+        return compare15(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual16(int a, int b) {
+        return compare16(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual17(int a, int b) {
+        return compare17(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual18(int a, int b) {
+        return compare18(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual19(int a, int b) {
+        return compare19(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual20(int a, int b) {
+        return compare20(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual21(int a, int b) {
+        return compare21(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual22(int a, int b) {
+        return compare22(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual23(int a, int b) {
+        return compare23(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual24(int a, int b) {
+        return compare24(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual25(int a, int b) {
+        return compare25(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual26(int a, int b) {
+        return compare26(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual27(int a, int b) {
+        return compare27(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual28(int a, int b) {
+        return compare28(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual29(int a, int b) {
+        return compare29(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual30(int a, int b) {
+        return compare30(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual31(int a, int b) {
+        return compare31(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual32(int a, int b) {
+        return compare32(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual33(int a, int b) {
+        return compare33(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual34(int a, int b) {
+        return compare34(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual35(int a, int b) {
+        return compare35(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual36(int a, int b) {
+        return compare36(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual37(int a, int b) {
+        return compare37(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual38(int a, int b) {
+        return compare38(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual39(int a, int b) {
+        return compare39(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual40(int a, int b) {
+        return compare40(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual41(int a, int b) {
+        return compare41(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual42(int a, int b) {
+        return compare42(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual43(int a, int b) {
+        return compare43(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual44(int a, int b) {
+        return compare44(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual45(int a, int b) {
+        return compare45(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual46(int a, int b) {
+        return compare46(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual47(int a, int b) {
+        return compare47(a, b) >= 0;
+    }
+
+    @Test(op = Operation.GREATER_EQUAL)
+    public static boolean testGreaterEqual48(int a, int b) {
+        return compare48(a, b) >= 0;
+    }
+
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater1(int a, int b) {
+        return compare1(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater2(int a, int b) {
+        return compare1(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater3(int a, int b) {
+        return compare1(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater4(int a, int b) {
+        return compare2(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater5(int a, int b) {
+        return compare2(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater6(int a, int b) {
+        return compare2(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater7(int a, int b) {
+        return compare3(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater8(int a, int b) {
+        return compare3(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater9(int a, int b) {
+        return compare3(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater10(int a, int b) {
+        return compare4(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater11(int a, int b) {
+        return compare4(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater12(int a, int b) {
+        return compare4(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater13(int a, int b) {
+        return compare5(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater14(int a, int b) {
+        return compare5(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater15(int a, int b) {
+        return compare5(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater16(int a, int b) {
+        return compare6(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater17(int a, int b) {
+        return compare6(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater18(int a, int b) {
+        return compare6(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater19(int a, int b) {
+        return compare7(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater20(int a, int b) {
+        return compare7(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater21(int a, int b) {
+        return compare7(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater22(int a, int b) {
+        return compare8(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater23(int a, int b) {
+        return compare8(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater24(int a, int b) {
+        return compare8(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater25(int a, int b) {
+        return compare9(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater26(int a, int b) {
+        return compare9(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater27(int a, int b) {
+        return compare9(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater28(int a, int b) {
+        return compare10(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater29(int a, int b) {
+        return compare10(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater30(int a, int b) {
+        return compare10(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater31(int a, int b) {
+        return compare11(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater32(int a, int b) {
+        return compare11(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater33(int a, int b) {
+        return compare11(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater34(int a, int b) {
+        return compare12(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater35(int a, int b) {
+        return compare12(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater36(int a, int b) {
+        return compare12(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater37(int a, int b) {
+        return compare13(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater38(int a, int b) {
+        return compare13(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater39(int a, int b) {
+        return compare13(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater40(int a, int b) {
+        return compare14(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater41(int a, int b) {
+        return compare14(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater42(int a, int b) {
+        return compare14(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater43(int a, int b) {
+        return compare15(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater44(int a, int b) {
+        return compare15(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater45(int a, int b) {
+        return compare15(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater46(int a, int b) {
+        return compare16(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater47(int a, int b) {
+        return compare16(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater48(int a, int b) {
+        return compare16(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater49(int a, int b) {
+        return compare17(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater50(int a, int b) {
+        return compare17(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater51(int a, int b) {
+        return compare17(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater52(int a, int b) {
+        return compare18(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater53(int a, int b) {
+        return compare18(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater54(int a, int b) {
+        return compare18(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater55(int a, int b) {
+        return compare19(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater56(int a, int b) {
+        return compare19(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater57(int a, int b) {
+        return compare19(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater58(int a, int b) {
+        return compare20(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater59(int a, int b) {
+        return compare20(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater60(int a, int b) {
+        return compare20(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater61(int a, int b) {
+        return compare21(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater62(int a, int b) {
+        return compare21(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater63(int a, int b) {
+        return compare21(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater64(int a, int b) {
+        return compare22(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater65(int a, int b) {
+        return compare22(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater66(int a, int b) {
+        return compare22(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater67(int a, int b) {
+        return compare23(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater68(int a, int b) {
+        return compare23(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater69(int a, int b) {
+        return compare23(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater70(int a, int b) {
+        return compare24(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater71(int a, int b) {
+        return compare24(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater72(int a, int b) {
+        return compare24(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater73(int a, int b) {
+        return compare25(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater74(int a, int b) {
+        return compare25(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater75(int a, int b) {
+        return compare25(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater76(int a, int b) {
+        return compare26(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater77(int a, int b) {
+        return compare26(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater78(int a, int b) {
+        return compare26(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater79(int a, int b) {
+        return compare27(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater80(int a, int b) {
+        return compare27(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater81(int a, int b) {
+        return compare27(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater82(int a, int b) {
+        return compare28(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater83(int a, int b) {
+        return compare28(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater84(int a, int b) {
+        return compare28(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater85(int a, int b) {
+        return compare29(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater86(int a, int b) {
+        return compare29(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater87(int a, int b) {
+        return compare29(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater88(int a, int b) {
+        return compare30(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater89(int a, int b) {
+        return compare30(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater90(int a, int b) {
+        return compare30(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater91(int a, int b) {
+        return compare31(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater92(int a, int b) {
+        return compare31(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater93(int a, int b) {
+        return compare31(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater94(int a, int b) {
+        return compare32(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater95(int a, int b) {
+        return compare32(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater96(int a, int b) {
+        return compare32(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater97(int a, int b) {
+        return compare33(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater98(int a, int b) {
+        return compare33(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater99(int a, int b) {
+        return compare33(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater100(int a, int b) {
+        return compare34(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater101(int a, int b) {
+        return compare34(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater102(int a, int b) {
+        return compare34(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater103(int a, int b) {
+        return compare35(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater104(int a, int b) {
+        return compare35(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater105(int a, int b) {
+        return compare35(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater106(int a, int b) {
+        return compare36(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater107(int a, int b) {
+        return compare36(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater108(int a, int b) {
+        return compare36(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater109(int a, int b) {
+        return compare37(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater110(int a, int b) {
+        return compare37(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater111(int a, int b) {
+        return compare37(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater112(int a, int b) {
+        return compare38(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater113(int a, int b) {
+        return compare38(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater114(int a, int b) {
+        return compare38(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater115(int a, int b) {
+        return compare39(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater116(int a, int b) {
+        return compare39(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater117(int a, int b) {
+        return compare39(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater118(int a, int b) {
+        return compare40(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater119(int a, int b) {
+        return compare40(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater120(int a, int b) {
+        return compare40(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater121(int a, int b) {
+        return compare41(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater122(int a, int b) {
+        return compare41(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater123(int a, int b) {
+        return compare41(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater124(int a, int b) {
+        return compare42(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater125(int a, int b) {
+        return compare42(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater126(int a, int b) {
+        return compare42(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater127(int a, int b) {
+        return compare43(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater128(int a, int b) {
+        return compare43(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater129(int a, int b) {
+        return compare43(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater130(int a, int b) {
+        return compare44(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater131(int a, int b) {
+        return compare44(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater132(int a, int b) {
+        return compare44(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater133(int a, int b) {
+        return compare45(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater134(int a, int b) {
+        return compare45(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater135(int a, int b) {
+        return compare45(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater136(int a, int b) {
+        return compare46(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater137(int a, int b) {
+        return compare46(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater138(int a, int b) {
+        return compare46(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater139(int a, int b) {
+        return compare47(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater140(int a, int b) {
+        return compare47(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater141(int a, int b) {
+        return compare47(a, b) >= 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater142(int a, int b) {
+        return compare48(a, b) == 1;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater143(int a, int b) {
+        return compare48(a, b) > 0;
+    }
+
+    @Test(op = Operation.GREATER)
+    public static boolean testGreater144(int a, int b) {
+        return compare48(a, b) >= 1;
+    }
+
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse1(int a, int b) {
+        return compareAlwaysFalse1(a, b) == 2;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse2(int a, int b) {
+        return compareAlwaysFalse1(a, b) > 1;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse3(int a, int b) {
+        return compareAlwaysFalse1(a, b) >= 2;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse4(int a, int b) {
+        return compareAlwaysFalse2(a, b) == 2;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse5(int a, int b) {
+        return compareAlwaysFalse2(a, b) > 1;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse6(int a, int b) {
+        return compareAlwaysFalse2(a, b) >= 2;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse7(int a, int b) {
+        return compareAlwaysFalse3(a, b) == 2;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse8(int a, int b) {
+        return compareAlwaysFalse3(a, b) > 1;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse9(int a, int b) {
+        return compareAlwaysFalse3(a, b) >= 2;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse10(int a, int b) {
+        return compareAlwaysFalse4(a, b) == 2;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse11(int a, int b) {
+        return compareAlwaysFalse4(a, b) > 1;
+    }
+
+    @Test(op = Operation.ALWAYS_FALSE)
+    public static boolean testAlwaysFalse12(int a, int b) {
+        return compareAlwaysFalse4(a, b) >= 2;
+    }
+
+    public static void main(String[] args) throws Exception {
+        Random rand = Utils.getRandomInstance();
+        for (int i = 0; i < 20_000; ++i) {
+            int low = rand.nextInt();
+            int high = rand.nextInt();
+            if (low == high) {
+                --low;
+            }
+            if (low > high) {
+                int tmp = low;
+                low = high;
+                high = tmp;
+            }
+            for (Method m : TestTrichotomyExpressions.class.getMethods()) {
+                if (m.isAnnotationPresent(Test.class)) {
+                    Operation op = m.getAnnotation(Test.class).op();
+                    boolean result = (boolean)m.invoke(null, low, low);
+                    Asserts.assertEquals(result, (op == Operation.EQUAL || op == Operation.SMALLER_EQUAL || op == Operation.GREATER_EQUAL) ? true : false, m + " failed");
+                    result = (boolean)m.invoke(null, low, high);
+                    Asserts.assertEquals(result, (op == Operation.SMALLER || op == Operation.SMALLER_EQUAL) ? true : false, m + " failed");
+                    result = (boolean)m.invoke(null, high, low);
+                    Asserts.assertEquals(result, (op == Operation.GREATER || op == Operation.GREATER_EQUAL) ? true : false, m + " failed");
+                }
+            }
+        }
+    }
+}
--- a/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java	Tue Oct 16 09:55:30 2018 -0400
@@ -33,7 +33,7 @@
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  *
- * @run main/othervm
+ * @run main/othervm/timeout=300
  *        -Xbootclasspath/a:.
  *        -XX:+UnlockDiagnosticVMOptions
  *        -XX:+WhiteBoxAPI
--- a/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -34,5 +34,6 @@
  *
  * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
  *
- * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.Math_[a-lA-L] -exclude ExcludeList.txt
+ * @run main/othervm/timeout=300 compiler.graalunit.common.GraalUnitTestLauncher
+ *     -prefix org.graalvm.compiler.jtt.lang.Math_[a-lA-L] -exclude ExcludeList.txt
  */
--- a/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -34,5 +34,6 @@
  *
  * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
  *
- * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.Math_[m-zM-Z] -exclude ExcludeList.txt
+ * @run main/othervm/timeout=300 compiler.graalunit.common.GraalUnitTestLauncher
+ *     -prefix org.graalvm.compiler.jtt.lang.Math_[m-zM-Z] -exclude ExcludeList.txt
  */
--- a/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,7 +25,7 @@
  * @test
  * @library /test/lib /
  *
- * @run driver compiler.jsr292.ContinuousCallSiteTargetChange
+ * @run driver/timeout=300 compiler.jsr292.ContinuousCallSiteTargetChange
  */
 
 package compiler.jsr292;
--- a/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationApp.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationApp.java	Tue Oct 16 09:55:30 2018 -0400
@@ -116,10 +116,10 @@
         System.out.println("INFO: AppCDSv1 " + (wb.isSharedClass(InstrumentationApp.class) ? "enabled" :"disabled"));
         System.out.println("INFO: AppCDSv2 " + (isAppCDSV2Enabled()                        ? "enabled" : "disabled"));
 
-        File bootJar = new File(args[0]);
-        File appJar  = new File(args[1]);
-        File custJar = new File(args[2]);
-        String flagFile = args[3];
+        String flagFile = args[0];
+        File bootJar = new File(args[1]);
+        File appJar  = new File(args[2]);
+        File custJar = new File(args[3]);
         waitAttach(flagFile);
 
         instrumentation = InstrumentationRegisterClassFileTransformer.getInstrumentation();
--- a/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -120,7 +120,7 @@
                 "-XX:+WhiteBoxAPI",
                 "-Xshare:off",
                 agentCmdArg,
-                "InstrumentationApp", bootJar, appJar, custJar, flagFile);
+                "InstrumentationApp", flagFile, bootJar, appJar, custJar);
         TestCommon.executeAndLog(pb, "no-sharing").shouldHaveExitValue(0);
         checkAttach(t);
 
@@ -155,7 +155,7 @@
                 "-XX:+UnlockDiagnosticVMOptions",
                 "-XX:+WhiteBoxAPI",
                 agentCmdArg,
-               "InstrumentationApp", bootJar, appJar, custJar, flagFile);
+               "InstrumentationApp", flagFile, bootJar, appJar, custJar);
 
         CDSOptions opts = (new CDSOptions()).setXShareMode("auto");
         TestCommon.checkExec(out, opts);
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/BooleanArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/BooleanArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,7 +36,9 @@
  * Signature: ([Z)Z
  */
 JNIEXPORT jboolean JNICALL Java_nsk_share_gc_lock_jni_BooleanArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jbooleanArray arr;
         jboolean *pa;
@@ -44,22 +47,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return JNI_FALSE;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return JNI_FALSE;
-                }
         }
         arr = (jbooleanArray) env->GetObjectField(o, objFieldId);
-        if (arr == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return JNI_FALSE;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetArrayLength(arr);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ByteArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ByteArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -34,7 +35,9 @@
  * Method:    criticalNative
  */
 JNIEXPORT jbyte JNICALL Java_nsk_share_gc_lock_jni_ByteArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jbyteArray arr;
         jbyte *pa;
@@ -43,22 +46,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return 0;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return 0;
-                }
         }
         arr = (jbyteArray) env->GetObjectField(o, objFieldId);
-        if (arr == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return 0;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetArrayLength(arr);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/CharArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/CharArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,7 +36,9 @@
  * Signature: ([Z)Z
  */
 JNIEXPORT jchar JNICALL Java_nsk_share_gc_lock_jni_CharArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jcharArray arr;
         jchar *pa;
@@ -44,22 +47,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return 0;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return 0;
-                }
         }
         arr = (jcharArray) env->GetObjectField(o, objFieldId);
-        if (arr == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return JNI_FALSE;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetArrayLength(arr);
         start_time = time(NULL);
         current_time = 0;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/DoubleArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/DoubleArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,7 +36,9 @@
  * Signature: ([Z)Z
  */
 JNIEXPORT jdouble JNICALL Java_nsk_share_gc_lock_jni_DoubleArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jdoubleArray arr;
         jdouble *pa;
@@ -44,22 +47,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return 0;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return 0;
-                }
         }
         arr = (jdoubleArray) env->GetObjectField(o, objFieldId);
-        if (arr == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return JNI_FALSE;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetArrayLength(arr);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/FloatArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/FloatArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,7 +36,9 @@
  * Signature: ([Z)Z
  */
 JNIEXPORT jfloat JNICALL Java_nsk_share_gc_lock_jni_FloatArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jfloatArray arr;
         jfloat *pa;
@@ -44,22 +47,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return 0;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return 0;
-                }
         }
         arr = (jfloatArray) env->GetObjectField(o, objFieldId);
-        if (arr == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return JNI_FALSE;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetArrayLength(arr);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/IntArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/IntArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,7 +36,9 @@
  * Signature: ([Z)Z
  */
 JNIEXPORT jint JNICALL Java_nsk_share_gc_lock_jni_IntArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jintArray arr;
         jint *pa;
@@ -44,22 +47,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return 0;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return 0;
-                }
         }
         arr = (jintArray) env->GetObjectField(o, objFieldId);
-        if (arr == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return JNI_FALSE;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetArrayLength(arr);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/LongArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/LongArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,7 +36,9 @@
  * Signature: ([Z)Z
  */
 JNIEXPORT jlong JNICALL Java_nsk_share_gc_lock_jni_LongArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jlongArray arr;
         jlong *pa;
@@ -44,22 +47,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return 0;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return 0;
-                }
         }
         arr = (jlongArray) env->GetObjectField(o, objFieldId);
-        if (arr == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return JNI_FALSE;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetArrayLength(arr);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ShortArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ShortArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,7 +36,9 @@
  * Signature: ([Z)Z
  */
 JNIEXPORT jshort JNICALL Java_nsk_share_gc_lock_jni_ShortArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jshortArray arr;
         jshort *pa;
@@ -44,22 +47,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return 0;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return 0;
-                }
         }
         arr = (jshortArray) env->GetObjectField(o, objFieldId);
-        if (arr == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return JNI_FALSE;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetArrayLength(arr);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/StringCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/StringCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,7 +36,9 @@
  * Signature: ([Z)Z
  */
 JNIEXPORT jchar JNICALL Java_nsk_share_gc_lock_jni_StringCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jsize size, i;
         jstring str;
         const jchar *pa;
@@ -44,22 +47,11 @@
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return JNI_FALSE;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return JNI_FALSE;
-                }
         }
         str = (jstring) env->GetObjectField(o, objFieldId);
-        if (str == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return JNI_FALSE;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         size = env->GetStringLength(str);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libBooleanArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libBooleanArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -22,5 +22,6 @@
  */
 
 #include "BooleanArrayCriticalLocker.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libByteArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libByteArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -22,5 +22,6 @@
  */
 
 #include "ByteArrayCriticalLocker.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libCharArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libCharArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -22,5 +22,6 @@
  */
 
 #include "CharArrayCriticalLocker.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libDoubleArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libDoubleArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -22,5 +22,6 @@
  */
 
 #include "DoubleArrayCriticalLocker.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libFloatArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libFloatArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "FloatArrayCriticalLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libIntArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libIntArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "IntArrayCriticalLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libLongArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libLongArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "LongArrayCriticalLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libShortArrayCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libShortArrayCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "ShortArrayCriticalLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libStringCriticalLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libStringCriticalLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "StringCriticalLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIGlobalRefLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIGlobalRefLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
-#include "ExceptionCheckingJniEnv.hpp"
 
 extern "C" {
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNILocalRefLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNILocalRefLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,28 +36,18 @@
  * Signature: (JJ)V
  */
 JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNILocalRefLocker_criticalNative
-  (JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+  (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jobject obj;
         jobject gref;
         time_t start_time, current_time;
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return;
-                }
         }
         obj = env->GetObjectField(o, objFieldId);
-        if (obj == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return;
-        }
         env->SetObjectField(o, objFieldId, NULL);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIRefLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIRefLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,29 +36,21 @@
  * Signature: (JJ)V
  */
 JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNIRefLocker_criticalNative
-  (JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+  (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jobject obj;
         jobject gref, lref, gwref;
         time_t start_time, current_time;
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return;
-                }
         }
+
         obj = env->GetObjectField(o, objFieldId);
-        if (obj == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         start_time = time(NULL);
         enterTime /= 1000;
         current_time = 0;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIWeakGlobalRefLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIWeakGlobalRefLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -23,6 +23,7 @@
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
 #include "jni_tools.h"
 
 extern "C" {
@@ -35,29 +36,20 @@
  * Signature: (JJ)V
  */
 JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNIWeakGlobalRefLocker_criticalNative
-  (JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+  (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jobject obj;
         jobject gref;
         time_t start_time, current_time;
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return;
-                }
         }
         obj = env->GetObjectField(o, objFieldId);
-        if (obj == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return;
-        }
         env->SetObjectField(o, objFieldId, NULL);
+
         start_time = time(NULL);
         enterTime /= 1000;
         current_time = 0;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIGlobalRefLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIGlobalRefLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,7 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "JNIGlobalRefLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
-#include "ExceptionCheckingJniEnv.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNILocalRefLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNILocalRefLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "JNILocalRefLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIRefLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIRefLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "JNIRefLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIWeakGlobalRefLocker.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIWeakGlobalRefLocker.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
  * questions.
  */
 
+#include "ExceptionCheckingJniEnv.cpp"
 #include "JNIWeakGlobalRefLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.cpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.cpp	Tue Oct 16 09:55:30 2018 -0400
@@ -22,6 +22,8 @@
  * questions.
  */
 
+#include <stdlib.h>
+
 #include "ExceptionCheckingJniEnv.hpp"
 
 namespace {
@@ -86,7 +88,7 @@
 }
 
 jfieldID ExceptionCheckingJniEnv::GetFieldID(jclass klass, const char *name, const char* type) {
-  JNIVerifier<jfieldID> marker(this, "GetObjectClass");
+  JNIVerifier<jfieldID> marker(this, "GetFieldID");
   return marker.ResultNotNull(_jni_env->GetFieldID(klass, name, type));
 }
 
@@ -101,7 +103,7 @@
 }
 
 jobject ExceptionCheckingJniEnv::NewGlobalRef(jobject obj) {
-  JNIVerifier<jobject> marker(this, "GetObjectField");
+  JNIVerifier<jobject> marker(this, "NewGlobalRef");
   return marker.ResultNotNull(_jni_env->NewGlobalRef(obj));
 }
 
@@ -109,3 +111,53 @@
   JNIVerifier<> marker(this, "DeleteGlobalRef");
   _jni_env->DeleteGlobalRef(obj);
 }
+
+jobject ExceptionCheckingJniEnv::NewLocalRef(jobject obj) {
+  JNIVerifier<jobject> marker(this, "NewLocalRef");
+  return marker.ResultNotNull(_jni_env->NewLocalRef(obj));
+}
+
+void ExceptionCheckingJniEnv::DeleteLocalRef(jobject obj) {
+  JNIVerifier<> marker(this, "DeleteLocalRef");
+  _jni_env->DeleteLocalRef(obj);
+}
+
+jweak ExceptionCheckingJniEnv::NewWeakGlobalRef(jobject obj) {
+  JNIVerifier<jweak> marker(this, "NewWeakGlobalRef");
+  return marker.ResultNotNull(_jni_env->NewWeakGlobalRef(obj));
+}
+
+void ExceptionCheckingJniEnv::DeleteWeakGlobalRef(jweak weak_ref) {
+  JNIVerifier<> marker(this, "DeleteWeakGlobalRef");
+  _jni_env->DeleteWeakGlobalRef(weak_ref);
+}
+
+jsize ExceptionCheckingJniEnv::GetArrayLength(jarray array) {
+  JNIVerifier<> marker(this, "GetArrayLength");
+  return _jni_env->GetArrayLength(array);
+}
+
+jsize ExceptionCheckingJniEnv::GetStringLength(jstring str) {
+  JNIVerifier<> marker(this, "GetStringLength");
+  return _jni_env->GetStringLength(str);
+}
+
+void* ExceptionCheckingJniEnv::GetPrimitiveArrayCritical(jarray array, jboolean* isCopy) {
+  JNIVerifier<> marker(this, "GetPrimitiveArrayCritical");
+  return marker.ResultNotNull(_jni_env->GetPrimitiveArrayCritical(array, isCopy));
+}
+
+void ExceptionCheckingJniEnv::ReleasePrimitiveArrayCritical(jarray array, void* carray, jint mode) {
+  JNIVerifier<> marker(this, "ReleasePrimitiveArrayCritical");
+  _jni_env->ReleasePrimitiveArrayCritical(array, carray, mode);
+}
+
+const jchar* ExceptionCheckingJniEnv::GetStringCritical(jstring str, jboolean* isCopy) {
+  JNIVerifier<const jchar*> marker(this, "GetPrimitiveArrayCritical");
+  return marker.ResultNotNull(_jni_env->GetStringCritical(str, isCopy));
+}
+
+void ExceptionCheckingJniEnv::ReleaseStringCritical(jstring str, const jchar* carray) {
+  JNIVerifier<> marker(this, "ReleaseStringCritical");
+  _jni_env->ReleaseStringCritical(str, carray);
+}
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.hpp	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.hpp	Tue Oct 16 09:55:30 2018 -0400
@@ -66,8 +66,20 @@
   jobject GetObjectField(jobject obj, jfieldID field);
   void SetObjectField(jobject obj, jfieldID field, jobject value);
 
+  jsize GetArrayLength(jarray array);
+  jsize GetStringLength(jstring str);
+
+  void* GetPrimitiveArrayCritical(jarray array, jboolean* isCopy);
+  void ReleasePrimitiveArrayCritical(jarray array, void* carray, jint mode);
+  const jchar* GetStringCritical(jstring str, jboolean* isCopy);
+  void ReleaseStringCritical(jstring str, const jchar* carray);
+
   jobject NewGlobalRef(jobject obj);
   void DeleteGlobalRef(jobject obj);
+  jobject NewLocalRef(jobject ref);
+  void DeleteLocalRef(jobject ref);
+  jweak NewWeakGlobalRef(jobject obj);
+  void DeleteWeakGlobalRef(jweak obj);
 
   // ExceptionCheckingJniEnv methods.
   JNIEnv* GetJNIEnv() {
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/correctBootstrap/TestDescription.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/correctBootstrap/TestDescription.java	Tue Oct 16 09:55:30 2018 -0400
@@ -50,7 +50,7 @@
  * @build vm.mlvm.share.ClassfileGeneratorTest
  * @run driver vm.mlvm.share.IndifiedClassesBuilder
  *
- * @run main/othervm
+ * @run main/othervm/timeout=300
  *      vm.mlvm.share.ClassfileGeneratorTest
  *      -generator vm.mlvm.cp.share.GenManyIndyCorrectBootstrap
  */
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/incorrectBootstrap/TestDescription.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/incorrectBootstrap/TestDescription.java	Tue Oct 16 09:55:30 2018 -0400
@@ -51,7 +51,7 @@
  * @build vm.mlvm.share.ClassfileGeneratorTest
  * @run driver vm.mlvm.share.IndifiedClassesBuilder
  *
- * @run main/othervm
+ * @run main/othervm/timeout=300
  *      vm.mlvm.share.ClassfileGeneratorTest
  *      -generator vm.mlvm.cp.share.GenManyIndyIncorrectBootstrap
  */
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mh/TestDescription.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mh/TestDescription.java	Tue Oct 16 09:55:30 2018 -0400
@@ -50,6 +50,6 @@
  * @build vm.mlvm.share.ClassfileGeneratorTest
  * @run driver vm.mlvm.share.IndifiedClassesBuilder
  *
- * @run main/othervm vm.mlvm.share.ClassfileGeneratorTest -generator vm.mlvm.cp.share.GenCPFullOfMH
+ * @run main/othervm/timeout=300 vm.mlvm.share.ClassfileGeneratorTest -generator vm.mlvm.cp.share.GenCPFullOfMH
  */
 
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mt/TestDescription.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mt/TestDescription.java	Tue Oct 16 09:55:30 2018 -0400
@@ -50,6 +50,6 @@
  * @build vm.mlvm.share.ClassfileGeneratorTest
  * @run driver vm.mlvm.share.IndifiedClassesBuilder
  *
- * @run main/othervm vm.mlvm.share.ClassfileGeneratorTest -generator vm.mlvm.cp.share.GenCPFullOfMT
+ * @run main/othervm/timeout=300 vm.mlvm.share.ClassfileGeneratorTest -generator vm.mlvm.cp.share.GenCPFullOfMT
  */
 
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/gc/createLotsOfMHConsts/Test.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/gc/createLotsOfMHConsts/Test.java	Tue Oct 16 09:55:30 2018 -0400
@@ -50,7 +50,7 @@
  * @build vm.mlvm.meth.stress.gc.createLotsOfMHConsts.Test
  * @run driver vm.mlvm.share.IndifiedClassesBuilder
  *
- * @run main/othervm
+ * @run main/othervm/timeout=300
  *      vm.mlvm.meth.stress.gc.createLotsOfMHConsts.Test
  *      -stressIterationsFactor 100000
  *      -generator vm.mlvm.cp.share.GenCPFullOfMH
--- a/test/jdk/com/sun/net/httpserver/SelCacheTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/SelCacheTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -24,14 +24,14 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm -Dsun.net.httpserver.selCacheTimeout=2 SelCacheTest
  * @summary  Light weight HTTP server
  */
 
 import com.sun.net.httpserver.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 import java.util.*;
 import java.util.concurrent.*;
--- a/test/jdk/com/sun/net/httpserver/Test1.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test1.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, 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
@@ -24,8 +24,8 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm Test1
  * @run main/othervm -Dsun.net.httpserver.maxReqTime=10 Test1
  * @run main/othervm -Dsun.net.httpserver.nodelay=true Test1
@@ -38,7 +38,7 @@
 import java.io.*;
 import java.net.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /* basic http/s connectivity test
  * Tests:
--- a/test/jdk/com/sun/net/httpserver/Test12.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test12.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm Test12
- * @summary  Light weight HTTP server
+ * @summary Light weight HTTP server
  */
 
 import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
 import java.io.*;
 import java.net.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /* basic http/s connectivity test
  * Tests:
--- a/test/jdk/com/sun/net/httpserver/Test13.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test13.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm Test13
- * @summary  Light weight HTTP server
+ * @summary Light weight HTTP server
  */
 
 import com.sun.net.httpserver.*;
@@ -37,7 +37,7 @@
 import java.io.*;
 import java.net.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /* basic http/s connectivity test
  * Tests:
--- a/test/jdk/com/sun/net/httpserver/Test6a.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test6a.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm Test6a
- * @summary  Light weight HTTP server
+ * @summary Light weight HTTP server
  */
 
 import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
 import java.io.*;
 import java.net.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /**
  * Test https POST large file via chunked encoding (unusually small chunks)
--- a/test/jdk/com/sun/net/httpserver/Test7a.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test7a.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm Test7a
- * @summary  Light weight HTTP server
+ * @summary Light weight HTTP server
  */
 
 import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
 import java.io.*;
 import java.net.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /**
  * Test POST large file via chunked encoding (large chunks)
--- a/test/jdk/com/sun/net/httpserver/Test8a.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test8a.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm Test8a
- * @summary  Light weight HTTP server
+ * @summary Light weight HTTP server
  */
 
 import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
 import java.io.*;
 import java.net.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /**
  * Test POST large file via fixed len encoding
--- a/test/jdk/com/sun/net/httpserver/Test9.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test9.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm Test9
- * @summary  Light weight HTTP server
+ * @summary Light weight HTTP server
  */
 
 import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
 import java.io.*;
 import java.net.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /* Same as Test1 but requests run in parallel.
  */
--- a/test/jdk/com/sun/net/httpserver/Test9a.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test9a.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
 /**
  * @test
  * @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm Test9a
- * @summary  Light weight HTTP server
+ * @summary Light weight HTTP server
  */
 
 import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
 import java.io.*;
 import java.net.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /* Same as Test1 but requests run in parallel.
  */
--- a/test/jdk/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     5086470 6358247 7193302
+ * @bug     5086470 6358247 7193302 8048215
  * @summary Test type conversion when invoking ThreadMXBean.dumpAllThreads
  *          through proxy.
  * @author  Mandy Chung
@@ -45,6 +45,7 @@
     private static ThreadMXBean mbean;
     static Mutex mutex = new Mutex();
     static Object lock = new Object();
+    static Object waiter = new Object();
     static MyThread thread = new MyThread();
     public static void main(String[] argv) throws Exception {
         mbean = newPlatformMXBeanProxy(server,
@@ -68,6 +69,12 @@
            }
         }
 
+        // 'thread' holds the mutex, which means it must also have the monitor of
+        // 'waiter' at least until it does the wait(). So we acquire the monitor of
+        // 'waiter' here, which ensures that 'thread' must be in wait()
+        synchronized(waiter) {
+        }
+
         long[] ids = new long[] { thread.getId() };
 
         // validate the local access
@@ -108,11 +115,10 @@
         }
         public void run() {
             synchronized (lock) {
-                mutex.lock();
-                Object o = new Object();
-                synchronized(o) {
+                synchronized(waiter) {
+                    mutex.lock();
                     try {
-                        o.wait();
+                        waiter.wait();
                     } catch (InterruptedException e) {
                         throw new RuntimeException(e);
                     }
--- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java	Tue Oct 16 09:55:30 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
@@ -35,12 +35,12 @@
 /*
  * @test
  * @bug 8169415
- * @library /lib/testlibrary/
+ * @library /test/lib
  * @modules java.logging
  *          java.base/sun.net.www
  *          java.base/sun.net.www.protocol.http
  *          jdk.httpserver/sun.net.httpserver
- * @build jdk.testlibrary.SimpleSSLContext HTTPTest HTTPTestServer HTTPTestClient HTTPSetAuthenticatorTest
+ * @build jdk.test.lib.net.SimpleSSLContext HTTPTest HTTPTestServer HTTPTestClient HTTPSetAuthenticatorTest
  * @summary A simple HTTP test that starts an echo server supporting the given
  *          authentication scheme, then starts a regular HTTP client to invoke it.
  *          The client first does a GET request on "/", then follows on
--- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java	Tue Oct 16 09:55:30 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
@@ -41,16 +41,16 @@
 import javax.net.ssl.HttpsURLConnection;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSession;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /*
  * @test
  * @bug 8169415
- * @library /lib/testlibrary/
+ * @library /test/lib
  * @modules java.logging
  *          java.base/sun.net.www
  *          jdk.httpserver/sun.net.httpserver
- * @build jdk.testlibrary.SimpleSSLContext HTTPTest HTTPTestServer HTTPTestClient
+ * @build jdk.test.lib.net.SimpleSSLContext HTTPTest HTTPTestServer HTTPTestClient
  * @summary A simple HTTP test that starts an echo server supporting Digest
  *          authentication, then starts a regular HTTP client to invoke it.
  *          The client first does a GET request on "/", then follows on
--- a/test/jdk/java/net/URLPermission/URLTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/URLPermission/URLTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,8 @@
  * @test
  * @bug 8010464
  * @modules jdk.httpserver
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm URLTest
  * @summary check URLPermission with Http(s)URLConnection
  */
@@ -38,7 +38,7 @@
 import java.util.concurrent.*;
 import com.sun.net.httpserver.*;
 import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 public class URLTest {
 
--- a/test/jdk/java/net/httpclient/AbstractNoBody.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AbstractNoBody.java	Tue Oct 16 09:55:30 2018 -0400
@@ -35,7 +35,7 @@
 import com.sun.net.httpserver.HttpsServer;
 import java.net.http.HttpClient;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/AbstractThrowingPublishers.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AbstractThrowingPublishers.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,7 +24,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when push promise handlers and their
  *          response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker AbstractThrowingPushPromises
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
@@ -35,7 +35,7 @@
  * @run testng/othervm -Djdk.internal.httpclient.debug=true AbstractThrowingPushPromises
  */
 
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,7 +24,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/AsFileDownloadTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AsFileDownloadTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -31,9 +31,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build jdk.test.lib.Platform
  * @build jdk.test.lib.util.FileUtils
  * @run testng/othervm AsFileDownloadTest
@@ -67,7 +67,7 @@
 import java.util.Locale;
 import java.util.Map;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import jdk.test.lib.util.FileUtils;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/AsFileDownloadTest.policy	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AsFileDownloadTest.policy	Tue Oct 16 09:55:30 2018 -0400
@@ -21,10 +21,10 @@
 // questions.
 //
 
-// for JTwork/classes/0/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.class
-grant codeBase "file:${test.classes}/../../../../lib/testlibrary/-" {
+// for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
+grant codeBase "file:${test.classes}/../../../../test/lib/-" {
     permission java.util.PropertyPermission "test.src.path", "read";
-    permission java.io.FilePermission "${test.src}/../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
+    permission java.io.FilePermission "${test.src}/../../../../lib/jdk/test/lib/net/testkeys", "read";
 };
 
 // for JTwork//classes/0/java/net/httpclient/http2/server/*
--- a/test/jdk/java/net/httpclient/BasicRedirectTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/BasicRedirectTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -30,9 +30,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=trace,headers,requests
  *       BasicRedirectTest
@@ -53,7 +53,7 @@
 import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandlers;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/CancelledResponse.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/CancelledResponse.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,7 +26,7 @@
 import java.net.http.HttpHeaders;
 import java.net.http.HttpRequest;
 import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 import javax.net.ServerSocketFactory;
 import javax.net.ssl.SSLContext;
@@ -55,9 +55,9 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
+ * @library /test/lib
  * @modules java.net.http/jdk.internal.net.http.common
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer ReferenceTracker
  * @run main/othervm  CancelledResponse
  * @run main/othervm  CancelledResponse SSL
--- a/test/jdk/java/net/httpclient/ConcurrentResponses.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ConcurrentResponses.java	Tue Oct 16 09:55:30 2018 -0400
@@ -32,9 +32,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *      -Djdk.httpclient.HttpClient.log=headers,errors,channel
  *      ConcurrentResponses
@@ -67,7 +67,7 @@
 import java.net.http.HttpResponse.BodyHandlers;
 import java.net.http.HttpResponse.BodySubscriber;
 import java.net.http.HttpResponse.BodySubscribers;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/CookieHeaderTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/CookieHeaderTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -31,9 +31,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.tls.acknowledgeCloseNotify=true
  *       -Djdk.httpclient.HttpClient.log=trace,headers,requests
@@ -43,7 +43,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/CustomRequestPublisher.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/CustomRequestPublisher.java	Tue Oct 16 09:55:30 2018 -0400
@@ -30,9 +30,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm CustomRequestPublisher
  */
 
@@ -62,7 +62,7 @@
 import java.net.http.HttpClient;
 import java.net.http.HttpRequest;
 import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/CustomResponseSubscriber.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/CustomResponseSubscriber.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @summary Tests response body subscribers's onComplete is not invoked before onSubscribe
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -57,7 +57,7 @@
 import java.net.http.HttpResponse.BodySubscriber;
 import java.net.http.HttpResponse.BodySubscribers;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/DependentActionsTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/DependentActionsTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,8 +26,8 @@
  * @summary Verify that dependent synchronous actions added before the CF
  *          completes are executed either asynchronously in an executor when the
  *          CF later completes, or in the user thread that joins.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters DependentActionsTest
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters DependentActionsTest
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -43,7 +43,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,8 +26,8 @@
  * @summary Verify that dependent synchronous actions added before the promise CF
  *          completes are executed either asynchronously in an executor when the
  *          CF later completes, or in the user thread that joins.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters DependentPromiseActionsTest
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters DependentPromiseActionsTest
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -40,7 +40,7 @@
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.lang.StackWalker.StackFrame;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/DigestEchoClient.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/DigestEchoClient.java	Tue Oct 16 09:55:30 2018 -0400
@@ -51,7 +51,7 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import sun.net.NetProperties;
 import sun.net.www.HeaderParser;
 import static java.lang.System.out;
@@ -62,8 +62,8 @@
  * @summary this test verifies that a client may provides authorization
  *          headers directly when connecting with a server.
  * @bug 8087112
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters DigestEchoServer
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters DigestEchoServer
  *        ReferenceTracker DigestEchoClient
  * @modules java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/DigestEchoClientSSL.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/DigestEchoClientSSL.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,8 +26,8 @@
  * @bug 8087112
  * @summary this test verifies that a client may provides authorization
  *          headers directly when connecting with a server over SSL.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext DigestEchoServer
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer
  *        DigestEchoClient ReferenceTracker DigestEchoClientSSL
  * @modules java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/EchoHandler.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/EchoHandler.java	Tue Oct 16 09:55:30 2018 -0400
@@ -32,7 +32,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Random;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import static java.net.http.HttpRequest.*;
 import static java.net.http.HttpResponse.*;
 import java.util.logging.ConsoleHandler;
--- a/test/jdk/java/net/httpclient/EncodedCharsInURI.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/EncodedCharsInURI.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,8 +26,8 @@
  * @bug 8199683
  * @summary Tests that escaped characters in URI are correctly
  *          handled (not re-escaped and not unescaped)
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters EncodedCharsInURI
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters EncodedCharsInURI
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -42,7 +42,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/EscapedOctetsInURI.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/EscapedOctetsInURI.java	Tue Oct 16 09:55:30 2018 -0400
@@ -31,9 +31,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=reqeusts,headers
  *       EscapedOctetsInURI
@@ -58,7 +58,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ExpectContinue.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ExpectContinue.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,8 +26,8 @@
  * @summary Basic test for Expect 100-Continue ( HTTP/1.1 only )
  * @modules java.net.http
  *          jdk.httpserver
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm ExpectContinue
  */
 
@@ -49,7 +49,7 @@
 import java.net.http.HttpResponse.BodyHandlers;
 import java.util.List;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -43,7 +43,7 @@
 import java.net.http.HttpClient;
 import java.net.http.HttpRequest;
 import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
@@ -67,9 +67,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm FlowAdapterPublisherTest
  */
 
--- a/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java	Tue Oct 16 09:55:30 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
@@ -48,7 +48,7 @@
 import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandlers;
 import java.net.http.HttpResponse.BodySubscribers;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
@@ -68,9 +68,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm -Djdk.internal.httpclient.debug=true FlowAdapterSubscriberTest
  */
 
--- a/test/jdk/java/net/httpclient/HeadTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/HeadTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -31,9 +31,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=trace,headers,requests
  *       HeadTest
@@ -42,7 +42,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/HttpClientBuilderTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/HttpClientBuilderTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -48,7 +48,7 @@
 import java.net.http.HttpClient;
 import java.net.http.HttpClient.Redirect;
 import java.net.http.HttpClient.Version;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.Test;
 import static java.time.Duration.*;
 import static org.testng.Assert.*;
@@ -56,8 +56,8 @@
 /*
  * @test
  * @summary HttpClient[.Builder] API and behaviour checks
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng HttpClientBuilderTest
  */
 
--- a/test/jdk/java/net/httpclient/HttpEchoHandler.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/HttpEchoHandler.java	Tue Oct 16 09:55:30 2018 -0400
@@ -32,7 +32,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Random;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import static java.net.http.HttpRequest.*;
 import static java.net.http.HttpResponse.*;
 import java.util.logging.ConsoleHandler;
--- a/test/jdk/java/net/httpclient/HttpsTunnelTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/HttpsTunnelTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -23,7 +23,7 @@
 
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import javax.net.ssl.SSLContext;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
@@ -49,8 +49,8 @@
  *          be preemptively downgraded. That, is the stack should attempt
  *          a new h2 connection to the new host.
  * @bug 8196967
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters DigestEchoServer HttpsTunnelTest
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters DigestEchoServer HttpsTunnelTest
  * @modules java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
  *          java.net.http/jdk.internal.net.http.hpack
--- a/test/jdk/java/net/httpclient/ImmutableFlowItems.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ImmutableFlowItems.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests response body subscribers's onNext's Lists are unmodifiable,
  *          and that the buffers are read-only
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -57,7 +57,7 @@
 import java.net.http.HttpResponse.BodySubscriber;
 import java.net.http.HttpResponse.BodySubscribers;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,8 +26,8 @@
  * @summary Tests an asynchronous BodySubscriber that completes
  *          immediately with an InputStream which issues bad
  *          requests
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext ReferenceTracker
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -38,7 +38,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/InvalidSSLContextTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/InvalidSSLContextTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Test to ensure the HTTP client throws an appropriate SSL exception
  *          when SSL context is not valid.
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm -Djdk.internal.httpclient.debug=true InvalidSSLContextTest
  */
 
@@ -47,7 +47,7 @@
 import java.net.http.HttpRequest;
 import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandlers;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.Assert;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -27,8 +27,8 @@
  * @summary Tests an asynchronous BodySubscriber that completes
  *          immediately with a Publisher<List<ByteBuffer>> whose
  *          subscriber issues bad requests
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext ReferenceTracker
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -39,7 +39,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/LightWeightHttpServer.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/LightWeightHttpServer.java	Tue Oct 16 09:55:30 2018 -0400
@@ -22,8 +22,8 @@
  */
 
 /**
- * library /lib/testlibrary/ /
- * build jdk.testlibrary.SimpleSSLContext ProxyServer
+ * library /test/lib /
+ * build jdk.test.lib.net.SimpleSSLContext ProxyServer
  * compile ../../../com/sun/net/httpserver/LogFilter.java
  * compile ../../../com/sun/net/httpserver/EchoHandler.java
  * compile ../../../com/sun/net/httpserver/FileServerHandler.java
@@ -50,7 +50,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 public class LightWeightHttpServer {
 
--- a/test/jdk/java/net/httpclient/LineBodyHandlerTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/LineBodyHandlerTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -52,7 +52,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
@@ -77,9 +77,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer LineBodyHandlerTest HttpServerAdapters
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm LineBodyHandlerTest
  */
 
--- a/test/jdk/java/net/httpclient/ManyRequests.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ManyRequests.java	Tue Oct 16 09:55:30 2018 -0400
@@ -27,8 +27,8 @@
  * @modules java.net.http
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
  * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
@@ -63,7 +63,7 @@
 import java.util.logging.Level;
 import java.util.concurrent.CompletableFuture;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 public class ManyRequests {
 
--- a/test/jdk/java/net/httpclient/ManyRequests2.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ManyRequests2.java	Tue Oct 16 09:55:30 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
@@ -27,8 +27,8 @@
  * @modules java.net.http
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
  * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
@@ -36,8 +36,11 @@
  * @run main/othervm/timeout=40 -Dtest.XFixed=true ManyRequests2
  * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.insertDelay=true ManyRequests2
  * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.chunkSize=64 ManyRequests2
- * @run main/othervm/timeout=40 -Djdk.internal.httpclient.debug=true -Dtest.XFixed=true -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequests2
- * @summary Send a large number of requests asynchronously. The server echoes back using known content length.
+ * @run main/othervm/timeout=40 -Djdk.internal.httpclient.debug=true
+ *                              -Dtest.XFixed=true -Dtest.insertDelay=true
+ *                              -Dtest.chunkSize=64 ManyRequests2
+ * @summary Send a large number of requests asynchronously.
+ *          The server echoes back using known content length.
  */
  // * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests
 
--- a/test/jdk/java/net/httpclient/ManyRequestsLegacy.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,16 +26,19 @@
  * @modules java.net.http
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
  * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
  * @run main/othervm/timeout=40 ManyRequestsLegacy
  * @run main/othervm/timeout=40 -Dtest.insertDelay=true ManyRequestsLegacy
  * @run main/othervm/timeout=40 -Dtest.chunkSize=64 ManyRequestsLegacy
- * @run main/othervm/timeout=40 -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequestsLegacy
- * @summary Send a large number of requests asynchronously using the legacy URL.openConnection(), to help sanitize results of the test ManyRequest.java.
+ * @run main/othervm/timeout=40 -Dtest.insertDelay=true
+ *                              -Dtest.chunkSize=64 ManyRequestsLegacy
+ * @summary Send a large number of requests asynchronously using the legacy
+ *          URL.openConnection(), to help sanitize results of the test
+ *          ManyRequest.java.
  */
 
 import javax.net.ssl.HttpsURLConnection;
@@ -70,7 +73,7 @@
 import java.util.Random;
 import java.util.logging.Logger;
 import java.util.logging.Level;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 public class ManyRequestsLegacy {
 
--- a/test/jdk/java/net/httpclient/MappingResponseSubscriber.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/MappingResponseSubscriber.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @summary Tests mapped response subscriber
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -62,7 +62,7 @@
 import  java.net.http.HttpResponse.BodySubscriber;
 import java.util.function.Function;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/MaxStreams.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/MaxStreams.java	Tue Oct 16 09:55:30 2018 -0400
@@ -32,9 +32,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm -ea -esa MaxStreams
  */
 
@@ -60,7 +60,7 @@
 import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandler;
 import java.net.http.HttpResponse.BodyHandlers;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/NoBodyPartOne.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/NoBodyPartOne.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @bug 8161157
  * @summary Test response body handlers/subscribers when there is no body
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/NoBodyPartTwo.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/NoBodyPartTwo.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @bug 8161157
  * @summary Test response body handlers/subscribers when there is no body
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java	Tue Oct 16 09:55:30 2018 -0400
@@ -32,9 +32,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @compile -encoding utf-8 NonAsciiCharsInURI.java
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=reqeusts,headers
@@ -58,7 +58,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java	Tue Oct 16 09:55:30 2018 -0400
@@ -28,8 +28,8 @@
  *          it verifies that the client honor the jdk.http.auth.*.disabledSchemes
  *          net properties.
  * @bug 8087112
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext DigestEchoServer DigestEchoClient
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer DigestEchoClient
  *        ReferenceTracker ProxyAuthDisabledSchemes
  * @modules java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java	Tue Oct 16 09:55:30 2018 -0400
@@ -28,8 +28,8 @@
  *          headers directly when connecting with a server over SSL, and
  *          it verifies that the client honor the jdk.http.auth.*.disabledSchemes
  *          net properties.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext DigestEchoServer DigestEchoClient
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer DigestEchoClient
  *        ReferenceTracker ProxyAuthDisabledSchemesSSL
  * @modules java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/ProxyTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ProxyTest.java	Tue Oct 16 09:55:30 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
@@ -56,7 +56,7 @@
 import java.net.http.HttpClient;
 import java.net.http.HttpRequest;
 import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /**
  * @test
@@ -67,8 +67,8 @@
  *          an SSL Tunnel connection when the client is HTTP/2 and the server
  *          and proxy are HTTP/1.1
  * @modules java.net.http
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext ProxyTest
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext ProxyTest
  * @run main/othervm ProxyTest
  * @author danielfuchs
  */
--- a/test/jdk/java/net/httpclient/RedirectMethodChange.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RedirectMethodChange.java	Tue Oct 16 09:55:30 2018 -0400
@@ -29,9 +29,9 @@
  *          java.net.http/jdk.internal.net.http.frame
  *          java.net.http/jdk.internal.net.http.hpack
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm RedirectMethodChange
  */
 
@@ -50,7 +50,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/RedirectWithCookie.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RedirectWithCookie.java	Tue Oct 16 09:55:30 2018 -0400
@@ -30,9 +30,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=trace,headers,requests
  *       RedirectWithCookie
@@ -55,7 +55,7 @@
 import java.net.http.HttpResponse.BodyHandlers;
 import java.util.List;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/RequestBodyTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RequestBodyTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -27,11 +27,11 @@
  * @modules java.net.http
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary/ /test/lib
+ * @library /test/lib
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
  * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build LightWeightHttpServer
  * @build jdk.test.lib.Platform
  * @build jdk.test.lib.util.FileUtils
--- a/test/jdk/java/net/httpclient/RequestBodyTest.policy	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RequestBodyTest.policy	Tue Oct 16 09:55:30 2018 -0400
@@ -27,10 +27,10 @@
     permission java.io.FilePermission "RequestBodyTest.tmp", "read,delete";
 };
 
-// for JTwork/classes/0/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.class
-grant codeBase "file:${test.classes}/../../../../lib/testlibrary/-" {
+// for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
+grant codeBase "file:${test.classes}/../../../../test/lib/-" {
     permission java.util.PropertyPermission "test.src.path", "read";
-    permission java.io.FilePermission "${test.src}/../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
+    permission java.io.FilePermission "${test.src}/../../../../lib/jdk/test/lib/net/testkeys", "read";
 };
 
 grant codeBase "file:${test.classes}/*" {
--- a/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests that all response body is delivered to the BodySubscriber
  *          before an abortive error terminates the flow
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm ResponseBodyBeforeError
  */
 
@@ -52,7 +52,7 @@
 import java.util.concurrent.CompletionStage;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Flow;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ResponsePublisher.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ResponsePublisher.java	Tue Oct 16 09:55:30 2018 -0400
@@ -26,8 +26,8 @@
  * @bug 8201186
  * @summary Tests an asynchronous BodySubscriber that completes
  *          immediately with a Publisher<List<ByteBuffer>>
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -40,7 +40,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/RetryWithCookie.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RetryWithCookie.java	Tue Oct 16 09:55:30 2018 -0400
@@ -31,9 +31,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext ReferenceTracker
+ * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=trace,headers,requests
  *       RetryWithCookie
@@ -42,7 +42,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ServerCloseTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ServerCloseTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests that our client deals correctly with servers that
  *          close the connection right after sending the last byte.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters EncodedCharsInURI
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters EncodedCharsInURI
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -35,7 +35,7 @@
  */
 //*        -Djdk.internal.httpclient.debug=true
 
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/ShortResponseBody.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ShortResponseBody.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests Exception detail message when too few response bytes are
  *          received before a socket exception or eof.
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=headers,errors,channel
  *       ShortResponseBody
@@ -55,7 +55,7 @@
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.stream.Stream;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ShortResponseBodyWithRetry.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ShortResponseBodyWithRetry.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @summary Run of ShortResponseBody with -Djdk.httpclient.enableAllMethodRetry
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build ShortResponseBody
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=headers,errors,channel
--- a/test/jdk/java/net/httpclient/SmokeTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SmokeTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -27,8 +27,8 @@
  * @modules java.net.http
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext ProxyServer
+ * @library /test/lib /
+ * @build jdk.test.lib.net.SimpleSSLContext ProxyServer
  * @compile ../../../com/sun/net/httpserver/LogFilter.java
  * @compile ../../../com/sun/net/httpserver/EchoHandler.java
  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
@@ -88,7 +88,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Random;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
 import static java.nio.file.StandardOpenOption.WRITE;
 
--- a/test/jdk/java/net/httpclient/SpecialHeadersTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SpecialHeadersTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -32,9 +32,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer HttpServerAdapters SpecialHeadersTest
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=requests,headers,errors
  *       SpecialHeadersTest
@@ -43,7 +43,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/SplitResponse.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponse.java	Tue Oct 16 09:55:30 2018 -0400
@@ -40,7 +40,7 @@
 import java.net.http.HttpResponse;
 import java.util.stream.Stream;
 
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import static java.lang.System.out;
 import static java.lang.String.format;
 import static java.nio.charset.StandardCharsets.ISO_8859_1;
@@ -49,8 +49,8 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer
  * @run main/othervm
  *     -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseAsync.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseAsync.java	Tue Oct 16 09:55:30 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
@@ -24,8 +24,8 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer SplitResponse
  * @run main/othervm
  *      -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseKeepAlive.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseKeepAlive.java	Tue Oct 16 09:55:30 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
@@ -24,8 +24,8 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer SplitResponse
  * @run main/othervm
  *      -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseKeepAliveAsync.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseKeepAliveAsync.java	Tue Oct 16 09:55:30 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
@@ -24,8 +24,8 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer SplitResponse
  * @run main/othervm
  *      -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseSSL.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseSSL.java	Tue Oct 16 09:55:30 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
@@ -24,8 +24,8 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer SplitResponse
  * @run main/othervm
  *      -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseSSLAsync.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLAsync.java	Tue Oct 16 09:55:30 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
@@ -24,8 +24,8 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer SplitResponse
  * @run main/othervm
  *      -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseSSLKeepAlive.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLKeepAlive.java	Tue Oct 16 09:55:30 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
@@ -24,8 +24,8 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer SplitResponse
  * @run main/othervm
  *      -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseSSLKeepAliveAsync.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLKeepAliveAsync.java	Tue Oct 16 09:55:30 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
@@ -24,8 +24,8 @@
 /**
  * @test
  * @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @build MockServer SplitResponse
  * @run main/othervm
  *      -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/StreamingBody.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/StreamingBody.java	Tue Oct 16 09:55:30 2018 -0400
@@ -31,9 +31,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=trace,headers,requests
  *       StreamingBody
@@ -53,7 +53,7 @@
 import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandlers;
 import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when request publishers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
  *        ReferenceTracker AbstractThrowingPublishers ThrowingPublishersCustomAfterCancel
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when request publishers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
  *        ReferenceTracker AbstractThrowingPublishers ThrowingPublishersCustomBeforeCancel
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when request publishers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
  *        ReferenceTracker AbstractThrowingPublishers ThrowingPublishersIOAfterCancel
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when request publishers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
  *        ReferenceTracker AbstractThrowingPublishers ThrowingPublishersIOBeforeCancel
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when request publishers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
  *        ReferenceTracker AbstractThrowingPublishers ThrowingPublishersInNextRequest
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when request publishers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
  *        ReferenceTracker AbstractThrowingPublishers ThrowingPublishersInRequest
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when request publishers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
  *        ReferenceTracker AbstractThrowingPublishers ThrowingPublishersInSubscribe
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when request publishers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
  *        ReferenceTracker AbstractThrowingPublishers ThrowingPublishersSanity
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when push promise handlers and their
  *          response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsInputStreamCustom
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when push promise handlers and their
  *          response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsInputStreamIO
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when push promise handlers and their
  *          response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsLinesCustom
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when push promise handlers and their
  *          response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsLinesIO
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when push promise handlers and their
  *          response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsStringCustom
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when push promise handlers and their
  *          response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsStringIO
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when push promise handlers and their
  *          response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesSanity
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when response body handlers and subscribers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker ThrowingSubscribersAsInputStream AbstractThrowingSubscribers
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when response body handlers and subscribers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker ThrowingSubscribersAsInputStreamAsync AbstractThrowingSubscribers
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when response body handlers and subscribers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker ThrowingSubscribersAsLines AbstractThrowingSubscribers
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when response body handlers and subscribers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker ThrowingSubscribersAsLinesAsync AbstractThrowingSubscribers
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when response body handlers and subscribers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker ThrowingSubscribersAsString AbstractThrowingSubscribers
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when response body handlers and subscribers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker ThrowingSubscribersAsStringAsync AbstractThrowingSubscribers
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java	Tue Oct 16 09:55:30 2018 -0400
@@ -25,8 +25,8 @@
  * @test
  * @summary Tests what happens when response body handlers and subscribers
  *          throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
   *       ReferenceTracker ThrowingSubscribersSanity AbstractThrowingSubscribers
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/TimeoutBasic.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/TimeoutBasic.java	Tue Oct 16 09:55:30 2018 -0400
@@ -31,7 +31,7 @@
 import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandlers;
 import java.net.http.HttpTimeoutException;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 import javax.net.ServerSocketFactory;
 import javax.net.ssl.SSLContext;
@@ -46,8 +46,8 @@
 
 /**
  * @test
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @summary Basic tests for response timeouts
  * @run main/othervm TimeoutBasic
  */
--- a/test/jdk/java/net/httpclient/UnauthorizedTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/UnauthorizedTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -35,9 +35,9 @@
  *          java.net.http/jdk.internal.net.http.hpack
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm
  *       -Djdk.httpclient.HttpClient.log=headers
  *       UnauthorizedTest
@@ -46,7 +46,7 @@
 import com.sun.net.httpserver.HttpServer;
 import com.sun.net.httpserver.HttpsConfigurator;
 import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -35,13 +35,13 @@
 import java.net.http.HttpClient;
 import java.net.http.HttpRequest;
 import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 
 /**
  * @test
  * @bug 8207966
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest plain false
  * @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest SSL false
  * @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest plain true
--- a/test/jdk/java/net/httpclient/dependent.policy	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/dependent.policy	Tue Oct 16 09:55:30 2018 -0400
@@ -21,10 +21,10 @@
 // questions.
 //
 
-// for JTwork/classes/0/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.class
-grant codeBase "file:${test.classes}/../../../../lib/testlibrary/-" {
+// for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
+grant codeBase "file:${test.classes}/../../../../test/lib/-" {
     permission java.util.PropertyPermission "test.src.path", "read";
-    permission java.io.FilePermission "${test.src}/../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
+    permission java.io.FilePermission "${test.src}/../../../../lib/jdk/test/lib/net/testkeys", "read";
 };
 
 // for JTwork//classes/0/java/net/httpclient/http2/server/*
--- a/test/jdk/java/net/httpclient/http2/BadHeadersTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/BadHeadersTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -27,9 +27,9 @@
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
  *          java.net.http/jdk.internal.net.http.hpack
- * @library /lib/testlibrary server
+ * @library /test/lib server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm -Djdk.internal.httpclient.debug=true BadHeadersTest
  */
 
@@ -38,7 +38,7 @@
 import jdk.internal.net.http.frame.HeaderFrame;
 import jdk.internal.net.http.frame.HeadersFrame;
 import jdk.internal.net.http.frame.Http2Frame;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/http2/BasicTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/BasicTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 8087112
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -47,7 +47,7 @@
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.Test;
 import static java.net.http.HttpClient.Version.HTTP_2;
 
--- a/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -28,9 +28,9 @@
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
  *          java.net.http/jdk.internal.net.http.hpack
- * @library /lib/testlibrary server
+ * @library /test/lib server
  * @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @run testng/othervm ContinuationFrameTest
  */
 
@@ -55,7 +55,7 @@
 import jdk.internal.net.http.frame.HeaderFrame;
 import jdk.internal.net.http.frame.HeadersFrame;
 import jdk.internal.net.http.frame.Http2Frame;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/http2/ErrorTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ErrorTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 8157105
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -46,7 +46,7 @@
 import javax.net.ssl.SSLParameters;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ExecutorService;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import static java.net.http.HttpClient.Version.HTTP_2;
 
 import org.testng.annotations.Test;
--- a/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 8087112 8177935
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
@@ -40,7 +40,7 @@
 import javax.net.ssl.*;
 import java.nio.file.*;
 import java.util.concurrent.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import static java.net.http.HttpClient.Version.HTTP_2;
 import org.testng.annotations.Test;
 
--- a/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java	Tue Oct 16 09:55:30 2018 -0400
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/http2/ProxyTest2.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ProxyTest2.java	Tue Oct 16 09:55:30 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
@@ -52,7 +52,7 @@
 import java.net.http.HttpClient;
 import java.net.http.HttpRequest;
 import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import java.util.concurrent.*;
 
 /**
@@ -61,12 +61,12 @@
  * @summary  Verifies that you can access an HTTP/2 server over HTTPS by
  *           tunnelling through an HTTP/1.1 proxy.
  * @modules java.net.http
- * @library /lib/testlibrary server
+ * @library /test/lib server
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
  *          java.net.http/jdk.internal.net.http.hpack
- * @build jdk.testlibrary.SimpleSSLContext ProxyTest2
+ * @build jdk.test.lib.net.SimpleSSLContext ProxyTest2
  * @run main/othervm ProxyTest2
  * @author danielfuchs
  */
--- a/test/jdk/java/net/httpclient/http2/RedirectTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/RedirectTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 8156514
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/http2/ServerPush.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ServerPush.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug 8087112 8159814
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java	Tue Oct 16 09:55:30 2018 -0400
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.base/sun.net.www.http
  *          java.net.http/jdk.internal.net.http.common
  *          java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/security/Driver.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/security/Driver.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,12 +24,11 @@
 /*
  * @test
  * @bug 8087112
- * @library /lib/testlibrary/
  * @library /test/lib
  * @modules java.net.http
  *          java.logging
  *          jdk.httpserver
- * @build jdk.testlibrary.SimpleSSLContext jdk.test.lib.Utils
+ * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.Utils
  * @compile ../../../../com/sun/net/httpserver/LogFilter.java
  * @compile ../../../../com/sun/net/httpserver/FileServerHandler.java
  * @compile ../ProxyServer.java
--- a/test/jdk/java/net/httpclient/security/Security.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/security/Security.java	Tue Oct 16 09:55:30 2018 -0400
@@ -27,8 +27,8 @@
  * @modules java.net.http
  *          java.logging
  *          jdk.httpserver
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @compile ../../../../com/sun/net/httpserver/LogFilter.java
  * @compile ../../../../com/sun/net/httpserver/FileServerHandler.java
  * @compile ../ProxyServer.java
--- a/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java	Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
 /*
  * @test
  * @summary Basic test for WebSocketHandshakeException
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
  * @modules java.net.http
  *          jdk.httpserver
  * @run testng/othervm -Djdk.internal.httpclient.debug=true WSHandshakeExceptionTest
@@ -39,7 +39,7 @@
 import java.net.http.HttpClient;
 import java.net.http.WebSocket;
 import java.net.http.WebSocketHandshakeException;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/AbstractSSLTubeTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/AbstractSSLTubeTest.java	Tue Oct 16 09:55:30 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
@@ -28,22 +28,13 @@
 import jdk.internal.net.http.common.Utils;
 import org.testng.annotations.Test;
 
-import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
 import javax.net.ssl.SSLParameters;
-import javax.net.ssl.TrustManagerFactory;
-import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.ByteBuffer;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
 import java.util.List;
 import java.util.StringTokenizer;
 import java.util.concurrent.CompletableFuture;
@@ -244,76 +235,4 @@
         engine.setUseClientMode(client);
         return engine;
     }
-
-    /**
-     * Creates a simple usable SSLContext for SSLSocketFactory or a HttpsServer
-     * using either a given keystore or a default one in the test tree.
-     *
-     * Using this class with a security manager requires the following
-     * permissions to be granted:
-     *
-     * permission "java.util.PropertyPermission" "test.src.path", "read";
-     * permission java.io.FilePermission "${test.src}/../../../../lib/testlibrary/jdk/testlibrary/testkeys",
-     * "read"; The exact path above depends on the location of the test.
-     */
-    protected static class SimpleSSLContext {
-
-        private final SSLContext ssl;
-
-        /**
-         * Loads default keystore from SimpleSSLContext source directory
-         */
-        public SimpleSSLContext() throws IOException {
-            String paths = System.getProperty("test.src.path");
-            StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
-            boolean securityExceptions = false;
-            SSLContext sslContext = null;
-            while (st.hasMoreTokens()) {
-                String path = st.nextToken();
-                try {
-                    File f = new File(path, "../../../../lib/testlibrary/jdk/testlibrary/testkeys");
-                    if (f.exists()) {
-                        try (FileInputStream fis = new FileInputStream(f)) {
-                            sslContext = init(fis);
-                            break;
-                        }
-                    }
-                } catch (SecurityException e) {
-                    // catch and ignore because permission only required
-                    // for one entry on path (at most)
-                    securityExceptions = true;
-                }
-            }
-            if (securityExceptions) {
-                System.err.println("SecurityExceptions thrown on loading testkeys");
-            }
-            ssl = sslContext;
-        }
-
-        private SSLContext init(InputStream i) throws IOException {
-            try {
-                char[] passphrase = "passphrase".toCharArray();
-                KeyStore ks = KeyStore.getInstance("JKS");
-                ks.load(i, passphrase);
-
-                KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
-                kmf.init(ks, passphrase);
-
-                TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
-                tmf.init(ks);
-
-                SSLContext ssl = SSLContext.getInstance("TLS");
-                ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
-                return ssl;
-            } catch (KeyManagementException | KeyStoreException |
-                    UnrecoverableKeyException | CertificateException |
-                    NoSuchAlgorithmException e) {
-                throw new RuntimeException(e.getMessage());
-            }
-        }
-
-        public SSLContext get() {
-            return ssl;
-        }
-    }
 }
--- a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java	Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java	Tue Oct 16 09:55:30 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
@@ -24,8 +24,6 @@
 package jdk.internal.net.http;
 
 import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -33,12 +31,6 @@
 import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.nio.ByteBuffer;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
 import java.util.List;
 import java.util.Random;
 import java.util.StringTokenizer;
@@ -53,9 +45,7 @@
 import java.util.concurrent.SubmissionPublisher;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
-import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.*;
-import javax.net.ssl.TrustManagerFactory;
 import jdk.internal.net.http.common.Utils;
 import org.testng.annotations.Test;
 import jdk.internal.net.http.common.SSLFlowDelegate;
@@ -467,80 +457,6 @@
         }
     }
 
-    /**
-     * Creates a simple usable SSLContext for SSLSocketFactory
-     * or a HttpsServer using either a given keystore or a default
-     * one in the test tree.
-     * <p>
-     * Using this class with a security manager requires the following
-     * permissions to be granted:
-     * <p>
-     * permission "java.util.PropertyPermission" "test.src.path", "read";
-     * permission java.io.FilePermission
-     * "${test.src}/../../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
-     * The exact path above depends on the location of the test.
-     */
-    static class SimpleSSLContext {
-
-        private final SSLContext ssl;
-
-        /**
-         * Loads default keystore from SimpleSSLContext source directory
-         */
-        public SimpleSSLContext() throws IOException {
-            String paths = System.getProperty("test.src.path");
-            StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
-            boolean securityExceptions = false;
-            SSLContext sslContext = null;
-            while (st.hasMoreTokens()) {
-                String path = st.nextToken();
-                try {
-                    File f = new File(path, "../../../../lib/testlibrary/jdk/testlibrary/testkeys");
-                    if (f.exists()) {
-                        try (FileInputStream fis = new FileInputStream(f)) {
-                            sslContext = init(fis);
-                            break;
-                        }
-                    }
-                } catch (SecurityException e) {
-                    // catch and ignore because permission only required
-                    // for one entry on path (at most)
-                    securityExceptions = true;
-                }
-            }
-            if (securityExceptions) {
-                System.out.println("SecurityExceptions thrown on loading testkeys");
-            }
-            ssl = sslContext;
-        }
-
-        private SSLContext init(InputStream i) throws IOException {
-            try {
-                char[] passphrase = "passphrase".toCharArray();
-                KeyStore ks = KeyStore.getInstance("JKS");
-                ks.load(i, passphrase);
-
-                KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
-                kmf.init(ks, passphrase);
-
-                TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
-                tmf.init(ks);
-
-                SSLContext ssl = SSLContext.getInstance("TLS");
-                ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
-                return ssl;
-            } catch (KeyManagementException | KeyStoreException |
-                    UnrecoverableKeyException | CertificateException |
-                    NoSuchAlgorithmException e) {
-                throw new RuntimeException(e.getMessage());
-            }
-        }
-
-        public SSLContext get() {
-            return ssl;
-        }
-    }
-
     private static void sleep(int millis) {
         try {
             Thread.sleep(millis);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SimpleSSLContext.java	Tue Oct 16 09:55:30 2018 -0400
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.net.http;
+