Merge
authorpsadhukhan
Wed, 03 Apr 2019 13:30:05 +0530
changeset 54410 7feb5e303c83
parent 54409 94986cf5e969 (current diff)
parent 54391 f9feec76a481 (diff)
child 54411 1ad7f5bcc670
child 54501 d79e50159c0e
Merge
make/CompileJavaModules.gmk
test/hotspot/jtreg/applications/ctw/modules/jdk_incubator_httpclient.java
test/hotspot/jtreg/applications/ctw/modules/jdk_packager.java
test/hotspot/jtreg/applications/ctw/modules/jdk_packager_services.java
--- a/make/Bundles.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/Bundles.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -72,7 +72,7 @@
 
   $(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME): $$($1_FILES)
 	$$(call MakeTargetDir)
-        # If any of the files contain a space in the file name, CacheFind
+        # If any of the files contain a space in the file name, FindFiles
         # will have replaced it with ?. Tar does not accept that so need to
         # switch it back.
 	$$(foreach d, $$($1_BASE_DIRS), \
@@ -166,11 +166,12 @@
 ################################################################################
 
 ifneq ($(filter product-bundles legacy-bundles, $(MAKECMDGOALS)), )
-  $(eval $(call FillCacheFind, $(IMAGES_OUTPUTDIR)))
 
   SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.pdb %.map
 
-  ALL_JDK_FILES := $(call CacheFind, $(JDK_IMAGE_DIR))
+  # There may be files with spaces in the names, so use ShellFindFiles
+  # explicitly.
+  ALL_JDK_FILES := $(call ShellFindFiles, $(JDK_IMAGE_DIR))
 
   # Create special filter rules when dealing with unzipped .dSYM directories on
   # macosx
@@ -201,11 +202,11 @@
               $(ALL_JDK_FILES) \
           ) \
       ) \
-      $(call CacheFind, $(SYMBOLS_IMAGE_DIR))
+      $(call FindFiles, $(SYMBOLS_IMAGE_DIR))
 
   TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_IMAGE_HOMEDIR)/demo/%, $(ALL_JDK_FILES))
 
-  ALL_JRE_FILES := $(call CacheFind, $(JRE_IMAGE_DIR))
+  ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR))
 
   # Create special filter rules when dealing with unzipped .dSYM directories on
   # macosx
@@ -266,7 +267,7 @@
 ################################################################################
 
 ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
-  TEST_BUNDLE_FILES := $(call CacheFind, $(TEST_IMAGE_DIR))
+  TEST_BUNDLE_FILES := $(call FindFiles, $(TEST_IMAGE_DIR))
 
   $(eval $(call SetupBundleFile, BUILD_TEST_BUNDLE, \
       BUNDLE_NAME := $(TEST_BUNDLE_NAME), \
@@ -280,7 +281,7 @@
 ################################################################################
 
 ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
-  DOCS_BUNDLE_FILES := $(call CacheFind, $(DOCS_IMAGE_DIR))
+  DOCS_BUNDLE_FILES := $(call FindFiles, $(DOCS_IMAGE_DIR))
 
   $(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
       BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \
@@ -295,7 +296,7 @@
 ################################################################################
 
 ifneq ($(filter jcov-bundles, $(MAKECMDGOALS)), )
-  JCOV_BUNDLE_FILES := $(call CacheFind, $(JCOV_IMAGE_DIR))
+  JCOV_BUNDLE_FILES := $(call FindFiles, $(JCOV_IMAGE_DIR))
 
   $(eval $(call SetupBundleFile, BUILD_JCOV_BUNDLE, \
       BUNDLE_NAME := $(JCOV_BUNDLE_NAME), \
--- a/make/CompileDemos.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/CompileDemos.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
 # Prepare the find cache.
 DEMO_SRC_DIRS += $(TOPDIR)/src/demo
 
-$(eval $(call FillCacheFind, $(wildcard $(DEMO_SRC_DIRS))))
+$(call FillFindCache, $(DEMO_SRC_DIRS))
 
 # Append demo goals to this variable.
 TARGETS =
@@ -237,11 +237,11 @@
 ifeq ($(call isTargetOs, solaris), true)
   TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
     $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
-    $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
+    $(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
 else
   TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
     $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
-    $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
+    $(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
 endif
 
 ################################################################################
@@ -250,7 +250,7 @@
   $(eval $(call SetupCopyFiles, COPY_TO_TEST_IMAGE, \
       SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \
       DEST := $(TEST_IMAGE_DIR)/jdk/demos, \
-      FILES := $(call CacheFind, $(SUPPORT_OUTPUTDIR)/demos/image), \
+      FILES := $(call FindFiles, $(SUPPORT_OUTPUTDIR)/demos/image), \
   ))
 
   IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)
--- a/make/CompileJavaModules.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/CompileJavaModules.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -653,7 +653,7 @@
 
 ifneq ($(wildcard $(IMPORT_MODULE_DIR)), )
   $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
-      $(call CacheFind, $(IMPORT_MODULE_DIR))
+      $(call FindFiles, $(IMPORT_MODULE_DIR))
 	$(call MakeDir, $(@D))
         # Do not delete marker and build meta data files
 	$(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))
--- a/make/CopyImportModules.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/CopyImportModules.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
 CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
 CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
 
-$(eval $(call FillCacheFind, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR)))
+$(call FillFindCache, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR))
 
 ifneq ($(LIBS_DIR), )
   ifeq ($(call isTargetOs, windows), true)
@@ -45,21 +45,21 @@
         SRC := $(LIBS_DIR), \
         DEST := $(JDK_OUTPUTDIR)/bin, \
         FILES := $(filter $(TO_BIN_FILTER), \
-            $(call CacheFind, $(LIBS_DIR))) \
+            $(call FindFiles, $(LIBS_DIR))) \
     ))
 
     $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
         SRC := $(LIBS_DIR), \
         DEST := $(JDK_OUTPUTDIR)/lib, \
         FILES := $(filter-out $(TO_BIN_FILTER), \
-            $(call CacheFind, $(LIBS_DIR))) \
+            $(call FindFiles, $(LIBS_DIR))) \
     ))
     TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB)
   else
     $(eval $(call SetupCopyFiles, COPY_LIBS, \
         SRC := $(LIBS_DIR), \
         DEST := $(JDK_OUTPUTDIR)/lib, \
-        FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
+        FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
     ))
 
     # Use relative links if the import dir is inside the OUTPUTDIR, otherwise
@@ -75,7 +75,7 @@
     $(eval $(call SetupCopyFiles, LINK_LIBS, \
         SRC := $(LIBS_DIR), \
         DEST := $(JDK_OUTPUTDIR)/lib, \
-        FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
+        FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
         MACRO := $(LINK_MACRO), \
         LOG_ACTION := $(LOG_ACTION), \
     ))
@@ -87,7 +87,7 @@
   $(eval $(call SetupCopyFiles, COPY_CMDS, \
       SRC := $(CMDS_DIR), \
       DEST := $(JDK_OUTPUTDIR)/bin, \
-      FILES := $(call CacheFind, $(CMDS_DIR)), \
+      FILES := $(call FindFiles, $(CMDS_DIR)), \
   ))
   TARGETS += $(COPY_CMDS)
 endif
@@ -96,7 +96,7 @@
   $(eval $(call SetupCopyFiles, COPY_CONF, \
       SRC := $(CONF_DIR), \
       DEST := $(JDK_OUTPUTDIR)/lib, \
-      FILES := $(call CacheFind, $(CONF_DIR)), \
+      FILES := $(call FindFiles, $(CONF_DIR)), \
   ))
   TARGETS += $(COPY_CONF)
 endif
--- a/make/CreateBuildJdkCopy.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/CreateBuildJdkCopy.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
 # 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,7 +39,7 @@
 
 COPY_CLASSES_TARGET := $(BUILDJDK_OUTPUTDIR)/jdk/modules/java.base/_the.buildjdk-copy-marker
 
-$(COPY_CLASSES_TARGET): $(call CacheFind, $(wildcard \
+$(COPY_CLASSES_TARGET): $(call FindFiles, $(wildcard \
     $(addprefix $(JDK_OUTPUTDIR)/modules/, $(MODULES_TO_COPY))))
 	$(call LogInfo, Copying java modules to buildjdk: $(MODULES_TO_COPY))
 	$(RM) -r $(BUILDJDK_OUTPUTDIR)/jdk/modules
@@ -56,7 +56,7 @@
 $(eval $(call SetupCopyFiles, COPY_SUPPORT_HEADERS, \
     SRC := $(OUTPUTDIR), \
     DEST := $(BUILDJDK_OUTPUTDIR), \
-    FILES := $(call CacheFind, $(wildcard \
+    FILES := $(call FindFiles, $(wildcard \
         $(addprefix $(SUPPORT_OUTPUTDIR)/headers/, $(MODULES_TO_COPY)))), \
 ))
 
--- a/make/CreateJmods.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/CreateJmods.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -53,33 +53,33 @@
 MAN_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \
     $(SUPPORT_OUTPUTDIR)/modules_man $(IMPORT_MODULES_MAN))))
 
-$(eval $(call FillCacheFind, \
+$(call FillFindCache, \
     $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \
-))
+)
 
 ifneq ($(LIBS_DIR), )
   JMOD_FLAGS += --libs $(LIBS_DIR)
-  DEPS += $(call CacheFind, $(LIBS_DIR))
+  DEPS += $(call FindFiles, $(LIBS_DIR))
 endif
 ifneq ($(CMDS_DIR), )
   JMOD_FLAGS += --cmds $(CMDS_DIR)
-  DEPS += $(call CacheFind, $(CMDS_DIR))
+  DEPS += $(call FindFiles, $(CMDS_DIR))
 endif
 ifneq ($(CONF_DIR), )
   JMOD_FLAGS += --config $(CONF_DIR)
-  DEPS += $(call CacheFind, $(CONF_DIR))
+  DEPS += $(call FindFiles, $(CONF_DIR))
 endif
 ifneq ($(CLASSES_DIR), )
   JMOD_FLAGS += --class-path $(CLASSES_DIR)
-  DEPS += $(call CacheFind, $(CLASSES_DIR))
+  DEPS += $(call FindFiles, $(CLASSES_DIR))
 endif
 ifneq ($(INCLUDE_HEADERS_DIR), )
   JMOD_FLAGS += --header-files $(INCLUDE_HEADERS_DIR)
-  DEPS += $(call CacheFind, $(INCLUDE_HEADERS_DIR))
+  DEPS += $(call FindFiles, $(INCLUDE_HEADERS_DIR))
 endif
 ifneq ($(MAN_DIR), )
   JMOD_FLAGS += --man-pages $(MAN_DIR)
-  DEPS += $(call CacheFind, $(MAN_DIR))
+  DEPS += $(call FindFiles, $(MAN_DIR))
 endif
 
 # If a specific modules_legal dir exists for this module, only pick up files
@@ -93,7 +93,7 @@
     )
 
 LEGAL_NOTICES_PATH := $(call PathList, $(LEGAL_NOTICES))
-DEPS += $(call CacheFind, $(LEGAL_NOTICES))
+DEPS += $(call FindFiles, $(LEGAL_NOTICES))
 
 JMOD_FLAGS += --legal-notices $(LEGAL_NOTICES_PATH)
 
@@ -147,7 +147,7 @@
 # the actual command. Filter that out using wildcard before adding to DEPS.
 DEPS += $(wildcard $(JMOD_CMD))
 ifeq ($(EXTERNAL_BUILDJDK), false)
-  DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
+  DEPS += $(call FindFiles, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
 endif
 
 # If creating interim versions of jmods, certain files need to be filtered out
--- a/make/Docs.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/Docs.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -337,7 +337,7 @@
       $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
 
   # Get a list of all files in all the source dirs for all included modules
-  $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
+  $1_SOURCE_DEPS := $$(call FindFiles, $$(wildcard $$(foreach module, \
       $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
 
   $$(eval $$(call SetupExecute, javadoc_$1, \
@@ -484,7 +484,7 @@
 GLOBAL_SPECS_RESOURCES_DIR := $(TOPDIR)/make/data/docs-resources/
 $(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
     SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
-    FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
+    FILES := $(call FindFiles, $(GLOBAL_SPECS_RESOURCES_DIR)), \
     DEST := $(DOCS_OUTPUTDIR), \
 ))
 JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
@@ -509,10 +509,10 @@
 $(foreach m, $(ALL_MODULES), \
   $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
   $(foreach d, $(SPECS_$m), \
-    $(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
+    $(if $(filter $(COPY_SPEC_FILTER), $(call FindFiles, $d)), \
       $(eval $(call SetupCopyFiles, COPY_$m, \
           SRC := $d, \
-          FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
+          FILES := $(filter $(COPY_SPEC_FILTER), $(call FindFiles, $d)), \
           DEST := $(DOCS_OUTPUTDIR)/specs/, \
       )) \
       $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
@@ -529,11 +529,11 @@
   $(foreach m, $(ALL_MODULES), \
     $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
     $(foreach d, $(SPECS_$m), \
-      $(if $(filter %.md, $(call CacheFind, $d)), \
+      $(if $(filter %.md, $(call FindFiles, $d)), \
         $(eval $m_$d_NAME := SPECS_TO_HTML_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
         $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
             SRC := $d, \
-            FILES := $(filter %.md, $(call CacheFind, $d)), \
+            FILES := $(filter %.md, $(call FindFiles, $d)), \
             DEST := $(DOCS_OUTPUTDIR)/specs/, \
             CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
         )) \
@@ -556,11 +556,11 @@
   $(foreach m, $(ALL_MODULES), \
     $(eval MAN_$m := $(call FindModuleManDirs, $m)) \
     $(foreach d, $(MAN_$m), \
-      $(if $(filter %.md, $(call CacheFind, $d)), \
+      $(if $(filter %.md, $(call FindFiles, $d)), \
         $(eval $m_$d_NAME := MAN_TO_HTML_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
         $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
             SRC := $d, \
-            FILES := $(filter %.md, $(call CacheFind, $d)), \
+            FILES := $(filter %.md, $(call FindFiles, $d)), \
             DEST := $(DOCS_OUTPUTDIR)/specs/man, \
             FILTER := $(PANDOC_HTML_MANPAGE_FILTER), \
             CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
--- a/make/Images.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/Images.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -183,21 +183,14 @@
 
 ifeq ($(GCOV_ENABLED), true)
 
-  GCOV_FIND_EXPR := -type f -name "*.gcno"
-
-  $(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
+  $(eval $(call SetupCopyFiles,COPY_GCOV_GCNO, \
       SRC := $(OUTPUTDIR), \
       DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
-      FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
-
-  SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
+      FILES := $(call FindFiles, $(HOTSPOT_OUTPUTDIR) \
+          $(SUPPORT_OUTPUTDIR)/native, *.gcno) \
+  ))
 
-  $(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
-      SRC := $(OUTPUTDIR), \
-      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
-      FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))
-
-  SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)
+  SYMBOLS_TARGETS += $(COPY_GCOV_GCNO)
 
 endif
 
@@ -230,10 +223,10 @@
   # On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
   # dirs.
   ifeq ($(call isTargetOs, macosx), true)
-    $(eval $(call FillCacheFind, \
-        $(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs))
+    $(call FillFindCache, \
+        $(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs)
     FindDebuginfoFiles = \
-        $(if $(wildcard $1), $(call containing, .dSYM/, $(call CacheFind, $1)))
+        $(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
   endif
 endif
 
--- a/make/InitSupport.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/InitSupport.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -264,13 +264,9 @@
       endif
     endif
 
-    # The --no-print-directory is needed to make the call from
-    # FindTest.gmk to Test.gmk work with LOG=debug/trace. See
-    # JDK-8213736
     $$(main_targets_file):
 	@( cd $$(topdir) && \
-	$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R --no-print-directory \
-	    -f $$(topdir)/make/Main.gmk \
+	$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \
 	    -I $$(topdir)/make/common SPEC=$(strip $2) NO_RECIPES=true \
 	    $$(MAKE_LOG_VARS) \
 	    create-main-targets-include )
--- a/make/MacBundles.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/MacBundles.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # 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,13 +52,13 @@
   $(eval $(call SetupCopyFiles, COPY_JDK_IMAGE, \
       SRC := $(JDK_IMAGE_DIR), \
       DEST := $(JDK_MACOSX_CONTENTS_DIR)/Home, \
-      FILES := $(call CacheFind, $(JDK_IMAGE_DIR)), \
+      FILES := $(call FindFiles, $(JDK_IMAGE_DIR)), \
   ))
 
   $(eval $(call SetupCopyFiles, COPY_JRE_IMAGE, \
       SRC := $(JRE_IMAGE_DIR), \
       DEST := $(JRE_MACOSX_CONTENTS_DIR)/Home, \
-      FILES := $(call CacheFind, $(JRE_IMAGE_DIR)), \
+      FILES := $(call FindFiles, $(JRE_IMAGE_DIR)), \
   ))
 
   $(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
--- a/make/RunTestsPrebuilt.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/RunTestsPrebuilt.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -338,6 +338,12 @@
 
 run-test-prebuilt:
 	@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
+        # The lazy initialization of the cache file in FindTests.gmk does not
+        # always work with RunTests.gmk. To guarantee that the jtreg test groups
+        # are always found and parsed, call FindTests.gmk stand alone once
+        # before calling RunTests.gmk.
+	@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/common/FindTests.gmk \
+	    SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true
 	@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
 	    TEST="$(TEST)"
 
--- a/make/ZipSource.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/ZipSource.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,7 @@
       EXCLUDE_FILES := $(SRC_ZIP_EXCLUDE_FILES), \
       SUFFIXES := .java, \
       ZIP := $(SUPPORT_OUTPUTDIR)/src.zip, \
+      FOLLOW_SYMLINKS := true, \
   ))
 
   do-zip: $(BUILD_SRC_ZIP)
--- a/make/common/FindTests.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/FindTests.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -26,6 +26,16 @@
 ifndef _FIND_TESTS_GMK
 _FIND_TESTS_GMK := 1
 
+# This makefile can be called directly to just trigger generation of the cache
+# makefile. If so, SPEC and MakeBase.gmk need to be included.
+ifeq ($(FINDTESTS_STAND_ALONE), true)
+  include $(SPEC)
+  include MakeBase.gmk
+endif
+
+# Make sure this variable is not lazy evaled.
+ALL_NAMED_TESTS :=
+
 # Hook to include the corresponding custom file, if present.
 $(eval $(call IncludeCustomExtension, common/FindTests.gmk))
 
@@ -35,32 +45,40 @@
 # JTREG_TESTROOTS might have been set by a custom extension
 JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools nashorn jaxp)
 
-################################################################################
-# Find the Jtreg test groups for the given component.
-#
-# Parameter 1 is the jtreg root dir. This name is used as variable prefix.
-#
-# After this macro has been evaluated, the following variables are defined for
-# the component:
-#   JTREG_TESTROOT - The path to the root of the test directory
-#   JTREG_GROUP_FILES - The file(s) containing the group definitions
-#   JTREG_TEST_GROUPS - The name of the test groups that the component defines
+# Extract the names of the Jtreg group files from the TEST.ROOT files. The
+# TEST.ROOT files being properties files can be interpreted as makefiles so
+# use include to get at the contents instead of expensive shell calls. We are
+# looking for the "groups" property in each file.
+JTREG_ROOT_FILES := $(addsuffix /TEST.ROOT, $(JTREG_TESTROOTS))
+JTREG_GROUP_FILES :=
+$(foreach root, $(JTREG_TESTROOTS), \
+  $(eval include $(root)/TEST.ROOT) \
+  $(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \
+  $(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \
+)
+
+# Cache the expensive to calculate test names in a generated makefile.
+FIND_TESTS_CACHE_FILE := $(MAKESUPPORT_OUTPUTDIR)/find-tests.gmk
+
+# If this file is deemed outdated, it will automatically get regenerated
+# by this rule before being included below.
 #
-FindJtregGroups = $(NamedParamsMacroTemplate)
-define FindJtregGroupsBody
-  ifneq ($$(wildcard $1), )
-    $1_JTREG_GROUP_FILENAMES := $$(shell $$(SED) -n -e 's/\[\(.*\)\]/\1/g' \
-        -e 's/^groups\w*=//p' $1/TEST.ROOT)
-    $1_JTREG_GROUP_FILES := $$(addprefix $1/, $$($1_JTREG_GROUP_FILENAMES))
-    $1_JTREG_TEST_GROUPS := $$(strip $$(shell $$(SED) -n \
-        -e 's/^\#.*//g' \
-        -e 's/\([^ ]*\)\w*=.*/\1/gp' $$(wildcard $$($1_JTREG_GROUP_FILES)) \
-        | $$(SORT) -u))
-  endif
-endef
+# When calling TestMake.gmk, override the log level to avoid any kind of debug
+# output being captured into the generated makefile.
+$(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES)
+	$(call MakeTargetDir)
+	( $(foreach root, $(JTREG_TESTROOTS), \
+	    $(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \
+	    $(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \
+	      $($(root)_JTREG_GROUP_FILES) \
+	      | $(SORT) -u | $(TR) '\n' ' ' ; \
+	  ) \
+	  $(PRINTF) "\nMAKE_TEST_TARGETS := " ; \
+	  $(MAKE) -s --no-print-directory $(MAKE_ARGS) LOG_LEVEL=warn \
+	      SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
+	) > $@
 
-# Configure definitions for all available test components
-$(foreach root, $(JTREG_TESTROOTS), $(eval $(call FindJtregGroups, $(root))))
+-include $(FIND_TESTS_CACHE_FILE)
 
 # Create a list of all available Jtreg test groups in all components
 JTREG_TEST_GROUPS += $(sort $(foreach root, $(JTREG_TESTROOTS), \
@@ -70,18 +88,15 @@
 # ALL_NAMED_TESTS might have been set by a custom extension
 ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS)
 
+# Add the make test targets
+ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
+
 # Add Gtest
 ALL_NAMED_TESTS += gtest
 
 # Add microbenchmarks
 ALL_NAMED_TESTS += micro
 
-# Find make test targets
-MAKE_TEST_TARGETS := $(shell $(MAKE) -s --no-print-directory $(MAKE_ARGS) \
-    SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets)
-
-ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
-
 # Add special tests
 ALL_NAMED_TESTS += failure-handler make
 
--- a/make/common/JarArchive.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/JarArchive.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -124,9 +124,9 @@
   ifeq ($$($1_DEPENDENCIES), )
     # Add all source roots to the find cache since we are likely going to run find
     # on these more than once. The cache will only be updated if necessary.
-    $$(eval $$(call FillCacheFind, $$($1_FIND_LIST)))
+    $$(call FillFindCache, $$($1_FIND_LIST))
     $1_DEPENDENCIES:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
-        $$(call CacheFind,$$($1_SRCS)))
+        $$(call FindFiles,$$($1_SRCS)))
     ifneq (,$$($1_GREP_INCLUDE_PATTERNS))
       $1_DEPENDENCIES:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
     endif
@@ -137,7 +137,7 @@
     $1_DEPENDENCIES+=$$(wildcard $$(foreach src, $$($1_SRCS), \
         $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))
     ifeq (,$$($1_SKIP_METAINF))
-      $1_DEPENDENCIES+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
+      $1_DEPENDENCIES+=$$(call FindFiles,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
     endif
   endif
   # The dependency list should never be empty
--- a/make/common/JavaCompilation.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/JavaCompilation.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -222,13 +222,12 @@
     ) \
   )
   $$(call MakeDir,$$($1_BIN))
-  # Add all source roots to the find cache since we are likely going to run find
-  # on these more than once. The cache will only be updated if necessary.
-  $$(eval $$(call FillCacheFind, $$($1_SRC)))
-  # Find all files in the source trees. Preserve order of source roots so that
-  # the first version in case of multiple instances of the same file is selected.
-  # CacheFind does not preserve order so need to call it for each root.
-  $1_ALL_SRCS += $$($1_EXTRA_FILES) $$(foreach s, $$($1_SRC), $$(call CacheFind, $$s))
+  # Order src files according to the order of the src dirs. Correct odering is
+  # needed for correct overriding between different source roots.
+  $1_ALL_SRC_RAW := $$(call FindFiles, $$($1_SRC))
+  $1_ALL_SRCS := $$($1_EXTRA_FILES) \
+      $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_ALL_SRC_RAW)))
+
   # Extract the java files.
   $1_SRCS := $$(filter %.java, $$($1_ALL_SRCS))
 
--- a/make/common/MakeBase.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/MakeBase.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -64,10 +64,12 @@
 
 endef
 
-# In GNU Make 4.0 and higher, there is a file function for writing to files.
+# Certain features only work in newer version of GNU Make. The build will still
+# function in 3.81, but will be less performant.
 ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
   HAS_FILE_FUNCTION := true
   CORRECT_FUNCTION_IN_RECIPE_EVALUATION := true
+  RWILDCARD_WORKS := true
 endif
 
 
@@ -341,74 +343,116 @@
 
 ################################################################################
 
-ifneq ($(DISABLE_CACHE_FIND), true)
-  # In Cygwin, finds are very costly, both because of expensive forks and because
-  # of bad file system caching. Find is used extensively in $(shell) commands to
-  # find source files. This makes rerunning make with no or few changes rather
-  # expensive. To speed this up, these two macros are used to cache the results
-  # of simple find commands for reuse.
-  #
-  # Runs a find and stores both the directories where it was run and the results.
-  # This macro can be called multiple times to add to the cache. Only finds files
-  # with no filters.
-  #
-  # Files containing space will get spaces replaced with ? because GNU Make
-  # cannot handle lists of files with space in them. By using ?, make will match
-  # the wildcard to space in many situations so we don't need to replace back
-  # to space on every use. While not a complete solution it does allow some uses
-  # of CacheFind to function with spaces in file names, including for
-  # SetupCopyFiles.
-  #
-  # Needs to be called with $(eval )
-  #
-  # Even if the performance benifit is negligible on other platforms, keep the
-  # functionality active unless explicitly disabled to exercise it more.
-  #
-  # Initialize FIND_CACHE_DIRS with := to make it a non recursively-expanded variable
-  FIND_CACHE_DIRS :=
-  # Param 1 - Dirs to find in
-  # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
-  define FillCacheFind
-    # Filter out already cached dirs. The - is needed when FIND_CACHE_DIRS is empty
-    # since filter out will then return empty.
-    FIND_CACHE_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
-        - $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS), $1)
-    ifneq ($$(FIND_CACHE_NEW_DIRS), )
-      # Remove any trailing slash from dirs in the cache dir list
-      FIND_CACHE_DIRS += $$(patsubst %/,%, $$(FIND_CACHE_NEW_DIRS))
-      FIND_CACHE := $$(sort $$(FIND_CACHE) \
-          $$(shell $(FIND) $$(wildcard $$(FIND_CACHE_NEW_DIRS)) \
-              \( -type f -o -type l \) $2 | $(TR) ' ' '?'))
-    endif
-  endef
+# Recursive wildcard function. Walks down directories recursively and matches
+# files with the search patterns. Patterns use standard file wildcards (* and
+# ?).
+#
+# $1 - Directories to start search in
+# $2 - Search patterns
+rwildcard = \
+    $(strip \
+        $(foreach d, \
+          $(patsubst %/,%,$(sort $(dir $(wildcard $(addsuffix /*/*, $(strip $1)))))), \
+          $(call rwildcard,$d,$2) \
+        ) \
+        $(call DoubleDollar, $(wildcard $(foreach p, $2, $(addsuffix /$(strip $p), $(strip $1))))) \
+    )
+
+# Find non directories using recursive wildcard function. This function may
+# be used directly when a small amount of directories is expected to be
+# searched and caching is not expected to be of use.
+#
+# $1 - Directory to start search in
+# $2 - Optional search patterns, defaults to '*'.
+WildcardFindFiles = \
+    $(sort $(strip \
+        $(eval WildcardFindFiles_result := $(call rwildcard,$(patsubst %/,%,$1),$(if $(strip $2),$2,*))) \
+        $(filter-out $(patsubst %/,%,$(sort $(dir $(WildcardFindFiles_result)))), \
+            $(WildcardFindFiles_result) \
+        ) \
+    ))
+
+# Find non directories using the find utility in the shell. Safe to call for
+# non existing directories, or directories containing wildcards.
+#
+# Files containing space will get spaces replaced with ? because GNU Make
+# cannot handle lists of files with space in them. By using ?, make will match
+# the wildcard to space in many situations so we don't need to replace back
+# to space on every use. While not a complete solution it does allow some uses
+# of FindFiles to function with spaces in file names, including for
+# SetupCopyFiles. Unfortunately this does not work for WildcardFindFiles so
+# if files with spaces are anticipated, use ShellFindFiles directly.
+#
+# $1 - Directories to start search in.
+# $2 - Optional search patterns, empty means find everything. Patterns use
+#      standard file wildcards (* and ?) and should not be quoted.
+# $3 - Optional options to find.
+ShellFindFiles = \
+    $(if $(wildcard $1), \
+      $(sort \
+          $(shell $(FIND) $3 $(patsubst %/,%,$(wildcard $1)) \( -type f -o -type l \) \
+              $(if $(strip $2), -a \( -name "$(firstword $2)" \
+              $(foreach p, $(filter-out $(firstword $2), $2), -o -name "$(p)") \)) \
+              | $(TR) ' ' '?' \
+          ) \
+      ) \
+    )
 
-  # Mimics find by looking in the cache if all of the directories have been cached.
-  # Otherwise reverts to shell find. This is safe to call on all platforms, even if
-  # cache is deactivated.
-  #
-  # $1 can be either a directory or a file. If it's a directory, make
-  # sure we have exactly one trailing slash before the wildcard.
-  # The extra - is needed when FIND_CACHE_DIRS is empty but should be harmless.
-  #
-  # Param 1 - Dirs to find in
-  # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
-  # Param 3 - (optional) options to find.
-  define CacheFind
-    $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
-      $(if $(wildcard $1), $(shell $(FIND) $3 $(wildcard $1) \( -type f -o -type l \) $2 \
-          | $(TR) ' ' '?')), \
-      $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
-  endef
+# Find non directories using the method most likely to work best for the
+# current build host
+#
+# $1 - Directory to start search in
+# $2 - Optional search patterns, defaults to '*'.
+ifeq ($(OPENJDK_BUILD_OS)-$(RWILDCARD_WORKS), windows-true)
+  DirectFindFiles = $(WildcardFindFiles)
+else
+  DirectFindFiles = $(ShellFindFiles)
+endif
 
+# Finds files using a cache that is populated by FillFindCache below. If any of
+# the directories given have not been cached, DirectFindFiles is used for
+# everything. Caching is especially useful in Cygwin, where file finds are very
+# costly.
+#
+# $1 - Directories to start search in.
+# $2 - Optional search patterns. If used, no caching is done.
+CacheFindFiles_CACHED_DIRS :=
+CacheFindFiles_CACHED_FILES :=
+CacheFindFiles = \
+    $(if $2, \
+      $(call DirectFindFiles, $1, $2) \
+    , \
+      $(if $(filter-out $(addsuffix /%, $(CacheFindFiles_CACHED_DIRS)) \
+          $(CacheFindFiles_CACHED_DIRS), $1), \
+        $(call DirectFindFiles, $1) \
+      , \
+        $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(CacheFindFiles_CACHED_FILES)) \
+      ) \
+    )
+
+# Explicitly adds files to the find cache used by CacheFindFiles.
+#
+# $1 - Directories to start search in
+FillFindCache = \
+    $(eval CacheFindFiles_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
+        $$(CacheFindFiles_CACHED_DIRS)) $$(CacheFindFiles_CACHED_DIRS), $1)) \
+    $(if $(CacheFindFiles_NEW_DIRS), \
+      $(eval CacheFindFiles_CACHED_DIRS += $$(patsubst %/,%,$$(CacheFindFiles_NEW_DIRS))) \
+      $(eval CacheFindFiles_CACHED_FILES := $$(sort $$(CacheFindFiles_CACHED_FILES) \
+          $$(call DirectFindFiles, $$(CacheFindFiles_NEW_DIRS)))) \
+    )
+
+# Findfiles is the default macro that should be used to find files in the file
+# system. This function does not always support files with spaces in the names.
+# If files with spaces are anticipated, use ShellFindFiles directly.
+#
+# $1 - Directories to start search in.
+# $2 - Optional search patterns, empty means find everything. Patterns use
+#      standard file wildcards (* and ?) and should not be quoted.
+ifeq ($(DISABLE_CACHE_FIND), true)
+  FindFiles = $(DirectFindFiles)
 else
-  # If CacheFind is disabled, just run the find command.
-  # Param 1 - Dirs to find in
-  # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
-  define CacheFind
-    $(if $(wildcard $1, \
-      $(shell $(FIND) $(wildcard $1) \( -type f -o -type l \) $2 | $(TR) ' ' '?') \
-    )
-  endef
+  FindFiles = $(CacheFindFiles)
 endif
 
 ################################################################################
--- a/make/common/NativeCompilation.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/NativeCompilation.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -505,7 +505,7 @@
   $$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
       $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
 
-  $1_SRCS_RAW = $$(call CacheFind, $$($1_SRC))
+  $1_SRCS_RAW := $$(call FindFiles, $$($1_SRC))
   # Order src files according to the order of the src dirs
   $1_SRCS := $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_SRCS_RAW)))
   $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
--- a/make/common/TestFilesCompilation.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/TestFilesCompilation.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -77,8 +77,7 @@
 
   # Locate all files with the matching prefix
   $1_FILE_LIST := \
-      $$(shell $$(FIND) $$($1_SOURCE_DIRS) -type f \( -name "$$($1_PREFIX)*.c" \
-          -o -name "$$($1_PREFIX)*.cpp" \))
+      $$(call FindFiles, $$($1_SOURCE_DIRS), $$($1_PREFIX)*.c $$($1_PREFIX)*.cpp)
 
   $1_EXCLUDE_PATTERN := $$(addprefix %/, $$($1_EXCLUDE))
   $1_FILTERED_FILE_LIST := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_FILE_LIST))
--- a/make/common/TextFileProcessing.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/TextFileProcessing.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@
           $$(error SOURCE_DIRS contains directory $$(src) outside \
               SOURCE_BASE_DIR $$($1_SOURCE_BASE_DIR) (in $1))))
     endif
-    $1_SOURCE_FILES := $$(sort $$(call CacheFind,$$($1_SOURCE_DIRS)))
+    $1_SOURCE_FILES := $$(sort $$(call FindFiles,$$($1_SOURCE_DIRS)))
     $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
     $1_INCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
     $1_SOURCE_FILES := $$(filter-out $$($1_EXCLUDE_FILES),$$($1_SOURCE_FILES))
--- a/make/common/Utils.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/Utils.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -70,8 +70,8 @@
 
 ################################################################################
 # Replace question marks with space in string. This macro needs to be called on
-# files from CacheFind in case any of them contains space in their file name,
-# since CacheFind replaces space with ?.
+# files from FindFiles in case any of them contains space in their file name,
+# since FindFiles replaces space with ?.
 # Param 1 - String to replace in
 DecodeSpace = \
     $(subst ?,$(SPACE),$(strip $1))
--- a/make/common/ZipArchive.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/common/ZipArchive.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # 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,6 +48,8 @@
 #                           src dir
 #   SUFFIXES
 #   EXTRA_DEPS
+#   FOLLOW_SYMLINKS - Set to explicitly follow symlinks. Affects performance of
+#                     finding files.
 #   ZIP_OPTIONS extra options to pass to zip
 SetupZipArchive = $(NamedParamsMacroTemplate)
 define SetupZipArchiveBody
@@ -62,9 +64,14 @@
     $1_FIND_LIST := $$($1_SRC)
   endif
 
-  # Find all files in the source tree. Follow symlinks in this find since that is
-  # what zip does.
-  $1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST), , -L))
+  # Find all files in the source tree.
+  # If asked to, follow symlinks in this find since that is what zip does. To do
+  # this, we need to call ShellFindFiles directly.
+  ifeq ($$($1_FOLLOW_SYMLINKS), true)
+    $1_ALL_SRCS := $$(call not-containing,_the.,$$(call ShellFindFiles,$$($1_FIND_LIST), , -L))
+  else
+    $1_ALL_SRCS := $$(call not-containing,_the.,$$(call FindFiles,$$($1_FIND_LIST)))
+  endif
 
   # Filter on suffixes if set
   ifneq ($$($1_SUFFIXES),)
--- a/make/copy/CopyCommon.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/copy/CopyCommon.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
   $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE, \
       SRC := $(INCLUDE_SOURCE_DIR), \
       DEST := $(INCLUDE_TARGET_DIR), \
-      FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_DIR))), \
+      FILES := $(filter %.h, $(call FindFiles, $(INCLUDE_SOURCE_DIR))), \
   ))
 
   TARGETS += $(COPY_EXPORTED_INCLUDE)
@@ -56,7 +56,7 @@
   $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE_OS, \
       SRC := $(INCLUDE_SOURCE_OS_DIR), \
       DEST := $(INCLUDE_TARGET_DIR)/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR), \
-      FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_OS_DIR))), \
+      FILES := $(filter %.h, $(call FindFiles, $(INCLUDE_SOURCE_OS_DIR))), \
   ))
 
   TARGETS += $(COPY_EXPORTED_INCLUDE_OS)
--- a/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -65,7 +65,7 @@
 
 PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))
 
-PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
+PROC_SRCS := $(filter %.java, $(call FindFiles, $(PROC_SRC_DIRS)))
 
 ALL_SRC_DIRS := $(SRC_DIR) $(wildcard $(SRC_DIR)/*/src)
 SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
--- a/make/gensrc/Gensrc-jdk.internal.vm.compiler.management.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/gensrc/Gensrc-jdk.internal.vm.compiler.management.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
 # 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,7 +39,7 @@
 
 PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))
 
-PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
+PROC_SRCS := $(filter %.java, $(call FindFiles, $(PROC_SRC_DIRS)))
 
 ALL_SRC_DIRS := $(SRC_DIR) $(wildcard $(SRC_DIR)/*/src)
 SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
--- a/make/gensrc/GensrcCommonLangtools.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/gensrc/GensrcCommonLangtools.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@
 define SetupCompileProperties
   # Lookup the properties that need to be compiled into resource bundles.
   PROPSOURCES := $2 \
-      $$(shell $(FIND) $(TOPDIR)/src/$(MODULE)/share/classes -name "*.properties")
+      $$(call FindFiles, $(TOPDIR)/src/$(MODULE)/share/classes, *.properties)
 
   # Filter out any excluded translations
   PROPSOURCES := $$(call FilterExcludedTranslations, $$(PROPSOURCES), .properties)
--- a/make/gensrc/GensrcLocaleData.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/gensrc/GensrcLocaleData.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -28,16 +28,16 @@
 # into LocaleDataMetaInfo.java
 
 # First go look for all locale files
-LOCALE_FILES := $(shell $(FIND) \
+LOCALE_FILES := $(call FindFiles, \
     $(TOPDIR)/src/$(MODULE)/share/classes/sun/text/resources \
-    $(TOPDIR)/src/$(MODULE)/share/classes/sun/util/resources \
-    -name "FormatData_*.java" -o -name "FormatData_*.properties" -o \
-    -name "CollationData_*.java" -o -name "CollationData_*.properties" -o \
-    -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
-    -name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
-    -name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
-    -name "CalendarData_*.java" -o -name "CalendarData_*.properties" -o \
-    -name "BreakIteratorInfo_*.java" -o -name "BreakIteratorRules_*.java")
+    $(TOPDIR)/src/$(MODULE)/share/classes/sun/util/resources, \
+    FormatData_*.java FormatData_*.properties \
+    CollationData_*.java CollationData_*.properties \
+    TimeZoneNames_*.java TimeZoneNames_*.properties \
+    LocaleNames_*.java LocaleNames_*.properties \
+    CurrencyNames_*.java CurrencyNames_*.properties \
+    CalendarData_*.java CalendarData_*.properties \
+    BreakIteratorInfo_*.java BreakIteratorRules_*.java)
 
 # Then translate the locale files into for example: FormatData_sv
 LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
--- a/make/gensrc/GensrcProperties.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/gensrc/GensrcProperties.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@
   endif
 
   # Locate all properties files in the given source dirs.
-  $1_SRC_FILES := $$(filter %.properties, $$(call CacheFind, $$($1_SRC_DIRS)))
+  $1_SRC_FILES := $$(call FindFiles, $$($1_SRC_DIRS), *.properties)
 
   ifneq ($$($1_EXCLUDE), )
     $1_SRC_FILES := $$(filter-out $$($1_EXCLUDE), $$($1_SRC_FILES))
--- a/make/hotspot/lib/CompileJvm.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/hotspot/lib/CompileJvm.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -167,7 +167,7 @@
 JVM_STRIPFLAGS ?= $(STRIPFLAGS)
 
 # This source set is reused so save in cache.
-$(eval $(call FillCacheFind, $(JVM_SRC_DIRS)))
+$(call FillFindCache, $(JVM_SRC_DIRS))
 
 ################################################################################
 # Now set up the actual compilation of the main hotspot native library
--- a/make/hotspot/lib/JvmOverrideFiles.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/hotspot/lib/JvmOverrideFiles.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@
     # significantly reduce the GC pause time on 32 bit Linux/Unix platforms by
     # compiling without the PIC flag (-fPIC on linux).
     # See 6454213 for more details.
-    ALL_SRC := $(filter %.cpp, $(call CacheFind, $(TOPDIR)/src/hotspot/share))
+    ALL_SRC := $(call FindFiles, $(TOPDIR)/src/hotspot/share, *.cpp)
     NONPIC_FILTER := $(addsuffix %, $(addprefix $(TOPDIR)/src/hotspot/share/, \
         memory oops gc))
     # Due to what looks like a bug in the old build implementation of this, add a
--- a/make/lib/Lib-java.base.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/lib/Lib-java.base.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 $(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk))
 
 # Prepare the find cache.
-$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.base/*/native)))
+$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native))
 
 ################################################################################
 # Create all the core libraries
--- a/make/lib/Lib-java.desktop.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/make/lib/Lib-java.desktop.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 $(eval $(call IncludeCustomExtension, lib/Lib-java.desktop.gmk))
 
 # Prepare the find cache.
-$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.desktop/*/native)))
+$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native))
 
 ################################################################################
 # Create the AWT/2D libraries
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -46,7 +46,18 @@
                                                        Register addr, Register count, RegSet saved_regs) {
   if (is_oop) {
     bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0;
-    if (!dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
+    if (ShenandoahSATBBarrier && !dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
+
+      Label done;
+
+      // Avoid calling runtime if count == 0
+      __ cbz(count, done);
+
+      // Is marking active?
+      Address gc_state(rthread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
+      __ ldrb(rscratch1, gc_state);
+      __ tbz(rscratch1, ShenandoahHeap::MARKING_BITPOS, done);
+
       __ push(saved_regs, sp);
       if (count == c_rarg0) {
         if (addr == c_rarg1) {
@@ -68,6 +79,7 @@
         __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_array_pre_oop_entry), 2);
       }
       __ pop(saved_regs, sp);
+      __ bind(done);
     }
   }
 }
--- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -66,26 +66,22 @@
     }
 #endif
 
-    if (!dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
+    if (ShenandoahSATBBarrier && !dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
       Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
 #ifndef _LP64
       __ push(thread);
       __ get_thread(thread);
 #endif
 
-      Label filtered;
-      Address in_progress(thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_active_offset()));
-      // Is marking active?
-      if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
-        __ cmpl(in_progress, 0);
-      } else {
-        assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
-        __ cmpb(in_progress, 0);
-      }
+      Label done;
+      // Short-circuit if count == 0.
+      __ testptr(count, count);
+      __ jcc(Assembler::zero, done);
 
-      NOT_LP64(__ pop(thread);)
-
-        __ jcc(Assembler::equal, filtered);
+      // Avoid runtime call when not marking.
+      Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
+      __ testb(gc_state, ShenandoahHeap::MARKING);
+      __ jcc(Assembler::zero, done);
 
       __ pusha();                      // push registers
 #ifdef _LP64
@@ -111,7 +107,8 @@
                       dst, count);
 #endif
       __ popa();
-      __ bind(filtered);
+      __ bind(done);
+      NOT_LP64(__ pop(thread);)
     }
   }
 
--- a/src/hotspot/share/classfile/stringTable.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/classfile/stringTable.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -761,10 +761,6 @@
       return true;
     }
     unsigned int hash = java_lang_String::hash_code(s);
-    if (hash == 0) {
-      // We do not archive Strings with a 0 hashcode because ......
-      return true;
-    }
 
     java_lang_String::set_hash(s, hash);
     oop new_s = StringTable::create_archived_string(s, Thread::current());
--- a/src/hotspot/share/compiler/compilerOracle.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/compiler/compilerOracle.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -738,30 +738,6 @@
   parse_line(token);
 }
 
-void CompilerOracle::append_comment_to_file(const char* message) {
-  assert(has_command_file(), "command file must be specified");
-  fileStream stream(fopen(cc_file(), "at"));
-  stream.print("# ");
-  for (int index = 0; message[index] != '\0'; index++) {
-    stream.put(message[index]);
-    if (message[index] == '\n') stream.print("# ");
-  }
-  stream.cr();
-}
-
-void CompilerOracle::append_exclude_to_file(const methodHandle& method) {
-  assert(has_command_file(), "command file must be specified");
-  fileStream stream(fopen(cc_file(), "at"));
-  stream.print("exclude ");
-  method->method_holder()->name()->print_symbol_on(&stream);
-  stream.print(".");
-  method->name()->print_symbol_on(&stream);
-  method->signature()->print_symbol_on(&stream);
-  stream.cr();
-  stream.cr();
-}
-
-
 void compilerOracle_init() {
   CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line);
   CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only);
--- a/src/hotspot/share/compiler/compilerOracle.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/compiler/compilerOracle.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -83,10 +83,6 @@
   static void parse_from_line(char* line);
   static void parse_compile_only(char * line);
 
-  // For updating the oracle file
-  static void append_comment_to_file(const char* message);
-  static void append_exclude_to_file(const methodHandle& method);
-
   // Tells whether there are any methods to print for print_method_statistics()
   static bool should_print_methods();
 };
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -2731,7 +2731,7 @@
           // The remembered set might contain references to already freed
           // regions. Filter out such entries to avoid failing card table
           // verification.
-          if (g1h->is_in_closed_subset(ct->addr_for(card_ptr))) {
+          if (g1h->is_in(ct->addr_for(card_ptr))) {
             if (*card_ptr != G1CardTable::dirty_card_val()) {
               *card_ptr = G1CardTable::dirty_card_val();
               _dcq.enqueue(card_ptr);
@@ -4608,11 +4608,6 @@
          used(), recalculate_used());
 }
 
-bool G1CollectedHeap::is_in_closed_subset(const void* p) const {
-  HeapRegion* hr = heap_region_containing(p);
-  return hr->is_in(p);
-}
-
 // Methods for the mutator alloc region
 
 HeapRegion* G1CollectedHeap::new_mutator_alloc_region(size_t word_size,
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -1119,8 +1119,6 @@
     return _hrm->reserved();
   }
 
-  virtual bool is_in_closed_subset(const void* p) const;
-
   G1HotCardCache* g1_hot_card_cache() const { return _hot_card_cache; }
 
   G1CardTable* card_table() const {
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -1766,17 +1766,17 @@
   G1CMSATBBufferClosure _cm_satb_cl;
   G1CMOopClosure _cm_cl;
   MarkingCodeBlobClosure _code_cl;
-  int _thread_parity;
+  uintx _claim_token;
 
  public:
   G1RemarkThreadsClosure(G1CollectedHeap* g1h, G1CMTask* task) :
     _cm_satb_cl(task, g1h),
     _cm_cl(g1h, task),
     _code_cl(&_cm_cl, !CodeBlobToOopClosure::FixRelocations),
-    _thread_parity(Threads::thread_claim_parity()) {}
+    _claim_token(Threads::thread_claim_token()) {}
 
   void do_thread(Thread* thread) {
-    if (thread->claim_oops_do(true, _thread_parity)) {
+    if (thread->claim_threads_do(true, _claim_token)) {
       SATBMarkQueue& queue = G1ThreadLocalData::satb_mark_queue(thread);
       queue.apply_closure_and_empty(&_cm_satb_cl);
       if (thread->is_Java_thread()) {
--- a/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -61,7 +61,7 @@
     _cc++;
     oop obj = CompressedOops::decode_not_null(heap_oop);
     bool failed = false;
-    if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _verify_option)) {
+    if (!_g1h->is_in(obj) || _g1h->is_obj_dead_cond(obj, _verify_option)) {
       MutexLockerEx x(ParGCRareEvent_lock,
           Mutex::_no_safepoint_check_flag);
       LogStreamHandle(Error, gc, verify) yy;
@@ -69,7 +69,7 @@
         yy.cr();
         yy.print_cr("----------");
       }
-      if (!_g1h->is_in_closed_subset(obj)) {
+      if (!_g1h->is_in(obj)) {
         HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
         yy.print_cr("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
                     p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
--- a/src/hotspot/share/gc/g1/heapRegion.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/g1/heapRegion.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -514,7 +514,7 @@
     if (!CompressedOops::is_null(heap_oop)) {
       oop obj = CompressedOops::decode_not_null(heap_oop);
       bool failed = false;
-      if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _vo)) {
+      if (!_g1h->is_in(obj) || _g1h->is_obj_dead_cond(obj, _vo)) {
         MutexLockerEx x(ParGCRareEvent_lock,
           Mutex::_no_safepoint_check_flag);
 
@@ -522,7 +522,7 @@
           log.error("----------");
         }
         ResourceMark rm;
-        if (!_g1h->is_in_closed_subset(obj)) {
+        if (!_g1h->is_in(obj)) {
           HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
           log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
                     p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
--- a/src/hotspot/share/gc/serial/serialHeap.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/serial/serialHeap.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -59,11 +59,6 @@
   virtual GrowableArray<GCMemoryManager*> memory_managers();
   virtual GrowableArray<MemoryPool*> memory_pools();
 
-  // override
-  virtual bool is_in_closed_subset(const void* p) const {
-    return is_in(p);
-  }
-
   DefNewGeneration* young_gen() const {
     assert(_young_gen->kind() == Generation::DefNew, "Wrong generation type");
     return static_cast<DefNewGeneration*>(_young_gen);
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -575,3 +575,8 @@
 size_t CollectedHeap::obj_size(oop obj) const {
   return obj->size();
 }
+
+uint32_t CollectedHeap::hash_oop(oop obj) const {
+  const uintptr_t addr = cast_from_oop<uintptr_t>(obj);
+  return static_cast<uint32_t>(addr >> LogMinObjAlignment);
+}
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -239,37 +239,7 @@
 
   DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
 
-  // Let's define some terms: a "closed" subset of a heap is one that
-  //
-  // 1) contains all currently-allocated objects, and
-  //
-  // 2) is closed under reference: no object in the closed subset
-  //    references one outside the closed subset.
-  //
-  // Membership in a heap's closed subset is useful for assertions.
-  // Clearly, the entire heap is a closed subset, so the default
-  // implementation is to use "is_in_reserved".  But this may not be too
-  // liberal to perform useful checking.  Also, the "is_in" predicate
-  // defines a closed subset, but may be too expensive, since "is_in"
-  // verifies that its argument points to an object head.  The
-  // "closed_subset" method allows a heap to define an intermediate
-  // predicate, allowing more precise checking than "is_in_reserved" at
-  // lower cost than "is_in."
-
-  // One important case is a heap composed of disjoint contiguous spaces,
-  // such as the Garbage-First collector.  Such heaps have a convenient
-  // closed subset consisting of the allocated portions of those
-  // contiguous spaces.
-
-  // Return "TRUE" iff the given pointer points into the heap's defined
-  // closed subset (which defaults to the entire heap).
-  virtual bool is_in_closed_subset(const void* p) const {
-    return is_in_reserved(p);
-  }
-
-  bool is_in_closed_subset_or_null(const void* p) const {
-    return p == NULL || is_in_closed_subset(p);
-  }
+  virtual uint32_t hash_oop(oop obj) const;
 
   void set_gc_cause(GCCause::Cause v) {
      if (UsePerfData) {
--- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -824,7 +824,6 @@
                                      CLDClosure* weak_cld_closure,
                                      CodeBlobToOopClosure* code_roots) {
   // General roots.
-  assert(Threads::thread_claim_parity() != 0, "must have called prologue code");
   assert(code_roots != NULL, "code root closure should always be set");
   // _n_termination for _process_strong_tasks should be set up stream
   // in a method not running in a GC worker.  Otherwise the GC worker
--- a/src/hotspot/share/gc/shared/genCollectedHeap.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -234,10 +234,9 @@
   void collect(GCCause::Cause cause, GenerationType max_generation);
 
   // Returns "TRUE" iff "p" points into the committed areas of the heap.
-  // The methods is_in(), is_in_closed_subset() and is_in_youngest() may
-  // be expensive to compute in general, so, to prevent
-  // their inadvertent use in product jvm's, we restrict their use to
-  // assertion checking or verification only.
+  // The methods is_in() and is_in_youngest() may be expensive to compute
+  // in general, so, to prevent their inadvertent use in product jvm's, we
+  // restrict their use to assertion checking or verification only.
   bool is_in(const void* p) const;
 
   // Returns true if the reference is to an object in the reserved space
--- a/src/hotspot/share/gc/shared/strongRootsScope.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shared/strongRootsScope.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
 }
 
 StrongRootsScope::StrongRootsScope(uint n_threads) : _n_threads(n_threads) {
-  Threads::change_thread_claim_parity();
+  Threads::change_thread_claim_token();
 }
 
 StrongRootsScope::~StrongRootsScope() {
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -132,12 +132,23 @@
 template <class T>
 void ShenandoahBarrierSet::write_ref_array_pre_work(T* dst, size_t count) {
   shenandoah_assert_not_in_cset_loc_except(dst, _heap->cancelled_gc());
-  if (ShenandoahSATBBarrier && _heap->is_concurrent_mark_in_progress()) {
-    T* elem_ptr = dst;
-    for (size_t i = 0; i < count; i++, elem_ptr++) {
-      T heap_oop = RawAccess<>::oop_load(elem_ptr);
-      if (!CompressedOops::is_null(heap_oop)) {
-        enqueue(CompressedOops::decode_not_null(heap_oop));
+  assert(ShenandoahThreadLocalData::satb_mark_queue(Thread::current()).is_active(), "Shouldn't be here otherwise");
+  assert(ShenandoahSATBBarrier, "Shouldn't be here otherwise");
+  assert(count > 0, "Should have been filtered before");
+
+  Thread* thread = Thread::current();
+  ShenandoahMarkingContext* ctx = _heap->marking_context();
+  bool has_forwarded = _heap->has_forwarded_objects();
+  T* elem_ptr = dst;
+  for (size_t i = 0; i < count; i++, elem_ptr++) {
+    T heap_oop = RawAccess<>::oop_load(elem_ptr);
+    if (!CompressedOops::is_null(heap_oop)) {
+      oop obj = CompressedOops::decode_not_null(heap_oop);
+      if (has_forwarded) {
+        obj = resolve_forwarded_not_null(obj);
+      }
+      if (!ctx->is_marked(obj)) {
+        ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue_known_active(obj);
       }
     }
   }
@@ -309,11 +320,9 @@
 }
 
 oop ShenandoahBarrierSet::storeval_barrier(oop obj) {
-  if (ShenandoahStoreValEnqueueBarrier) {
-    if (!CompressedOops::is_null(obj)) {
-      obj = write_barrier(obj);
-      enqueue(obj);
-    }
+  if (ShenandoahStoreValEnqueueBarrier && !CompressedOops::is_null(obj) && _heap->is_concurrent_traversal_in_progress()) {
+    obj = write_barrier(obj);
+    enqueue(obj);
   }
   if (ShenandoahStoreValReadBarrier) {
     obj = resolve_forwarded(obj);
@@ -329,14 +338,14 @@
 
 void ShenandoahBarrierSet::enqueue(oop obj) {
   shenandoah_assert_not_forwarded_if(NULL, obj, _heap->is_concurrent_traversal_in_progress());
-  if (!_satb_mark_queue_set.is_active()) return;
+  assert(_satb_mark_queue_set.is_active(), "only get here when SATB active");
 
   // Filter marked objects before hitting the SATB queues. The same predicate would
   // be used by SATBMQ::filter to eliminate already marked objects downstream, but
   // filtering here helps to avoid wasteful SATB queueing work to begin with.
   if (!_heap->requires_marking<false>(obj)) return;
 
-  ShenandoahThreadLocalData::satb_mark_queue(Thread::current()).enqueue(obj);
+  ShenandoahThreadLocalData::satb_mark_queue(Thread::current()).enqueue_known_active(obj);
 }
 
 void ShenandoahBarrierSet::on_thread_create(Thread* thread) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -141,7 +141,7 @@
   bool arraycopy_loop(T* src, T* dst, size_t length, Klass* bound, bool disjoint);
 
   template <typename T, bool CHECKCAST, bool SATB, ShenandoahBarrierSet::ArrayCopyStoreValMode STOREVAL_MODE>
-  bool arraycopy_element(T* cur_src, T* cur_dst, Klass* bound, Thread* thread);
+  bool arraycopy_element(T* cur_src, T* cur_dst, Klass* bound, Thread* const thread, ShenandoahMarkingContext* const ctx);
 
 public:
   // Callbacks for runtime accesses.
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -28,6 +28,9 @@
 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
 #include "gc/shenandoah/shenandoahBrooksPointer.inline.hpp"
 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
+#include "gc/shenandoah/shenandoahHeapRegion.hpp"
+#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
+#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
 
 bool ShenandoahBarrierSet::need_update_refs_barrier() {
   return _heap->is_update_refs_in_progress() ||
@@ -59,7 +62,8 @@
   } while ((! oopDesc::equals_raw(compare_value, expected)) && oopDesc::equals_raw(resolve_forwarded(compare_value), resolve_forwarded(expected)));
   if (oopDesc::equals_raw(expected, compare_value)) {
     const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
-    if (keep_alive && ShenandoahSATBBarrier && !CompressedOops::is_null(compare_value)) {
+    if (keep_alive && ShenandoahSATBBarrier && !CompressedOops::is_null(compare_value) &&
+        ShenandoahHeap::heap()->is_concurrent_mark_in_progress()) {
       ShenandoahBarrierSet::barrier_set()->enqueue(compare_value);
     }
   }
@@ -72,7 +76,8 @@
   oop previous = Raw::oop_atomic_xchg(new_value, addr);
   if (ShenandoahSATBBarrier) {
     const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
-    if (keep_alive && !CompressedOops::is_null(previous)) {
+    if (keep_alive && !CompressedOops::is_null(previous) &&
+        ShenandoahHeap::heap()->is_concurrent_mark_in_progress()) {
       ShenandoahBarrierSet::barrier_set()->enqueue(previous);
     }
   }
@@ -134,7 +139,7 @@
 template <typename T, bool CHECKCAST, bool SATB, ShenandoahBarrierSet::ArrayCopyStoreValMode STOREVAL_MODE>
 bool ShenandoahBarrierSet::arraycopy_loop(T* src, T* dst, size_t length, Klass* bound, bool disjoint) {
   Thread* thread = Thread::current();
-
+  ShenandoahMarkingContext* ctx = _heap->marking_context();
   ShenandoahEvacOOMScope oom_evac_scope;
 
   // We need to handle four cases:
@@ -161,7 +166,7 @@
     T* cur_dst = dst;
     T* src_end = src + length;
     for (; cur_src < src_end; cur_src++, cur_dst++) {
-      if (!arraycopy_element<T, CHECKCAST, SATB, STOREVAL_MODE>(cur_src, cur_dst, bound, thread)) {
+      if (!arraycopy_element<T, CHECKCAST, SATB, STOREVAL_MODE>(cur_src, cur_dst, bound, thread, ctx)) {
         return false;
       }
     }
@@ -170,7 +175,7 @@
     T* cur_src = src + length - 1;
     T* cur_dst = dst + length - 1;
     for (; cur_src >= src; cur_src--, cur_dst--) {
-      if (!arraycopy_element<T, CHECKCAST, SATB, STOREVAL_MODE>(cur_src, cur_dst, bound, thread)) {
+      if (!arraycopy_element<T, CHECKCAST, SATB, STOREVAL_MODE>(cur_src, cur_dst, bound, thread, ctx)) {
         return false;
       }
     }
@@ -179,14 +184,26 @@
 }
 
 template <typename T, bool CHECKCAST, bool SATB, ShenandoahBarrierSet::ArrayCopyStoreValMode STOREVAL_MODE>
-bool ShenandoahBarrierSet::arraycopy_element(T* cur_src, T* cur_dst, Klass* bound, Thread* thread) {
+bool ShenandoahBarrierSet::arraycopy_element(T* cur_src, T* cur_dst, Klass* bound, Thread* const thread, ShenandoahMarkingContext* const ctx) {
   T o = RawAccess<>::oop_load(cur_src);
 
   if (SATB) {
+    assert(ShenandoahThreadLocalData::satb_mark_queue(thread).is_active(), "Shouldn't be here otherwise");
     T prev = RawAccess<>::oop_load(cur_dst);
     if (!CompressedOops::is_null(prev)) {
       oop prev_obj = CompressedOops::decode_not_null(prev);
-      enqueue(prev_obj);
+      switch (STOREVAL_MODE) {
+      case NONE:
+        break;
+      case READ_BARRIER:
+      case WRITE_BARRIER:
+        // The write-barrier case cannot really happen. It's traversal-only and traversal
+        // doesn't currently use SATB. And even if it did, it would not be fatal to just do the normal RB here.
+        prev_obj = ShenandoahBarrierSet::resolve_forwarded_not_null(prev_obj);
+      }
+      if (!ctx->is_marked(prev_obj)) {
+        ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue_known_active(prev_obj);
+      }
     }
   }
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -213,15 +213,15 @@
 class ShenandoahSATBThreadsClosure : public ThreadClosure {
 private:
   ShenandoahSATBBufferClosure* _satb_cl;
-  int _thread_parity;
+  uintx _claim_token;
 
 public:
   ShenandoahSATBThreadsClosure(ShenandoahSATBBufferClosure* satb_cl) :
     _satb_cl(satb_cl),
-    _thread_parity(Threads::thread_claim_parity()) {}
+    _claim_token(Threads::thread_claim_token()) {}
 
   void do_thread(Thread* thread) {
-    if (thread->claim_oops_do(true, _thread_parity)) {
+    if (thread->claim_threads_do(true, _claim_token)) {
       ShenandoahThreadLocalData::satb_mark_queue(thread).apply_closure_and_empty(_satb_cl);
     }
   }
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -436,6 +436,7 @@
   _cycle_memory_manager("Shenandoah Cycles", "end of GC cycle"),
   _gc_timer(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
   _soft_ref_policy(),
+  _log_min_obj_alignment_in_bytes(LogMinObjAlignmentInBytes),
   _ref_processor(NULL),
   _marking_context(NULL),
   _bitmap_size(0),
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -505,6 +505,8 @@
   ConcurrentGCTimer*           _gc_timer;
   SoftRefPolicy                _soft_ref_policy;
 
+  // For exporting to SA
+  int                          _log_min_obj_alignment_in_bytes;
 public:
   ShenandoahMonitoringSupport* monitoring_support() { return _monitoring_support;    }
   GCMemoryManager* cycle_memory_manager()           { return &_cycle_memory_manager; }
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -51,7 +51,8 @@
   }
   shenandoah_assert_correct(NULL, orig);
   // store the original value that was in the field reference
-  ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue(orig);
+  assert(ShenandoahThreadLocalData::satb_mark_queue(thread).is_active(), "Shouldn't be here otherwise");
+  ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue_known_active(orig);
 JRT_END
 
 JRT_LEAF(oopDesc*, ShenandoahRuntime::write_barrier_JRT(oopDesc* src))
--- a/src/hotspot/share/gc/shenandoah/vmStructs_shenandoah.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/vmStructs_shenandoah.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -27,13 +27,28 @@
 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
 #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
 
-#define VM_STRUCTS_SHENANDOAH(nonstatic_field, volatile_nonstatic_field, static_field)  \
-  static_field(ShenandoahHeapRegion, RegionSizeBytes,        size_t)                    \
-  nonstatic_field(ShenandoahHeap, _num_regions,              size_t)                    \
-  volatile_nonstatic_field(ShenandoahHeap, _used,            size_t)                    \
-  volatile_nonstatic_field(ShenandoahHeap, _committed,       size_t)                    \
+#define VM_STRUCTS_SHENANDOAH(nonstatic_field, volatile_nonstatic_field, static_field)                \
+  nonstatic_field(ShenandoahHeap, _num_regions,                    size_t)                            \
+  nonstatic_field(ShenandoahHeap, _regions,                        ShenandoahHeapRegion**)            \
+  nonstatic_field(ShenandoahHeap, _log_min_obj_alignment_in_bytes, int)                               \
+  volatile_nonstatic_field(ShenandoahHeap, _used,                  size_t)                            \
+  volatile_nonstatic_field(ShenandoahHeap, _committed,             size_t)                            \
+  static_field(ShenandoahHeapRegion, RegionSizeBytes,              size_t)                            \
+  static_field(ShenandoahHeapRegion, RegionSizeBytesShift,         size_t)                            \
+  nonstatic_field(ShenandoahHeapRegion, _state,                    ShenandoahHeapRegion::RegionState) \
+  nonstatic_field(ShenandoahHeapRegion, _region_number,            size_t)                            \
 
-#define VM_INT_CONSTANTS_SHENANDOAH(declare_constant, declare_constant_with_value)
+#define VM_INT_CONSTANTS_SHENANDOAH(declare_constant, declare_constant_with_value) \
+  declare_constant(ShenandoahHeapRegion::_empty_uncommitted)                       \
+  declare_constant(ShenandoahHeapRegion::_empty_committed)                         \
+  declare_constant(ShenandoahHeapRegion::_regular)                                 \
+  declare_constant(ShenandoahHeapRegion::_humongous_start)                         \
+  declare_constant(ShenandoahHeapRegion::_humongous_cont)                          \
+  declare_constant(ShenandoahHeapRegion::_pinned_humongous_start)                  \
+  declare_constant(ShenandoahHeapRegion::_cset)                                    \
+  declare_constant(ShenandoahHeapRegion::_pinned)                                  \
+  declare_constant(ShenandoahHeapRegion::_pinned_cset)                             \
+  declare_constant(ShenandoahHeapRegion::_trash)                                   \
 
 #define VM_TYPES_SHENANDOAH(declare_type,                                     \
                             declare_toplevel_type,                            \
@@ -42,5 +57,6 @@
   declare_type(ShenandoahHeapRegion, ContiguousSpace)                         \
   declare_toplevel_type(ShenandoahHeap*)                                      \
   declare_toplevel_type(ShenandoahHeapRegion*)                                \
+  declare_toplevel_type(ShenandoahHeapRegion::RegionState)                    \
 
 #endif // SHARE_GC_SHENANDOAH_VMSTRUCTS_SHENANDOAH_HPP
--- a/src/hotspot/share/gc/z/zCollectedHeap.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -110,8 +110,8 @@
   return is_in_reserved(p) && _heap.is_in((uintptr_t)p);
 }
 
-bool ZCollectedHeap::is_in_closed_subset(const void* p) const {
-  return is_in(p);
+uint32_t ZCollectedHeap::hash_oop(oop obj) const {
+  return _heap.hash_oop(obj);
 }
 
 HeapWord* ZCollectedHeap::allocate_new_tlab(size_t min_size, size_t requested_size, size_t* actual_size) {
--- a/src/hotspot/share/gc/z/zCollectedHeap.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/z/zCollectedHeap.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -72,7 +72,8 @@
 
   virtual bool is_maximal_no_gc() const;
   virtual bool is_in(const void* p) const;
-  virtual bool is_in_closed_subset(const void* p) const;
+
+  virtual uint32_t hash_oop(oop obj) const;
 
   virtual HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded);
   virtual MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
--- a/src/hotspot/share/gc/z/zHeap.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/z/zHeap.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -103,6 +103,7 @@
   size_t unsafe_max_tlab_alloc() const;
 
   bool is_in(uintptr_t addr) const;
+  uint32_t hash_oop(oop obj) const;
 
   // Block
   uintptr_t block_start(uintptr_t addr) const;
--- a/src/hotspot/share/gc/z/zHeap.inline.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/z/zHeap.inline.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -27,6 +27,7 @@
 #include "gc/z/zAddress.inline.hpp"
 #include "gc/z/zForwarding.inline.hpp"
 #include "gc/z/zForwardingTable.inline.hpp"
+#include "gc/z/zHash.inline.hpp"
 #include "gc/z/zHeap.hpp"
 #include "gc/z/zMark.inline.hpp"
 #include "gc/z/zOop.inline.hpp"
@@ -44,6 +45,11 @@
   return &_reference_processor;
 }
 
+inline uint32_t ZHeap::hash_oop(oop obj) const {
+  const uintptr_t offset = ZAddress::offset(ZOop::to_address(obj));
+  return ZHash::address_to_uint32(offset);
+}
+
 inline bool ZHeap::is_object_live(uintptr_t addr) const {
   ZPage* page = _page_table.get(addr);
   return page->is_object_live(addr);
--- a/src/hotspot/share/gc/z/zRootsIterator.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/gc/z/zRootsIterator.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -179,7 +179,7 @@
     _code_cache(this) {
   assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
   ZStatTimer timer(ZSubPhasePauseRootsSetup);
-  Threads::change_thread_claim_parity();
+  Threads::change_thread_claim_token();
   COMPILER2_PRESENT(DerivedPointerTable::clear());
   if (ClassUnloading) {
     nmethod::oops_do_marking_prologue();
@@ -404,7 +404,7 @@
     _threads(this) {
   assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
   ZStatTimer timer(ZSubPhasePauseRootsSetup);
-  Threads::change_thread_claim_parity();
+  Threads::change_thread_claim_token();
 }
 
 ZThreadRootsIterator::~ZThreadRootsIterator() {
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -565,12 +565,12 @@
 
 JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child))
   bool ret = true;
-  if(!Universe::heap()->is_in_closed_subset(parent)) {
+  if(!Universe::heap()->is_in(parent)) {
     tty->print_cr("Parent Object " INTPTR_FORMAT " not in heap", p2i(parent));
     parent->print();
     ret=false;
   }
-  if(!Universe::heap()->is_in_closed_subset(child)) {
+  if(!Universe::heap()->is_in(child)) {
     tty->print_cr("Child Object " INTPTR_FORMAT " not in heap", p2i(child));
     child->print();
     ret=false;
--- a/src/hotspot/share/memory/iterator.inline.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/memory/iterator.inline.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -56,7 +56,7 @@
     T heap_oop = RawAccess<>::oop_load(p);
     if (!CompressedOops::is_null(heap_oop)) {
       oop o = CompressedOops::decode_not_null(heap_oop);
-      assert(Universe::heap()->is_in_closed_subset(o),
+      assert(Universe::heap()->is_in(o),
              "should be in closed *p " PTR_FORMAT " " PTR_FORMAT, p2i(p), p2i(o));
     }
   }
--- a/src/hotspot/share/oops/constantPool.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/oops/constantPool.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -280,9 +280,7 @@
       rr->obj_at_put(i, NULL);
       if (p != NULL && i < ref_map_len) {
         int index = object_to_cp_index(i);
-        // Skip the entry if the string hash code is 0 since the string
-        // is not included in the shared string_table, see StringTable::copy_shared_string.
-        if (tag_at(index).is_string() && java_lang_String::hash_code(p) != 0) {
+        if (tag_at(index).is_string()) {
           oop op = StringTable::create_archived_string(p, THREAD);
           // If the String object is not archived (possibly too large),
           // NULL is returned. Also set it in the array, so we won't
--- a/src/hotspot/share/oops/oop.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/oops/oop.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -122,12 +122,6 @@
 }
 
 #ifndef PRODUCT
-// used only for asserts
-bool oopDesc::is_unlocked_oop() const {
-  if (!Universe::heap()->is_in_reserved(this)) return false;
-  return mark()->is_unlocked();
-}
-
 #if INCLUDE_CDS_JAVA_HEAP
 bool oopDesc::is_archived_object(oop p) {
   return HeapShared::is_archived_object(p);
--- a/src/hotspot/share/oops/oop.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/oops/oop.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -256,7 +256,6 @@
   static bool is_oop(oop obj, bool ignore_mark_word = false);
   static bool is_oop_or_null(oop obj, bool ignore_mark_word = false);
 #ifndef PRODUCT
-  inline bool is_unlocked_oop() const;
   static bool is_archived_object(oop p) NOT_CDS_JAVA_HEAP_RETURN_(false);
 #endif
 
--- a/src/hotspot/share/prims/jvmtiTagMap.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/prims/jvmtiTagMap.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -181,17 +181,9 @@
 
   // hash a given key (oop) with the specified size
   static unsigned int hash(oop key, int size) {
-    ZGC_ONLY(assert(ZAddressMetadataShift >= sizeof(unsigned int) * BitsPerByte, "cast removes the metadata bits");)
-
-    // shift right to get better distribution (as these bits will be zero
-    // with aligned addresses)
-    key = Access<>::resolve(key);
-    unsigned int addr = (unsigned int)(cast_from_oop<intptr_t>(key));
-#ifdef _LP64
-    return (addr >> 3) % size;
-#else
-    return (addr >> 2) % size;
-#endif
+    const oop obj = Access<>::resolve(key);
+    const unsigned int hash = Universe::heap()->hash_oop(obj);
+    return hash % size;
   }
 
   // hash a given key (oop)
--- a/src/hotspot/share/prims/methodHandles.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/prims/methodHandles.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -316,7 +316,7 @@
   }
 
   Handle resolved_method = info.resolved_method_name();
-  assert(java_lang_invoke_ResolvedMethodName::vmtarget(resolved_method()) == m(),
+  assert(java_lang_invoke_ResolvedMethodName::vmtarget(resolved_method()) == m() || m->is_old(),
          "Should not change after link resolution");
 
   oop mname_oop = mname();
--- a/src/hotspot/share/runtime/sweeper.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/runtime/sweeper.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -219,7 +219,7 @@
   NMethodMarkingTask(NMethodMarkingThreadClosure* cl) :
     AbstractGangTask("Parallel NMethod Marking"),
     _cl(cl) {
-    Threads::change_thread_claim_parity();
+    Threads::change_thread_claim_token();
   }
 
   ~NMethodMarkingTask() {
--- a/src/hotspot/share/runtime/thread.cpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/runtime/thread.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -238,8 +238,8 @@
   set_last_handle_mark(NULL);
   DEBUG_ONLY(_missed_ic_stub_refill_verifier = NULL);
 
-  // This initial value ==> never claimed.
-  _oops_do_parity = 0;
+  // Initial value of zero ==> never claimed.
+  _threads_do_token = 0;
   _threads_hazard_ptr = NULL;
   _threads_list_ptr = NULL;
   _nested_threads_hazard_ptr_cnt = 0;
@@ -885,16 +885,14 @@
 
 
 // GC Support
-bool Thread::claim_oops_do_par_case(int strong_roots_parity) {
-  int thread_parity = _oops_do_parity;
-  if (thread_parity != strong_roots_parity) {
-    jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity);
-    if (res == thread_parity) {
+bool Thread::claim_par_threads_do(uintx claim_token) {
+  uintx token = _threads_do_token;
+  if (token != claim_token) {
+    uintx res = Atomic::cmpxchg(claim_token, &_threads_do_token, token);
+    if (res == token) {
       return true;
-    } else {
-      guarantee(res == strong_roots_parity, "Or else what?");
-      return false;
     }
+    guarantee(res == claim_token, "invariant");
   }
   return false;
 }
@@ -3472,7 +3470,7 @@
 int         Threads::_number_of_threads = 0;
 int         Threads::_number_of_non_daemon_threads = 0;
 int         Threads::_return_code = 0;
-int         Threads::_thread_claim_parity = 0;
+uintx       Threads::_thread_claim_token = 1; // Never zero.
 size_t      JavaThread::_stack_size_at_create = 0;
 
 #ifdef ASSERT
@@ -3532,14 +3530,14 @@
 }
 
 void Threads::possibly_parallel_threads_do(bool is_par, ThreadClosure* tc) {
-  int cp = Threads::thread_claim_parity();
+  uintx claim_token = Threads::thread_claim_token();
   ALL_JAVA_THREADS(p) {
-    if (p->claim_oops_do(is_par, cp)) {
+    if (p->claim_threads_do(is_par, claim_token)) {
       tc->do_thread(p);
     }
   }
   VMThread* vmt = VMThread::vm_thread();
-  if (vmt->claim_oops_do(is_par, cp)) {
+  if (vmt->claim_threads_do(is_par, claim_token)) {
     tc->do_thread(vmt);
   }
 }
@@ -4525,27 +4523,39 @@
   VMThread::vm_thread()->oops_do(f, cf);
 }
 
-void Threads::change_thread_claim_parity() {
-  // Set the new claim parity.
-  assert(_thread_claim_parity >= 0 && _thread_claim_parity <= 2,
-         "Not in range.");
-  _thread_claim_parity++;
-  if (_thread_claim_parity == 3) _thread_claim_parity = 1;
-  assert(_thread_claim_parity >= 1 && _thread_claim_parity <= 2,
-         "Not in range.");
+void Threads::change_thread_claim_token() {
+  if (++_thread_claim_token == 0) {
+    // On overflow of the token counter, there is a risk of future
+    // collisions between a new global token value and a stale token
+    // for a thread, because not all iterations visit all threads.
+    // (Though it's pretty much a theoretical concern for non-trivial
+    // token counter sizes.)  To deal with the possibility, reset all
+    // the thread tokens to zero on global token overflow.
+    struct ResetClaims : public ThreadClosure {
+      virtual void do_thread(Thread* t) {
+        t->claim_threads_do(false, 0);
+      }
+    } reset_claims;
+    Threads::threads_do(&reset_claims);
+    // On overflow, update the global token to non-zero, to
+    // avoid the special "never claimed" initial thread value.
+    _thread_claim_token = 1;
+  }
 }
 
 #ifdef ASSERT
+void assert_thread_claimed(const char* kind, Thread* t, uintx expected) {
+  const uintx token = t->threads_do_token();
+  assert(token == expected,
+         "%s " PTR_FORMAT " has incorrect value " UINTX_FORMAT " != "
+         UINTX_FORMAT, kind, p2i(t), token, expected);
+}
+
 void Threads::assert_all_threads_claimed() {
   ALL_JAVA_THREADS(p) {
-    const int thread_parity = p->oops_do_parity();
-    assert((thread_parity == _thread_claim_parity),
-           "Thread " PTR_FORMAT " has incorrect parity %d != %d", p2i(p), thread_parity, _thread_claim_parity);
-  }
-  VMThread* vmt = VMThread::vm_thread();
-  const int thread_parity = vmt->oops_do_parity();
-  assert((thread_parity == _thread_claim_parity),
-         "VMThread " PTR_FORMAT " has incorrect parity %d != %d", p2i(vmt), thread_parity, _thread_claim_parity);
+    assert_thread_claimed("Thread", p, _thread_claim_token);
+  }
+  assert_thread_claimed("VMThread", VMThread::vm_thread(), _thread_claim_token);
 }
 #endif // ASSERT
 
--- a/src/hotspot/share/runtime/thread.hpp	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/hotspot/share/runtime/thread.hpp	Wed Apr 03 13:30:05 2019 +0530
@@ -338,9 +338,8 @@
   // Point to the last handle mark
   HandleMark* _last_handle_mark;
 
-  // The parity of the last strong_roots iteration in which this thread was
-  // claimed as a task.
-  int _oops_do_parity;
+  // Claim value for parallel iteration over threads.
+  uintx _threads_do_token;
 
   // Support for GlobalCounter
  private:
@@ -647,27 +646,28 @@
   // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
   virtual void oops_do(OopClosure* f, CodeBlobClosure* cf);
 
-  // Handles the parallel case for the method below.
+  // Handles the parallel case for claim_threads_do.
  private:
-  bool claim_oops_do_par_case(int collection_parity);
+  bool claim_par_threads_do(uintx claim_token);
  public:
-  // Requires that "collection_parity" is that of the current roots
-  // iteration.  If "is_par" is false, sets the parity of "this" to
-  // "collection_parity", and returns "true".  If "is_par" is true,
-  // uses an atomic instruction to set the current threads parity to
-  // "collection_parity", if it is not already.  Returns "true" iff the
+  // Requires that "claim_token" is that of the current iteration.
+  // If "is_par" is false, sets the token of "this" to
+  // "claim_token", and returns "true".  If "is_par" is true,
+  // uses an atomic instruction to set the current thread's token to
+  // "claim_token", if it is not already.  Returns "true" iff the
   // calling thread does the update, this indicates that the calling thread
-  // has claimed the thread's stack as a root group in the current
-  // collection.
-  bool claim_oops_do(bool is_par, int collection_parity) {
+  // has claimed the thread in the current iteration.
+  bool claim_threads_do(bool is_par, uintx claim_token) {
     if (!is_par) {
-      _oops_do_parity = collection_parity;
+      _threads_do_token = claim_token;
       return true;
     } else {
-      return claim_oops_do_par_case(collection_parity);
+      return claim_par_threads_do(claim_token);
     }
   }
 
+  uintx threads_do_token() const { return _threads_do_token; }
+
   // jvmtiRedefineClasses support
   void metadata_handles_do(void f(Metadata*));
 
@@ -750,7 +750,6 @@
   Monitor* owned_locks() const                   { return _owned_locks;          }
   bool owns_locks() const                        { return owned_locks() != NULL; }
   bool owns_locks_but_compiled_lock() const;
-  int oops_do_parity() const                     { return _oops_do_parity; }
 
   // Deadlock detection
   bool allow_allocation()                        { return _allow_allocation_count == 0; }
@@ -2223,7 +2222,7 @@
   static int         _number_of_threads;
   static int         _number_of_non_daemon_threads;
   static int         _return_code;
-  static int         _thread_claim_parity;
+  static uintx       _thread_claim_token;
 #ifdef ASSERT
   static bool        _vm_complete;
 #endif
@@ -2256,21 +2255,23 @@
   // Does not include JNI_VERSION_1_1
   static jboolean is_supported_jni_version(jint version);
 
-  // The "thread claim parity" provides a way for threads to be claimed
+  // The "thread claim token" provides a way for threads to be claimed
   // by parallel worker tasks.
   //
-  // Each thread contains a "parity" field. A task will claim the
-  // thread only if its parity field is the same as the global parity,
-  // which is updated by calling change_thread_claim_parity().
+  // Each thread contains a "token" field. A task will claim the
+  // thread only if its token is different from the global token,
+  // which is updated by calling change_thread_claim_token().  When
+  // a thread is claimed, it's token is set to the global token value
+  // so other threads in the same iteration pass won't claim it.
   //
-  // For this to work change_thread_claim_parity() needs to be called
+  // For this to work change_thread_claim_token() needs to be called
   // exactly once in sequential code before starting parallel tasks
   // that should claim threads.
   //
-  // New threads get their parity set to 0 and change_thread_claim_parity()
-  // never sets the global parity to 0.
-  static int thread_claim_parity() { return _thread_claim_parity; }
-  static void change_thread_claim_parity();
+  // New threads get their token set to 0 and change_thread_claim_token()
+  // never sets the global token to 0.
+  static uintx thread_claim_token() { return _thread_claim_token; }
+  static void change_thread_claim_token();
   static void assert_all_threads_claimed() NOT_DEBUG_RETURN;
 
   // Apply "f->do_oop" to all root oops in all threads.
@@ -2324,6 +2325,8 @@
 
   // Deoptimizes all frames tied to marked nmethods
   static void deoptimized_wrt_marked_nmethods();
+
+  struct Test;                  // For private gtest access.
 };
 
 
--- a/src/java.base/share/classes/java/lang/String.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/java.base/share/classes/java/lang/String.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1510,8 +1510,14 @@
     public int hashCode() {
         int h = hash;
         if (h == 0 && value.length > 0) {
-            hash = h = isLatin1() ? StringLatin1.hashCode(value)
-                                  : StringUTF16.hashCode(value);
+            h = isLatin1() ? StringLatin1.hashCode(value)
+                           : StringUTF16.hashCode(value);
+            // Avoid issuing a store if the calculated value is also zero:
+            // in addition to a minor performance benefit, this allows storing
+            // Strings with zero hash code in read-only memory.
+            if (h != 0) {
+                hash = h;
+            }
         }
         return h;
     }
--- a/src/java.base/share/lib/security/default.policy	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/java.base/share/lib/security/default.policy	Wed Apr 03 13:30:05 2019 +0530
@@ -160,6 +160,7 @@
 grant codeBase "jrt:/jdk.internal.vm.compiler.management" {
     permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.vm.compiler.collections";
     permission java.lang.RuntimePermission "accessClassInPackage.jdk.vm.ci.runtime";
+    permission java.lang.RuntimePermission "accessClassInPackage.jdk.vm.ci.services";
     permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.core.common";
     permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.debug";
     permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.hotspot";
--- a/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c	Wed Apr 03 13:30:05 2019 +0530
@@ -1065,8 +1065,11 @@
 
     // Allow creation of symbolic links when the process is not elevated.
     // Developer Mode must be enabled for this option to function, otherwise
-    // it will be ignored.
-    DWORD dwFlags = (DWORD)flags | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
+    // it will be ignored. Check that symbol is available in current build SDK.
+    DWORD dwFlags = (DWORD)flags;
+#ifdef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
+    dwFlags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
+#endif
 
     // On Windows 64-bit this appears to succeed even when there are
     // insufficient privileges
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java	Wed Apr 03 13:30:05 2019 +0530
@@ -237,7 +237,7 @@
         return true;
     }
     // where
-        private static final Set<Option> javacFileManagerOptions =
+        protected static final Set<Option> javacFileManagerOptions =
             Option.getJavacFileManagerOptions();
 
     @Override @DefinedBy(Api.COMPILER)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Wed Apr 03 13:30:05 2019 +0530
@@ -27,6 +27,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
 import java.net.MalformedURLException;
@@ -71,6 +72,7 @@
 
 import com.sun.tools.javac.file.RelativePath.RelativeDirectory;
 import com.sun.tools.javac.file.RelativePath.RelativeFile;
+import com.sun.tools.javac.main.Option;
 import com.sun.tools.javac.resources.CompilerProperties.Errors;
 import com.sun.tools.javac.util.Assert;
 import com.sun.tools.javac.util.Context;
@@ -129,6 +131,19 @@
     protected SortFiles sortFiles;
 
     /**
+     * We use a two-layered map instead of a map with a complex key because we don't want to reindex
+     * the values for every Location+RelativeDirectory pair. Once the PathsAndContainers are needed
+     * for a single Location, we should know all valid RelativeDirectory mappings. Because the
+     * indexing is costly for very large classpaths, this can result in a significant savings.
+     */
+    private Map<Location, Map<RelativeDirectory, java.util.List<PathAndContainer>>>
+        pathsAndContainersByLocationAndRelativeDirectory = new HashMap<>();
+
+    /** Containers that have no indexing by {@link RelativeDirectory}, keyed by {@link Location}. */
+    private Map<Location, java.util.List<PathAndContainer>> nonIndexingContainersByLocation =
+        new HashMap<>();
+
+    /**
      * Register a Context.Factory to create a JavacFileManager.
      */
     public static void preRegister(Context context) {
@@ -338,6 +353,13 @@
                                   ListBuffer<JavaFileObject> resultList) throws IOException;
         public abstract JavaFileObject getFileObject(Path userPath, RelativeFile name) throws IOException;
         public abstract void close() throws IOException;
+        public abstract boolean maintainsDirectoryIndex();
+
+        /**
+         * The directories this container indexes if {@link #maintainsDirectoryIndex()}, otherwise
+         * an empty iterable.
+         */
+        public abstract Iterable<RelativeDirectory> indexedDirectories();
     }
 
     private static final Container MISSING_CONTAINER =  new Container() {
@@ -354,6 +376,14 @@
         }
         @Override
         public void close() throws IOException {}
+        @Override
+        public boolean maintainsDirectoryIndex() {
+            return false;
+        }
+        @Override
+        public Iterable<RelativeDirectory> indexedDirectories() {
+            return List.nil();
+        }
     };
 
     private final class JRTImageContainer implements Container {
@@ -407,6 +437,16 @@
         @Override
         public void close() throws IOException {
         }
+
+        @Override
+        public boolean maintainsDirectoryIndex() {
+            return false;
+        }
+
+        @Override
+        public Iterable<RelativeDirectory> indexedDirectories() {
+            return List.nil();
+        }
     }
 
     private synchronized JRTIndex getJRTIndex() {
@@ -498,6 +538,16 @@
         @Override
         public void close() throws IOException {
         }
+
+        @Override
+        public boolean maintainsDirectoryIndex() {
+            return false;
+        }
+
+        @Override
+        public Iterable<RelativeDirectory> indexedDirectories() {
+            return List.nil();
+        }
     }
 
     private static final Set<FileVisitOption> NO_FILE_VISIT_OPTIONS = Set.of();
@@ -506,7 +556,7 @@
     private final class ArchiveContainer implements Container {
         private final Path archivePath;
         private final FileSystem fileSystem;
-        private final Map<RelativePath, Path> packages;
+        private final Map<RelativeDirectory, Path> packages;
 
         public ArchiveContainer(Path archivePath) throws IOException, ProviderNotFoundException, SecurityException {
             this.archivePath = archivePath;
@@ -604,6 +654,16 @@
         public void close() throws IOException {
             fileSystem.close();
         }
+
+        @Override
+        public boolean maintainsDirectoryIndex() {
+            return true;
+        }
+
+        @Override
+        public Iterable<RelativeDirectory> indexedDirectories() {
+            return packages.keySet();
+        }
     }
 
     /**
@@ -654,6 +714,8 @@
     @Override @DefinedBy(Api.COMPILER)
     public void flush() {
         contentCache.clear();
+        pathsAndContainersByLocationAndRelativeDirectory.clear();
+        nonIndexingContainersByLocation.clear();
     }
 
     /**
@@ -704,15 +766,12 @@
         nullCheck(packageName);
         nullCheck(kinds);
 
-        Iterable<? extends Path> path = getLocationAsPaths(location);
-        if (path == null)
-            return List.nil();
         RelativeDirectory subdirectory = RelativeDirectory.forPackage(packageName);
         ListBuffer<JavaFileObject> results = new ListBuffer<>();
 
-        for (Path directory : path) {
-            Container container = getContainer(directory);
-
+        for (PathAndContainer pathAndContainer : pathsAndContainers(location, subdirectory)) {
+            Path directory = pathAndContainer.path;
+            Container container = pathAndContainer.container;
             container.list(directory, subdirectory, kinds, recurse, results);
         }
 
@@ -927,6 +986,7 @@
     {
         nullCheck(location);
         locations.setLocation(location, asPaths(searchpath));
+        clearCachesForLocation(location);
     }
 
     @Override @DefinedBy(Api.COMPILER)
@@ -936,6 +996,7 @@
     {
         nullCheck(location);
         locations.setLocation(location, nullCheck(searchpath));
+        clearCachesForLocation(location);
     }
 
     @Override @DefinedBy(Api.COMPILER)
@@ -945,11 +1006,113 @@
     }
 
     @Override @DefinedBy(Api.COMPILER)
-    public Iterable<? extends Path> getLocationAsPaths(Location location) {
+    public Collection<? extends Path> getLocationAsPaths(Location location) {
         nullCheck(location);
         return locations.getLocation(location);
     }
 
+    private java.util.List<PathAndContainer> pathsAndContainers(
+            Location location, RelativeDirectory relativeDirectory) throws IOException {
+        try {
+            return pathsAndContainersByLocationAndRelativeDirectory.computeIfAbsent(
+                    location, this::indexPathsAndContainersByRelativeDirectory)
+                .computeIfAbsent(
+                    relativeDirectory, d -> nonIndexingContainersByLocation.get(location));
+        } catch (UncheckedIOException e) {
+            throw e.getCause();
+        }
+    }
+
+    private Map<RelativeDirectory, java.util.List<PathAndContainer>> indexPathsAndContainersByRelativeDirectory(
+            Location location) {
+        Map<RelativeDirectory, java.util.List<PathAndContainer>> result = new HashMap<>();
+        java.util.List<PathAndContainer> allPathsAndContainers = pathsAndContainers(location);
+
+        // First collect all of the containers that don't maintain their own index on
+        // RelativeDirectory. These need to always be included for all mappings
+        java.util.List<PathAndContainer> nonIndexingContainers = new ArrayList<>();
+        for (PathAndContainer pathAndContainer : allPathsAndContainers) {
+            if (!pathAndContainer.container.maintainsDirectoryIndex()) {
+                nonIndexingContainers.add(pathAndContainer);
+            }
+        }
+
+        // Next, use the container that do maintain their own RelativeDirectory index to create a
+        // single master index.
+        for (PathAndContainer pathAndContainer : allPathsAndContainers) {
+            Container container = pathAndContainer.container;
+            if (container.maintainsDirectoryIndex()) {
+                for (RelativeDirectory directory : container.indexedDirectories()) {
+                    result.computeIfAbsent(directory, d -> new ArrayList<>(nonIndexingContainers))
+                          .add(pathAndContainer);
+                }
+            }
+        }
+        nonIndexingContainersByLocation.put(location, nonIndexingContainers);
+
+        // Sorting preserves the search order used in the uncached Location path, which has
+        // maintains consistency with the classpath order
+        result.values().forEach(pathAndContainerList -> Collections.sort(pathAndContainerList));
+
+        return result;
+    }
+
+    /**
+     * For each {@linkplain #getLocationAsPaths(Location) path of the location}, compute the
+     * corresponding {@link Container}.
+     */
+    private java.util.List<PathAndContainer> pathsAndContainers(Location location) {
+        Collection<? extends Path> paths = getLocationAsPaths(location);
+        if (paths == null) {
+            return List.nil();
+        }
+        java.util.List<PathAndContainer> pathsAndContainers =
+            new ArrayList<>(paths.size());
+        for (Path path : paths) {
+            Container container;
+            try {
+                container = getContainer(path);
+            } catch (IOException e) {
+                throw new UncheckedIOException(e);
+            }
+            pathsAndContainers.add(new PathAndContainer(path, container, pathsAndContainers.size()));
+        }
+        return pathsAndContainers;
+    }
+
+    private static class PathAndContainer implements Comparable<PathAndContainer> {
+        private final Path path;
+        private final Container container;
+        private final int index;
+
+        PathAndContainer(Path path, Container container, int index) {
+            this.path = path;
+            this.container = container;
+            this.index = index;
+        }
+
+        @Override
+        public int compareTo(PathAndContainer other) {
+            return index - other.index;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+          if (o == null || !(o instanceof PathAndContainer)) {
+            return false;
+          }
+          PathAndContainer that = (PathAndContainer) o;
+          return path.equals(that.path)
+              && container.equals(that.container)
+              && index == this.index;
+        }
+
+        @Override
+        public int hashCode() {
+          return Objects.hash(path, container, index);
+        }
+    }
+
     @Override @DefinedBy(Api.COMPILER)
     public boolean contains(Location location, FileObject fo) throws IOException {
         nullCheck(location);
@@ -1008,6 +1171,7 @@
         nullCheck(location);
         checkModuleOrientedOrOutputLocation(location);
         locations.setLocationForModule(location, nullCheck(moduleName), nullCheck(paths));
+        clearCachesForLocation(location);
     }
 
     @Override @DefinedBy(Api.COMPILER)
@@ -1163,4 +1327,19 @@
             }
         };
     }
+
+    @Override
+    public boolean handleOption(Option option, String value) {
+        if (javacFileManagerOptions.contains(option)) {
+            pathsAndContainersByLocationAndRelativeDirectory.clear();
+            nonIndexingContainersByLocation.clear();
+        }
+        return super.handleOption(option, value);
+    }
+
+    private void clearCachesForLocation(Location location) {
+        nullCheck(location);
+        pathsAndContainersByLocationAndRelativeDirectory.remove(location);
+        nonIndexingContainersByLocation.remove(location);
+    }
 }
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java	Wed Apr 03 13:30:05 2019 +0530
@@ -64,6 +64,8 @@
   public abstract long capacity();
   public abstract long used();
 
+  public long oopOffset() { return 0; }
+
   public MemRegion reservedRegion() {
     return new MemRegion(addr.addOffsetTo(reservedFieldOffset));
   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahBitMap.java	Wed Apr 03 13:30:05 2019 +0530
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.gc.shenandoah;
+
+import sun.jvm.hotspot.utilities.BitMap;
+import sun.jvm.hotspot.utilities.BitMapInterface;
+
+import java.util.HashMap;
+
+public class ShenandoahBitMap implements BitMapInterface {
+    private HashMap<ShenandoahHeapRegion, BitMap> regionToBitMap = new HashMap<>();
+    private ShenandoahHeap heap;
+
+    ShenandoahBitMap(ShenandoahHeap heap) {
+        this.heap = heap;
+    }
+
+    @Override
+    public boolean at(long offset) {
+        ShenandoahHeapRegion region = heap.regionAtOffset(offset);
+        BitMap bitmap = regionToBitMap.get(region);
+        if (bitmap == null) {
+            return false;
+        } else {
+            int index = toBitMapOffset(offset, region);
+            return bitmap.at(index);
+        }
+    }
+
+    @Override
+    public void atPut(long offset, boolean value) {
+        ShenandoahHeapRegion region = heap.regionAtOffset(offset);
+        BitMap bitmap = getOrAddBitMap(region);
+        int index = toBitMapOffset(offset, region);
+        bitmap.atPut(index, value);
+    }
+
+    @Override
+    public void clear() {
+        for (BitMap bitMap : regionToBitMap.values()) {
+            bitMap.clear();
+        }
+    }
+
+    private int toBitMapOffset(long offset, ShenandoahHeapRegion region) {
+        long regionSize = ShenandoahHeapRegion.regionSizeBytes();
+        long regionOffset = region.regionNumber() * regionSize;
+        long offsetInRegion = offset - regionOffset;
+
+        if (offsetInRegion < 0 || offsetInRegion >= regionSize) {
+            throw new RuntimeException("Unexpected negative offset: " + offsetInRegion);
+        }
+        return (int)(offsetInRegion >>> heap.getLogMinObjAlignmentInBytes());
+    }
+
+    private BitMap getOrAddBitMap(ShenandoahHeapRegion region) {
+        BitMap bitMap = regionToBitMap.get(region);
+        if (bitMap == null) {
+            long regionSize = ShenandoahHeapRegion.regionSizeBytes();
+            long maxNumObjects = regionSize >>> heap.getLogMinObjAlignmentInBytes();
+
+            if (maxNumObjects > Integer.MAX_VALUE) {
+                throw new RuntimeException("int overflow");
+            }
+            int intMaxNumObjects = (int)maxNumObjects;
+
+            bitMap = new BitMap(intMaxNumObjects);
+            regionToBitMap.put(region,  bitMap);
+        }
+
+        return bitMap;
+    }
+}
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -28,10 +28,14 @@
 import sun.jvm.hotspot.gc.shared.LiveRegionsClosure;
 import sun.jvm.hotspot.debugger.Address;
 import sun.jvm.hotspot.runtime.VM;
+import sun.jvm.hotspot.runtime.VMObjectFactory;
+import sun.jvm.hotspot.types.AddressField;
 import sun.jvm.hotspot.types.Type;
 import sun.jvm.hotspot.types.TypeDataBase;
 import sun.jvm.hotspot.memory.MemRegion;
 import sun.jvm.hotspot.types.CIntegerField;
+import sun.jvm.hotspot.utilities.BitMapInterface;
+
 import java.io.PrintStream;
 import java.util.Observable;
 import java.util.Observer;
@@ -40,6 +44,11 @@
     static private CIntegerField numRegions;
     static private CIntegerField used;
     static private CIntegerField committed;
+    static private AddressField  regions;
+    static private CIntegerField logMinObjAlignmentInBytes;
+
+    static private long regionPtrFieldSize;
+    static private long brookPtrSize;
     static {
         VM.registerVMInitializedObserver(new Observer() {
             public void update(Observable o, Object data) {
@@ -53,6 +62,21 @@
         numRegions = type.getCIntegerField("_num_regions");
         used = type.getCIntegerField("_used");
         committed = type.getCIntegerField("_committed");
+        regions = type.getAddressField("_regions");
+        logMinObjAlignmentInBytes = type.getCIntegerField("_log_min_obj_alignment_in_bytes");
+
+        brookPtrSize = db.lookupIntConstant("HeapWordSize").longValue();
+        Type regionPtrType = db.lookupType("ShenandoahHeapRegion*");
+        regionPtrFieldSize = regionPtrType.getSize();
+    }
+
+    public ShenandoahHeap(Address addr) {
+        super(addr);
+    }
+
+    @Override
+    public long oopOffset() {
+        return brookPtrSize;
     }
 
     @Override
@@ -78,10 +102,35 @@
         return committed.getValue(addr);
     }
 
+    public int getLogMinObjAlignmentInBytes() {
+        return logMinObjAlignmentInBytes.getJInt(addr);
+    }
+
+    public ShenandoahHeapRegion getRegion(long index) {
+        if (index < numOfRegions()) {
+            Address arrayAddr = regions.getValue(addr);
+            Address regAddr = arrayAddr.getAddressAt(index * regionPtrFieldSize);
+            ShenandoahHeapRegion region = VMObjectFactory.newObject(ShenandoahHeapRegion.class, regAddr);
+            region.setHeap(this);
+            return region;
+        }
+        return null;
+    }
+
+    public ShenandoahHeapRegion regionAtOffset(long offset) {
+        long index = offset >>> ShenandoahHeapRegion.regionSizeBytesShift();
+        if (index < 0 || index >= numOfRegions()) {
+            throw new RuntimeException("Invalid offset: " + offset);
+        }
+        return getRegion(index);
+    }
+
     @Override
     public void liveRegionsIterate(LiveRegionsClosure closure) {
-        // Operation (currently) not supported with Shenandoah GC.
-        System.err.println("Warning: Operation not supported with Shenandoah GC");
+        for (long index = 0; index < numOfRegions(); index ++) {
+            ShenandoahHeapRegion region = getRegion(index);
+            closure.doLiveRegions(region);
+        }
     }
 
     @Override
@@ -92,7 +141,9 @@
         tty.println(" region size " + ShenandoahHeapRegion.regionSizeBytes() / 1024 + " K");
     }
 
-    public ShenandoahHeap(Address addr) {
-        super(addr);
+    @Override
+    public BitMapInterface createBitMap(long bits) {
+        return new ShenandoahBitMap(this);
     }
+
 }
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeapRegion.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeapRegion.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -23,19 +23,43 @@
 
 package sun.jvm.hotspot.gc.shenandoah;
 
+import sun.jvm.hotspot.debugger.OopHandle;
 import sun.jvm.hotspot.gc.shared.ContiguousSpace;
-import sun.jvm.hotspot.types.CIntegerField;
+import sun.jvm.hotspot.gc.shared.LiveRegionsProvider;
+import sun.jvm.hotspot.memory.MemRegion;
+import sun.jvm.hotspot.oops.Mark;
+import sun.jvm.hotspot.oops.Oop;
+import sun.jvm.hotspot.oops.UnknownOopException;
+import sun.jvm.hotspot.types.*;
 import sun.jvm.hotspot.runtime.VM;
-import sun.jvm.hotspot.types.Type;
-import sun.jvm.hotspot.types.TypeDataBase;
 import sun.jvm.hotspot.debugger.Address;
+import sun.jvm.hotspot.utilities.AddressOps;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Observable;
 import java.util.Observer;
 
 
-public class ShenandoahHeapRegion extends ContiguousSpace {
-    private static CIntegerField RegionSizeBytes;
+public class ShenandoahHeapRegion extends ContiguousSpace implements LiveRegionsProvider {
+    private static int EmptyUncommitted;
+    private static int EmptyCommitted;
+    private static int Regular;
+    private static int HumongousStart;
+    private static int HumongousCont;
+    private static int PinnedHumongousStart;
+    private static int CSet;
+    private static int Pinned;
+    private static int PinnedCSet;
+    private static int Trash;
+
+    private static CIntegerField RegionSizeBytesField;
+    private static Field         RegionStateField;
+    private static CIntegerField RegionNumberField;
+    private static CIntegerField RegionSizeBytesShiftField;
+
+    private ShenandoahHeap heap;
+
     static {
         VM.registerVMInitializedObserver(new Observer() {
             public void update(Observable o, Object data) {
@@ -46,12 +70,154 @@
 
     static private synchronized void initialize(TypeDataBase db) {
         Type type = db.lookupType("ShenandoahHeapRegion");
-        RegionSizeBytes = type.getCIntegerField("RegionSizeBytes");
+        RegionSizeBytesField = type.getCIntegerField("RegionSizeBytes");
+        RegionStateField = type.getField("_state");
+        RegionNumberField = type.getCIntegerField("_region_number");
+
+        RegionSizeBytesShiftField = type.getCIntegerField("RegionSizeBytesShift");
+
+        EmptyUncommitted     = db.lookupIntConstant("ShenandoahHeapRegion::_empty_uncommitted").intValue();
+        EmptyCommitted       = db.lookupIntConstant("ShenandoahHeapRegion::_empty_committed").intValue();
+        Regular              = db.lookupIntConstant("ShenandoahHeapRegion::_regular").intValue();
+        HumongousStart       = db.lookupIntConstant("ShenandoahHeapRegion::_humongous_start").intValue();
+        HumongousCont        = db.lookupIntConstant("ShenandoahHeapRegion::_humongous_cont").intValue();
+        PinnedHumongousStart = db.lookupIntConstant("ShenandoahHeapRegion::_pinned_humongous_start").intValue();
+        CSet                 = db.lookupIntConstant("ShenandoahHeapRegion::_cset").intValue();
+        Pinned               = db.lookupIntConstant("ShenandoahHeapRegion::_pinned").intValue();
+        PinnedCSet           = db.lookupIntConstant("ShenandoahHeapRegion::_pinned_cset").intValue();
+        Trash                = db.lookupIntConstant("ShenandoahHeapRegion::_trash").intValue();
     }
 
-    public static long regionSizeBytes() { return RegionSizeBytes.getValue(); }
+    public static long regionSizeBytes() {
+        return RegionSizeBytesField.getValue();
+    }
+
+    public static int  regionSizeBytesShift() {
+        return RegionSizeBytesShiftField.getJInt();
+    }
 
     public ShenandoahHeapRegion(Address addr) {
         super(addr);
     }
+
+    public void setHeap(ShenandoahHeap heap) {
+        this.heap = heap;
+    }
+
+    @Override
+    public int hashCode() {
+        return (int)regionNumber();
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (other instanceof ShenandoahHeapRegion) {
+            ShenandoahHeapRegion otherRegion = (ShenandoahHeapRegion)other;
+            return otherRegion.regionNumber() == regionNumber();
+        }
+        return false;
+    }
+
+    public List<MemRegion> getLiveRegions() {
+        List<MemRegion> res = new ArrayList<>();
+        int state = regionState();
+        if (state == EmptyUncommitted || state == EmptyCommitted || state == Trash) {
+            // No live data
+        } else if (state == HumongousCont) {
+            // Handled by HumongousStart
+        } else if (state == HumongousStart || state == PinnedHumongousStart) {
+            handleHumongousRegion(res);
+        } else if (state == Regular || state == Pinned) {
+            handleRegularRegion(res);
+        } else if (state == CSet || state == PinnedCSet) {
+            // CSet
+            handleCSetRegion(res);
+        } else {
+            throw new RuntimeException("Unknown region state: " + state);
+        }
+        return res;
+    }
+
+    /*
+     * Note: RegionState is an enum on JVM side. Seems that there is not
+     *       a standard way to read enum value. We read it as an integer
+     *       from the field's offset.
+     */
+    private int regionState() {
+        long offset = RegionStateField.getOffset();
+        return addr.getJIntAt(offset);
+    }
+
+    private void handleHumongousRegion(List<MemRegion> res) {
+        long index = regionNumber();
+        Address topAddr = top();
+        ShenandoahHeapRegion region = heap.getRegion(++ index);
+        while (region.regionState() == HumongousCont) {
+            topAddr = region.top();
+            region = heap.getRegion(++ index);
+        }
+        res.add(new MemRegion(bottom(), topAddr));
+    }
+
+    private void handleRegularRegion(List<MemRegion> res) {
+        res.add(new MemRegion(bottom(), top()));
+    }
+
+    // Filter out forwarded objects, they should be counted in other regions
+    private void handleCSetRegion(List<MemRegion> res) {
+        Address end = top();
+        Address start = bottom();
+
+        Address regionStart = null;
+        Address regionEnd = null;
+        while (AddressOps.lessThan(start, end)) {
+            long size = getObjectSize(start);
+            if (hasForwardee(start)) {
+                // has to-space object, skip this one
+                if (regionEnd != null) {
+                    MemRegion mr = new MemRegion(regionStart, regionEnd);
+                    res.add(mr);
+                    regionStart = null;
+                    regionEnd = null;
+                }
+            } else {
+                if (regionStart == null) {
+                    regionStart = start;
+                } else {
+                    regionEnd = start.addOffsetTo(heap.oopOffset() + size);
+                }
+            }
+            start = start.addOffsetTo(heap.oopOffset() + size);
+        }
+
+        if (regionStart != null) {
+            MemRegion mr = new MemRegion(regionStart, top());
+            res.add(mr);
+        }
+    }
+
+    public long regionNumber() {
+        return RegionNumberField.getValue(addr);
+    }
+
+    private boolean hasForwardee(Address rawPtr) {
+        // Use Mark as a helper to read forward pointer value.
+        Mark mark = new Mark(rawPtr);
+        Address forwardee = mark.valueAsAddress();
+        return (forwardee != rawPtr.addOffsetTo(heap.oopOffset()));
+    }
+
+    private long getObjectSize(Address rawPtr) {
+        // Dealing with a raw pointer, offsets forward pointer to find real Oop.
+        OopHandle handle = rawPtr.addOffsetToAsOopHandle(heap.oopOffset());
+        Oop obj = null;
+
+        try {
+            // Best effort, may fail
+            obj = VM.getVM().getObjectHeap().newOop(handle);
+        } catch (UnknownOopException exp) {
+            throw new RuntimeException(" UnknownOopException  " + exp);
+        }
+        return obj.getObjectSize();
+    }
 }
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java	Wed Apr 03 13:30:05 2019 +0530
@@ -255,7 +255,9 @@
         OopHandle handle = bottom.addOffsetToAsOopHandle(0);
 
         while (handle.lessThan(top)) {
-        Oop obj = null;
+          Oop obj = null;
+          // Raw pointer walk
+          handle = handle.addOffsetToAsOopHandle(heap.oopOffset());
 
           try {
             obj = newOop(handle);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/gtest/runtime/test_threads.cpp	Wed Apr 03 13:30:05 2019 +0530
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/interfaceSupport.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/vmOperations.hpp"
+#include "runtime/vmThread.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/ostream.hpp"
+#include "unittest.hpp"
+
+struct Threads::Test : public AllStatic {
+  class VM_TestClaimOverflow;
+  class CountThreads;
+  class CheckClaims;
+};
+
+class Threads::Test::CountThreads : public ThreadClosure {
+  uintx _claim_token;
+  uint _java_threads_count;
+  uint _non_java_threads_count;
+  bool _need_claim;
+
+public:
+  CountThreads(uintx claim_token, bool need_claim) :
+    _claim_token(claim_token),
+    _java_threads_count(0),
+    _non_java_threads_count(0),
+    _need_claim(need_claim)
+  {}
+
+  virtual void do_thread(Thread* t) {
+    if (!_need_claim || t->claim_threads_do(true, _claim_token)) {
+      if (t->is_Java_thread()) {
+        ++_java_threads_count;
+      } else {
+        ++_non_java_threads_count;
+      }
+    }
+  }
+
+  uint java_threads_count() const { return _java_threads_count; }
+  uint non_java_threads_count() const { return _non_java_threads_count; }
+  uint count() const { return _java_threads_count + _non_java_threads_count; }
+};
+
+class Threads::Test::CheckClaims : public ThreadClosure {
+  uintx _claim_token;
+  uint _java_threads_claimed;
+  uint _java_threads_unclaimed;
+  uint _non_java_threads_claimed;
+  uint _non_java_threads_unclaimed;
+
+public:
+  CheckClaims(uintx claim_token) :
+    _claim_token(claim_token),
+    _java_threads_claimed(0),
+    _java_threads_unclaimed(0),
+    _non_java_threads_claimed(0),
+    _non_java_threads_unclaimed(0)
+  {}
+
+  virtual void do_thread(Thread* t) {
+    uintx thread_token = t->threads_do_token();
+    if (thread_token == _claim_token) {
+      if (t->is_Java_thread()) {
+        ++_java_threads_claimed;
+      } else {
+        ++_non_java_threads_claimed;
+      }
+    } else {
+      if (t->is_Java_thread()) {
+        ++_java_threads_unclaimed;
+      } else {
+        ++_non_java_threads_unclaimed;
+      }
+    }
+  }
+
+  uint java_threads_claimed() const { return _java_threads_claimed; }
+  uint java_threads_unclaimed() const { return _java_threads_unclaimed; }
+
+  uint non_java_threads_claimed() const { return _non_java_threads_claimed; }
+  uint non_java_threads_unclaimed() const { return _non_java_threads_unclaimed; }
+
+  uint claimed() const {
+    return _java_threads_claimed + _non_java_threads_claimed;
+  }
+
+  uint unclaimed() const {
+    return _java_threads_unclaimed + _non_java_threads_unclaimed;
+  }
+};
+
+class Threads::Test::VM_TestClaimOverflow : public VM_GTestExecuteAtSafepoint {
+public:
+  void doit() {
+    // Prevent changes to the NJT list while we're conducting our test.
+    MutexLockerEx ml(NonJavaThreadsList_lock, Mutex::_no_safepoint_check_flag);
+
+    _thread_claim_token = max_uintx - 1;
+
+    ASSERT_EQ(max_uintx - 1, thread_claim_token());
+    CountThreads count1(thread_claim_token(), true);
+    threads_do(&count1);
+    tty->print_cr("Testing claim overflow with %u threads", count1.count());
+    // At least the main thread and the VM thread.
+    ASSERT_LE(2u, count1.count());
+    ASSERT_LE(1u, count1.java_threads_count());
+    ASSERT_LE(1u, count1.non_java_threads_count());
+
+    ASSERT_EQ(max_uintx - 1, thread_claim_token());
+    CheckClaims check1(thread_claim_token());
+    threads_do(&check1);
+    ASSERT_EQ(count1.count(), check1.claimed());
+    ASSERT_EQ(count1.java_threads_count(), check1.java_threads_claimed());
+    ASSERT_EQ(0u, check1.java_threads_unclaimed());
+    ASSERT_EQ(count1.non_java_threads_count(), check1.non_java_threads_claimed());
+    ASSERT_EQ(0u, check1.non_java_threads_unclaimed());
+
+    change_thread_claim_token(); // No overflow yet.
+    ASSERT_EQ(max_uintx, thread_claim_token());
+
+    CountThreads count2(thread_claim_token(), false); // Claimed by PPTD below
+    possibly_parallel_threads_do(true, &count2);
+    ASSERT_EQ(count1.java_threads_count(), count2.java_threads_count());
+    ASSERT_EQ(1u, count2.non_java_threads_count()); // Only VM thread
+
+    CheckClaims check2(thread_claim_token());
+    threads_do(&check2);
+    ASSERT_EQ(count2.java_threads_count(), check2.java_threads_claimed());
+    ASSERT_EQ(0u, check2.java_threads_unclaimed());
+    ASSERT_EQ(1u, check2.non_java_threads_claimed()); // Only VM thread
+    ASSERT_EQ(count1.non_java_threads_count(),
+              check2.non_java_threads_claimed() +
+              check2.non_java_threads_unclaimed());
+
+    change_thread_claim_token(); // Expect overflow.
+    ASSERT_EQ(uintx(1), thread_claim_token());
+
+    // Verify all threads have claim value of 0 after change overflow.
+    CheckClaims check3(0);
+    threads_do(&check3);
+    ASSERT_EQ(count1.count(), check3.claimed());
+    ASSERT_EQ(0u, check3.unclaimed());
+  }
+};
+
+// Test overflow handling in Threads::change_thread_claim_token().
+TEST_VM(ThreadsTest, claim_overflow) {
+  Threads::Test::VM_TestClaimOverflow op;
+  ThreadInVMfromNative invm(JavaThread::current());
+  VMThread::execute(&op);
+}
--- a/test/hotspot/jtreg/ProblemList.txt	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/ProblemList.txt	Wed Apr 03 13:30:05 2019 +0530
@@ -139,13 +139,6 @@
 
 #############################################################################
 
-# :hotspot_gc_shenandoah
-
-gc/shenandoah/TestStringDedup.java                            8220671,8221102 generic-all
-gc/shenandoah/TestStringDedupStress.java                      8220671,8221102 generic-all
-
-#############################################################################
-
 # :hotspot_misc
 
 #############################################################################
--- a/test/hotspot/jtreg/applications/ctw/modules/generate.bash	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/generate.bash	Wed Apr 03 13:30:05 2019 +0530
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-#  Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+#  Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
 #  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 #  This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
     echo creating $file for $module...
     cat > $file <<EOF
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox\$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:$module
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:$module
  */
 EOF
 
--- a/test/hotspot/jtreg/applications/ctw/modules/java_base.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_base.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.base 0% 50%
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.base 0% 50%
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_base_2.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_base_2.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.base 50% 100%
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.base 50% 100%
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_compiler.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_compiler.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.compiler
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.compiler
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_datatransfer.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_datatransfer.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.datatransfer
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.datatransfer
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_desktop.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_desktop.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.desktop 0% 50%
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.desktop 0% 50%
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_desktop_2.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_desktop_2.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.desktop 50% 100%
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.desktop 50% 100%
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_instrument.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_instrument.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.instrument
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.instrument
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_logging.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_logging.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.logging
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.logging
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_management.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_management.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.management
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.management
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_management_rmi.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_management_rmi.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.management.rmi
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.management.rmi
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_naming.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_naming.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.naming
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.naming
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_net_http.java	Wed Apr 03 13:30:05 2019 +0530
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary run CTW for all classes from java.net.http module
+ *
+ * @library /test/lib / /testlibrary/ctw/src
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
+ *          java.base/jdk.internal.misc
+ *          java.base/jdk.internal.reflect
+ * @modules java.net.http
+ *
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.net.http
+ */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_prefs.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_prefs.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.prefs
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.prefs
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_rmi.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_rmi.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.rmi
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.rmi
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_scripting.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_scripting.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.scripting
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.scripting
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_security_jgss.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_security_jgss.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.security.jgss
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.security.jgss
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_security_sasl.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_security_sasl.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.security.sasl
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.security.sasl
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_smartcardio.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_smartcardio.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.smartcardio
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.smartcardio
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_sql.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_sql.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.sql
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.sql
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_sql_rowset.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_sql_rowset.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.sql.rowset
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.sql.rowset
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_transaction_xa.java	Wed Apr 03 13:30:05 2019 +0530
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary run CTW for all classes from java.transaction.xa module
+ *
+ * @library /test/lib / /testlibrary/ctw/src
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
+ *          java.base/jdk.internal.misc
+ *          java.base/jdk.internal.reflect
+ * @modules java.transaction.xa
+ *
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.transaction.xa
+ */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_xml.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_xml.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.xml
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.xml
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/java_xml_crypto.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_xml_crypto.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.xml.crypto
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.xml.crypto
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_accessibility.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_accessibility.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.accessibility
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.accessibility
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_aot.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_aot.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.aot
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.aot
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_attach.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_attach.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.attach
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.attach
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_charsets.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_charsets.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.charsets
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.charsets
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_compiler.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_compiler.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.compiler
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.compiler
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_cryptoki.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_cryptoki.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.cryptoki
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.cryptoki
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.ec
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.ec
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_mscapi.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_mscapi.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.mscapi
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.mscapi
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ucrypto.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ucrypto.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.ucrypto
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.ucrypto
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_dynalink.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_dynalink.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.dynalink
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.dynalink
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_editpad.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_editpad.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.editpad
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.editpad
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_hotspot_agent.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_hotspot_agent.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.hotspot.agent
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.hotspot.agent
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_httpserver.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_httpserver.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.httpserver
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.httpserver
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_incubator_httpclient.java	Tue Apr 02 10:57:57 2019 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary run CTW for all classes from jdk.incubator.httpclient module
- *
- * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.access
- *          java.base/jdk.internal.jimage
- *          java.base/jdk.internal.misc
- *          java.base/jdk.internal.reflect
- * @modules jdk.incubator.httpclient
- *
- * @build sun.hotspot.WhiteBox
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.incubator.httpclient
- */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_ed.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_ed.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.ed
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.ed
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_jvmstat.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_jvmstat.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.jvmstat
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.jvmstat
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_le.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_le.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.le
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.le
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_opt.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_opt.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.opt
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.opt
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_ci.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_ci.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.vm.ci
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.vm.ci
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.vm.compiler
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.vm.compiler
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler_management.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler_management.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.vm.compiler.management
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.internal.vm.compiler.management
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jartool.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jartool.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jartool
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jartool
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_javadoc.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_javadoc.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.javadoc
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.javadoc
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jcmd.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jcmd.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jcmd
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jcmd
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jconsole.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jconsole.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jconsole
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jconsole
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jdeps.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jdeps.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jdeps
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jdeps
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jdi.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jdi.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jdi
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jdi
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jfr.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jfr.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jfr
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jfr
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jlink.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jlink.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jlink
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jlink
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jshell.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jshell.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jshell
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jshell
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jsobject
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jsobject
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_jstatd.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jstatd.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jstatd
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.jstatd
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.localedata
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.localedata
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_management.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_management.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.management
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.management
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_management_agent.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_management_agent.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.management.agent
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.management.agent
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_management_jfr.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_management_jfr.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.management.jfr
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.management.jfr
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_dns.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_dns.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.naming.dns
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.naming.dns
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_rmi.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_rmi.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.naming.rmi
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.naming.rmi
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_net.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_net.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.net
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.net
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_packager.java	Tue Apr 02 10:57:57 2019 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary run CTW for all classes from jdk.packager module
- *
- * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.access
- *          java.base/jdk.internal.jimage
- *          java.base/jdk.internal.misc
- *          java.base/jdk.internal.reflect
- * @modules jdk.packager
- *
- * @build sun.hotspot.WhiteBox
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.packager
- */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_packager_services.java	Tue Apr 02 10:57:57 2019 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary run CTW for all classes from jdk.packager.services module
- *
- * @library /test/lib / /testlibrary/ctw/src
- * @modules java.base/jdk.internal.access
- *          java.base/jdk.internal.jimage
- *          java.base/jdk.internal.misc
- *          java.base/jdk.internal.reflect
- * @modules jdk.packager.services
- *
- * @build sun.hotspot.WhiteBox
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.packager.services
- */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_rmic.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_rmic.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.rmic
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.rmic
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.scripting.nashorn
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.scripting.nashorn
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn_shell.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn_shell.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.scripting.nashorn.shell
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.scripting.nashorn.shell
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_sctp.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_sctp.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.sctp
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.sctp
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_security_auth.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_security_auth.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.security.auth
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.security.auth
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_security_jgss.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_security_jgss.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.security.jgss
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.security.jgss
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_unsupported.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_unsupported.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.unsupported
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.unsupported
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_unsupported_desktop.java	Wed Apr 03 13:30:05 2019 +0530
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary run CTW for all classes from jdk.unsupported.desktop module
+ *
+ * @library /test/lib / /testlibrary/ctw/src
+ * @modules java.base/jdk.internal.access
+ *          java.base/jdk.internal.jimage
+ *          java.base/jdk.internal.misc
+ *          java.base/jdk.internal.reflect
+ * @modules jdk.unsupported.desktop
+ *
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.unsupported.desktop
+ */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_xml_dom.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_xml_dom.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.xml.dom
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.xml.dom
  */
--- a/test/hotspot/jtreg/applications/ctw/modules/jdk_zipfs.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_zipfs.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,5 +35,5 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.zipfs
+ * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.zipfs
  */
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/HelloStringPlus.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/HelloStringPlus.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,8 +66,8 @@
         // Check intern() method for "" string
         String empty = "";
         String empty_interned = empty.intern();
-        if (wb.isShared(empty)) {
-           throw new RuntimeException("Empty string should not be shared");
+        if (!wb.isShared(empty)) {
+           throw new RuntimeException("Empty string should be shared");
         }
         if (empty_interned != empty) {
             throw new RuntimeException("Different string is returned from intern() for empty string");
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockStringTest.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockStringTest.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,49 @@
 import sun.hotspot.WhiteBox;
 
 public class LockStringTest extends Thread {
-    static String lock = "StringLock";
-    static boolean done = false;
+    static String lock;
+    static boolean done;
+    static WhiteBox wb = WhiteBox.getWhiteBox();
 
     public static void main(String[] args) throws Exception {
-        WhiteBox wb = WhiteBox.getWhiteBox();
+
         if (wb.areSharedStringsIgnored()) {
             System.out.println("The shared strings are ignored");
             System.out.println("LockStringTest: PASS");
             return;
         }
 
+        if (!wb.isShared(LockStringTest.class)) {
+            throw new RuntimeException("Failed: LockStringTest class is not shared.");
+        }
+
+        // Note: This class is archived. All string literals (including the ones used in this class)
+        // in all archived classes are interned into the CDS shared string table.
+
+        doTest("StringLock", false);
+        doTest("", true);
+
+        // The following string has a 0 hashCode. Calling String.hashCode() could cause
+        // the String.hash field to be written into, if so make sure we don't functionally
+        // break.
+        doTest("\u0121\u0151\u00a2\u0001\u0001\udbb2", true);
+    }
+
+    private static void doTest(String s, boolean hasZeroHashCode) throws Exception {
+        lock = s;
+        done = false;
+
         if (!wb.isShared(lock)) {
-            throw new RuntimeException("Failed: String is not shared.");
+            throw new RuntimeException("Failed: String \"" + lock + "\" is not shared.");
+        }
+
+        if (hasZeroHashCode && lock.hashCode() != 0) {
+            throw new RuntimeException("Shared string \"" + lock + "\" should have 0 hashCode, but is instead " + lock.hashCode());
+        }
+
+        String copy = new String(lock);
+        if (lock.hashCode() != copy.hashCode()) {
+            throw new RuntimeException("Shared string \"" + lock + "\" does not have the same hashCode as its non-shared copy");
         }
 
         new LockStringTest().start();
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java	Wed Apr 03 13:30:05 2019 +0530
@@ -35,7 +35,6 @@
  * @bug 8191658
  * @summary Test clhsdb jhisto command
  * @requires vm.hasSA
- * @requires vm.gc != "Shenandoah"
  * @library /test/lib
  * @run main/othervm ClhsdbJhisto
  */
--- a/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java	Wed Apr 03 13:30:05 2019 +0530
@@ -47,7 +47,6 @@
  * @library /test/lib
  * @bug 8171084
  * @requires vm.hasSAandCanAttach & (vm.bits == "64" & os.maxMemory > 8g)
- * @requires vm.gc != "Shenandoah"
  * @modules java.base/jdk.internal.misc
  *          jdk.hotspot.agent/sun.jvm.hotspot
  *          jdk.hotspot.agent/sun.jvm.hotspot.utilities
--- a/test/jdk/jdk/internal/ref/Cleaner/ExitOnThrow.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/jdk/jdk/internal/ref/Cleaner/ExitOnThrow.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
  * @bug 4954921 8009259
  * @library /test/lib
  * @modules java.base/jdk.internal.ref
- *          java.base/jdk.internal.misc
  * @build jdk.test.lib.Utils
  *        jdk.test.lib.Asserts
  *        jdk.test.lib.JDKToolFinder
@@ -36,38 +35,22 @@
  * @run main ExitOnThrow
  * @summary Ensure that if a cleaner throws an exception then the VM exits
  */
-import java.util.Arrays;
 
 import jdk.internal.ref.Cleaner;
-import jdk.test.lib.JDKToolLauncher;
-import jdk.test.lib.process.OutputAnalyzer;
+
 import jdk.test.lib.process.ProcessTools;
 
 public class ExitOnThrow {
 
-    static final String cp = System.getProperty("test.classes", ".");
-
     public static void main(String[] args) throws Exception {
         if (args.length == 0) {
-            String[] cmd = JDKToolLauncher.createUsingTestJDK("java")
-                                          .addToolArg("-cp")
-                                          .addToolArg(cp)
-                                          .addToolArg("ExitOnThrow")
-                                          .addToolArg("-executeCleaner")
-                                          .getCommand();
-            ProcessBuilder pb = new ProcessBuilder(cmd);
-            OutputAnalyzer out = ProcessTools.executeProcess(pb);
-            System.out.println("======================");
-            System.out.println(Arrays.toString(cmd));
-            String msg = " stdout: [" + out.getStdout() + "]\n" +
-                         " stderr: [" + out.getStderr() + "]\n" +
-                         " exitValue = " + out.getExitValue() + "\n";
-            System.out.println(msg);
-
-            if (out.getExitValue() != 1)
-                throw new RuntimeException("Unexpected exit code: " +
-                                           out.getExitValue());
-
+            ProcessTools.executeTestJvm("--add-exports", "java.base/jdk.internal.ref=ALL-UNNAMED",
+                                        "ExitOnThrow",
+                                        "-executeCleaner")
+                        .outputTo(System.out)
+                        .errorTo(System.out)
+                        .shouldHaveExitValue(1)
+                        .shouldContain("java.lang.RuntimeException: Foo!");
         } else {
             Cleaner.create(new Object(),
                            () -> { throw new RuntimeException("Foo!"); } );
--- a/test/make/TestCopyFiles.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/make/TestCopyFiles.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -63,7 +63,7 @@
 $(eval $(call SetupCopyFiles, COPY_1, \
     SRC := $(SRC_DIR), \
     DEST := $(DEST_DIR), \
-    FILES := $(call CacheFind, $(SRC_DIR)), \
+    FILES := $(call ShellFindFiles, $(SRC_DIR)), \
 ))
 
 # Optionally define a rule that deletes all the target files after the makefile
--- a/test/make/TestMakeBase.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/make/TestMakeBase.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -140,13 +140,13 @@
 ################################################################################
 # Test remove-prefixes
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call remove-prefixes, pre, prefix postfix), fix postfix, \
-    Prefixes not properly removed))
+    Prefixes not properly removed)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call remove-prefixes, pre post, prefix postfix), fix fix, \
-    Prefixes not properly removed))
+    Prefixes not properly removed)
 
 ################################################################################
 # Test ShellQuote
@@ -239,19 +239,19 @@
 VARDEP_TEST_VAR2 := value3
 
 VARDEP_RETURN_VALUE := $(call DependOnVariable, VARDEP_TEST_VAR2, $(VARDEP_VALUE_FILE))
-$(eval $(call assert-equals, $(VARDEP_RETURN_VALUE), $(VARDEP_VALUE_FILE), \
-    Wrong filename returned))
+$(call AssertEquals, $(VARDEP_RETURN_VALUE), $(VARDEP_VALUE_FILE), \
+    Wrong filename returned)
 -include $(VARDEP_VALUE_FILE)
-$(eval $(call assert-equals, $(VARDEP_TEST_VAR2_old), $(VARDEP_TEST_VAR2), \
-    Wrong contents in vardeps file))
+$(call AssertEquals, $(VARDEP_TEST_VAR2_old), $(VARDEP_TEST_VAR2), \
+    Wrong contents in vardeps file)
 
 # Test with a variable value containing some problematic characters
 VARDEP_TEST_VAR3 := foo '""' "''" bar \$$ORIGIN &\#x00a9
 VARDEP_VALUE_FILE := $(call DependOnVariable, VARDEP_TEST_VAR3)
 -include $(VARDEP_VALUE_FILE)
-$(eval $(call assert-equals, $(call EscapeHash,$(VARDEP_TEST_VAR3_old)), \
+$(call AssertEquals, $(call EscapeHash,$(VARDEP_TEST_VAR3_old)), \
     $(call EscapeHash,$(VARDEP_TEST_VAR3)), \
-    Wrong contents in vardep file))
+    Wrong contents in vardep file)
 
 TEST_TARGETS += test-vardep
 
@@ -280,85 +280,86 @@
 
 PATHLIST_INPUT := foo bar baz
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call PathList, $(call PathList, $(PATHLIST_INPUT))), \
     $(call PathList, $(PATHLIST_INPUT)), \
-    PathList call not safe for calling twice))
+    PathList call not safe for calling twice, \
+)
 
 ################################################################################
 # Test FindCommonPathPrefix
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar/banan), \
     /foo/bar, \
     FindCommonPathPrefix, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar), \
     /foo/bar, \
     FindCommonPathPrefix, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar/), \
     /foo/bar, \
     FindCommonPathPrefix, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call FindCommonPathPrefix, foo/bar/baz, foo/bar/banan), \
     foo/bar, \
     FindCommonPathPrefix, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call FindCommonPathPrefix, foo/bar/baz, /foo/bar/banan), \
     , \
     FindCommonPathPrefix, \
-))
+)
 
 ################################################################################
 # DirToDotDot
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call DirToDotDot, foo/bar/baz/), \
     ../../.., \
     DirToDotDot, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call DirToDotDot, foo/bar), \
     ../.., \
     DirToDotDot, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call DirToDotDot, /foo), \
     .., \
     DirToDotDot, \
-))
+)
 
 ################################################################################
 # RelativePath
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call RelativePath, foo/bar/baz, foo/bar/banan), \
     ../baz, \
     RelativePath, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call RelativePath, foo/bar/baz/banan/kung, foo/bar/banan/kung), \
     ../../baz/banan/kung, \
     RelativePath, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(call RelativePath, /foo/bar/baz/banan/kung, /foo/bar/banan/kung/), \
     ../../baz/banan/kung, \
     RelativePath, \
-))
+)
 
 ################################################################################
 # Test ParseKeywordVariable
@@ -370,29 +371,29 @@
     STRING_KEYWORDS := COUNT MANY_WORDS, \
 ))
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(KWBASE_APA), \
     banan, \
     ParseKeywordVariable failed to parse APA, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(KWBASE_COUNT), \
     1 2 3 4 5, \
     ParseKeywordVariable failed to parse COUNT, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(KWBASE_SUM), \
     1+2+3+4+5, \
     ParseKeywordVariable failed to parse SUM, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(KWBASE_MANY_WORDS), \
     I have the best words., \
     ParseKeywordVariable failed to parse MANY_WORDS, \
-))
+)
 
 # Simulate variable set from command line by using "override"
 override KWBASE_WEIRD_GURKA := paprika
@@ -403,17 +404,211 @@
     STRING_KEYWORDS := COUNT, \
 ))
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(KWBASE_WEIRD_APA), \
     skansen, \
     ParseKeywordVariable failed to overwrite APA, \
-))
+)
 
-$(eval $(call assert-equals, \
+$(call AssertEquals, \
     $(KWBASE_WEIRD_GURKA), \
     paprika, \
     ParseKeywordVariable failed to preserve GURKA, \
-))
+)
+
+################################################################################
+# Test recursive wildcard
+
+A_FOOBAR := $(OUTPUT_DIR)/wildcard/a/foo.bar
+A_B_DOOBAR := $(OUTPUT_DIR)/wildcard/a/b/doo.bar
+A_B_FOOBAR := $(OUTPUT_DIR)/wildcard/a/b/foo.bar
+A_B_FOOBAZ := $(OUTPUT_DIR)/wildcard/a/b/foo.baz
+X_Y_FOOBAR := $(OUTPUT_DIR)/wildcard/x/y/foo.bar
+X_Y_FOOBAZ := $(OUTPUT_DIR)/wildcard/x/y/foo.baz
+X_Y_FOODOLLAR := $(OUTPUT_DIR)/wildcard/x/y/foo$$foo
+
+$(call MakeDir, $(OUTPUT_DIR)/wildcard/a/b)
+$(call MakeDir, $(OUTPUT_DIR)/wildcard/x/y)
+$(shell $(TOUCH) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_DOOBAR) $(A_B_FOOBAZ) \
+    $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(call ShellQuote, $(X_Y_FOODOLLAR)))
+
+ifeq ($(RWILDCARD_WORKS), true)
+  $(call AssertEquals, \
+      $(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, *.bar)), \
+      $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_FOOBAR) $(X_Y_FOOBAR)), \
+      Wrong files returned from rwildcard, \
+  )
+
+  $(call AssertEquals, \
+      $(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, doo.*)), \
+      $(A_B_DOOBAR), \
+      Wrong files returned from rwildcard, \
+  )
+
+  $(call AssertEquals, \
+      $(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, *.bar *.baz)), \
+      $(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
+      $(X_Y_FOOBAR) $(X_Y_FOOBAZ)), \
+      Wrong files returned from rwildcard, \
+  )
+
+  $(call AssertEquals, \
+      $(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard)), \
+      $(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
+      $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+      Wrong files returned from WildcardFindFiles, \
+  )
+
+  $(call AssertEquals, \
+      $(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \
+      $(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+      Wrong files returned from WildcardFindFiles, \
+  )
+
+  $(call AssertEquals, \
+      $(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/x)), \
+      $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
+      $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+      Wrong files returned from WildcardFindFiles, \
+  )
+endif
+
+$(call AssertEquals, \
+    $(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard)), \
+    $(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
+    $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+    Wrong files returned from ShellFindFiles, \
+)
+
+$(call AssertEquals, \
+    $(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \
+    $(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+    Wrong files returned from ShellFindFiles, \
+)
+
+$(call AssertEquals, \
+    $(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/x)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
+    $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+    Wrong files returned from ShellFindFiles, \
+)
+
+$(call AssertEquals, \
+    $(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, *.bar)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_FOOBAR) $(X_Y_FOOBAR)), \
+    Wrong files returned from ShellFindFiles, \
+)
+
+$(call AssertEquals, \
+    $(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, doo.*)), \
+    $(A_B_DOOBAR), \
+    Wrong files returned from ShellFindFiles, \
+)
+
+$(call AssertEquals, \
+    $(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, *.bar *.baz)), \
+    $(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
+    $(X_Y_FOOBAR) $(X_Y_FOOBAZ)), \
+    Wrong files returned from ShellFindFiles, \
+)
+
+################################################################################
+
+$(call AssertEquals, \
+    $(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a/b)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \
+    CacheFindFiles test 1, \
+)
+$(call FillFindCache, $(OUTPUT_DIR)/wildcard/a/b)
+$(call AssertEquals, \
+    $(CacheFindFiles_CACHED_DIRS), $(OUTPUT_DIR)/wildcard/a/b, \
+    Wrong files in find cache dirs, \
+)
+$(call AssertEquals, \
+    $(sort $(CacheFindFiles_CACHED_FILES)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \
+    Wrong files in find cache files, \
+)
+$(call AssertEquals, \
+    $(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a/b)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \
+    CacheFindFiles test 1, \
+)
+
+$(call AssertEquals, \
+    $(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \
+    CacheFindFiles test 2, \
+)
+$(call FillFindCache, $(OUTPUT_DIR)/wildcard/a)
+$(call AssertEquals, \
+    $(CacheFindFiles_CACHED_DIRS), \
+    $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a, \
+    Wrong files in find cache dirs, \
+)
+$(call AssertEquals, \
+    $(sort $(CacheFindFiles_CACHED_FILES)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \
+    Wrong files in find cache files, \
+)
+$(call AssertEquals, \
+    $(words $(CacheFindFiles_CACHED_FILES)), 4, \
+    Wrong files in find cache files >$(CacheFindFiles_CACHED_FILES)<, \
+)
+$(call AssertEquals, \
+    $(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \
+    CacheFindFiles test 2, \
+)
+
+$(call AssertEquals, \
+    $(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x)), \
+    $(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+    CacheFindFiles test 3, \
+)
+$(call FillFindCache, $(OUTPUT_DIR)/wildcard/x)
+$(call AssertEquals, \
+    $(CacheFindFiles_CACHED_DIRS), \
+    $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a $(OUTPUT_DIR)/wildcard/x, \
+    Wrong files in find cache dirs, \
+)
+$(call AssertEquals, \
+    $(sort $(CacheFindFiles_CACHED_FILES)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR) \
+        $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+    Wrong files in find cache files, \
+)
+$(call AssertEquals, \
+    $(words $(CacheFindFiles_CACHED_FILES)), 7, \
+    Wrong files in find cache files, \
+)
+$(call AssertEquals, \
+    $(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x)), \
+    $(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+    CacheFindFiles test 3, \
+)
+
+$(call AssertEquals, \
+    $(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \
+    $(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+    CacheFindFiles test 4, \
+)
+$(call FillFindCache, $(OUTPUT_DIR)/wildcard/x/y)
+$(call AssertEquals, \
+    $(CacheFindFiles_CACHED_DIRS), \
+    $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a $(OUTPUT_DIR)/wildcard/x, \
+    Wrong files in find cache dirs, \
+)
+$(call AssertEquals, \
+    $(sort $(CacheFindFiles_CACHED_FILES)), \
+    $(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR) \
+        $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
+    Wrong files in find cache files, \
+)
+$(call AssertEquals, \
+    $(words $(CacheFindFiles_CACHED_FILES)), 7, \
+    Wrong files in find cache files, \
+)
 
 ################################################################################
 
--- a/test/make/UtilsForTests.gmk	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/make/UtilsForTests.gmk	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -29,11 +29,16 @@
 # 1 - Tested value
 # 2 - Exepected value
 # 3 - Error message
-define assert-equals
-  ifneq ($$(strip $1),$$(strip $2))
-    $$(error $3 - Expected >$$(strip $2)< - Got >$$(strip $1)<)
-  endif
-endef
+AssertEquals = \
+    $(if $(call equals, $(strip $1), $(strip $2)), , \
+      $(info FAILURE: $3) \
+      $(info Expected: >$(strip $2)<) \
+      $(info Actual:   >$(strip $1)<) \
+      $(error $3) \
+    )
+
+CreateFile = $(shell $(MKDIR) -p $(call ShellQuote, $(dir $1)) \
+    && $(TOUCH) $(call ShellQuote, $1))
 
 # On macosx, file system timestamps only have 1 second resultion so must add
 # sleeps to properly test dependencies.
--- a/test/micro/org/openjdk/bench/java/lang/StringHashCode.java	Tue Apr 02 10:57:57 2019 +0530
+++ b/test/micro/org/openjdk/bench/java/lang/StringHashCode.java	Wed Apr 03 13:30:05 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,11 +42,13 @@
 
     private String hashcode;
     private String hashcode0;
+    private String empty;
 
     @Setup
     public void setup() {
         hashcode = "abcdefghijkl";
         hashcode0 = new String(new char[]{72, 90, 100, 89, 105, 2, 72, 90, 100, 89, 105, 2});
+        empty = new String();
     }
 
     /**
@@ -66,4 +68,13 @@
     public int notCached() {
         return hashcode0.hashCode();
     }
+
+    /**
+     * Benchmark testing String.hashCode() with the empty string. Since the
+     * empty String has hashCode = 0, this value is always recalculated.
+     */
+    @Benchmark
+    public int empty() {
+        return empty.hashCode();
+    }
 }