changeset 53461:5f41edd3513b

Merge
author robm
date Tue, 16 Jul 2019 16:24:54 +0000
parents ef10c169136c b58f3dee17d1
children 96bf85c704b6
files .hgtags 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
diffstat 334 files changed, 3273 insertions(+), 1299 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Jul 16 16:20:54 2019 +0000
+++ b/.hgtags	Tue Jul 16 16:24:54 2019 +0000
@@ -549,6 +549,8 @@
 edbfbc928f5d928a237d6cc384e75672759a2c6f jdk-12.0.1+9
 e657e6b868841da27767e780f932f221b72e5713 jdk-12.0.1+10
 8afa031910e32132bb19830b73e26e2991a7d68f jdk-12.0.1+11
+e831fc6bca9e6afa6b486f07d386146e1ae0f6e1 jdk-12.0.1+12
+e831fc6bca9e6afa6b486f07d386146e1ae0f6e1 jdk-12.0.1-ga
 9a91d1dc777a633330e5d99f78123e46c3b2cdf2 jdk-12.0.2+0
 4ce38123759d27de5cc9588aab4a36ceea29b6f4 jdk-12.0.2+1
 b6c02a742b403ce2d7a6d28eed351e8d3e07ee1b jdk-12.0.2+2
--- a/make/Bundles.gmk	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/Bundles.gmk	Tue Jul 16 16:24:54 2019 +0000
@@ -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
@@ -29,6 +29,7 @@
 include MakeBase.gmk
 
 PRODUCT_TARGETS :=
+LEGACY_TARGETS :=
 TEST_TARGETS :=
 DOCS_TARGETS :=
 
@@ -146,19 +147,25 @@
 # correct base directories.
 ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
   JDK_IMAGE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
+  JRE_IMAGE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
   JDK_IMAGE_HOMEDIR := $(JDK_MACOSX_CONTENTS_DIR)/Home
+  JRE_IMAGE_HOMEDIR := $(JRE_MACOSX_CONTENTS_DIR)/Home
   JDK_BUNDLE_SUBDIR :=
+  JRE_BUNDLE_SUBDIR :=
 else
   JDK_IMAGE_HOMEDIR := $(JDK_IMAGE_DIR)
+  JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
   JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
+  JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
   ifneq ($(DEBUG_LEVEL), release)
     JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
+    JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
   endif
 endif
 
 ################################################################################
 
-ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
+ifneq ($(filter product-bundles legacy-bundles, $(MAKECMDGOALS)), )
   $(eval $(call FillCacheFind, $(IMAGES_OUTPUTDIR)))
 
   SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.pdb %.map
@@ -198,6 +205,22 @@
 
   TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_IMAGE_HOMEDIR)/demo/%, $(ALL_JDK_FILES))
 
+  ALL_JRE_FILES := $(call CacheFind, $(JRE_IMAGE_DIR))
+
+  # Create special filter rules when dealing with unzipped .dSYM directories on
+  # macosx
+  ifeq ($(OPENJDK_TARGET_OS), macosx)
+    ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
+      JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
+          $(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
+    endif
+  endif
+
+  JRE_BUNDLE_FILES := $(filter-out \
+      $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
+      $(SYMBOLS_EXCLUDE_PATTERN), \
+      $(ALL_JRE_FILES))
+
   $(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
       BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
       FILES := $(JDK_BUNDLE_FILES), \
@@ -208,6 +231,15 @@
 
   PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
 
+  $(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
+      BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
+      FILES := $(JRE_BUNDLE_FILES), \
+      BASE_DIRS := $(JRE_IMAGE_DIR), \
+      SUBDIR := $(JRE_BUNDLE_SUBDIR), \
+  ))
+
+  LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
+
   $(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
       BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
       FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
@@ -283,6 +315,7 @@
 ################################################################################
 
 product-bundles: $(PRODUCT_TARGETS)
+legacy-bundles: $(LEGACY_TARGETS)
 test-bundles: $(TEST_TARGETS)
 docs-bundles: $(DOCS_TARGETS)
 jcov-bundles: $(JCOV_TARGETS)
--- a/make/Main.gmk	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/Main.gmk	Tue Jul 16 16:24:54 2019 +0000
@@ -576,6 +576,9 @@
 product-bundles:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk product-bundles)
 
+legacy-bundles:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk legacy-bundles)
+
 test-bundles:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk test-bundles)
 
@@ -587,7 +590,7 @@
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk jcov-bundles)
 endif
 
-ALL_TARGETS += product-bundles test-bundles docs-bundles jcov-bundles
+ALL_TARGETS += product-bundles legacy-bundles test-bundles docs-bundles jcov-bundles
 
 ################################################################################
 # Install targets
@@ -909,6 +912,8 @@
 
   product-bundles: product-images
 
+  legacy-bundles: legacy-images
+
   test-bundles: test-image
 
   docs-bundles: docs-image
@@ -1011,6 +1016,9 @@
 # (and possibly other, more specific versions)
 product-images: jdk-image symbols-image exploded-image
 
+# This target builds the legacy images, e.g. the legacy JRE image
+legacy-images: legacy-jre-image
+
 # zip-security is actually a bundle, but for now it needs to be considered
 # an image until this can be cleaned up properly.
 product-images: zip-security
@@ -1027,6 +1035,8 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   product-images: mac-jdk-bundle
+
+  legacy-images: mac-legacy-jre-bundle
 endif
 
 # This target builds the documentation image
@@ -1061,7 +1071,7 @@
     jdk.jdwp.agent-gensrc $(ALL_MODULES) demos \
     exploded-image-base exploded-image \
     create-buildjdk docs-jdk-api docs-javase-api docs-reference-api docs-jdk \
-    docs-javase docs-reference docs-javadoc mac-bundles product-images \
+    docs-javase docs-reference docs-javadoc mac-bundles product-images legacy-images \
     docs-image test-image all-images \
     all-bundles
 
--- a/make/autoconf/flags-cflags.m4	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/autoconf/flags-cflags.m4	Tue Jul 16 16:24:54 2019 +0000
@@ -560,7 +560,7 @@
     TOOLCHAIN_CFLAGS="-errshort=tags"
 
     TOOLCHAIN_CFLAGS_JDK="-mt $TOOLCHAIN_FLAGS"
-    TOOLCHAIN_CFLAGS_JDK_CONLY="-xc99=%none -xCC -Xa -W0,-noglobal $TOOLCHAIN_CFLAGS" # C only
+    TOOLCHAIN_CFLAGS_JDK_CONLY="-xCC -Xa -W0,-noglobal $TOOLCHAIN_CFLAGS" # C only
     TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only
     TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \
         -library=stlport4 -mt -features=no%except $TOOLCHAIN_FLAGS"
--- a/make/autoconf/flags-other.m4	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/autoconf/flags-other.m4	Tue Jul 16 16:24:54 2019 +0000
@@ -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
@@ -81,10 +81,10 @@
     RC_FLAGS="$RC_FLAGS \
         -D\"JDK_VERSION_STRING=\$(VERSION_STRING)\" \
         -D\"JDK_COMPANY=\$(COMPANY_NAME)\" \
-        -D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
+        -D\"JDK_COMPONENT=\$(JDK_RC_NAME) binary\" \
         -D\"JDK_VER=\$(VERSION_NUMBER)\" \
         -D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
-        -D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(VERSION_FEATURE)\" \
+        -D\"JDK_NAME=\$(JDK_RC_NAME) \$(VERSION_FEATURE)\" \
         -D\"JDK_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
 
     JVM_RCFLAGS="$JVM_RCFLAGS \
--- a/make/autoconf/jdk-version.m4	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/autoconf/jdk-version.m4	Tue Jul 16 16:24:54 2019 +0000
@@ -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
@@ -66,9 +66,52 @@
   AC_SUBST(PRODUCT_SUFFIX)
   AC_SUBST(JDK_RC_PLATFORM_NAME)
   AC_SUBST(HOTSPOT_VM_DISTRO)
+
+  # Set the MACOSX Bundle Name base
+  AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
+      [Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
+      @<:@not specified@:>@])])
+  if test "x$with_macosx_bundle_name_base" = xyes; then
+    AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
+  elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
+    AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
+  elif test "x$with_macosx_bundle_name_base" != x; then
+    # Set MACOSX_BUNDLE_NAME_BASE to the configured value.
+    MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
+  fi
   AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
+
+  # Set the MACOSX Bundle ID base
+  AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
+      [Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
+      @<:@not specified@:>@])])
+  if test "x$with_macosx_bundle_id_base" = xyes; then
+    AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
+  elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
+    AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
+  elif test "x$with_macosx_bundle_id_base" != x; then
+    # Set MACOSX_BUNDLE_ID_BASE to the configured value.
+    MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
+  fi
   AC_SUBST(MACOSX_BUNDLE_ID_BASE)
 
+  # Set the JDK RC name
+  AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name],
+      [Set JDK RC name. This is used for FileDescription and ProductName properties
+       of MS Windows binaries. @<:@not specified@:>@])])
+  if test "x$with_jdk_rc_name" = xyes; then
+    AC_MSG_ERROR([--with-jdk-rc-name must have a value])
+  elif [ ! [[ $with_jdk_rc_name =~ ^[[:print:]]*$ ]] ]; then
+    AC_MSG_ERROR([--with-jdk-rc-name contains non-printing characters: $with_jdk_rc_name])
+  elif test "x$with_jdk_rc_name" != x; then
+    # Set JDK_RC_NAME to a custom value if '--with-jdk-rc-name' was used and is not empty.
+    JDK_RC_NAME="$with_jdk_rc_name"
+  else
+    # Otherwise calculate from "version-numbers" included above.
+    JDK_RC_NAME="$PRODUCT_NAME $JDK_RC_PLATFORM_NAME"
+  fi
+  AC_SUBST(JDK_RC_NAME)
+
   # The vendor name, if any
   AC_ARG_WITH(vendor-name, [AS_HELP_STRING([--with-vendor-name],
       [Set vendor name. Among others, used to set the 'java.vendor'
--- a/make/autoconf/spec.gmk.in	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/autoconf/spec.gmk.in	Tue Jul 16 16:24:54 2019 +0000
@@ -148,6 +148,7 @@
 PRODUCT_NAME:=@PRODUCT_NAME@
 PRODUCT_SUFFIX:=@PRODUCT_SUFFIX@
 JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@
+JDK_RC_NAME:=@JDK_RC_NAME@
 COMPANY_NAME:=@COMPANY_NAME@
 HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@
 MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@
@@ -891,6 +892,7 @@
   JDK_BUNDLE_EXTENSION := tar.gz
 endif
 JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
+JRE_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
 JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
 TEST_DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests-demos$(DEBUG_PART).tar.gz
 TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz
@@ -898,6 +900,7 @@
 JCOV_BUNDLE_NAME := jdk-jcov-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
 
 JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
+JRE_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JRE_BUNDLE_NAME)
 JDK_SYMBOLS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME)
 TEST_DEMOS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_DEMOS_BUNDLE_NAME)
 TEST_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
--- a/make/data/publicsuffixlist/VERSION	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/data/publicsuffixlist/VERSION	Tue Jul 16 16:24:54 2019 +0000
@@ -1,2 +1,2 @@
-Github: https://raw.githubusercontent.com/publicsuffix/list/2225db8d9f4a2a27ec697c883360632fa0c16261/public_suffix_list.dat
-Date: 2018-05-24
+Github: https://raw.githubusercontent.com/publicsuffix/list/ce0d1a5fba657e55adea3abde4b7f1e50636ff10/public_suffix_list.dat
+Date: 2019-01-28
--- a/make/data/publicsuffixlist/public_suffix_list.dat	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/data/publicsuffixlist/public_suffix_list.dat	Tue Jul 16 16:24:54 2019 +0000
@@ -381,8 +381,13 @@
 net.bm
 org.bm
 
-// bn : https://en.wikipedia.org/wiki/.bn
-*.bn
+// bn : http://www.bnnic.bn/faqs
+bn
+com.bn
+edu.bn
+gov.bn
+net.bn
+org.bn
 
 // bo : https://nic.bo/delegacion2015.php#h-1.10
 bo
@@ -546,6 +551,7 @@
 not.br
 ntr.br
 odo.br
+ong.br
 org.br
 osasco.br
 palmas.br
@@ -1239,7 +1245,7 @@
 utazas.hu
 video.hu
 
-// id : https://register.pandi.or.id/
+// id : https://pandi.id/en/domain/registration-requirements/
 id
 ac.id
 biz.id
@@ -1250,6 +1256,7 @@
 my.id
 net.id
 or.id
+ponpes.id
 sch.id
 web.id
 
@@ -1407,9 +1414,9 @@
 tos.it
 toscana.it
 trentin-sud-tirol.it
-trentin-süd-tirol.it
+trentin-süd-tirol.it
 trentin-sudtirol.it
-trentin-südtirol.it
+trentin-südtirol.it
 trentin-sued-tirol.it
 trentin-suedtirol.it
 trentino-a-adige.it
@@ -1419,9 +1426,9 @@
 trentino-s-tirol.it
 trentino-stirol.it
 trentino-sud-tirol.it
-trentino-süd-tirol.it
+trentino-süd-tirol.it
 trentino-sudtirol.it
-trentino-südtirol.it
+trentino-südtirol.it
 trentino-sued-tirol.it
 trentino-suedtirol.it
 trentino.it
@@ -1432,15 +1439,15 @@
 trentinos-tirol.it
 trentinostirol.it
 trentinosud-tirol.it
-trentinosüd-tirol.it
+trentinosüd-tirol.it
 trentinosudtirol.it
-trentinosüdtirol.it
+trentinosüdtirol.it
 trentinosued-tirol.it
 trentinosuedtirol.it
 trentinsud-tirol.it
-trentinsüd-tirol.it
+trentinsüd-tirol.it
 trentinsudtirol.it
-trentinsüdtirol.it
+trentinsüdtirol.it
 trentinsued-tirol.it
 trentinsuedtirol.it
 tuscany.it
@@ -1457,13 +1464,13 @@
 valled-aosta.it
 valledaosta.it
 vallee-aoste.it
-vallée-aoste.it
+vallée-aoste.it
 vallee-d-aoste.it
-vallée-d-aoste.it
+vallée-d-aoste.it
 valleeaoste.it
-valléeaoste.it
+valléeaoste.it
 valleedaoste.it
-valléedaoste.it
+valléedaoste.it
 vao.it
 vda.it
 ven.it
@@ -1497,7 +1504,7 @@
 avellino.it
 ba.it
 balsan-sudtirol.it
-balsan-südtirol.it
+balsan-südtirol.it
 balsan-suedtirol.it
 balsan.it
 bari.it
@@ -1516,7 +1523,7 @@
 bolzano-altoadige.it
 bolzano.it
 bozen-sudtirol.it
-bozen-südtirol.it
+bozen-südtirol.it
 bozen-suedtirol.it
 bozen.it
 br.it
@@ -1525,7 +1532,7 @@
 bs.it
 bt.it
 bulsan-sudtirol.it
-bulsan-südtirol.it
+bulsan-südtirol.it
 bulsan-suedtirol.it
 bulsan.it
 bz.it
@@ -1545,9 +1552,9 @@
 cb.it
 ce.it
 cesena-forli.it
-cesena-forlì.it
+cesena-forlì.it
 cesenaforli.it
-cesenaforlì.it
+cesenaforlì.it
 ch.it
 chieti.it
 ci.it
@@ -1578,9 +1585,9 @@
 fm.it
 foggia.it
 forli-cesena.it
-forlì-cesena.it
+forlì-cesena.it
 forlicesena.it
-forlìcesena.it
+forlìcesena.it
 fr.it
 frosinone.it
 ge.it
@@ -1711,7 +1718,7 @@
 sr.it
 ss.it
 suedtirol.it
-südtirol.it
+südtirol.it
 sv.it
 ta.it
 taranto.it
@@ -3692,8 +3699,16 @@
 seoul.kr
 ulsan.kr
 
-// kw : https://en.wikipedia.org/wiki/.kw
-*.kw
+// kw : https://www.nic.kw/policies/
+// Confirmed by registry <nic.tech@citra.gov.kw>
+kw
+com.kw
+edu.kw
+emb.kw
+gov.kw
+ind.kw
+net.kw
+org.kw
 
 // ky : http://www.icta.ky/da_ky_reg_dom.php
 // Confirmed by registry <kysupport@perimeterusa.com> 2008-06-17
@@ -3775,10 +3790,18 @@
 org.lr
 net.lr
 
-// ls : https://en.wikipedia.org/wiki/.ls
+// ls : http://www.nic.ls/
+// Confirmed by registry <lsadmin@nic.ls>
 ls
+ac.ls
+biz.ls
 co.ls
+edu.ls
+gov.ls
+info.ls
+net.ls
 org.ls
+sc.ls
 
 // lt : https://en.wikipedia.org/wiki/.lt
 lt
@@ -4636,9 +4659,6 @@
 //      ccTLD for the Netherlands
 nl
 
-// BV.nl will be a registry for dutch BV's (besloten vennootschap)
-bv.nl
-
 // no : http://www.norid.no/regelverk/index.en.html
 // The Norwegian registry has declined to notify us of updates. The web pages
 // referenced below are the official source of the data. There is also an
@@ -8329,9 +8349,6 @@
 // goo : 2014-12-18 NTT Resonant Inc.
 goo
 
-// goodhands : 2015-07-31 Allstate Fire and Casualty Insurance Company
-goodhands
-
 // goodyear : 2015-07-02 The Goodyear Tire & Rubber Company
 goodyear
 
@@ -8608,9 +8625,6 @@
 // iveco : 2015-09-03 CNH Industrial N.V.
 iveco
 
-// iwc : 2014-06-23 Richemont DNS Inc.
-iwc
-
 // jaguar : 2014-11-13 Jaguar Land Rover Ltd
 jaguar
 
@@ -8635,9 +8649,6 @@
 // jio : 2015-04-02 Reliance Industries Limited
 jio
 
-// jlc : 2014-12-04 Richemont DNS Inc.
-jlc
-
 // jll : 2015-04-02 Jones Lang LaSalle Incorporated
 jll
 
@@ -8989,9 +9000,6 @@
 // menu : 2013-09-11 Wedding TLD2, LLC
 menu
 
-// meo : 2014-11-07 MEO Servicos de Comunicacoes e Multimedia, S.A.
-meo
-
 // merckmsd : 2016-07-14 MSD Registry Holdings, Inc.
 merckmsd
 
@@ -9283,9 +9291,6 @@
 // panasonic : 2015-07-30 Panasonic Corporation
 panasonic
 
-// panerai : 2014-11-07 Richemont DNS Inc.
-panerai
-
 // paris : 2014-01-30 City of Paris
 paris
 
@@ -9634,9 +9639,6 @@
 // sap : 2014-03-27 SAP AG
 sap
 
-// sapo : 2014-11-07 MEO Servicos de Comunicacoes e Multimedia, S.A.
-sapo
-
 // sarl : 2014-07-03 Binky Moon, LLC
 sarl
 
@@ -9877,9 +9879,6 @@
 // statefarm : 2015-07-30 State Farm Mutual Automobile Insurance Company
 statefarm
 
-// statoil : 2014-12-04 Statoil ASA
-statoil
-
 // stc : 2014-10-09 Saudi Telecom Company
 stc
 
@@ -9991,9 +9990,6 @@
 // technology : 2013-09-13 Binky Moon, LLC
 technology
 
-// telecity : 2015-02-19 TelecityGroup International Limited
-telecity
-
 // telefonica : 2014-10-16 Telefónica S.A.
 telefonica
 
@@ -10201,9 +10197,6 @@
 // vision : 2013-12-05 Binky Moon, LLC
 vision
 
-// vista : 2014-09-18 Vistaprint Limited
-vista
-
 // vistaprint : 2014-09-18 Vistaprint Limited
 vistaprint
 
@@ -10642,9 +10635,6 @@
 // xn--zfr164b : 2013-11-08 China Organizational Name Administration Center
 政务
 
-// xperia : 2015-05-14 Sony Mobile Communications AB
-xperia
-
 // xyz : 2013-12-05 XYZ.COM LLC
 xyz
 
@@ -10737,6 +10727,7 @@
 // Amazon Elastic Beanstalk : https://aws.amazon.com/elasticbeanstalk/
 // Submitted by Luke Wells <psl-maintainers@amazon.com>
 cn-north-1.eb.amazonaws.com.cn
+cn-northwest-1.eb.amazonaws.com.cn
 elasticbeanstalk.com
 ap-northeast-1.elasticbeanstalk.com
 ap-northeast-2.elasticbeanstalk.com
@@ -10823,6 +10814,10 @@
 t3l3p0rt.net
 tele.amune.org
 
+// Apigee : https://apigee.com/
+// Submitted by Apigee Security Team <security@apigee.com>
+apigee.io
+
 // Aptible : https://www.aptible.com/
 // Submitted by Thomas Orozco <thomas@aptible.com>
 on-aptible.com
@@ -10842,6 +10837,11 @@
 // Submitted by Vincent Tseng <vincenttseng@asustor.com>
 myasustor.com
 
+// Automattic Inc. : https://automattic.com/
+// Submitted by Alex Concha <alex.concha@automattic.com>
+go-vip.co
+wpcomstaging.com
+
 // AVM : https://avm.de
 // Submitted by Andreas Weise <a.weise@avm.de>
 myfritz.net
@@ -10888,6 +10888,11 @@
 // Submitted by Dave Tharp <browsersafetymark.io@quicinc.com>
 browsersafetymark.io
 
+// Bytemark Hosting : https://www.bytemark.co.uk
+// Submitted by Paul Cammish <paul.cammish@bytemark.co.uk>
+dh.bytemark.co.uk
+vm.bytemark.co.uk
+
 // callidomus : https://www.callidomus.com/
 // Submitted by Marcus Popp <admin@callidomus.com>
 mycd.eu
@@ -11080,6 +11085,11 @@
 reg.dk
 store.dk
 
+// dapps.earth : https://dapps.earth/
+// Submitted by Daniil Burdakov <icqkill@gmail.com>
+*.dapps.earth
+*.bzz.dapps.earth
+
 // Debian : https://www.debian.org/
 // Submitted by Peter Palfrader / Debian Sysadmin Team <dsa-publicsuffixlist@debian.org>
 debian.net
@@ -11092,6 +11102,11 @@
 // Submitted by Norbert Auler <mail@dnshome.de>
 dnshome.de
 
+// DotArai : https://www.dotarai.com/
+// Submitted by Atsadawat Netcharadsang <atsadawat@dotarai.co.th>
+online.th
+shop.th
+
 // DrayTek Corp. : https://www.draytek.com/
 // Submitted by Paul Fang <mis@draytek.com>
 drayddns.com
@@ -11648,6 +11663,10 @@
 app.os.fedoraproject.org
 app.os.stg.fedoraproject.org
 
+// Fermax : https://fermax.com/
+// submitted by Koen Van Isterdael <k.vanisterdael@fermax.be>
+mydobiss.com
+
 // Filegear Inc. : https://www.filegear.com
 // Submitted by Jason Zhu <jason@owtware.com>
 filegear.me
@@ -11713,6 +11732,8 @@
 
 // Google, Inc.
 // Submitted by Eduardo Vela <evn@google.com>
+run.app
+a.run.app
 *.0emm.com
 appspot.com
 blogspot.ae
@@ -11918,6 +11939,12 @@
 lcube-server.de
 svn-repos.de
 
+// Leadpages : https://www.leadpages.net
+// Submitted by Greg Dallavalle <domains@leadpages.net>
+leadpages.co
+lpages.co
+lpusercontent.com
+
 // Lightmaker Property Manager, Inc. : https://app.lmpm.com/
 // Submitted by Greg Holland <greg.holland@lmpm.com>
 app.lmpm.com
@@ -11935,6 +11962,15 @@
 // Submitted by Victor Velchev <admin@liquidnetlimited.com>
 we.bs
 
+// LubMAN UMCS Sp. z o.o : https://lubman.pl/
+// Submitted by Ireneusz Maliszewski <ireneusz.maliszewski@lubman.pl>
+krasnik.pl
+leczna.pl
+lubartow.pl
+lublin.pl
+poniatowa.pl
+swidnik.pl
+
 // Lug.org.uk : https://lug.org.uk
 // Submitted by Jon Spriggs <admin@lug.org.uk>
 uklugs.org
@@ -12322,6 +12358,10 @@
 chirurgiens-dentistes-en-france.fr
 byen.site
 
+// Redstar Consultants : https://www.redstarconsultants.com/
+// Submitted by Jons Slemmer <jons@redstarconsultants.com>
+instantcloud.cn
+
 // Russian Academy of Sciences
 // Submitted by Tech Support <support@rasnet.ru>
 ras.ru
@@ -12350,6 +12390,10 @@
 rackmaze.com
 rackmaze.net
 
+// Read The Docs, Inc : https://www.readthedocs.org
+// Submitted by David Fischer <team@readthedocs.org>
+readthedocs.io
+
 // Red Hat, Inc. OpenShift : https://openshift.redhat.com/
 // Submitted by Tim Kramer <tkramer@rhcloud.com>
 rhcloud.com
@@ -12426,6 +12470,10 @@
 sinaapp.com
 vipsinaapp.com
 
+// Siteleaf : https://www.siteleaf.com/
+// Submitted by Skylar Challand <support@siteleaf.com>
+siteleaf.net
+
 // Skyhat : http://www.skyhat.io
 // Submitted by Shante Adam <shante@skyhat.io>
 bounty-full.com
@@ -12451,10 +12499,6 @@
 // Submitted by Stefan Neufeind <info@speedpartner.de>
 customer.speedpartner.de
 
-// Stackspace : https://www.stackspace.io/
-// Submitted by Lina He <info@stackspace.io>
-stackspace.space
-
 // Storj Labs Inc. : https://storj.io/
 // Submitted by Philip Hutchins <hostmaster@storj.io>
 storj.farm
@@ -12495,6 +12539,12 @@
 med.pl
 sopot.pl
 
+// Telebit : https://telebit.cloud
+// Submitted by AJ ONeal <aj@telebit.cloud>
+telebit.app
+telebit.io
+*.telebit.xyz
+
 // The Gwiddle Foundation : https://gwiddlefoundation.org.uk
 // Submitted by Joshua Bayfield <joshua.bayfield@gwiddlefoundation.org.uk>
 gwiddle.co.uk
@@ -12533,7 +12583,7 @@
 webspace.rocks
 lima.zone
 
-// TransIP : htts://www.transip.nl
+// TransIP : https://www.transip.nl
 // Submitted by Rory Breuk <rbreuk@transip.nl>
 *.transurl.be
 *.transurl.eu
--- a/make/test/JtregNativeJdk.gmk	Tue Jul 16 16:20:54 2019 +0000
+++ b/make/test/JtregNativeJdk.gmk	Tue Jul 16 16:24:54 2019 +0000
@@ -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
@@ -61,6 +61,7 @@
   BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := $(WIN_LIB_JAVA)
   WIN_LIB_JLI := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
   BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := $(WIN_LIB_JLI)
+  BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := jvm.lib
 else
   BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava
   BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava
@@ -70,6 +71,7 @@
     BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava -lsocket -lnsl
   endif
   BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := -ljli
+  BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := -ljvm
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
--- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -1455,13 +1455,11 @@
           break;
       }
     } else {
-      if (opr2->is_address()) {
-        DEBUG_ONLY( Unimplemented(); ) // Seems to be unused at the moment.
-        LIR_Address *addr = opr2->as_address_ptr();
-        BasicType type = addr->type();
-        if (type == T_OBJECT) { __ ld(R0, index_or_disp(addr), addr->base()->as_register()); }
-        else                  { __ lwa(R0, index_or_disp(addr), addr->base()->as_register()); }
-        __ cmpd(BOOL_RESULT, opr1->as_register(), R0);
+      assert(opr1->type() != T_ADDRESS && opr2->type() != T_ADDRESS, "currently unsupported");
+      if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) {
+        // There are only equal/notequal comparisons on objects.
+        assert(condition == lir_cond_equal || condition == lir_cond_notEqual, "oops");
+        __ cmpd(BOOL_RESULT, opr1->as_register(), opr2->as_register());
       } else {
         if (unsigned_comp) {
           __ cmplw(BOOL_RESULT, opr1->as_register(), opr2->as_register());
@@ -1497,14 +1495,6 @@
     } else {
       ShouldNotReachHere();
     }
-  } else if (opr1->is_address()) {
-    DEBUG_ONLY( Unimplemented(); ) // Seems to be unused at the moment.
-    LIR_Address * addr = opr1->as_address_ptr();
-    BasicType type = addr->type();
-    assert (opr2->is_constant(), "Checking");
-    if (type == T_OBJECT) { __ ld(R0, index_or_disp(addr), addr->base()->as_register()); }
-    else                  { __ lwa(R0, index_or_disp(addr), addr->base()->as_register()); }
-    __ cmpdi(BOOL_RESULT, R0, opr2->as_constant_ptr()->as_jint());
   } else {
     ShouldNotReachHere();
   }
--- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -2968,9 +2968,8 @@
 
     __ enter();
     __ subptr(rsp, 8 * wordSize);
-    if (multi_block) {
-      __ push(limit);
-    }
+    handleSOERegisters(true /*saving*/);
+
     __ movptr(buf, buf_param);
     __ movptr(state, state_param);
     if (multi_block) {
@@ -2981,9 +2980,7 @@
     __ fast_sha1(abcd, e0, e1, msg0, msg1, msg2, msg3, shuf_mask,
       buf, state, ofs, limit, rsp, multi_block);
 
-    if (multi_block) {
-      __ pop(limit);
-    }
+    handleSOERegisters(false /*restoring*/);
     __ addptr(rsp, 8 * wordSize);
     __ leave();
     __ ret(0);
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -582,8 +582,9 @@
       __ cmpl(flags, ltos);
       __ jcc(Assembler::notEqual, notLong);
       // ltos
+      // Loading high word first because movptr clobbers rax
+      NOT_LP64(__ movptr(rdx, field.plus_disp(4)));
       __ movptr(rax, field);
-      NOT_LP64(__ movptr(rdx, field.plus_disp(4)));
       __ push(ltos);
       __ jmp(Done);
 
@@ -2985,7 +2986,8 @@
   __ jcc(Assembler::notEqual, notDouble);
 #endif
   // dtos
-  __ access_load_at(T_DOUBLE, IN_HEAP, noreg /* dtos */, field, noreg, noreg);
+  // MO_RELAXED: for the case of volatile field, in fact it adds no extra work for the underlying implementation
+  __ access_load_at(T_DOUBLE, IN_HEAP | MO_RELAXED, noreg /* dtos */, field, noreg, noreg);
   __ push(dtos);
   // Rewrite bytecode to be faster
   if (!is_static && rc == may_rewrite) {
@@ -3254,7 +3256,8 @@
   {
     __ pop(ltos);
     if (!is_static) pop_and_check_object(obj);
-    __ access_store_at(T_LONG, IN_HEAP, field, noreg /* ltos*/, noreg, noreg);
+    // MO_RELAXED: generate atomic store for the case of volatile field (important for x86_32)
+    __ access_store_at(T_LONG, IN_HEAP | MO_RELAXED, field, noreg /* ltos*/, noreg, noreg);
 #ifdef _LP64
     if (!is_static && rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_lputfield, bc, rbx, true, byte_no);
@@ -3289,7 +3292,8 @@
   {
     __ pop(dtos);
     if (!is_static) pop_and_check_object(obj);
-    __ access_store_at(T_DOUBLE, IN_HEAP, field, noreg /* dtos */, noreg, noreg);
+    // MO_RELAXED: for the case of volatile field, in fact it adds no extra work for the underlying implementation
+    __ access_store_at(T_DOUBLE, IN_HEAP | MO_RELAXED, field, noreg /* dtos */, noreg, noreg);
     if (!is_static && rc == may_rewrite) {
       patch_bytecode(Bytecodes::_fast_dputfield, bc, rbx, true, byte_no);
     }
--- a/src/hotspot/cpu/x86/vm_version_x86.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/cpu/x86/vm_version_x86.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -901,11 +901,15 @@
     FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
   }
 
+#ifdef _LP64
+  // These are only supported on 64-bit
   if (UseSHA && supports_avx2() && supports_bmi2()) {
     if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) {
       FLAG_SET_DEFAULT(UseSHA512Intrinsics, true);
     }
-  } else if (UseSHA512Intrinsics) {
+  } else
+#endif
+  if (UseSHA512Intrinsics) {
     warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.");
     FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
   }
--- a/src/hotspot/cpu/x86/x86_32.ad	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/cpu/x86/x86_32.ad	Tue Jul 16 16:24:54 2019 +0000
@@ -1309,7 +1309,7 @@
 }
 
 uint MachSpillCopyNode::size(PhaseRegAlloc *ra_) const {
-  return implementation( NULL, ra_, true, NULL );
+  return MachNode::size(ra_);
 }
 
 
--- a/src/hotspot/os/linux/os_linux.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os/linux/os_linux.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -4988,13 +4988,16 @@
     return JNI_ERR;
   }
 
+#if defined(IA32)
+  // Need to ensure we've determined the process's initial stack to
+  // perform the workaround
+  Linux::capture_initial_stack(JavaThread::stack_size_at_create());
+  workaround_expand_exec_shield_cs_limit();
+#else
   suppress_primordial_thread_resolution = Arguments::created_by_java_launcher();
   if (!suppress_primordial_thread_resolution) {
     Linux::capture_initial_stack(JavaThread::stack_size_at_create());
   }
-
-#if defined(IA32)
-  workaround_expand_exec_shield_cs_limit();
 #endif
 
   Linux::libpthread_init();
--- a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -561,8 +561,7 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Aix::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
-  print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
+  print_instructions(st, pc, /*instrsize=*/4);
   st->cr();
 
   // Try to decode the instructions.
--- a/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -1021,8 +1021,8 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Bsd::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" INTPTR_FORMAT ")", (intptr_t)pc);
-  print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
+  print_instructions(st, pc, sizeof(char));
+  st->cr();
 }
 
 void os::print_register_info(outputStream *st, const void *context) {
--- a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -606,8 +606,8 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
-  print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
+  print_instructions(st, pc, sizeof(char));
+  st->cr();
 }
 
 void os::print_register_info(outputStream *st, const void *context) {
--- a/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -543,8 +543,8 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" INTPTR_FORMAT ")", p2i(pc));
-  print_hex_dump(st, pc - 32, pc + 32, Assembler::InstructionSize);
+  print_instructions(st, pc, Assembler::InstructionSize);
+  st->cr();
 }
 
 void os::print_register_info(outputStream *st, const void *context) {
--- a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -574,8 +574,7 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
-  print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
+  print_instructions(st, pc, /*instrsize=*/4);
   st->cr();
 }
 
--- a/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -605,9 +605,7 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  if (Verbose) { st->print_cr("pc at " PTR_FORMAT, p2i(pc)); }
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
-  print_hex_dump(st, pc-64, pc+64, /*intrsize=*/4);
+  print_instructions(st, pc, /*intrsize=*/4);
   st->cr();
 }
 
--- a/src/hotspot/os_cpu/linux_s390/thread_linux_s390.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/linux_s390/thread_linux_s390.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2016 SAP SE. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,7 +63,7 @@
 
     if (ret_frame.is_interpreted_frame()) {
       frame::z_ijava_state* istate = ret_frame.ijava_state_unchecked();
-       if (!((Method*)(istate->method))->is_metaspace_object()) {
+       if ((stack_base() >= (address)istate && (address)istate > stack_end()) || !((Method*)(istate->method))->is_metaspace_object()) {
          return false;
        }
        uint64_t reg_bcp = uc->uc_mcontext.gregs[13/*Z_BCP*/];
--- a/src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -232,8 +232,8 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" INTPTR_FORMAT ")", p2i(pc));
-  print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
+  print_instructions(st, pc, sizeof(char));
+  st->cr();
 }
 
 
--- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -755,8 +755,8 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
-  print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
+  print_instructions(st, pc, sizeof(char));
+  st->cr();
 }
 
 void os::print_register_info(outputStream *st, const void *context) {
@@ -827,6 +827,7 @@
  */
 void os::workaround_expand_exec_shield_cs_limit() {
 #if defined(IA32)
+  assert(Linux::initial_thread_stack_bottom() != NULL, "sanity");
   size_t page_size = os::vm_page_size();
 
   /*
--- a/src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -655,8 +655,8 @@
   // this at the end, and hope for the best.
   ExtendedPC epc = os::Solaris::ucontext_get_ExtendedPC(uc);
   address pc = epc.pc();
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
-  print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
+  print_instructions(st, pc, sizeof(char));
+  st->cr();
 }
 
 void os::print_register_info(outputStream *st, const void *context) {
--- a/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -827,8 +827,8 @@
   // this at the end, and hope for the best.
   ExtendedPC epc = os::Solaris::ucontext_get_ExtendedPC(uc);
   address pc = epc.pc();
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
-  print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
+  print_instructions(st, pc, sizeof(char));
+  st->cr();
 }
 
 void os::print_register_info(outputStream *st, const void *context) {
--- a/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -585,8 +585,7 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = (address)uc->REG_PC;
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
-  print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
+  print_instructions(st, pc, sizeof(char));
   st->cr();
 }
 
--- a/src/hotspot/share/ci/ciMethod.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/ci/ciMethod.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -190,10 +190,11 @@
   // Code size for inlining decisions.
   int code_size_for_inlining();
 
-  bool caller_sensitive()    const { return get_Method()->caller_sensitive();    }
-  bool force_inline()        const { return get_Method()->force_inline();        }
-  bool dont_inline()         const { return get_Method()->dont_inline();         }
-  bool intrinsic_candidate() const { return get_Method()->intrinsic_candidate(); }
+  bool caller_sensitive()      const { return get_Method()->caller_sensitive();      }
+  bool force_inline()          const { return get_Method()->force_inline();          }
+  bool dont_inline()           const { return get_Method()->dont_inline();           }
+  bool intrinsic_candidate()   const { return get_Method()->intrinsic_candidate();   }
+  bool is_static_initializer() const { return get_Method()->is_static_initializer(); }
 
   int comp_level();
   int highest_osr_comp_level();
--- a/src/hotspot/share/code/codeCache.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/code/codeCache.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -948,13 +948,14 @@
 CodeCache::UnloadingScope::UnloadingScope(BoolObjectClosure* is_alive)
   : _is_unloading_behaviour(is_alive)
 {
+  _saved_behaviour = IsUnloadingBehaviour::current();
   IsUnloadingBehaviour::set_current(&_is_unloading_behaviour);
   increment_unloading_cycle();
   DependencyContext::cleaning_start();
 }
 
 CodeCache::UnloadingScope::~UnloadingScope() {
-  IsUnloadingBehaviour::set_current(NULL);
+  IsUnloadingBehaviour::set_current(_saved_behaviour);
   DependencyContext::cleaning_end();
 }
 
--- a/src/hotspot/share/code/codeCache.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/code/codeCache.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -180,6 +180,7 @@
   // "unloading_occurred" controls whether metadata should be cleaned because of class unloading.
   class UnloadingScope: StackObj {
     ClosureIsUnloadingBehaviour _is_unloading_behaviour;
+    IsUnloadingBehaviour*       _saved_behaviour;
 
   public:
     UnloadingScope(BoolObjectClosure* is_alive);
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -91,7 +91,9 @@
 
 void ThreadLocalAllocBuffer::insert_filler() {
   assert(end() != NULL, "Must not be retired");
-  Universe::heap()->fill_with_dummy_object(top(), hard_end(), true);
+  if (top() < hard_end()) {
+    Universe::heap()->fill_with_dummy_object(top(), hard_end(), true);
+  }
 }
 
 void ThreadLocalAllocBuffer::make_parsable() {
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -3400,6 +3400,7 @@
 int ShenandoahEnqueueBarrierNode::needed(Node* n) {
   if (n == NULL ||
       n->is_Allocate() ||
+      n->Opcode() == Op_ShenandoahEnqueueBarrier ||
       n->bottom_type() == TypePtr::NULL_PTR ||
       (n->bottom_type()->make_oopptr() != NULL && n->bottom_type()->make_oopptr()->const_oop() != NULL)) {
     return NotNeeded;
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -46,7 +46,7 @@
     ShenandoahStore,
     ShenandoahValue,
     ShenandoahOopStore,
-    ShenandoahNone,
+    ShenandoahNone
   };
 
   static bool verify_helper(Node* in, Node_Stack& phis, VectorSet& visited, verify_type t, bool trace, Unique_Node_List& barriers_used);
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -75,10 +75,10 @@
   // we hit max_cset. When max_cset is hit, we terminate the cset selection. Note that in this scheme,
   // ShenandoahGarbageThreshold is the soft threshold which would be ignored until min_garbage is hit.
 
-  size_t capacity    = ShenandoahHeap::heap()->capacity();
-  size_t free_target = ShenandoahMinFreeThreshold * capacity / 100;
+  size_t capacity    = ShenandoahHeap::heap()->max_capacity();
+  size_t free_target = capacity / 100 * ShenandoahMinFreeThreshold;
   size_t min_garbage = free_target > actual_free ? (free_target - actual_free) : 0;
-  size_t max_cset    = (size_t)(1.0 * ShenandoahEvacReserve * capacity / 100 / ShenandoahEvacWaste);
+  size_t max_cset    = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste);
 
   log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "M, Actual Free: "
                      SIZE_FORMAT "M, Max CSet: " SIZE_FORMAT "M, Min Garbage: " SIZE_FORMAT "M",
@@ -126,12 +126,12 @@
 
 bool ShenandoahAdaptiveHeuristics::should_start_normal_gc() const {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
-  size_t capacity = heap->capacity();
+  size_t capacity = heap->max_capacity();
   size_t available = heap->free_set()->available();
 
   // Check if we are falling below the worst limit, time to trigger the GC, regardless of
   // anything else.
-  size_t min_threshold = ShenandoahMinFreeThreshold * heap->capacity() / 100;
+  size_t min_threshold = capacity / 100 * ShenandoahMinFreeThreshold;
   if (available < min_threshold) {
     log_info(gc)("Trigger: Free (" SIZE_FORMAT "M) is below minimum threshold (" SIZE_FORMAT "M)",
                  available / M, min_threshold / M);
@@ -141,7 +141,7 @@
   // Check if are need to learn a bit about the application
   const size_t max_learn = ShenandoahLearningSteps;
   if (_gc_times_learned < max_learn) {
-    size_t init_threshold = ShenandoahInitFreeThreshold * heap->capacity() / 100;
+    size_t init_threshold = capacity / 100 * ShenandoahInitFreeThreshold;
     if (available < init_threshold) {
       log_info(gc)("Trigger: Learning " SIZE_FORMAT " of " SIZE_FORMAT ". Free (" SIZE_FORMAT "M) is below initial threshold (" SIZE_FORMAT "M)",
                    _gc_times_learned + 1, max_learn, available / M, init_threshold / M);
@@ -155,8 +155,8 @@
 
   size_t allocation_headroom = available;
 
-  size_t spike_headroom = ShenandoahAllocSpikeFactor * capacity / 100;
-  size_t penalties      = _gc_time_penalties         * capacity / 100;
+  size_t spike_headroom = capacity / 100 * ShenandoahAllocSpikeFactor;
+  size_t penalties      = capacity / 100 * _gc_time_penalties;
 
   allocation_headroom -= MIN2(allocation_headroom, spike_headroom);
   allocation_headroom -= MIN2(allocation_headroom, penalties);
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -55,9 +55,11 @@
 bool ShenandoahCompactHeuristics::should_start_normal_gc() const {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
 
+  size_t capacity = heap->max_capacity();
   size_t available = heap->free_set()->available();
-  size_t threshold_bytes_allocated = heap->capacity() * ShenandoahAllocationThreshold / 100;
-  size_t min_threshold = ShenandoahMinFreeThreshold * heap->capacity() / 100;
+
+  size_t threshold_bytes_allocated = capacity / 100 * ShenandoahAllocationThreshold;
+  size_t min_threshold = capacity / 100 * ShenandoahMinFreeThreshold;
 
   if (available < min_threshold) {
     log_info(gc)("Trigger: Free (" SIZE_FORMAT "M) is below minimum threshold (" SIZE_FORMAT "M)",
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -84,8 +84,8 @@
 
   // Do not select too large CSet that would overflow the available free space.
   // Take at least the entire evacuation reserve, and be free to overflow to free space.
-  size_t capacity  = ShenandoahHeap::heap()->capacity();
-  size_t available = MAX2(ShenandoahEvacReserve * capacity / 100, actual_free);
+  size_t capacity  = ShenandoahHeap::heap()->max_capacity();
+  size_t available = MAX2(capacity / 100 * ShenandoahEvacReserve, actual_free);
   size_t max_cset  = (size_t)(available / ShenandoahEvacWaste);
 
   log_info(gc, ergo)("CSet Selection. Actual Free: " SIZE_FORMAT "M, Max CSet: " SIZE_FORMAT "M",
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -55,9 +55,9 @@
 bool ShenandoahStaticHeuristics::should_start_normal_gc() const {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
 
-  size_t capacity = heap->capacity();
+  size_t capacity = heap->max_capacity();
   size_t available = heap->free_set()->available();
-  size_t threshold_available = (capacity * ShenandoahFreeThreshold) / 100;
+  size_t threshold_available = capacity / 100 * ShenandoahFreeThreshold;
 
   if (available < threshold_available) {
     log_info(gc)("Trigger: Free (" SIZE_FORMAT "M) is below free threshold (" SIZE_FORMAT "M)",
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -127,11 +127,11 @@
   // The significant complication is that liveness data was collected at the previous cycle, and only
   // for those regions that were allocated before previous cycle started.
 
-  size_t capacity    = heap->capacity();
+  size_t capacity    = heap->max_capacity();
   size_t actual_free = heap->free_set()->available();
-  size_t free_target = ShenandoahMinFreeThreshold * capacity / 100;
+  size_t free_target = capacity / 100 * ShenandoahMinFreeThreshold;
   size_t min_garbage = free_target > actual_free ? (free_target - actual_free) : 0;
-  size_t max_cset    = (size_t)(1.0 * ShenandoahEvacReserve * capacity / 100 / ShenandoahEvacWaste);
+  size_t max_cset    = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste);
 
   log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "M, Actual Free: "
                      SIZE_FORMAT "M, Max CSet: " SIZE_FORMAT "M, Min Garbage: " SIZE_FORMAT "M",
@@ -216,12 +216,12 @@
   ShenandoahHeap* heap = ShenandoahHeap::heap();
   assert(!heap->has_forwarded_objects(), "no forwarded objects here");
 
-  size_t capacity = heap->capacity();
+  size_t capacity = heap->max_capacity();
   size_t available = heap->free_set()->available();
 
   // Check if we are falling below the worst limit, time to trigger the GC, regardless of
   // anything else.
-  size_t min_threshold = ShenandoahMinFreeThreshold * heap->capacity() / 100;
+  size_t min_threshold = capacity / 100 * ShenandoahMinFreeThreshold;
   if (available < min_threshold) {
     log_info(gc)("Trigger: Free (" SIZE_FORMAT "M) is below minimum threshold (" SIZE_FORMAT "M)",
                  available / M, min_threshold / M);
@@ -231,7 +231,7 @@
   // Check if are need to learn a bit about the application
   const size_t max_learn = ShenandoahLearningSteps;
   if (_gc_times_learned < max_learn) {
-    size_t init_threshold = ShenandoahInitFreeThreshold * heap->capacity() / 100;
+    size_t init_threshold = capacity / 100 * ShenandoahInitFreeThreshold;
     if (available < init_threshold) {
       log_info(gc)("Trigger: Learning " SIZE_FORMAT " of " SIZE_FORMAT ". Free (" SIZE_FORMAT "M) is below initial threshold (" SIZE_FORMAT "M)",
                    _gc_times_learned + 1, max_learn, available / M, init_threshold / M);
@@ -245,8 +245,8 @@
 
   size_t allocation_headroom = available;
 
-  size_t spike_headroom = ShenandoahAllocSpikeFactor * capacity / 100;
-  size_t penalties      = _gc_time_penalties         * capacity / 100;
+  size_t spike_headroom = capacity / 100 * ShenandoahAllocSpikeFactor;
+  size_t penalties      = capacity / 100 * _gc_time_penalties;
 
   allocation_headroom -= MIN2(allocation_headroom, spike_headroom);
   allocation_headroom -= MIN2(allocation_headroom, penalties);
--- a/src/hotspot/share/gc/shenandoah/shenandoahAllocRequest.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahAllocRequest.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -33,7 +33,7 @@
     _alloc_shared_gc,   // Allocate common, outside of GCLAB
     _alloc_tlab,        // Allocate TLAB
     _alloc_gclab,       // Allocate GCLAB
-    _ALLOC_LIMIT,
+    _ALLOC_LIMIT
   };
 
   static const char* alloc_type_to_string(Type type) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -29,7 +29,6 @@
 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
-#include "gc/shenandoah/shenandoahTaskqueue.hpp"
 #include "utilities/defaultStream.hpp"
 
 void ShenandoahArguments::initialize() {
@@ -55,17 +54,6 @@
   FLAG_SET_DEFAULT(ShenandoahCloneBarrier,           false);
 #endif
 
-#ifdef _LP64
-  // The optimized ObjArrayChunkedTask takes some bits away from the full 64 addressable
-  // bits, fail if we ever attempt to address more than we can. Only valid on 64bit.
-  if (MaxHeapSize >= ObjArrayChunkedTask::max_addressable()) {
-    jio_fprintf(defaultStream::error_stream(),
-                "Shenandoah GC cannot address more than " SIZE_FORMAT " bytes, and " SIZE_FORMAT " bytes heap requested.",
-                ObjArrayChunkedTask::max_addressable(), MaxHeapSize);
-    vm_exit(1);
-  }
-#endif
-
   if (UseLargePages && (MaxHeapSize / os::large_page_size()) < ShenandoahHeapRegion::MIN_NUM_REGIONS) {
     warning("Large pages size (" SIZE_FORMAT "K) is too large to afford page-sized regions, disabling uncommit",
             os::large_page_size() / K);
@@ -159,6 +147,11 @@
     FLAG_SET_DEFAULT(ShenandoahUncommit, false);
   }
 
+  if ((InitialHeapSize == MaxHeapSize) && ShenandoahUncommit) {
+    log_info(gc)("Min heap equals to max heap, disabling ShenandoahUncommit");
+    FLAG_SET_DEFAULT(ShenandoahUncommit, false);
+  }
+
   // If class unloading is disabled, no unloading for concurrent cycles as well.
   // If class unloading is enabled, users should opt-in for unloading during
   // concurrent cycles.
--- a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -35,7 +35,7 @@
     _safe_unknown,
     _safe_oop,
     _safe_oop_fwd,
-    _safe_all,
+    _safe_all
   };
 
   static void print_obj(ShenandoahMessageBuffer &msg, oop obj);
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -32,12 +32,13 @@
 class ShenandoahBarrierSetAssembler;
 
 class ShenandoahBarrierSet: public BarrierSet {
-private:
+public:
   enum ArrayCopyStoreValMode {
     NONE,
     READ_BARRIER,
     WRITE_BARRIER
   };
+private:
 
   ShenandoahHeap* _heap;
   ShenandoahSATBMarkQueueSet _satb_mark_queue_set;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahClosures.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ *
+ */
+#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP
+#define SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP
+
+#include "memory/iterator.hpp"
+
+class ShenandoahHeap;
+class ShenandoahMarkingContext;
+class Thread;
+
+class ShenandoahForwardedIsAliveClosure: public BoolObjectClosure {
+private:
+  ShenandoahMarkingContext* const _mark_context;
+public:
+  inline ShenandoahForwardedIsAliveClosure();
+  inline bool do_object_b(oop obj);
+};
+
+class ShenandoahIsAliveClosure: public BoolObjectClosure {
+private:
+  ShenandoahMarkingContext* const _mark_context;
+public:
+  inline ShenandoahIsAliveClosure();
+  inline bool do_object_b(oop obj);
+};
+
+class ShenandoahIsAliveSelector : public StackObj {
+private:
+  ShenandoahIsAliveClosure _alive_cl;
+  ShenandoahForwardedIsAliveClosure _fwd_alive_cl;
+public:
+  inline BoolObjectClosure* is_alive_closure();
+};
+
+class ShenandoahUpdateRefsClosure: public OopClosure {
+private:
+  ShenandoahHeap* _heap;
+public:
+  inline ShenandoahUpdateRefsClosure();
+  inline void do_oop(oop* p);
+  inline void do_oop(narrowOop* p);
+private:
+  template <class T>
+  inline void do_oop_work(T* p);
+};
+
+class ShenandoahEvacuateUpdateRootsClosure: public BasicOopIterateClosure {
+private:
+  ShenandoahHeap* _heap;
+  Thread* _thread;
+public:
+  inline ShenandoahEvacuateUpdateRootsClosure();
+  inline void do_oop(oop* p);
+  inline void do_oop(narrowOop* p);
+
+private:
+  template <class T>
+  inline void do_oop_work(T* p);
+};
+
+#endif // SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ *
+ */
+#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_INLINE_HPP
+#define SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_INLINE_HPP
+
+#include "gc/shenandoah/shenandoahAsserts.hpp"
+#include "gc/shenandoah/shenandoahClosures.hpp"
+#include "gc/shenandoah/shenandoahHeap.inline.hpp"
+#include "oops/compressedOops.inline.hpp"
+#include "runtime/thread.hpp"
+
+ShenandoahForwardedIsAliveClosure::ShenandoahForwardedIsAliveClosure() :
+  _mark_context(ShenandoahHeap::heap()->marking_context()) {
+}
+
+bool ShenandoahForwardedIsAliveClosure::do_object_b(oop obj) {
+  if (CompressedOops::is_null(obj)) {
+    return false;
+  }
+  obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
+  shenandoah_assert_not_forwarded_if(NULL, obj,
+                                     (ShenandoahHeap::heap()->is_concurrent_mark_in_progress() ||
+                                     ShenandoahHeap::heap()->is_concurrent_traversal_in_progress()));
+  return _mark_context->is_marked(obj);
+}
+
+ShenandoahIsAliveClosure::ShenandoahIsAliveClosure() :
+  _mark_context(ShenandoahHeap::heap()->marking_context()) {
+}
+
+bool ShenandoahIsAliveClosure::do_object_b(oop obj) {
+  if (CompressedOops::is_null(obj)) {
+    return false;
+  }
+  shenandoah_assert_not_forwarded(NULL, obj);
+  return _mark_context->is_marked(obj);
+}
+
+BoolObjectClosure* ShenandoahIsAliveSelector::is_alive_closure() {
+  return ShenandoahHeap::heap()->has_forwarded_objects() ?
+         reinterpret_cast<BoolObjectClosure*>(&_fwd_alive_cl) :
+         reinterpret_cast<BoolObjectClosure*>(&_alive_cl);
+}
+
+ShenandoahUpdateRefsClosure::ShenandoahUpdateRefsClosure() :
+  _heap(ShenandoahHeap::heap()) {
+}
+
+template <class T>
+void ShenandoahUpdateRefsClosure::do_oop_work(T* p) {
+  T o = RawAccess<>::oop_load(p);
+  if (!CompressedOops::is_null(o)) {
+    oop obj = CompressedOops::decode_not_null(o);
+    _heap->update_with_forwarded_not_null(p, obj);
+  }
+}
+
+void ShenandoahUpdateRefsClosure::do_oop(oop* p)       { do_oop_work(p); }
+void ShenandoahUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); }
+
+ShenandoahEvacuateUpdateRootsClosure::ShenandoahEvacuateUpdateRootsClosure() :
+  _heap(ShenandoahHeap::heap()), _thread(Thread::current()) {
+}
+
+template <class T>
+void ShenandoahEvacuateUpdateRootsClosure::do_oop_work(T* p) {
+  assert(_heap->is_evacuation_in_progress(), "Only do this when evacuation is in progress");
+
+  T o = RawAccess<>::oop_load(p);
+  if (! CompressedOops::is_null(o)) {
+    oop obj = CompressedOops::decode_not_null(o);
+    if (_heap->in_collection_set(obj)) {
+      shenandoah_assert_marked(p, obj);
+      oop resolved = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
+      if (oopDesc::equals_raw(resolved, obj)) {
+        resolved = _heap->evacuate_object(obj, _thread);
+      }
+      RawAccess<IS_NOT_NULL>::oop_store(p, resolved);
+    }
+  }
+}
+void ShenandoahEvacuateUpdateRootsClosure::do_oop(oop* p) {
+  do_oop_work(p);
+}
+
+void ShenandoahEvacuateUpdateRootsClosure::do_oop(narrowOop* p) {
+  do_oop_work(p);
+}
+
+#endif // SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP
--- a/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -28,24 +28,54 @@
 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
 #include "gc/shenandoah/shenandoahUtils.hpp"
 #include "runtime/atomic.hpp"
+#include "services/memTracker.hpp"
 #include "utilities/copy.hpp"
 
-ShenandoahCollectionSet::ShenandoahCollectionSet(ShenandoahHeap* heap, HeapWord* heap_base) :
+ShenandoahCollectionSet::ShenandoahCollectionSet(ShenandoahHeap* heap, char* heap_base, size_t size) :
   _map_size(heap->num_regions()),
   _region_size_bytes_shift(ShenandoahHeapRegion::region_size_bytes_shift()),
-  _cset_map(NEW_C_HEAP_ARRAY(jbyte, _map_size, mtGC)),
-  _biased_cset_map(_cset_map - ((uintx)heap_base >> _region_size_bytes_shift)),
+  _map_space(align_up(((uintx)heap_base + size) >> _region_size_bytes_shift, os::vm_allocation_granularity())),
+  _cset_map(_map_space.base() + ((uintx)heap_base >> _region_size_bytes_shift)),
+  _biased_cset_map(_map_space.base()),
   _heap(heap),
   _garbage(0),
   _live_data(0),
   _used(0),
   _region_count(0),
   _current_index(0) {
-  // Use 1-byte data type
-  STATIC_ASSERT(sizeof(jbyte) == 1);
 
-  // Initialize cset map
+  // The collection set map is reserved to cover the entire heap *and* zero addresses.
+  // This is needed to accept in-cset checks for both heap oops and NULLs, freeing
+  // high-performance code from checking for NULL first.
+  //
+  // Since heap_base can be far away, committing the entire map would waste memory.
+  // Therefore, we only commit the parts that are needed to operate: the heap view,
+  // and the zero page.
+  //
+  // Note: we could instead commit the entire map, and piggyback on OS virtual memory
+  // subsystem for mapping not-yet-written-to pages to a single physical backing page,
+  // but this is not guaranteed, and would confuse NMT and other memory accounting tools.
+
+  MemTracker::record_virtual_memory_type(_map_space.base(), mtGC);
+
+  size_t page_size = (size_t)os::vm_page_size();
+
+  if (!_map_space.special()) {
+    // Commit entire pages that cover the heap cset map.
+    char* bot_addr = align_down(_cset_map, page_size);
+    char* top_addr = align_up(_cset_map + _map_size, page_size);
+    os::commit_memory_or_exit(bot_addr, pointer_delta(top_addr, bot_addr, 1), false,
+                              "Unable to commit collection set bitmap: heap");
+
+    // Commit the zero page, if not yet covered by heap cset map.
+    if (bot_addr != _biased_cset_map) {
+      os::commit_memory_or_exit(_biased_cset_map, page_size, false,
+                                "Unable to commit collection set bitmap: zero page");
+    }
+  }
+
   Copy::zero_to_bytes(_cset_map, _map_size);
+  Copy::zero_to_bytes(_biased_cset_map, page_size);
 }
 
 void ShenandoahCollectionSet::add_region(ShenandoahHeapRegion* r) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -33,9 +33,10 @@
 private:
   size_t const          _map_size;
   size_t const          _region_size_bytes_shift;
-  jbyte* const          _cset_map;
+  ReservedSpace         _map_space;
+  char* const           _cset_map;
   // Bias cset map's base address for fast test if an oop is in cset
-  jbyte* const          _biased_cset_map;
+  char* const           _biased_cset_map;
 
   ShenandoahHeap* const _heap;
 
@@ -49,7 +50,7 @@
   DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, 0);
 
 public:
-  ShenandoahCollectionSet(ShenandoahHeap* heap, HeapWord* heap_base);
+  ShenandoahCollectionSet(ShenandoahHeap* heap, char* heap_base, size_t size);
 
   // Add region to collection set
   void add_region(ShenandoahHeapRegion* r);
@@ -88,7 +89,10 @@
   void clear();
 
 private:
-  jbyte* biased_map_address() const {
+  char* map_address() const {
+    return _cset_map;
+  }
+  char* biased_map_address() const {
     return _biased_cset_map;
   }
 };
--- a/src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -42,7 +42,7 @@
 
   Copy::zero_to_bytes(_degen_points, sizeof(size_t) * ShenandoahHeap::_DEGENERATED_LIMIT);
 
-  ShenandoahHeapRegion::setup_sizes(initial_heap_byte_size(), max_heap_byte_size());
+  ShenandoahHeapRegion::setup_sizes(max_heap_byte_size());
 
   initialize_all();
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -33,6 +33,7 @@
 #include "gc/shared/referenceProcessorPhaseTimes.hpp"
 
 #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
+#include "gc/shenandoah/shenandoahClosures.inline.hpp"
 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
--- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -462,9 +462,11 @@
 void ShenandoahControlThread::service_uncommit(double shrink_before) {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
 
-  // Scan through the heap and determine if there is work to do. This avoids taking
-  // heap lock if there is no work available, avoids spamming logs with superfluous
-  // logging messages, and minimises the amount of work while locks are taken.
+  // Determine if there is work to do. This avoids taking heap lock if there is
+  // no work available, avoids spamming logs with superfluous logging messages,
+  // and minimises the amount of work while locks are taken.
+
+  if (heap->committed() <= heap->min_capacity()) return;
 
   bool has_work = false;
   for (size_t i = 0; i < heap->num_regions(); i++) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -59,7 +59,7 @@
     concurrent_traversal,
     concurrent_normal,
     stw_degenerated,
-    stw_full,
+    stw_full
   } GCMode;
 
   // While we could have a single lock for these, it may risk unblocking
--- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -430,7 +430,7 @@
   }
 
   // Evac reserve: reserve trailing space for evacuations
-  size_t to_reserve = ShenandoahEvacReserve * _heap->capacity() / 100;
+  size_t to_reserve = _heap->max_capacity() / 100 * ShenandoahEvacReserve;
   size_t reserved = 0;
 
   for (size_t idx = _heap->num_regions() - 1; idx > 0; idx--) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -33,6 +33,7 @@
 #include "gc/shenandoah/shenandoahAllocTracker.hpp"
 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
 #include "gc/shenandoah/shenandoahBrooksPointer.hpp"
+#include "gc/shenandoah/shenandoahClosures.inline.hpp"
 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
@@ -51,6 +52,7 @@
 #include "gc/shenandoah/shenandoahPacer.inline.hpp"
 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
 #include "gc/shenandoah/shenandoahStringDedup.hpp"
+#include "gc/shenandoah/shenandoahTaskqueue.hpp"
 #include "gc/shenandoah/shenandoahUtils.hpp"
 #include "gc/shenandoah/shenandoahVerifier.hpp"
 #include "gc/shenandoah/shenandoahCodeRoots.hpp"
@@ -68,8 +70,6 @@
 #include "runtime/vmThread.hpp"
 #include "services/mallocTracker.hpp"
 
-ShenandoahUpdateRefsClosure::ShenandoahUpdateRefsClosure() : _heap(ShenandoahHeap::heap()) {}
-
 #ifdef ASSERT
 template <class T>
 void ShenandoahAssertToSpaceClosure::do_oop_work(T* p) {
@@ -139,6 +139,7 @@
   //
 
   size_t init_byte_size = collector_policy()->initial_heap_byte_size();
+  size_t min_byte_size  = collector_policy()->min_heap_byte_size();
   size_t max_byte_size  = collector_policy()->max_heap_byte_size();
   size_t heap_alignment = collector_policy()->heap_alignment();
 
@@ -157,8 +158,13 @@
   size_t num_committed_regions = init_byte_size / reg_size_bytes;
   num_committed_regions = MIN2(num_committed_regions, _num_regions);
   assert(num_committed_regions <= _num_regions, "sanity");
-
   _initial_size = num_committed_regions * reg_size_bytes;
+
+  size_t num_min_regions = min_byte_size / reg_size_bytes;
+  num_min_regions = MIN2(num_min_regions, _num_regions);
+  assert(num_min_regions <= _num_regions, "sanity");
+  _minimum_size = num_min_regions * reg_size_bytes;
+
   _committed = _initial_size;
 
   size_t heap_page_size   = UseLargePages ? (size_t)os::large_page_size() : (size_t)os::vm_page_size();
@@ -176,6 +182,18 @@
   assert((((size_t) base()) & ShenandoahHeapRegion::region_size_bytes_mask()) == 0,
          "Misaligned heap: " PTR_FORMAT, p2i(base()));
 
+#if SHENANDOAH_OPTIMIZED_OBJTASK
+  // The optimized ObjArrayChunkedTask takes some bits away from the full object bits.
+  // Fail if we ever attempt to address more than we can.
+  if ((uintptr_t)heap_rs.end() >= ObjArrayChunkedTask::max_addressable()) {
+    FormatBuffer<512> buf("Shenandoah reserved [" PTR_FORMAT ", " PTR_FORMAT") for the heap, \n"
+                          "but max object address is " PTR_FORMAT ". Try to reduce heap size, or try other \n"
+                          "VM options that allocate heap at lower addresses (HeapBaseMinAddress, AllocateHeapAt, etc).",
+                p2i(heap_rs.base()), p2i(heap_rs.end()), ObjArrayChunkedTask::max_addressable());
+    vm_exit_during_initialization("Fatal Error", buf);
+  }
+#endif
+
   ReservedSpace sh_rs = heap_rs.first_part(max_byte_size);
   if (!_heap_region_special) {
     os::commit_memory_or_exit(sh_rs.base(), _initial_size, heap_alignment, false,
@@ -252,7 +270,7 @@
 
   _regions = NEW_C_HEAP_ARRAY(ShenandoahHeapRegion*, _num_regions, mtGC);
   _free_set = new ShenandoahFreeSet(this, _num_regions);
-  _collection_set = new ShenandoahCollectionSet(this, (HeapWord*)sh_rs.base());
+  _collection_set = new ShenandoahCollectionSet(this, sh_rs.base(), sh_rs.size());
 
   {
     ShenandoahHeapLocker locker(lock());
@@ -350,8 +368,11 @@
 
   _control_thread = new ShenandoahControlThread();
 
-  log_info(gc, init)("Initialize Shenandoah heap with initial size " SIZE_FORMAT "%s",
-                     byte_size_in_proper_unit(_initial_size), proper_unit_for_byte_size(_initial_size));
+  log_info(gc, init)("Initialize Shenandoah heap: " SIZE_FORMAT "%s initial, " SIZE_FORMAT "%s min, " SIZE_FORMAT "%s max",
+                     byte_size_in_proper_unit(_initial_size),  proper_unit_for_byte_size(_initial_size),
+                     byte_size_in_proper_unit(_minimum_size),  proper_unit_for_byte_size(_minimum_size),
+                     byte_size_in_proper_unit(max_capacity()), proper_unit_for_byte_size(max_capacity())
+  );
 
   log_info(gc, init)("Safepointing mechanism: %s",
                      SafepointMechanism::uses_thread_local_poll() ? "thread-local poll" :
@@ -504,7 +525,7 @@
 void ShenandoahHeap::print_on(outputStream* st) const {
   st->print_cr("Shenandoah Heap");
   st->print_cr(" " SIZE_FORMAT "K total, " SIZE_FORMAT "K committed, " SIZE_FORMAT "K used",
-               capacity() / K, committed() / K, used() / K);
+               max_capacity() / K, committed() / K, used() / K);
   st->print_cr(" " SIZE_FORMAT " x " SIZE_FORMAT"K regions",
                num_regions(), ShenandoahHeapRegion::region_size_bytes() / K);
 
@@ -530,6 +551,15 @@
                p2i(reserved_region().start()),
                p2i(reserved_region().end()));
 
+  ShenandoahCollectionSet* cset = collection_set();
+  st->print_cr("Collection set:");
+  if (cset != NULL) {
+    st->print_cr(" - map (vanilla): " PTR_FORMAT, p2i(cset->map_address()));
+    st->print_cr(" - map (biased):  " PTR_FORMAT, p2i(cset->biased_map_address()));
+  } else {
+    st->print_cr(" (NULL)");
+  }
+
   st->cr();
   MetaspaceUtils::print_on(st);
 
@@ -617,13 +647,17 @@
 }
 
 size_t ShenandoahHeap::capacity() const {
-  return num_regions() * ShenandoahHeapRegion::region_size_bytes();
+  return committed();
 }
 
 size_t ShenandoahHeap::max_capacity() const {
   return _num_regions * ShenandoahHeapRegion::region_size_bytes();
 }
 
+size_t ShenandoahHeap::min_capacity() const {
+  return _minimum_size;
+}
+
 size_t ShenandoahHeap::initial_capacity() const {
   return _initial_size;
 }
@@ -637,12 +671,22 @@
 void ShenandoahHeap::op_uncommit(double shrink_before) {
   assert (ShenandoahUncommit, "should be enabled");
 
+  // Application allocates from the beginning of the heap, and GC allocates at
+  // the end of it. It is more efficient to uncommit from the end, so that applications
+  // could enjoy the near committed regions. GC allocations are much less frequent,
+  // and therefore can accept the committing costs.
+
   size_t count = 0;
-  for (size_t i = 0; i < num_regions(); i++) {
-    ShenandoahHeapRegion* r = get_region(i);
+  for (size_t i = num_regions(); i > 0; i--) { // care about size_t underflow
+    ShenandoahHeapRegion* r = get_region(i - 1);
     if (r->is_empty_committed() && (r->empty_time() < shrink_before)) {
       ShenandoahHeapLocker locker(lock());
       if (r->is_empty_committed()) {
+        // Do not uncommit below minimal capacity
+        if (committed() < min_capacity() + ShenandoahHeapRegion::region_size_bytes()) {
+          break;
+        }
+
         r->make_uncommitted();
         count++;
       }
@@ -651,8 +695,6 @@
   }
 
   if (count > 0) {
-    log_info(gc)("Uncommitted " SIZE_FORMAT "M. Heap: " SIZE_FORMAT "M reserved, " SIZE_FORMAT "M committed, " SIZE_FORMAT "M used",
-                 count * ShenandoahHeapRegion::region_size_bytes() / M, capacity() / M, committed() / M, used() / M);
     control_thread()->notify_heap_changed();
   }
 }
@@ -920,43 +962,6 @@
   return CollectedHeap::min_dummy_object_size() + ShenandoahBrooksPointer::word_size();
 }
 
-class ShenandoahEvacuateUpdateRootsClosure: public BasicOopIterateClosure {
-private:
-  ShenandoahHeap* _heap;
-  Thread* _thread;
-public:
-  ShenandoahEvacuateUpdateRootsClosure() :
-    _heap(ShenandoahHeap::heap()), _thread(Thread::current()) {
-  }
-
-private:
-  template <class T>
-  void do_oop_work(T* p) {
-    assert(_heap->is_evacuation_in_progress(), "Only do this when evacuation is in progress");
-
-    T o = RawAccess<>::oop_load(p);
-    if (! CompressedOops::is_null(o)) {
-      oop obj = CompressedOops::decode_not_null(o);
-      if (_heap->in_collection_set(obj)) {
-        shenandoah_assert_marked(p, obj);
-        oop resolved = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
-        if (oopDesc::equals_raw(resolved, obj)) {
-          resolved = _heap->evacuate_object(obj, _thread);
-        }
-        RawAccess<IS_NOT_NULL>::oop_store(p, resolved);
-      }
-    }
-  }
-
-public:
-  void do_oop(oop* p) {
-    do_oop_work(p);
-  }
-  void do_oop(narrowOop* p) {
-    do_oop_work(p);
-  }
-};
-
 class ShenandoahConcurrentEvacuateRegionObjectClosure : public ObjectClosure {
 private:
   ShenandoahHeap* const _heap;
@@ -1223,7 +1228,9 @@
 
 void ShenandoahHeap::gc_threads_do(ThreadClosure* tcl) const {
   workers()->threads_do(tcl);
-  _safepoint_workers->threads_do(tcl);
+  if (_safepoint_workers != NULL) {
+    _safepoint_workers->threads_do(tcl);
+  }
   if (ShenandoahStringDedup::is_enabled()) {
     ShenandoahStringDedup::threads_do(tcl);
   }
@@ -1564,6 +1571,10 @@
       if (ShenandoahPacing) {
         pacer()->setup_for_evac();
       }
+
+      if (ShenandoahVerify) {
+        verifier()->verify_during_evacuation();
+      }
     } else {
       if (ShenandoahVerify) {
         verifier()->verify_after_concmark();
@@ -1871,31 +1882,6 @@
   return result;
 }
 
-ShenandoahForwardedIsAliveClosure::ShenandoahForwardedIsAliveClosure() :
-  _mark_context(ShenandoahHeap::heap()->marking_context()) {
-}
-
-ShenandoahIsAliveClosure::ShenandoahIsAliveClosure() :
-  _mark_context(ShenandoahHeap::heap()->marking_context()) {
-}
-
-bool ShenandoahForwardedIsAliveClosure::do_object_b(oop obj) {
-  if (CompressedOops::is_null(obj)) {
-    return false;
-  }
-  obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
-  shenandoah_assert_not_forwarded_if(NULL, obj, ShenandoahHeap::heap()->is_concurrent_mark_in_progress() || ShenandoahHeap::heap()->is_concurrent_traversal_in_progress());
-  return _mark_context->is_marked(obj);
-}
-
-bool ShenandoahIsAliveClosure::do_object_b(oop obj) {
-  if (CompressedOops::is_null(obj)) {
-    return false;
-  }
-  shenandoah_assert_not_forwarded(NULL, obj);
-  return _mark_context->is_marked(obj);
-}
-
 void ShenandoahHeap::ref_processing_init() {
   assert(_max_workers > 0, "Sanity");
 
@@ -2853,8 +2839,3 @@
 ptrdiff_t ShenandoahHeap::cell_header_size() const {
   return ShenandoahBrooksPointer::byte_size();
 }
-
-BoolObjectClosure* ShenandoahIsAliveSelector::is_alive_closure() {
-  return ShenandoahHeap::heap()->has_forwarded_objects() ? reinterpret_cast<BoolObjectClosure*>(&_fwd_alive_cl)
-                                                         : reinterpret_cast<BoolObjectClosure*>(&_alive_cl);
-}
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -91,19 +91,6 @@
   virtual bool is_thread_safe() { return false; }
 };
 
-class ShenandoahUpdateRefsClosure: public OopClosure {
-private:
-  ShenandoahHeap* _heap;
-
-  template <class T>
-  inline void do_oop_work(T* p);
-
-public:
-  ShenandoahUpdateRefsClosure();
-  inline void do_oop(oop* p);
-  inline void do_oop(narrowOop* p);
-};
-
 #ifdef ASSERT
 class ShenandoahAssertToSpaceClosure : public OopClosure {
 private:
@@ -115,34 +102,6 @@
 };
 #endif
 
-class ShenandoahAlwaysTrueClosure : public BoolObjectClosure {
-public:
-  bool do_object_b(oop p) { return true; }
-};
-
-class ShenandoahForwardedIsAliveClosure: public BoolObjectClosure {
-private:
-  ShenandoahMarkingContext* const _mark_context;
-public:
-  ShenandoahForwardedIsAliveClosure();
-  bool do_object_b(oop obj);
-};
-
-class ShenandoahIsAliveClosure: public BoolObjectClosure {
-private:
-  ShenandoahMarkingContext* const _mark_context;
-public:
-  ShenandoahIsAliveClosure();
-  bool do_object_b(oop obj);
-};
-
-class ShenandoahIsAliveSelector : public StackObj {
-private:
-  ShenandoahIsAliveClosure _alive_cl;
-  ShenandoahForwardedIsAliveClosure _fwd_alive_cl;
-public:
-  BoolObjectClosure* is_alive_closure();
-};
 
 // Shenandoah GC is low-pause concurrent GC that uses Brooks forwarding pointers
 // to encode forwarding data. See BrooksPointer for details on forwarding data encoding.
@@ -198,6 +157,7 @@
 //
 private:
            size_t _initial_size;
+           size_t _minimum_size;
   DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
   volatile size_t _used;
   volatile size_t _committed;
@@ -216,6 +176,7 @@
   size_t bytes_allocated_since_gc_start();
   void reset_bytes_allocated_since_gc_start();
 
+  size_t min_capacity()     const;
   size_t max_capacity()     const;
   size_t initial_capacity() const;
   size_t capacity()         const;
@@ -283,7 +244,7 @@
     UPDATEREFS_BITPOS = 3,
 
     // Heap is under traversal collection
-    TRAVERSAL_BITPOS  = 4,
+    TRAVERSAL_BITPOS  = 4
   };
 
   enum GCState {
@@ -292,7 +253,7 @@
     MARKING       = 1 << MARKING_BITPOS,
     EVACUATION    = 1 << EVACUATION_BITPOS,
     UPDATEREFS    = 1 << UPDATEREFS_BITPOS,
-    TRAVERSAL     = 1 << TRAVERSAL_BITPOS,
+    TRAVERSAL     = 1 << TRAVERSAL_BITPOS
   };
 
 private:
@@ -342,7 +303,7 @@
     _degenerated_mark,
     _degenerated_evac,
     _degenerated_updaterefs,
-    _DEGENERATED_LIMIT,
+    _DEGENERATED_LIMIT
   };
 
   static const char* degen_point_to_string(ShenandoahDegenPoint point) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -49,17 +49,6 @@
 #include "utilities/copy.hpp"
 #include "utilities/globalDefinitions.hpp"
 
-template <class T>
-void ShenandoahUpdateRefsClosure::do_oop_work(T* p) {
-  T o = RawAccess<>::oop_load(p);
-  if (!CompressedOops::is_null(o)) {
-    oop obj = CompressedOops::decode_not_null(o);
-    _heap->update_with_forwarded_not_null(p, obj);
-  }
-}
-
-void ShenandoahUpdateRefsClosure::do_oop(oop* p)       { do_oop_work(p); }
-void ShenandoahUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); }
 
 inline ShenandoahHeapRegion* ShenandoahRegionIterator::next() {
   size_t new_index = Atomic::add((size_t) 1, &_index);
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -516,7 +516,7 @@
   }
 }
 
-void ShenandoahHeapRegion::setup_sizes(size_t initial_heap_size, size_t max_heap_size) {
+void ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) {
   // Absolute minimums we should not ever break.
   static const size_t MIN_REGION_SIZE = 256*K;
 
@@ -526,10 +526,10 @@
 
   size_t region_size;
   if (FLAG_IS_DEFAULT(ShenandoahHeapRegionSize)) {
-    if (ShenandoahMinRegionSize > initial_heap_size / MIN_NUM_REGIONS) {
-      err_msg message("Initial heap size (" SIZE_FORMAT "K) is too low to afford the minimum number "
+    if (ShenandoahMinRegionSize > max_heap_size / MIN_NUM_REGIONS) {
+      err_msg message("Max heap size (" SIZE_FORMAT "K) is too low to afford the minimum number "
                       "of regions (" SIZE_FORMAT ") of minimum region size (" SIZE_FORMAT "K).",
-                      initial_heap_size/K, MIN_NUM_REGIONS, ShenandoahMinRegionSize/K);
+                      max_heap_size/K, MIN_NUM_REGIONS, ShenandoahMinRegionSize/K);
       vm_exit_during_initialization("Invalid -XX:ShenandoahMinRegionSize option", message);
     }
     if (ShenandoahMinRegionSize < MIN_REGION_SIZE) {
@@ -562,10 +562,10 @@
     region_size = MIN2(ShenandoahMaxRegionSize, region_size);
 
   } else {
-    if (ShenandoahHeapRegionSize > initial_heap_size / MIN_NUM_REGIONS) {
-      err_msg message("Initial heap size (" SIZE_FORMAT "K) is too low to afford the minimum number "
+    if (ShenandoahHeapRegionSize > max_heap_size / MIN_NUM_REGIONS) {
+      err_msg message("Max heap size (" SIZE_FORMAT "K) is too low to afford the minimum number "
                               "of regions (" SIZE_FORMAT ") of requested size (" SIZE_FORMAT "K).",
-                      initial_heap_size/K, MIN_NUM_REGIONS, ShenandoahHeapRegionSize/K);
+                      max_heap_size/K, MIN_NUM_REGIONS, ShenandoahHeapRegionSize/K);
       vm_exit_during_initialization("Invalid -XX:ShenandoahHeapRegionSize option", message);
     }
     if (ShenandoahHeapRegionSize < ShenandoahMinRegionSize) {
@@ -619,6 +619,7 @@
 
   guarantee(HumongousThresholdWords == 0, "we should only set it once");
   HumongousThresholdWords = RegionSizeWords * ShenandoahHumongousThreshold / 100;
+  HumongousThresholdWords = align_down(HumongousThresholdWords, MinObjAlignment);
   assert (HumongousThresholdWords <= RegionSizeWords, "sanity");
 
   guarantee(HumongousThresholdBytes == 0, "we should only set it once");
@@ -643,13 +644,14 @@
   //
   // The whole thing is mitigated if Elastic TLABs are enabled.
   //
+  guarantee(MaxTLABSizeWords == 0, "we should only set it once");
+  MaxTLABSizeWords = MIN2(ShenandoahElasticTLAB ? RegionSizeWords : (RegionSizeWords / 8), HumongousThresholdWords);
+  MaxTLABSizeWords = align_down(MaxTLABSizeWords, MinObjAlignment);
+
   guarantee(MaxTLABSizeBytes == 0, "we should only set it once");
-  MaxTLABSizeBytes = MIN2(ShenandoahElasticTLAB ? RegionSizeBytes : (RegionSizeBytes / 8), HumongousThresholdBytes);
+  MaxTLABSizeBytes = MaxTLABSizeWords * HeapWordSize;
   assert (MaxTLABSizeBytes > MinTLABSize, "should be larger");
 
-  guarantee(MaxTLABSizeWords == 0, "we should only set it once");
-  MaxTLABSizeWords = MaxTLABSizeBytes / HeapWordSize;
-
   log_info(gc, init)("Regions: " SIZE_FORMAT " x " SIZE_FORMAT "%s",
                      RegionCount, byte_size_in_proper_unit(RegionSizeBytes), proper_unit_for_byte_size(RegionSizeBytes));
   log_info(gc, init)("Humongous object threshold: " SIZE_FORMAT "%s",
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -115,7 +115,7 @@
     _cset,                    // region is in collection set
     _pinned,                  // region is pinned
     _pinned_cset,             // region is pinned and in cset (evac failure path)
-    _trash,                   // region contains only trash
+    _trash                    // region contains only trash
   };
 
   const char* region_state_to_string(RegionState s) const {
@@ -258,7 +258,7 @@
 
   static const size_t MIN_NUM_REGIONS = 10;
 
-  static void setup_sizes(size_t initial_heap_size, size_t max_heap_size);
+  static void setup_sizes(size_t max_heap_size);
 
   double empty_time() {
     return _empty_time;
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -32,6 +32,8 @@
 HeapWord* ShenandoahHeapRegion::allocate(size_t size, ShenandoahAllocRequest::Type type) {
   _heap->assert_heaplock_or_safepoint();
 
+  assert(is_object_aligned(size), "alloc size breaks alignment: " SIZE_FORMAT, size);
+
   HeapWord* obj = top();
   if (pointer_delta(end(), obj) >= size) {
     make_regular_allocation();
@@ -39,7 +41,9 @@
 
     HeapWord* new_top = obj + size;
     set_top(new_top);
-    assert(is_aligned(obj) && is_aligned(new_top), "checking alignment");
+
+    assert(is_object_aligned(new_top), "new top breaks alignment: " PTR_FORMAT, p2i(new_top));
+    assert(is_object_aligned(obj),     "obj is not aligned: "       PTR_FORMAT, p2i(obj));
 
     return obj;
   } else {
--- a/src/hotspot/share/gc/shenandoah/shenandoahMonitoringSupport.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMonitoringSupport.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -46,12 +46,12 @@
   ShenandoahHeap* _heap;
 public:
   ShenandoahGenerationCounters(ShenandoahHeap* heap) :
-          GenerationCounters("Heap", 1, 1, heap->initial_capacity(), heap->max_capacity(), heap->committed()),
+          GenerationCounters("Heap", 1, 1, heap->initial_capacity(), heap->max_capacity(), heap->capacity()),
           _heap(heap)
   {};
 
   virtual void update_all() {
-    _current_size->set_value(_heap->committed());
+    _current_size->set_value(_heap->capacity());
   }
 };
 
@@ -94,7 +94,7 @@
   if (UsePerfData) {
     ShenandoahHeap* heap = ShenandoahHeap::heap();
     size_t used = heap->used();
-    size_t capacity = heap->capacity();
+    size_t capacity = heap->max_capacity();
     _heap_counters->update_all();
     _space_counters->update_all(capacity, used);
     _heap_region_counters->update();
--- a/src/hotspot/share/gc/shenandoah/shenandoahNumberSeq.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahNumberSeq.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -39,7 +39,7 @@
   enum PrivateConstants {
     ValBuckets = 512,
     MagBuckets = 24,
-    MagMinimum = -12,
+    MagMinimum = -12
   };
   int** _hdr;
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -41,7 +41,7 @@
 
 enum StringDedupMode {
   NO_DEDUP,      // Do not do anything for String deduplication
-  ENQUEUE_DEDUP, // Enqueue candidate Strings for deduplication
+  ENQUEUE_DEDUP  // Enqueue candidate Strings for deduplication
 };
 
 class ShenandoahMarkRefsSuperClosure : public MetadataVisitingOopIterateClosure {
@@ -184,24 +184,16 @@
   virtual bool do_metadata()        { return true; }
 };
 
-class ShenandoahUpdateHeapRefsSuperClosure : public BasicOopIterateClosure {
+class ShenandoahUpdateHeapRefsClosure : public BasicOopIterateClosure {
 private:
   ShenandoahHeap* _heap;
-public:
-  ShenandoahUpdateHeapRefsSuperClosure() :
-    _heap(ShenandoahHeap::heap()) {}
 
   template <class T>
-  void work(T *p);
-};
-
-class ShenandoahUpdateHeapRefsClosure : public ShenandoahUpdateHeapRefsSuperClosure {
-private:
-  template <class T>
-  inline  void do_oop_work(T* p)    { work<T>(p); }
+  void do_oop_work(T* p);
 
 public:
-  ShenandoahUpdateHeapRefsClosure() : ShenandoahUpdateHeapRefsSuperClosure() {}
+  ShenandoahUpdateHeapRefsClosure() :
+    _heap(ShenandoahHeap::heap()) {}
 
   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
   virtual void do_oop(oop* p)       { do_oop_work(p); }
--- a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -34,7 +34,7 @@
 }
 
 template <class T>
-inline void ShenandoahUpdateHeapRefsSuperClosure::work(T* p) {
+inline void ShenandoahUpdateHeapRefsClosure::do_oop_work(T* p) {
   _heap->maybe_update_with_forwarded(p);
 }
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -153,7 +153,7 @@
 void ShenandoahPacer::setup_for_idle() {
   assert(ShenandoahPacing, "Only be here when pacing is enabled");
 
-  size_t initial = _heap->capacity() * ShenandoahPacingIdleSlack / 100;
+  size_t initial = _heap->max_capacity() / 100 * ShenandoahPacingIdleSlack;
   double tax = 1;
 
   restart_with(initial, tax);
@@ -166,7 +166,7 @@
   if (_progress == -1) {
     // First initialization, report some prior
     Atomic::store((intptr_t)PACING_PROGRESS_ZERO, &_progress);
-    return (size_t) (_heap->capacity() * 0.1);
+    return (size_t) (_heap->max_capacity() * 0.1);
   } else {
     // Record history, and reply historical data
     _progress_history->add(_progress);
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -27,6 +27,7 @@
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "code/codeCache.hpp"
+#include "gc/shenandoah/shenandoahClosures.inline.hpp"
 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
 #include "gc/shenandoah/shenandoahHeap.hpp"
 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
--- a/src/hotspot/share/gc/shenandoah/shenandoahSharedVariables.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahSharedVariables.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -35,7 +35,7 @@
 typedef struct ShenandoahSharedFlag {
   enum {
     UNSET = 0,
-    SET = 1,
+    SET = 1
   };
 
   DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile ShenandoahSharedValue));
@@ -62,8 +62,8 @@
     return OrderAccess::load_acquire(&value) == UNSET;
   }
 
-  void set_cond(bool value) {
-    if (value) {
+  void set_cond(bool val) {
+    if (val) {
       set();
     } else {
       unset();
@@ -167,8 +167,8 @@
     return (OrderAccess::load_acquire(&value)) == 0;
   }
 
-  void set_cond(uint mask, bool value) {
-    if (value) {
+  void set_cond(uint mask, bool val) {
+    if (val) {
       set(mask);
     } else {
       unset(mask);
--- a/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -92,7 +92,7 @@
 void ShenandoahStringDedup::oops_do_slow(OopClosure* cl) {
   assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
   assert(is_enabled(), "String deduplication not enabled");
-  ShenandoahAlwaysTrueClosure always_true;
+  AlwaysTrueClosure always_true;
   StringDedupUnlinkOrOopsDoClosure sd_cl(&always_true, cl);
   StringDedupQueue::unlink_or_oops_do(&sd_cl);
   StringDedupTable::unlink_or_oops_do(&sd_cl, 0);
--- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -109,7 +109,7 @@
 // some bits back if chunks are counted in ObjArrayMarkingStride units.
 //
 // There is also a fallback version that uses plain fields, when we don't have enough space to steal the
-// bits from the native pointer. It is useful to debug the _LP64 version.
+// bits from the native pointer. It is useful to debug the optimized version.
 //
 
 #ifdef _MSC_VER
@@ -119,33 +119,36 @@
 #endif
 
 #ifdef _LP64
+#define SHENANDOAH_OPTIMIZED_OBJTASK 1
+#else
+#define SHENANDOAH_OPTIMIZED_OBJTASK 0
+#endif
+
+#if SHENANDOAH_OPTIMIZED_OBJTASK
 class ObjArrayChunkedTask
 {
 public:
   enum {
     chunk_bits   = 10,
     pow_bits     = 5,
-    oop_bits     = sizeof(uintptr_t)*8 - chunk_bits - pow_bits,
+    oop_bits     = sizeof(uintptr_t)*8 - chunk_bits - pow_bits
   };
   enum {
     oop_shift    = 0,
     pow_shift    = oop_shift + oop_bits,
-    chunk_shift  = pow_shift + pow_bits,
+    chunk_shift  = pow_shift + pow_bits
   };
 
 public:
   ObjArrayChunkedTask(oop o = NULL) {
-    _obj = ((uintptr_t)(void*) o) << oop_shift;
+    assert(oopDesc::equals_raw(decode_oop(encode_oop(o)), o), "oop can be encoded: " PTR_FORMAT, p2i(o));
+    _obj = encode_oop(o);
   }
-  ObjArrayChunkedTask(oop o, int chunk, int mult) {
-    assert(0 <= chunk && chunk < nth_bit(chunk_bits), "chunk is sane: %d", chunk);
-    assert(0 <= mult && mult < nth_bit(pow_bits), "pow is sane: %d", mult);
-    uintptr_t t_b = ((uintptr_t) chunk) << chunk_shift;
-    uintptr_t t_m = ((uintptr_t) mult) << pow_shift;
-    uintptr_t obj = (uintptr_t)(void*)o;
-    assert(obj < nth_bit(oop_bits), "obj ref is sane: " PTR_FORMAT, obj);
-    intptr_t t_o = obj << oop_shift;
-    _obj = t_o | t_m | t_b;
+  ObjArrayChunkedTask(oop o, int chunk, int pow) {
+    assert(oopDesc::equals_raw(decode_oop(encode_oop(o)), o), "oop can be encoded: " PTR_FORMAT, p2i(o));
+    assert(decode_chunk(encode_chunk(chunk)) == chunk, "chunk can be encoded: %d", chunk);
+    assert(decode_pow(encode_pow(pow)) == pow, "pow can be encoded: %d", pow);
+    _obj = encode_oop(o) | encode_chunk(chunk) | encode_pow(pow);
   }
   ObjArrayChunkedTask(const ObjArrayChunkedTask& t): _obj(t._obj) { }
 
@@ -159,14 +162,38 @@
     return *this;
   }
 
-  inline oop obj()   const { return (oop) reinterpret_cast<void*>((_obj >> oop_shift) & right_n_bits(oop_bits)); }
-  inline int chunk() const { return (int) (_obj >> chunk_shift) & right_n_bits(chunk_bits); }
-  inline int pow()   const { return (int) ((_obj >> pow_shift) & right_n_bits(pow_bits)); }
+  inline oop decode_oop(uintptr_t val) const {
+    return (oop) reinterpret_cast<void*>((val >> oop_shift) & right_n_bits(oop_bits));
+  }
+
+  inline int decode_chunk(uintptr_t val) const {
+    return (int) ((val >> chunk_shift) & right_n_bits(chunk_bits));
+  }
+
+  inline int decode_pow(uintptr_t val) const {
+    return (int) ((val >> pow_shift) & right_n_bits(pow_bits));
+  }
+
+  inline uintptr_t encode_oop(oop obj) const {
+    return ((uintptr_t)(void*) obj) << oop_shift;
+  }
+
+  inline uintptr_t encode_chunk(int chunk) const {
+    return ((uintptr_t) chunk) << chunk_shift;
+  }
+
+  inline uintptr_t encode_pow(int pow) const {
+    return ((uintptr_t) pow) << pow_shift;
+  }
+
+  inline oop obj()   const { return decode_oop(_obj);   }
+  inline int chunk() const { return decode_chunk(_obj); }
+  inline int pow()   const { return decode_pow(_obj);   }
   inline bool is_not_chunked() const { return (_obj & ~right_n_bits(oop_bits + pow_bits)) == 0; }
 
   DEBUG_ONLY(bool is_valid() const); // Tasks to be pushed/popped must be valid.
 
-  static size_t max_addressable() {
+  static uintptr_t max_addressable() {
     return nth_bit(oop_bits);
   }
 
@@ -229,7 +256,7 @@
   int _chunk;
   int _pow;
 };
-#endif
+#endif // SHENANDOAH_OPTIMIZED_OBJTASK
 
 #ifdef _MSC_VER
 #pragma warning(pop)
--- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -30,6 +30,7 @@
 #include "gc/shared/workgroup.hpp"
 #include "gc/shared/weakProcessor.inline.hpp"
 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
+#include "gc/shenandoah/shenandoahClosures.inline.hpp"
 #include "gc/shenandoah/shenandoahCodeRoots.hpp"
 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
@@ -554,7 +555,10 @@
 }
 
 void ShenandoahTraversalGC::concurrent_traversal_collection() {
-  ClassLoaderDataGraph::clear_claimed_marks();
+  {
+    MutexLocker ml(ClassLoaderDataGraph_lock);
+    ClassLoaderDataGraph::clear_claimed_marks();
+  }
 
   ShenandoahGCPhase phase_work(ShenandoahPhaseTimings::conc_traversal);
   if (!_heap->cancelled_gc()) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -628,6 +628,10 @@
         enabled = true;
         expected = ShenandoahHeap::HAS_FORWARDED;
         break;
+      case _verify_gcstate_evacuation:
+        enabled = true;
+        expected = ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::EVACUATION;
+        break;
       case _verify_gcstate_stable:
         enabled = true;
         expected = ShenandoahHeap::STABLE;
@@ -808,6 +812,18 @@
   );
 }
 
+void ShenandoahVerifier::verify_during_evacuation() {
+  verify_at_safepoint(
+          "During Evacuation",
+          _verify_forwarded_allow,   // some forwarded references are allowed
+          _verify_marked_disable,    // walk only roots
+          _verify_cset_disable,      // some cset references are not forwarded yet
+          _verify_liveness_disable,  // liveness data might be already stale after pre-evacs
+          _verify_regions_disable,   // trash regions not yet recycled
+          _verify_gcstate_evacuation // evacuation is in progress
+  );
+}
+
 void ShenandoahVerifier::verify_after_evacuation() {
   verify_at_safepoint(
           "After Evacuation",
--- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -73,7 +73,7 @@
     _verify_marked_incomplete,
 
     // Objects should be marked in "complete" bitmap.
-    _verify_marked_complete,
+    _verify_marked_complete
   } VerifyMarked;
 
   typedef enum {
@@ -84,7 +84,7 @@
     _verify_forwarded_none,
 
     // Objects may have forwardees.
-    _verify_forwarded_allow,
+    _verify_forwarded_allow
   } VerifyForwarded;
 
   typedef enum {
@@ -97,7 +97,7 @@
     // May have references to cset, all should be forwarded.
     // Note: Allowing non-forwarded references to cset is equivalent
     // to _verify_cset_disable.
-    _verify_cset_forwarded,
+    _verify_cset_forwarded
   } VerifyCollectionSet;
 
   typedef enum {
@@ -109,7 +109,7 @@
 
     // All objects should belong to live regions,
     // and liveness data should be accurate
-    _verify_liveness_complete,
+    _verify_liveness_complete
   } VerifyLiveness;
 
   typedef enum {
@@ -123,7 +123,7 @@
     _verify_regions_nocset,
 
     // No trash and no cset regions allowed
-    _verify_regions_notrash_nocset,
+    _verify_regions_notrash_nocset
   } VerifyRegions;
 
   typedef enum {
@@ -135,6 +135,9 @@
 
     // Nothing is in progress, some objects are forwarded
     _verify_gcstate_forwarded,
+
+    // Evacuation is in progress, some objects are forwarded
+    _verify_gcstate_evacuation
   } VerifyGCState;
 
   struct VerifyOptions {
@@ -173,6 +176,7 @@
   void verify_before_concmark();
   void verify_after_concmark();
   void verify_before_evacuation();
+  void verify_during_evacuation();
   void verify_after_evacuation();
   void verify_before_updaterefs();
   void verify_after_updaterefs();
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -925,23 +925,19 @@
            info.call_kind() == CallInfo::vtable_call, "");
   }
 #endif
+  // Get sender or sender's unsafe_anonymous_host, and only set cpCache entry to resolved if
+  // it is not an interface.  The receiver for invokespecial calls within interface
+  // methods must be checked for every call.
+  InstanceKlass* sender = pool->pool_holder();
+  sender = sender->is_unsafe_anonymous() ? sender->unsafe_anonymous_host() : sender;
 
   switch (info.call_kind()) {
-  case CallInfo::direct_call: {
-    // Get sender or sender's unsafe_anonymous_host, and only set cpCache entry to resolved if
-    // it is not an interface.  The receiver for invokespecial calls within interface
-    // methods must be checked for every call.
-    InstanceKlass* pool_holder = pool->pool_holder();
-    InstanceKlass* sender = pool_holder->is_unsafe_anonymous() ?
-                              pool_holder->unsafe_anonymous_host() : pool_holder;
-
+  case CallInfo::direct_call:
     cp_cache_entry->set_direct_call(
       bytecode,
       info.resolved_method(),
-      sender->is_interface(),
-      pool_holder);
+      sender->is_interface());
     break;
-  }
   case CallInfo::vtable_call:
     cp_cache_entry->set_vtable_call(
       bytecode,
--- a/src/hotspot/share/jfr/jni/jfrJniMethod.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/jni/jfrJniMethod.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -114,7 +114,7 @@
 NO_TRANSITION_END
 
 NO_TRANSITION(void, jfr_set_file_notification(JNIEnv* env, jobject jvm, jlong threshold))
-  JfrChunkRotation::set_threshold((intptr_t)threshold);
+  JfrChunkRotation::set_threshold(threshold);
 NO_TRANSITION_END
 
 NO_TRANSITION(void, jfr_set_sample_threads(JNIEnv* env, jobject jvm, jboolean sampleThreads))
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -44,13 +44,13 @@
   }
 }
 
-static void write_checkpoint_header(u1* pos, jlong size, jlong time, bool flushpoint, juint type_count) {
+static void write_checkpoint_header(u1* pos, int64_t size, jlong time, bool flushpoint, u4 type_count) {
   assert(pos != NULL, "invariant");
   JfrBigEndianWriter be_writer(pos, sizeof(JfrCheckpointEntry));
   be_writer.write(size);
   be_writer.write(time);
   be_writer.write(JfrTicks::now().value() - time);
-  be_writer.write(flushpoint ? (juint)1 : (juint)0);
+  be_writer.write(flushpoint ? (u4)1 : (u4)0);
   be_writer.write(type_count);
   assert(be_writer.is_valid(), "invariant");
 }
@@ -71,7 +71,7 @@
   assert(this->is_valid(), "invariant");
   assert(count() > 0, "invariant");
   assert(this->used_size() > sizeof(JfrCheckpointEntry), "invariant");
-  const jlong size = this->current_offset();
+  const int64_t size = this->current_offset();
   assert(size + this->start_pos() == this->current_pos(), "invariant");
   write_checkpoint_header(const_cast<u1*>(this->start_pos()), size, _time, is_flushpoint(), count());
   release();
@@ -85,11 +85,11 @@
   return _flushpoint;
 }
 
-juint JfrCheckpointWriter::count() const {
+u4 JfrCheckpointWriter::count() const {
   return _count;
 }
 
-void JfrCheckpointWriter::set_count(juint count) {
+void JfrCheckpointWriter::set_count(u4 count) {
   _count = count;
 }
 
@@ -111,7 +111,7 @@
 }
 
 void JfrCheckpointWriter::write_key(u8 key) {
-  write<u8>(key);
+  write(key);
 }
 
 void JfrCheckpointWriter::increment() {
@@ -119,10 +119,10 @@
 }
 
 void JfrCheckpointWriter::write_count(u4 nof_entries) {
-  write<u4>((u4)nof_entries);
+  write(nof_entries);
 }
 
-void JfrCheckpointWriter::write_count(u4 nof_entries, jlong offset) {
+void JfrCheckpointWriter::write_count(u4 nof_entries, int64_t offset) {
   write_padded_at_offset(nof_entries, offset);
 }
 
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -49,21 +49,21 @@
 typedef EventWriterHost<BigEndianEncoder, CompressedIntegerEncoder, JfrTransactionalCheckpointWriter> JfrCheckpointWriterBase;
 
 struct JfrCheckpointContext {
-  jlong offset;
-  juint count;
+  int64_t offset;
+  u4 count;
 };
 
 class JfrCheckpointWriter : public JfrCheckpointWriterBase {
   friend class JfrSerializerRegistration;
  private:
   JfrTicks _time;
-  jlong _offset;
-  juint _count;
+  int64_t _offset;
+  u4 _count;
   bool _flushpoint;
   bool _header;
 
-  juint count() const;
-  void set_count(juint count);
+  u4 count() const;
+  void set_count(u4 count);
   void increment();
   void set_flushpoint(bool flushpoint);
   bool is_flushpoint() const;
@@ -75,7 +75,7 @@
   ~JfrCheckpointWriter();
   void write_type(JfrTypeId type_id);
   void write_count(u4 nof_entries);
-  void write_count(u4 nof_entries, jlong offset);
+  void write_count(u4 nof_entries, int64_t offset);
   void write_key(u8 key);
   const JfrCheckpointContext context() const;
   void set_context(const JfrCheckpointContext ctx);
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -65,7 +65,7 @@
  private:
   JfrCheckpointWriter& _writer;
   JfrCheckpointContext _ctx;
-  const intptr_t _count_position;
+  const int64_t _count_position;
   Thread* const _curthread;
   u4 _count;
 
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetWriter.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetWriter.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -35,7 +35,7 @@
   WriterImpl _impl;
   JfrCheckpointWriter* _writer;
   JfrCheckpointContext _ctx;
-  jlong _count_offset;
+  int64_t _count_offset;
   int _count;
   bool _skip_header;
  public:
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -28,7 +28,7 @@
 #include "jfr/recorder/repository/jfrChunkWriter.hpp"
 
 static jobject chunk_monitor = NULL;
-static intptr_t threshold = 0;
+static int64_t threshold = 0;
 static bool rotate = false;
 
 static jobject install_chunk_monitor(Thread* thread) {
@@ -61,7 +61,6 @@
     // already in progress
     return;
   }
-  assert(!rotate, "invariant");
   if (writer.size_written() > threshold) {
     rotate = true;
     notify();
@@ -76,6 +75,6 @@
   rotate = false;
 }
 
-void JfrChunkRotation::set_threshold(intptr_t bytes) {
+void JfrChunkRotation::set_threshold(int64_t bytes) {
   threshold = bytes;
 }
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -36,7 +36,7 @@
 class JfrChunkRotation : AllStatic {
  public:
   static void evaluate(const JfrChunkWriter& writer);
-  static void set_threshold(intptr_t bytes);
+  static void set_threshold(int64_t bytes);
   static bool should_rotate();
   static void on_rotation();
 };
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkState.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkState.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -53,19 +53,19 @@
   set_previous_checkpoint_offset(0);
 }
 
-void JfrChunkState::set_previous_checkpoint_offset(jlong offset) {
+void JfrChunkState::set_previous_checkpoint_offset(int64_t offset) {
   _previous_checkpoint_offset = offset;
 }
 
-jlong JfrChunkState::previous_checkpoint_offset() const {
+int64_t JfrChunkState::previous_checkpoint_offset() const {
   return _previous_checkpoint_offset;
 }
 
-jlong JfrChunkState::previous_start_ticks() const {
+int64_t JfrChunkState::previous_start_ticks() const {
   return _previous_start_ticks;
 }
 
-jlong JfrChunkState::previous_start_nanos() const {
+int64_t JfrChunkState::previous_start_nanos() const {
   return _previous_start_nanos;
 }
 
@@ -92,7 +92,7 @@
   save_current_and_update_start_ticks();
 }
 
-jlong JfrChunkState::last_chunk_duration() const {
+int64_t JfrChunkState::last_chunk_duration() const {
   return _start_nanos - _previous_start_nanos;
 }
 
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkState.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkState.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,6 @@
 #ifndef SHARE_VM_JFR_RECORDER_REPOSITORY_JFRRCHUNKSTATE_HPP
 #define SHARE_VM_JFR_RECORDER_REPOSITORY_JFRRCHUNKSTATE_HPP
 
-#include "jni.h"
 #include "jfr/utilities/jfrAllocation.hpp"
 #include "jfr/utilities/jfrTypes.hpp"
 
@@ -33,11 +32,11 @@
   friend class JfrChunkWriter;
  private:
   char* _path;
-  jlong _start_ticks;
-  jlong _start_nanos;
-  jlong _previous_start_ticks;
-  jlong _previous_start_nanos;
-  jlong _previous_checkpoint_offset;
+  int64_t _start_ticks;
+  int64_t _start_nanos;
+  int64_t _previous_start_ticks;
+  int64_t _previous_start_nanos;
+  int64_t _previous_checkpoint_offset;
 
   void update_start_ticks();
   void update_start_nanos();
@@ -47,11 +46,11 @@
   JfrChunkState();
   ~JfrChunkState();
   void reset();
-  jlong previous_checkpoint_offset() const;
-  void set_previous_checkpoint_offset(jlong offset);
-  jlong previous_start_ticks() const;
-  jlong previous_start_nanos() const;
-  jlong last_chunk_duration() const;
+  int64_t previous_checkpoint_offset() const;
+  void set_previous_checkpoint_offset(int64_t offset);
+  int64_t previous_start_ticks() const;
+  int64_t previous_start_nanos() const;
+  int64_t last_chunk_duration() const;
   void update_time_to_now();
   void set_path(const char* path);
   const char* path() const;
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -32,9 +32,8 @@
 #include "runtime/os.hpp"
 #include "runtime/os.inline.hpp"
 
-const u2 JFR_VERSION_MAJOR = 2;
-const u2 JFR_VERSION_MINOR = 0;
-
+static const u2 JFR_VERSION_MAJOR = 2;
+static const u2 JFR_VERSION_MINOR = 0;
 static const size_t MAGIC_LEN = 4;
 static const size_t FILEHEADER_SLOT_SIZE = 8;
 static const size_t CHUNK_SIZE_OFFSET = 8;
@@ -79,14 +78,14 @@
   return is_open;
 }
 
-size_t JfrChunkWriter::close(intptr_t metadata_offset) {
+size_t JfrChunkWriter::close(int64_t metadata_offset) {
   write_header(metadata_offset);
   this->flush();
   this->close_fd();
-  return size_written();
+  return (size_t)size_written();
 }
 
-void JfrChunkWriter::write_header(intptr_t metadata_offset) {
+void JfrChunkWriter::write_header(int64_t metadata_offset) {
   assert(this->is_valid(), "invariant");
   // Chunk size
   this->write_be_at_offset(size_written(), CHUNK_SIZE_OFFSET);
@@ -106,15 +105,15 @@
   _chunkstate->set_path(chunk_path);
 }
 
-intptr_t JfrChunkWriter::size_written() const {
+int64_t JfrChunkWriter::size_written() const {
   return this->is_valid() ? this->current_offset() : 0;
 }
 
-intptr_t JfrChunkWriter::previous_checkpoint_offset() const {
+int64_t JfrChunkWriter::previous_checkpoint_offset() const {
   return _chunkstate->previous_checkpoint_offset();
 }
 
-void JfrChunkWriter::set_previous_checkpoint_offset(intptr_t offset) {
+void JfrChunkWriter::set_previous_checkpoint_offset(int64_t offset) {
   _chunkstate->set_previous_checkpoint_offset(offset);
 }
 
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -41,16 +41,16 @@
   JfrChunkState* _chunkstate;
 
   bool open();
-  size_t close(intptr_t metadata_offset);
-  void write_header(intptr_t metadata_offset);
+  size_t close(int64_t metadata_offset);
+  void write_header(int64_t metadata_offset);
   void set_chunk_path(const char* chunk_path);
 
  public:
   JfrChunkWriter();
   bool initialize();
-  intptr_t size_written() const;
-  intptr_t previous_checkpoint_offset() const;
-  void set_previous_checkpoint_offset(intptr_t offset);
+  int64_t size_written() const;
+  int64_t previous_checkpoint_offset() const;
+  void set_previous_checkpoint_offset(int64_t offset);
   void time_stamp_chunk_now();
 };
 
--- a/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -147,10 +147,10 @@
   iso8601_to_date_time(buffer);
 }
 
-static jlong file_size(fio_fd fd) {
+static int64_t file_size(fio_fd fd) {
   assert(fd != invalid_fd, "invariant");
-  const jlong current_offset = os::current_file_offset(fd);
-  const jlong size = os::lseek(fd, 0, SEEK_END);
+  const int64_t current_offset = os::current_file_offset(fd);
+  const int64_t size = os::lseek(fd, 0, SEEK_END);
   os::seek_to_file_offset(fd, current_offset);
   return size;
 }
@@ -219,7 +219,7 @@
   if (invalid_fd == entry_fd) {
     return NULL;
   }
-  const jlong entry_size = file_size(entry_fd);
+  const int64_t entry_size = file_size(entry_fd);
   os::close(entry_fd);
   if (0 == entry_size) {
     return NULL;
@@ -261,6 +261,7 @@
   }
 }
 #endif
+
 bool RepositoryIterator::has_next() const {
   return (_files != NULL && _iterator < _files->length());
 }
@@ -276,21 +277,27 @@
   if (file_copy_block == NULL) {
     return;
   }
- jlong bytes_written_total = 0;
+ int64_t bytes_written_total = 0;
   while (iterator.has_next()) {
     fio_fd current_fd = invalid_fd;
     const char* const fqn = iterator.next();
     if (fqn != NULL) {
       current_fd = open_existing(fqn);
       if (current_fd != invalid_fd) {
-        const jlong current_filesize = file_size(current_fd);
+        const int64_t current_filesize = file_size(current_fd);
         assert(current_filesize > 0, "invariant");
-        jlong bytes_read = 0;
-        jlong bytes_written = 0;
+        int64_t bytes_read = 0;
+        int64_t bytes_written = 0;
         while (bytes_read < current_filesize) {
-          bytes_read += (jlong)os::read_at(current_fd, file_copy_block, size_of_file_copy_block, bytes_read);
-          assert(bytes_read - bytes_written <= (jlong)size_of_file_copy_block, "invariant");
-          bytes_written += (jlong)os::write(emergency_fd, file_copy_block, bytes_read - bytes_written);
+          const ssize_t read_result = os::read_at(current_fd, file_copy_block, size_of_file_copy_block, bytes_read);
+          if (-1 == read_result) {
+            log_info(jfr) ( // For user, should not be "jfr, system"
+              "Unable to recover JFR data");
+            break;
+          }
+          bytes_read += (int64_t)read_result;
+          assert(bytes_read - bytes_written <= (int64_t)size_of_file_copy_block, "invariant");
+          bytes_written += (int64_t)os::write(emergency_fd, file_copy_block, bytes_read - bytes_written);
           assert(bytes_read == bytes_written, "invariant");
         }
         os::close(current_fd);
@@ -471,6 +478,6 @@
   return _chunkwriter->open();
 }
 
-size_t JfrRepository::close_chunk(jlong metadata_offset) {
+size_t JfrRepository::close_chunk(int64_t metadata_offset) {
   return _chunkwriter->close(metadata_offset);
 }
--- a/src/hotspot/share/jfr/recorder/repository/jfrRepository.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/repository/jfrRepository.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -55,7 +55,7 @@
   bool set_path(const char* path);
   void set_chunk_path(const char* path);
   bool open_chunk(bool vm_error = false);
-  size_t close_chunk(jlong metadata_offset);
+  size_t close_chunk(int64_t metadata_offset);
   void on_vm_error();
   static void notify_on_new_chunk_path();
   static JfrChunkWriter& chunkwriter();
--- a/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -130,18 +130,18 @@
   bool not_acquired() const { return !_acquired; }
 };
 
-static intptr_t write_checkpoint_event_prologue(JfrChunkWriter& cw, u8 type_id) {
-  const intptr_t prev_cp_offset = cw.previous_checkpoint_offset();
-  const intptr_t prev_cp_relative_offset = 0 == prev_cp_offset ? 0 : prev_cp_offset - cw.current_offset();
+static int64_t write_checkpoint_event_prologue(JfrChunkWriter& cw, u8 type_id) {
+  const int64_t prev_cp_offset = cw.previous_checkpoint_offset();
+  const int64_t prev_cp_relative_offset = 0 == prev_cp_offset ? 0 : prev_cp_offset - cw.current_offset();
   cw.reserve(sizeof(u4));
   cw.write<u8>(EVENT_CHECKPOINT);
   cw.write(JfrTicks::now());
-  cw.write<jlong>((jlong)0);
+  cw.write((int64_t)0);
   cw.write(prev_cp_relative_offset); // write previous checkpoint offset delta
   cw.write<bool>(false); // flushpoint
-  cw.write<u4>((u4)1); // nof types in this checkpoint
-  cw.write<u8>(type_id);
-  const intptr_t number_of_elements_offset = cw.current_offset();
+  cw.write((u4)1); // nof types in this checkpoint
+  cw.write(type_id);
+  const int64_t number_of_elements_offset = cw.current_offset();
   cw.reserve(sizeof(u4));
   return number_of_elements_offset;
 }
@@ -161,8 +161,8 @@
   }
   bool process() {
     // current_cp_offset is also offset for the event size header field
-    const intptr_t current_cp_offset = _cw.current_offset();
-    const intptr_t num_elements_offset = write_checkpoint_event_prologue(_cw, _type_id);
+    const int64_t current_cp_offset = _cw.current_offset();
+    const int64_t num_elements_offset = write_checkpoint_event_prologue(_cw, _type_id);
     // invocation
     _content_functor.process();
     const u4 number_of_elements = (u4)_content_functor.processed();
@@ -468,9 +468,9 @@
   JfrMetadataEvent::lock();
 }
 
-static jlong write_metadata_event(JfrChunkWriter& chunkwriter) {
+static int64_t write_metadata_event(JfrChunkWriter& chunkwriter) {
   assert(chunkwriter.is_valid(), "invariant");
-  const jlong metadata_offset = chunkwriter.current_offset();
+  const int64_t metadata_offset = chunkwriter.current_offset();
   JfrMetadataEvent::write(chunkwriter, metadata_offset);
   return metadata_offset;
 }
--- a/src/hotspot/share/jfr/writers/jfrEventWriterHost.inline.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/writers/jfrEventWriterHost.inline.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -49,7 +49,7 @@
 inline intptr_t EventWriterHost<BE, IE, WriterPolicyImpl>::end_write(void) {
   assert(this->is_acquired(),
     "state corruption, calling end with writer with non-acquired state!");
-  return this->is_valid() ? this->used_offset() : 0;
+  return this->is_valid() ? (intptr_t)this->used_offset() : 0;
 }
 
 template <typename BE, typename IE, typename WriterPolicyImpl>
--- a/src/hotspot/share/jfr/writers/jfrPosition.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/writers/jfrPosition.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -48,8 +48,8 @@
 
  public:
   size_t available_size() const;
-  intptr_t used_offset() const;
-  intptr_t current_offset() const;
+  int64_t used_offset() const;
+  int64_t current_offset() const;
   size_t used_size() const;
   void reset();
 };
--- a/src/hotspot/share/jfr/writers/jfrPosition.inline.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/writers/jfrPosition.inline.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -80,12 +80,12 @@
 }
 
 template <typename AP>
-inline intptr_t Position<AP>::used_offset() const {
+inline int64_t Position<AP>::used_offset() const {
   return _current_pos - _start_pos;
 }
 
 template <typename AP>
-inline intptr_t Position<AP>::current_offset() const {
+inline int64_t Position<AP>::current_offset() const {
   return this->used_offset();
 }
 
--- a/src/hotspot/share/jfr/writers/jfrStreamWriterHost.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/writers/jfrStreamWriterHost.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -33,9 +33,9 @@
  public:
   typedef typename Adapter::StorageType StorageType;
  private:
-  intptr_t _stream_pos;
+  int64_t _stream_pos;
   fio_fd _fd;
-  intptr_t current_stream_position() const;
+  int64_t current_stream_position() const;
 
  protected:
   StreamWriterHost(StorageType* storage, Thread* thread);
@@ -47,8 +47,8 @@
   bool has_valid_fd() const;
 
  public:
-  intptr_t current_offset() const;
-  void seek(intptr_t offset);
+  int64_t current_offset() const;
+  void seek(int64_t offset);
   void flush();
   void write_unbuffered(const void* src, size_t len);
   bool is_valid() const;
--- a/src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -44,7 +44,7 @@
 }
 
 template <typename Adapter, typename AP>
-inline intptr_t StreamWriterHost<Adapter, AP>::current_stream_position() const {
+inline int64_t StreamWriterHost<Adapter, AP>::current_stream_position() const {
   return this->used_offset() + _stream_pos;
 }
 
@@ -73,7 +73,7 @@
 inline void StreamWriterHost<Adapter, AP>::flush(size_t size) {
   assert(size > 0, "invariant");
   assert(this->is_valid(), "invariant");
-  _stream_pos += os::write(_fd, this->start_pos(), (int)size);
+  _stream_pos += os::write(_fd, this->start_pos(), (unsigned int)size);
   StorageHost<Adapter, AP>::reset();
   assert(0 == this->used_offset(), "invariant");
 }
@@ -84,12 +84,12 @@
 }
 
 template <typename Adapter, typename AP>
-inline intptr_t StreamWriterHost<Adapter, AP>::current_offset() const {
+inline int64_t StreamWriterHost<Adapter, AP>::current_offset() const {
   return current_stream_position();
 }
 
 template <typename Adapter, typename AP>
-void StreamWriterHost<Adapter, AP>::seek(intptr_t offset) {
+void StreamWriterHost<Adapter, AP>::seek(int64_t offset) {
   this->flush();
   assert(0 == this->used_offset(), "can only seek from beginning");
   _stream_pos = os::seek_to_file_offset(_fd, offset);
@@ -110,7 +110,7 @@
   this->flush();
   assert(0 == this->used_offset(), "can only seek from beginning");
   while (len > 0) {
-    const int n = MIN2<int>((int)len, INT_MAX);
+    const unsigned int n = MIN2((unsigned int)len, (unsigned int)INT_MAX);
     _stream_pos += os::write(_fd, buf, n);
     len -= n;
   }
--- a/src/hotspot/share/jfr/writers/jfrWriterHost.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/writers/jfrWriterHost.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -91,12 +91,12 @@
   void bytes(const void* buf, size_t len);
   void write_utf8_u2_len(const char* value);
   template <typename T>
-  void write_padded_at_offset(T value, intptr_t offset);
+  void write_padded_at_offset(T value, int64_t offset);
   template <typename T>
-  void write_at_offset(T value, intptr_t offset);
+  void write_at_offset(T value, int64_t offset);
   template <typename T>
-  void write_be_at_offset(T value, intptr_t offset);
-  intptr_t reserve(size_t size);
+  void write_be_at_offset(T value, int64_t offset);
+  int64_t reserve(size_t size);
 };
 
 #endif // SHARE_VM_JFR_WRITERS_JFRWRITERHOST_HPP
--- a/src/hotspot/share/jfr/writers/jfrWriterHost.inline.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/jfr/writers/jfrWriterHost.inline.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -196,7 +196,7 @@
 
 template <typename BE, typename IE, typename WriterPolicyImpl>
 inline void WriterHost<BE, IE, WriterPolicyImpl>::write(double value) {
-  be_write(*(uintptr_t*)&(value));
+  be_write(*(u8*)&(value));
 }
 
 template <typename BE, typename IE, typename WriterPolicyImpl>
@@ -317,9 +317,9 @@
 }
 
 template <typename BE, typename IE, typename WriterPolicyImpl>
-inline intptr_t WriterHost<BE, IE, WriterPolicyImpl>::reserve(size_t size) {
+inline int64_t WriterHost<BE, IE, WriterPolicyImpl>::reserve(size_t size) {
   if (ensure_size(size) != NULL) {
-    intptr_t reserved_offset = this->current_offset();
+    const int64_t reserved_offset = this->current_offset();
     this->set_current_pos(size);
     return reserved_offset;
   }
@@ -329,9 +329,9 @@
 
 template <typename BE, typename IE, typename WriterPolicyImpl>
 template <typename T>
-inline void WriterHost<BE, IE, WriterPolicyImpl>::write_padded_at_offset(T value, intptr_t offset) {
+inline void WriterHost<BE, IE, WriterPolicyImpl>::write_padded_at_offset(T value, int64_t offset) {
   if (this->is_valid()) {
-    const intptr_t current = this->current_offset();
+    const int64_t current = this->current_offset();
     this->seek(offset);
     write_padded(value);
     this->seek(current); // restore
@@ -340,9 +340,9 @@
 
 template <typename BE, typename IE, typename WriterPolicyImpl>
 template <typename T>
-inline void WriterHost<BE, IE, WriterPolicyImpl>::write_at_offset(T value, intptr_t offset) {
+inline void WriterHost<BE, IE, WriterPolicyImpl>::write_at_offset(T value, int64_t offset) {
   if (this->is_valid()) {
-    const intptr_t current = this->current_offset();
+    const int64_t current = this->current_offset();
     this->seek(offset);
     write(value);
     this->seek(current); // restore
@@ -351,9 +351,9 @@
 
 template <typename BE, typename IE, typename WriterPolicyImpl>
 template <typename T>
-inline void WriterHost<BE, IE, WriterPolicyImpl>::write_be_at_offset(T value, intptr_t offset) {
+inline void WriterHost<BE, IE, WriterPolicyImpl>::write_be_at_offset(T value, int64_t offset) {
   if (this->is_valid()) {
-    const intptr_t current = this->current_offset();
+    const int64_t current = this->current_offset();
     this->seek(offset);
     be_write(value);
     this->seek(current); // restore
--- a/src/hotspot/share/oops/constantPool.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/oops/constantPool.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -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
@@ -817,9 +817,9 @@
   constantTag tag = tag_at(which);
   if (tag.is_dynamic_constant() ||
       tag.is_dynamic_constant_in_error()) {
-    // have to look at the signature for this one
-    Symbol* constant_type = uncached_signature_ref_at(which);
-    return constantTag::ofBasicType(FieldType::basic_type(constant_type));
+    BasicType bt = basic_type_for_constant_at(which);
+    // dynamic constant could return an array, treat as object
+    return constantTag::ofBasicType(is_reference_type(bt) ? T_OBJECT : bt);
   }
   return tag;
 }
--- a/src/hotspot/share/oops/cpCache.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/oops/cpCache.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -168,8 +168,7 @@
 void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_code,
                                                        const methodHandle& method,
                                                        int vtable_index,
-                                                       bool sender_is_interface,
-                                                       InstanceKlass* pool_holder) {
+                                                       bool sender_is_interface) {
   bool is_vtable_call = (vtable_index >= 0);  // FIXME: split this method on this boolean
   assert(method->interpreter_entry() != NULL, "should have been set at this point");
   assert(!method->is_obsolete(),  "attempt to write obsolete method to cpCache");
@@ -264,17 +263,9 @@
     }
     // Don't mark invokestatic to method as resolved if the holder class has not yet completed
     // initialization. An invokestatic must only proceed if the class is initialized, but if
-    // we resolve it before then that class initialization check is skipped. However if the call
-    // is from the same class we can resolve as we must be executing with <clinit> on our call stack.
-    if (invoke_code == Bytecodes::_invokestatic) {
-      if (!method->method_holder()->is_initialized() &&
-          method->method_holder() != pool_holder) {
-        do_resolve = false;
-      } else {
-        assert(method->method_holder()->is_initialized() ||
-               method->method_holder()->is_reentrant_initialization(Thread::current()),
-               "invalid class initialization state for invoke_static");
-      }
+    // we resolve it before then that class initialization check is skipped.
+    if (invoke_code == Bytecodes::_invokestatic && !method->method_holder()->is_initialized()) {
+      do_resolve = false;
     }
     if (do_resolve) {
       set_bytecode_1(invoke_code);
@@ -319,17 +310,17 @@
 }
 
 void ConstantPoolCacheEntry::set_direct_call(Bytecodes::Code invoke_code, const methodHandle& method,
-                                             bool sender_is_interface, InstanceKlass* pool_holder) {
+                                             bool sender_is_interface) {
   int index = Method::nonvirtual_vtable_index;
   // index < 0; FIXME: inline and customize set_direct_or_vtable_call
-  set_direct_or_vtable_call(invoke_code, method, index, sender_is_interface, pool_holder);
+  set_direct_or_vtable_call(invoke_code, method, index, sender_is_interface);
 }
 
 void ConstantPoolCacheEntry::set_vtable_call(Bytecodes::Code invoke_code, const methodHandle& method, int index) {
   // either the method is a miranda or its holder should accept the given index
   assert(method->method_holder()->is_interface() || method->method_holder()->verify_vtable_index(index), "");
   // index >= 0; FIXME: inline and customize set_direct_or_vtable_call
-  set_direct_or_vtable_call(invoke_code, method, index, false, NULL /* not used */);
+  set_direct_or_vtable_call(invoke_code, method, index, false);
 }
 
 void ConstantPoolCacheEntry::set_itable_call(Bytecodes::Code invoke_code,
--- a/src/hotspot/share/oops/cpCache.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/oops/cpCache.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -230,16 +230,14 @@
     Bytecodes::Code invoke_code,                 // the bytecode used for invoking the method
     const methodHandle& method,                  // the method/prototype if any (NULL, otherwise)
     int             vtable_index,                // the vtable index if any, else negative
-    bool            sender_is_interface,         // 'logical' sender (may be host of VMAC)
-    InstanceKlass*  pool_holder                  // class from which the call is made
+    bool            sender_is_interface
   );
 
  public:
   void set_direct_call(                          // sets entry to exact concrete method entry
     Bytecodes::Code invoke_code,                 // the bytecode used for invoking the method
     const methodHandle& method,                  // the method to call
-    bool            sender_is_interface,         // 'logical' sender (may be host of VMAC)
-    InstanceKlass*  pool_holder                  // class from which the call is made
+    bool            sender_is_interface
   );
 
   void set_vtable_call(                          // sets entry to vtable index
--- a/src/hotspot/share/opto/bytecodeInfo.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/bytecodeInfo.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -204,7 +204,9 @@
   // First check all inlining restrictions which are required for correctness
   if ( callee_method->is_abstract()) {
     fail_msg = "abstract method"; // // note: we allow ik->is_abstract()
-  } else if (!callee_method->holder()->is_initialized()) {
+  } else if (!callee_method->holder()->is_initialized() &&
+             // access allowed in the context of static initializer
+             !C->is_compiling_clinit_for(callee_method->holder())) {
     fail_msg = "method holder not initialized";
   } else if ( callee_method->is_native()) {
     fail_msg = "native method";
@@ -446,13 +448,17 @@
 }
 
 //------------------------------pass_initial_checks----------------------------
-bool pass_initial_checks(ciMethod* caller_method, int caller_bci, ciMethod* callee_method) {
+bool InlineTree::pass_initial_checks(ciMethod* caller_method, int caller_bci, ciMethod* callee_method) {
   ciInstanceKlass *callee_holder = callee_method ? callee_method->holder() : NULL;
   // Check if a callee_method was suggested
   if( callee_method == NULL )            return false;
   // Check if klass of callee_method is loaded
   if( !callee_holder->is_loaded() )      return false;
-  if( !callee_holder->is_initialized() ) return false;
+  if( !callee_holder->is_initialized() &&
+      // access allowed in the context of static initializer
+      !C->is_compiling_clinit_for(callee_holder)) {
+    return false;
+  }
   if( !UseInterpreter ) /* running Xcomp */ {
     // Checks that constant pool's call site has been visited
     // stricter than callee_holder->is_initialized()
--- a/src/hotspot/share/opto/compile.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/compile.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -3835,6 +3835,11 @@
   }
 }
 
+bool Compile::is_compiling_clinit_for(ciKlass* k) {
+  ciMethod* root = method(); // the root method of compilation
+  return root->is_static_initializer() && root->holder() == k; // access in the context of clinit
+}
+
 #ifndef PRODUCT
 //------------------------------verify_graph_edges---------------------------
 // Walk the Graph and verify that there is a one-to-one correspondence
--- a/src/hotspot/share/opto/compile.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/compile.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -1361,6 +1361,8 @@
   // supporting clone_map
   CloneMap&     clone_map();
   void          set_clone_map(Dict* d);
+
+  bool is_compiling_clinit_for(ciKlass* k);
 };
 
 #endif // SHARE_VM_OPTO_COMPILE_HPP
--- a/src/hotspot/share/opto/graphKit.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/graphKit.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -2445,6 +2445,8 @@
                                   Node* parm2, Node* parm3,
                                   Node* parm4, Node* parm5,
                                   Node* parm6, Node* parm7) {
+  assert(call_addr != NULL, "must not call NULL targets");
+
   // Slow-path call
   bool is_leaf = !(flags & RC_NO_LEAF);
   bool has_io  = (!is_leaf && !(flags & RC_NO_IO));
--- a/src/hotspot/share/opto/library_call.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/library_call.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -2400,7 +2400,7 @@
   }
 
   // Can base be NULL? Otherwise, always on-heap access.
-  bool can_access_non_heap = TypePtr::NULL_PTR->higher_equal(_gvn.type(heap_base_oop));
+  bool can_access_non_heap = TypePtr::NULL_PTR->higher_equal(_gvn.type(base));
 
   if (!can_access_non_heap) {
     decorators |= IN_HEAP;
@@ -6339,6 +6339,9 @@
   }
   if (state == NULL) return false;
 
+  assert(stubAddr != NULL, "Stub is generated");
+  if (stubAddr == NULL) return false;
+
   // Call the stub.
   Node* call = make_runtime_call(RC_LEAF|RC_NO_FP, OptoRuntime::sha_implCompress_Type(),
                                  stubAddr, stubName, TypePtr::BOTTOM,
@@ -6411,6 +6414,9 @@
     fatal("unknown SHA intrinsic predicate: %d", predicate);
   }
   if (klass_SHA_name != NULL) {
+    assert(stub_addr != NULL, "Stub is generated");
+    if (stub_addr == NULL) return false;
+
     // get DigestBase klass to lookup for SHA klass
     const TypeInstPtr* tinst = _gvn.type(digestBase_obj)->isa_instptr();
     assert(tinst != NULL, "digestBase_obj is not instance???");
--- a/src/hotspot/share/opto/loopnode.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/loopnode.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -1593,12 +1593,17 @@
     } else {
       new_limit = igvn->transform(new SubINode(iv_phi, min));
     }
-    Node* cmp = inner_cle->cmp_node()->clone();
-    igvn->replace_input_of(cmp, 2, new_limit);
-    Node* bol = inner_cle->in(CountedLoopEndNode::TestValue)->clone();
-    cmp->set_req(2, limit);
-    bol->set_req(1, igvn->transform(cmp));
-    igvn->replace_input_of(outer_loop_end(), 1, igvn->transform(bol));
+    Node* inner_cmp = inner_cle->cmp_node();
+    Node* inner_bol = inner_cle->in(CountedLoopEndNode::TestValue);
+    Node* outer_bol = inner_bol;
+    // cmp node for inner loop may be shared
+    inner_cmp = inner_cmp->clone();
+    inner_cmp->set_req(2, new_limit);
+    inner_bol = inner_bol->clone();
+    inner_bol->set_req(1, igvn->transform(inner_cmp));
+    igvn->replace_input_of(inner_cle, CountedLoopEndNode::TestValue, igvn->transform(inner_bol));
+    // Set the outer loop's exit condition too
+    igvn->replace_input_of(outer_loop_end(), 1, outer_bol);
   } else {
     assert(false, "should be able to adjust outer loop");
     IfNode* outer_le = outer_loop_end();
--- a/src/hotspot/share/opto/parse.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/parse.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -57,6 +57,8 @@
 
   GrowableArray<InlineTree*> _subtrees;
 
+  bool pass_initial_checks(ciMethod* caller_method, int caller_bci, ciMethod* callee_method);
+
   void print_impl(outputStream* stj, int indent) const PRODUCT_RETURN;
   const char* _msg;
 protected:
--- a/src/hotspot/share/opto/parse3.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/parse3.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -55,25 +55,21 @@
   // need to be guarded.
   ciInstanceKlass *field_holder = field->holder();
 
-  bool access_OK = false;
   if (method->holder()->is_subclass_of(field_holder)) {
-    if (method->is_static()) {
-      if (method->name() == ciSymbol::class_initializer_name()) {
-        // OK to access static fields inside initializer
-        access_OK = true;
-      }
-    } else {
-      if (method->name() == ciSymbol::object_initializer_name()) {
-        // It's also OK to access static fields inside a constructor,
-        // because any thread calling the constructor must first have
-        // synchronized on the class by executing a '_new' bytecode.
-        access_OK = true;
-      }
+    if (method->is_static_initializer()) {
+      // OK to access static fields inside initializer
+      return true;
+    } else if (method->is_object_initializer()) {
+      // It's also OK to access static fields inside a constructor,
+      // because any thread calling the constructor must first have
+      // synchronized on the class by executing a '_new' bytecode.
+      return true;
     }
   }
-
-  return access_OK;
-
+  if (C->is_compiling_clinit_for(field_holder)) {
+    return true; // access in the context of static initializer
+  }
+  return false;
 }
 
 
--- a/src/hotspot/share/opto/split_if.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/opto/split_if.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -523,7 +523,9 @@
   }
   _igvn.remove_dead_node(new_iff);
   // Lazy replace IDOM info with the region's dominator
-  lazy_replace( iff, region_dom );
+  lazy_replace(iff, region_dom);
+  lazy_update(region, region_dom); // idom must be update before handle_uses
+  region->set_req(0, NULL);        // Break the self-cycle. Required for lazy_update to work on region
 
   // Now make the original merge point go dead, by handling all its uses.
   small_cache region_cache;
@@ -566,13 +568,8 @@
     --k;
   } // End of while merge point has phis
 
-  assert(region->outcnt() == 1, "Only self reference should remain"); // Just Self on the Region
-  region->set_req(0, NULL);       // Break the self-cycle
+  _igvn.remove_dead_node(region);
 
-  // Any leftover bits in the splitting block must not have depended on local
-  // Phi inputs (these have already been split-up).  Hence it's safe to hoist
-  // these guys to the dominating point.
-  lazy_replace( region, region_dom );
 #ifndef PRODUCT
   if( VerifyLoopOptimizations ) verify();
 #endif
--- a/src/hotspot/share/prims/methodHandles.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/prims/methodHandles.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -315,7 +315,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/os.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/runtime/os.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -910,6 +910,11 @@
   st->cr();
 }
 
+void os::print_instructions(outputStream* st, address pc, int unitsize) {
+  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
+  print_hex_dump(st, pc - 256, pc + 256, unitsize);
+}
+
 void os::print_environment_variables(outputStream* st, const char** env_list) {
   if (env_list) {
     st->print_cr("Environment Variables:");
--- a/src/hotspot/share/runtime/os.hpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/runtime/os.hpp	Tue Jul 16 16:24:54 2019 +0000
@@ -645,6 +645,7 @@
   static void print_siginfo(outputStream* st, const void* siginfo);
   static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
   static void print_date_and_time(outputStream* st, char* buf, size_t buflen);
+  static void print_instructions(outputStream* st, address pc, int unitsize);
 
   static void print_location(outputStream* st, intptr_t x, bool verbose = false);
   static size_t lasterror(char *buf, size_t len);
--- a/src/hotspot/share/runtime/sharedRuntime.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/hotspot/share/runtime/sharedRuntime.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1376,18 +1376,12 @@
   }
 #endif
 
-  // Do not patch call site for static call to another class
-  // when the class is not fully initialized.
-  if (invoke_code == Bytecodes::_invokestatic) {
-    if (!callee_method->method_holder()->is_initialized() &&
-        callee_method->method_holder() != caller_nm->method()->method_holder()) {
-      assert(callee_method->method_holder()->is_linked(), "must be");
-      return callee_method;
-    } else {
-      assert(callee_method->method_holder()->is_initialized() ||
-             callee_method->method_holder()->is_reentrant_initialization(thread),
-             "invalid class initialization state for invoke_static");
-    }
+  // Do not patch call site for static call when the class is not
+  // fully initialized.
+  if (invoke_code == Bytecodes::_invokestatic &&
+      !callee_method->method_holder()->is_initialized()) {
+    assert(callee_method->method_holder()->is_linked(), "must be");
+    return callee_method;
   }
 
   // JSR 292 key invariant:
--- a/src/java.base/share/classes/java/io/ObjectInputFilter.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java	Tue Jul 16 16:24:54 2019 +0000
@@ -283,7 +283,7 @@
         /**
          * Current configured filter.
          */
-        private static ObjectInputFilter serialFilter = configuredFilter;
+        private static volatile ObjectInputFilter serialFilter = configuredFilter;
 
         /**
          * Returns the process-wide serialization filter or {@code null} if not configured.
@@ -291,9 +291,7 @@
          * @return the process-wide serialization filter or {@code null} if not configured
          */
         public static ObjectInputFilter getSerialFilter() {
-            synchronized (serialFilterLock) {
-                return serialFilter;
-            }
+            return serialFilter;
         }
 
         /**
--- a/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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
@@ -670,6 +670,13 @@
     private boolean slowVerifyAccess(Class<?> caller, Class<?> memberClass,
                                      Class<?> targetClass, int modifiers)
     {
+
+        if (caller == null) {
+            // No caller frame when a native thread attaches to the VM
+            // only allow access to a public accessible member
+            return Reflection.verifyPublicMemberAccess(memberClass, modifiers);
+        }
+
         if (!Reflection.verifyMemberAccess(caller, memberClass, targetClass, modifiers)) {
             // access denied
             return false;
--- a/src/java.base/share/classes/java/util/ImmutableCollections.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.base/share/classes/java/util/ImmutableCollections.java	Tue Jul 16 16:24:54 2019 +0000
@@ -755,6 +755,11 @@
         }
 
         @Override
+        public V get(Object o) {
+            return o.equals(k0) ? v0 : null; // implicit nullcheck of o
+        }
+
+        @Override
         public boolean containsKey(Object o) {
             return o.equals(k0); // implicit nullcheck of o
         }
--- a/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1129,6 +1129,7 @@
             clone.entrySet = null;
             clone.values = null;
             clone.descendingMap = null;
+            clone.adder = null;
             clone.buildFromSorted(this);
             return clone;
         } catch (CloneNotSupportedException e) {
--- a/src/java.base/share/classes/jdk/internal/reflect/Reflection.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.base/share/classes/jdk/internal/reflect/Reflection.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -122,6 +122,9 @@
                                              Class<?> targetClass,
                                              int modifiers)
     {
+        Objects.requireNonNull(currentClass);
+        Objects.requireNonNull(memberClass);
+
         if (currentClass == memberClass) {
             // Always succeeds
             return true;
@@ -201,6 +204,22 @@
         return true;
     }
 
+    /*
+     * Verify if a member is public and memberClass is a public type
+     * in a package that is unconditionally exported and
+     * return {@code true}if it is granted.
+     *
+     * @param memberClass the declaring class of the member being accessed
+     * @param modifiers the member's access modifiers
+     * @return {@code true} if the member is public and in a publicly accessible type
+     */
+    public static boolean verifyPublicMemberAccess(Class<?> memberClass, int modifiers) {
+        Module m = memberClass.getModule();
+        return Modifier.isPublic(modifiers)
+            && m.isExported(memberClass.getPackageName())
+            && Modifier.isPublic(Reflection.getClassAccessFlags(memberClass));
+    }
+
     /**
      * Returns {@code true} if memberClass's module exports memberClass's
      * package to currentModule.
@@ -325,8 +344,10 @@
                                                                    Class<?> memberClass,
                                                                    Class<?> targetClass,
                                                                    int modifiers)
-        throws IllegalAccessException
     {
+        if (currentClass == null)
+            return newIllegalAccessException(memberClass, modifiers);
+
         String currentSuffix = "";
         String memberSuffix = "";
         Module m1 = currentClass.getModule();
@@ -356,6 +377,36 @@
     }
 
     /**
+     * Returns an IllegalAccessException with an exception message where
+     * there is no caller frame.
+     */
+    private static IllegalAccessException newIllegalAccessException(Class<?> memberClass,
+                                                                    int modifiers)
+    {
+        String memberSuffix = "";
+        Module m2 = memberClass.getModule();
+        if (m2.isNamed())
+            memberSuffix = " (in " + m2 + ")";
+
+        String memberPackageName = memberClass.getPackageName();
+
+        String msg = "JNI attached native thread (null caller frame) cannot access ";
+        if (m2.isExported(memberPackageName)) {
+
+            // module access okay so include the modifiers in the message
+            msg += "a member of " + memberClass + memberSuffix +
+                " with modifiers \"" + Modifier.toString(modifiers) + "\"";
+
+        } else {
+            // module access failed
+            msg += memberClass + memberSuffix+ " because "
+                + m2 + " does not export " + memberPackageName;
+        }
+
+        return new IllegalAccessException(msg);
+    }
+
+    /**
      * Returns true if {@code currentClass} and {@code memberClass}
      * are nestmates - that is, if they have the same nesthost as
      * determined by the VM.
--- a/src/java.base/share/legal/public_suffix.md	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.base/share/legal/public_suffix.md	Tue Jul 16 16:24:54 2019 +0000
@@ -11,7 +11,7 @@
 
 The Source Code of this file is available under the
 Mozilla Public License, v. 2.0 and is located at
-https://raw.githubusercontent.com/publicsuffix/list/2225db8d9f4a2a27ec697c883360632fa0c16261/public_suffix_list.dat.
+https://raw.githubusercontent.com/publicsuffix/list/ce0d1a5fba657e55adea3abde4b7f1e50636ff10/public_suffix_list.dat.
 If a copy of the MPL was not distributed with this file, you can obtain one
 at https://mozilla.org/MPL/2.0/.
 
Binary file src/java.base/share/lib/security/cacerts has changed
--- a/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c	Tue Jul 16 16:24:54 2019 +0000
@@ -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
@@ -1084,7 +1084,7 @@
 
     if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
                    (const char*)&index, sizeof(index)) < 0) {
-        if (errno == EINVAL && index > 0) {
+        if ((errno == EINVAL || errno == EADDRNOTAVAIL) && index > 0) {
             JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
                 "IPV6_MULTICAST_IF failed (interface has IPv4 "
                 "address only?)");
@@ -1496,6 +1496,7 @@
             CHECK_NULL_RETURN(ni_class, NULL);
         }
         ni = Java_java_net_NetworkInterface_getByInetAddress0(env, ni_class, addr);
+        JNU_CHECK_EXCEPTION_RETURN(env, NULL);
         if (ni) {
             return ni;
         }
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1182,13 +1182,24 @@
         ICONS_MAP = new HashMap<String, GTKStockIcon>();
         ICONS_MAP.put("FileChooser.cancelIcon", new GTKStockIcon("gtk-cancel", 4));
         ICONS_MAP.put("FileChooser.okIcon",     new GTKStockIcon("gtk-ok",     4));
-        ICONS_MAP.put("OptionPane.errorIcon", new GTKStockIcon("gtk-dialog-error", 6));
-        ICONS_MAP.put("OptionPane.informationIcon", new GTKStockIcon("gtk-dialog-info", 6));
-        ICONS_MAP.put("OptionPane.warningIcon", new GTKStockIcon("gtk-dialog-warning", 6));
-        ICONS_MAP.put("OptionPane.questionIcon", new GTKStockIcon("gtk-dialog-question", 6));
         ICONS_MAP.put("OptionPane.yesIcon", new GTKStockIcon("gtk-yes", 4));
         ICONS_MAP.put("OptionPane.noIcon", new GTKStockIcon("gtk-no", 4));
         ICONS_MAP.put("OptionPane.cancelIcon", new GTKStockIcon("gtk-cancel", 4));
         ICONS_MAP.put("OptionPane.okIcon", new GTKStockIcon("gtk-ok", 4));
+
+        //check whether the gtk version is >= 3.10 as the Icon names were
+        //changed from this version
+        UNIXToolkit tk = (UNIXToolkit)Toolkit.getDefaultToolkit();
+        if (tk.checkGtkVersion(3, 10, 0)) {
+            ICONS_MAP.put("OptionPane.errorIcon", new GTKStockIcon("dialog-error", 6));
+            ICONS_MAP.put("OptionPane.informationIcon", new GTKStockIcon("dialog-information", 6));
+            ICONS_MAP.put("OptionPane.warningIcon", new GTKStockIcon("dialog-warning", 6));
+            ICONS_MAP.put("OptionPane.questionIcon", new GTKStockIcon("dialog-question", 6));
+        } else {
+            ICONS_MAP.put("OptionPane.errorIcon", new GTKStockIcon("gtk-dialog-error", 6));
+            ICONS_MAP.put("OptionPane.informationIcon", new GTKStockIcon("gtk-dialog-info", 6));
+            ICONS_MAP.put("OptionPane.warningIcon", new GTKStockIcon("gtk-dialog-warning", 6));
+            ICONS_MAP.put("OptionPane.questionIcon", new GTKStockIcon("gtk-dialog-question", 6));
+        }
     }
 }
--- a/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java	Tue Jul 16 16:24:54 2019 +0000
@@ -449,14 +449,7 @@
             if (!doEraseBackground()) {
                 return;
             }
-            // 6304250: XAWT: Items in choice show a blue border on OpenGL + Solaris10 when background color is set
-            // Note: When OGL is enabled, surfaceData.pixelFor() will not
-            // return a pixel value appropriate for passing to
-            // XSetWindowBackground().  Therefore, we will use the ColorModel
-            // for this component in order to calculate a pixel value from
-            // the given RGB value.
-            ColorModel cm = getColorModel();
-            int pixel = PixelConverter.instance.rgbToPixel(c.getRGB(), cm);
+            int pixel = surfaceData.pixelFor(c.getRGB());
             XlibWrapper.XSetWindowBackground(XToolkit.getDisplay(), getContentWindow(), pixel);
             XlibWrapper.XClearWindow(XToolkit.getDisplay(), getContentWindow());
         }
--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c	Tue Jul 16 16:24:54 2019 +0000
@@ -1708,7 +1708,11 @@
 
     GtkStateFlags flags = get_gtk_flags(state_type);
     if (expander_style == GTK_EXPANDER_EXPANDED) {
-        flags |= GTK_STATE_FLAG_ACTIVE;
+        if (gtk3_version_3_14) {
+            flags |= GTK_STATE_FLAG_CHECKED;
+        } else {
+            flags |= GTK_STATE_FLAG_ACTIVE;
+        }
     }
 
     fp_gtk_style_context_set_state(context, flags);
@@ -1773,13 +1777,18 @@
         (widget_type == CHECK_BOX || widget_type == RADIO_BUTTON)) {
         return;
     }
-    gtk3_widget = gtk3_get_widget(widget_type);
-
-    GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget);
-    fp_gtk_style_context_save (context);
-
-    if (detail != 0) {
-        transform_detail_string(detail, context);
+
+    GtkStyleContext* context = NULL;
+    if (widget_type == TOOL_TIP) {
+        context = get_style(widget_type, detail);
+        fp_gtk_style_context_add_class(context, "background");
+    } else {
+        gtk3_widget = gtk3_get_widget(widget_type);
+        context = fp_gtk_widget_get_style_context (gtk3_widget);
+        fp_gtk_style_context_save (context);
+        if (detail != 0) {
+            transform_detail_string(detail, context);
+        }
     }
 
     GtkStateFlags flags = get_gtk_flags(state_type);
@@ -1795,8 +1804,11 @@
     }
 
     fp_gtk_render_background (context, cr, x, y, width, height);
-
-    fp_gtk_style_context_restore (context);
+    if (widget_type == TOOL_TIP) {
+        disposeOrRestoreContext(context);
+    } else {
+        fp_gtk_style_context_restore (context);
+    }
 }
 
 static void gtk3_paint_focus(WidgetType widget_type, GtkStateType state_type,
@@ -2356,17 +2368,19 @@
 
     init_containers();
 
-    if (widget_type == TEXT_FIELD && state_type == GTK_STATE_SELECTED &&
-        color_type == TEXT_BACKGROUND) {
-        widget_type = TEXT_AREA;
+    if (gtk3_version_3_20) {
+        if ((widget_type == TEXT_FIELD || widget_type == PASSWORD_FIELD || widget_type == SPINNER_TEXT_FIELD ||
+            widget_type == FORMATTED_TEXT_FIELD) && state_type == GTK_STATE_SELECTED && color_type == TEXT_BACKGROUND) {
+            widget_type = TEXT_AREA;
+        }
     }
 
-    gtk3_widget = gtk3_get_widget(widget_type);
-
-    GtkStyleContext* context = fp_gtk_widget_get_style_context(gtk3_widget);
-
+    GtkStyleContext* context = NULL;
     if (widget_type == TOOL_TIP) {
-        fp_gtk_style_context_add_class(context, "tooltip");
+        context = get_style(widget_type, "tooltip");
+    } else {
+        gtk3_widget = gtk3_get_widget(widget_type);
+        context = fp_gtk_widget_get_style_context(gtk3_widget);
     }
     if (widget_type == CHECK_BOX_MENU_ITEM
      || widget_type == RADIO_BUTTON_MENU_ITEM) {
@@ -2384,7 +2398,9 @@
 
     result = recode_color(color.alpha) << 24 | recode_color(color.red) << 16 |
              recode_color(color.green) << 8 | recode_color(color.blue);
-
+    if (widget_type == TOOL_TIP) {
+        disposeOrRestoreContext(context);
+    }
     return result;
 }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Tue Jul 16 16:24:54 2019 +0000
@@ -436,7 +436,14 @@
             } catch(ServiceConfigurationError sce) {
                 log.error(Errors.ProcBadConfigFile(sce.getLocalizedMessage()));
                 throw new Abort(sce);
+            } catch (UnsupportedClassVersionError ucve) {
+                log.error(Errors.ProcCantLoadClass(ucve.getLocalizedMessage()));
+                throw new Abort(ucve);
+            } catch (ClassFormatError cfe) {
+                log.error(Errors.ProcCantLoadClass(cfe.getLocalizedMessage()));
+                throw new Abort(cfe);
             } catch (Throwable t) {
+                log.error(Errors.ProcBadConfigFile(t.getLocalizedMessage()));
                 throw new Abort(t);
             }
         }
@@ -453,6 +460,7 @@
                 log.error(Errors.ProcBadConfigFile(sce.getLocalizedMessage()));
                 throw new Abort(sce);
             } catch (Throwable t) {
+                log.error(Errors.ProcBadConfigFile(t.getLocalizedMessage()));
                 throw new Abort(t);
             }
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -1051,6 +1051,10 @@
 compiler.err.proc.cant.find.class=\
     Could not find class file for ''{0}''.
 
+# 0: string
+compiler.err.proc.cant.load.class=\
+    Could not load processor class file due to ''{0}''.
+
 # Print a client-generated error message; assumed to be localized, no translation required
 # 0: string
 compiler.err.proc.messager=\
--- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -75,9 +75,9 @@
 
     protected final String algorithm;
 
-    protected CKey(String algorithm, long hCryptProv, long hCryptKey, int keyLength) {
+    protected CKey(String algorithm, NativeHandles handles, int keyLength) {
         this.algorithm = algorithm;
-        this.handles = new NativeHandles(hCryptProv, hCryptKey);
+        this.handles = handles;
         this.keyLength = keyLength;
     }
 
--- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyPair.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyPair.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -36,9 +36,13 @@
 
     private final CPublicKey publicKey;
 
+    /**
+     * This method is called by native codes in security.cpp.
+     */
     CKeyPair(String alg, long hCryptProv, long hCryptKey, int keyLength) {
-        privateKey = CPrivateKey.of(alg, hCryptProv, hCryptKey, keyLength);
-        publicKey = CPublicKey.of(alg, hCryptProv, hCryptKey, keyLength);
+        CKey.NativeHandles handles = new CKey.NativeHandles(hCryptProv, hCryptKey);
+        privateKey = CPrivateKey.of(alg, handles, keyLength);
+        publicKey = CPublicKey.of(alg, handles, keyLength);
     }
 
     public CPrivateKey getPrivate() {
--- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPrivateKey.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPrivateKey.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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,12 +37,18 @@
 
     private static final long serialVersionUID = 8113152807912338063L;
 
-    private CPrivateKey(String alg, long hCryptProv, long hCryptKey, int keyLength) {
-        super(alg, hCryptProv, hCryptKey, keyLength);
+    private CPrivateKey(String alg, NativeHandles handles, int keyLength) {
+        super(alg, handles, keyLength);
     }
 
-    public static CPrivateKey of(String alg, long hCryptProv, long hCryptKey, int keyLength) {
-        return new CPrivateKey(alg, hCryptProv, hCryptKey, keyLength);
+    // Called by native code inside security.cpp
+    static CPrivateKey of(
+            String alg, long hCryptProv, long hCryptKey, int keyLength) {
+        return of(alg, new NativeHandles(hCryptProv, hCryptKey), keyLength);
+    }
+
+    public static CPrivateKey of(String alg, NativeHandles handles, int keyLength) {
+        return new CPrivateKey(alg, handles, keyLength);
     }
 
     // this key does not support encoding
--- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPublicKey.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPublicKey.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -59,8 +59,8 @@
         private ECPoint w = null;
         private static final long serialVersionUID = 12L;
 
-        CECPublicKey(long hCryptProv, int keyLength) {
-            super("EC", hCryptProv, 0, keyLength);
+        CECPublicKey(NativeHandles handles, int keyLength) {
+            super("EC", handles, keyLength);
         }
 
         @Override
@@ -121,8 +121,8 @@
         private BigInteger exponent = null;
         private static final long serialVersionUID = 12L;
 
-        CRSAPublicKey(long hCryptProv, long hCryptKey, int keyLength) {
-            super("RSA", hCryptProv, hCryptKey, keyLength);
+        CRSAPublicKey(NativeHandles handles, int keyLength) {
+            super("RSA", handles, keyLength);
         }
 
         public String toString() {
@@ -181,21 +181,27 @@
         private native byte[] getModulus(byte[] keyBlob) throws KeyException;
     }
 
+    // Called by native code inside security.cpp
+    static CPublicKey of(
+            String alg, long hCryptProv, long hCryptKey, int keyLength) {
+        return of(alg, new NativeHandles(hCryptProv, hCryptKey), keyLength);
+    }
+
     public static CPublicKey of(
-            String alg, long hCryptProv, long hCryptKey, int keyLength) {
+            String alg, NativeHandles handles, int keyLength) {
         switch (alg) {
             case "RSA":
-                return new CRSAPublicKey(hCryptProv, hCryptKey, keyLength);
+                return new CRSAPublicKey(handles, keyLength);
             case "EC":
-                return new CECPublicKey(hCryptProv, keyLength);
+                return new CECPublicKey(handles, keyLength);
             default:
                 throw new AssertionError("Unsupported algorithm: " + alg);
         }
     }
 
     protected CPublicKey(
-            String alg, long hCryptProv, long hCryptKey, int keyLength) {
-        super(alg, hCryptProv, hCryptKey, keyLength);
+            String alg, NativeHandles handles, int keyLength) {
+        super(alg, handles, keyLength);
     }
 
     @Override
--- a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -692,18 +692,22 @@
 
 
 /*
- * Class:     sun_security_mscapi_Key
+ * Class:     sun_security_mscapi_CKey
  * Method:    cleanUp
  * Signature: (JJ)V
  */
-JNIEXPORT void JNICALL Java_sun_security_mscapi_Key_cleanUp
+JNIEXPORT void JNICALL Java_sun_security_mscapi_CKey_cleanUp
   (JNIEnv *env, jclass clazz, jlong hCryptProv, jlong hCryptKey)
 {
-    if (hCryptKey != NULL)
-        ::CryptDestroyKey((HCRYPTKEY) hCryptKey); // deprecated
+    if (hCryptKey == NULL && hCryptProv != NULL) {
+        NCryptFreeObject((NCRYPT_HANDLE)hCryptProv);
+    } else {
+        if (hCryptKey != NULL)
+            ::CryptDestroyKey((HCRYPTKEY) hCryptKey); // deprecated
 
-    if (hCryptProv != NULL)
-        ::CryptReleaseContext((HCRYPTPROV) hCryptProv, NULL); // deprecated
+        if (hCryptProv != NULL)
+            ::CryptReleaseContext((HCRYPTPROV) hCryptProv, NULL); // deprecated
+    }
 }
 
 /*
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, 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
@@ -172,7 +172,7 @@
     return 2;
   }
   public static int cellOffset(int index) {
-    return MethodData.cellSize + index * MethodData.cellSize;
+    return (headerSizeInCells() + index) * MethodData.cellSize;
   }
   // // Return a value which, when or-ed as a byte into _flags, sets the flag.
   // static int flagNumberToByteConstant(int flagNumber) {
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ar.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ar.java	Tue Jul 16 16:24:54 2019 +0000
@@ -212,6 +212,7 @@
                     "\u062a\u064a\u0634\u0648",
                     "\u0634\u0648\u0648\u0627",
                     "\u0647\u064a\u0633\u064a",
+                    "\u0631\u064a\u0648\u0627",
                 }
             },
             { "japanese.short.Eras",
@@ -221,6 +222,7 @@
                     "\u062a\u064a\u0634\u0648",
                     "\u0634\u0648\u0648\u0627",
                     "\u0647\u064a\u0633\u064a",
+                    "\u0631\u064a\u0648\u0627",
                 }
             },
             { "buddhist.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ko.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ko.java	Tue Jul 16 16:24:54 2019 +0000
@@ -192,6 +192,7 @@
                     "\ub2e4\uc774\uc1fc",
                     "\uc1fc\uc640",
                     "\ud5e4\uc774\uc138\uc774",
+                    "\ub808\uc774\uc640",
                 }
             },
             { "AmPmMarkers",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_th.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_th.java	Tue Jul 16 16:24:54 2019 +0000
@@ -245,6 +245,7 @@
                     "\u0e17\u0e30\u0e2d\u0e34\u0e42\u0e0a",
                     "\u0e42\u0e0a\u0e27\u0e30",
                     "\u0e40\u0e2e\u0e40\u0e0b",
+                    "\u0e40\u0e23\u0e27\u0e30",
                 }
             },
             { "japanese.short.Eras",
@@ -254,6 +255,7 @@
                     "\u0e17",
                     "\u0e0a",
                     "\u0e2e",
+                    "R",
                 }
             },
             { "buddhist.TimePatterns",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_zh.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_zh.java	Tue Jul 16 16:24:54 2019 +0000
@@ -282,6 +282,7 @@
                     "\u5927\u6b63",
                     "\u662d\u548c",
                     "\u5e73\u6210",
+                    "\u4ee4\u548c",
                 }
             },
             { "TimePatterns",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ar.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ar.java	Tue Jul 16 16:24:54 2019 +0000
@@ -157,6 +157,7 @@
             "\u062a\u064a\u0634\u0648",
             "\u0634\u0648\u0648\u0627",
             "\u0647\u064a\u0633\u064a",
+            "\u0631\u064a\u0648\u0627",
         };
 
         final String[] sharedShortEras = {
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_hi_IN.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_hi_IN.java	Tue Jul 16 16:24:54 2019 +0000
@@ -241,6 +241,7 @@
                     "\u0924\u093e\u0908\u0936\u094b",
                     "\u0936\u094b\u0935\u093e",
                     "\u0939\u0947\u0908\u0938\u0947\u0908",
+                    "\u0930\u0947\u0907\u0935\u093e",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -250,6 +251,7 @@
                     "\u0924\u093e\u0908\u0936\u094b",
                     "\u0936\u094b\u0935\u093e",
                     "\u0939\u0947\u0908\u0938\u0947\u0908",
+                    "\u0930\u0947\u0907\u0935\u093e",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_hr.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_hr.java	Tue Jul 16 16:24:54 2019 +0000
@@ -231,6 +231,7 @@
                     "Taish\u014d",
                     "Sh\u014dwa",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -240,6 +241,7 @@
                     "Taish\u014d",
                     "Sh\u014dwa",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_in.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_in.java	Tue Jul 16 16:24:54 2019 +0000
@@ -148,6 +148,7 @@
             "Taish\u014d",
             "Sh\u014dwa",
             "Heisei",
+            "Reiwa",
         };
 
         final String[] sharedEras = {
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ko.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ko.java	Tue Jul 16 16:24:54 2019 +0000
@@ -143,6 +143,7 @@
             "\ub2e4\uc774\uc1fc",
             "\uc1fc\uc640",
             "\ud5e4\uc774\uc138\uc774",
+            "\ub808\uc774\uc640",
         };
 
         final String[] sharedJavaTimeShortEras2 = {
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_lt.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_lt.java	Tue Jul 16 16:24:54 2019 +0000
@@ -223,6 +223,7 @@
                     "Tai\u0161o",
                     "\u0160ova",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -232,6 +233,7 @@
                     "Tai\u0161o",
                     "\u0160ova",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_nl.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_nl.java	Tue Jul 16 16:24:54 2019 +0000
@@ -265,6 +265,7 @@
                     "Taish\u014d",
                     "Sh\u014dwa",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -274,6 +275,7 @@
                     "Taish\u014d",
                     "Sh\u014dwa",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_no.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_no.java	Tue Jul 16 16:24:54 2019 +0000
@@ -283,6 +283,7 @@
                     "Taish\u014d",
                     "Sh\u014dwa",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -292,6 +293,7 @@
                     "T",
                     "S",
                     "H",
+                    "R",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ru.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ru.java	Tue Jul 16 16:24:54 2019 +0000
@@ -237,6 +237,7 @@
                     "\u042d\u043f\u043e\u0445\u0430 \u0422\u0430\u0439\u0441\u044c\u043e",
                     "\u0421\u044c\u043e\u0432\u0430",
                     "\u042d\u043f\u043e\u0445\u0430 \u0425\u044d\u0439\u0441\u044d\u0439",
+                    "\u0420\u044d\u0439\u0432\u0430",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -246,6 +247,7 @@
                     "\u042d\u043f\u043e\u0445\u0430 \u0422\u0430\u0439\u0441\u044c\u043e",
                     "\u0421\u044c\u043e\u0432\u0430",
                     "\u042d\u043f\u043e\u0445\u0430 \u0425\u044d\u0439\u0441\u044d\u0439",
+                    "\u0420\u044d\u0439\u0432\u0430",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_sr.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_sr.java	Tue Jul 16 16:24:54 2019 +0000
@@ -280,6 +280,7 @@
                     "\u0422\u0430\u0438\u0448\u043e",
                     "\u0428\u043e\u0432\u0430",
                     "\u0425\u0430\u0438\u0441\u0435\u0438",
+                    "\u0420\u0435\u0438\u0432\u0430",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -289,6 +290,7 @@
                     "\u0422\u0430\u0438\u0448\u043e",
                     "\u0428\u043e\u0432\u0430",
                     "\u0425\u0430\u0438\u0441\u0435\u0438",
+                    "\u0420\u0435\u0438\u0432\u0430",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_sr_Latn.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_sr_Latn.java	Tue Jul 16 16:24:54 2019 +0000
@@ -225,6 +225,7 @@
                     "Tai\u0161o",
                     "\u0160ova",
                     "Haisei",
+                    "Reiva",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -234,6 +235,7 @@
                     "Tai\u0161o",
                     "\u0160ova",
                     "Haisei",
+                    "Reiva",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_sv.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_sv.java	Tue Jul 16 16:24:54 2019 +0000
@@ -249,6 +249,7 @@
                     "Taish\u014d",
                     "Sh\u014dwa",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.japanese.short.Eras",
@@ -258,6 +259,7 @@
                     "Taish\u014d",
                     "Sh\u014dwa",
                     "Heisei",
+                    "Reiwa",
                 }
             },
             { "java.time.long.Eras",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_th.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_th.java	Tue Jul 16 16:24:54 2019 +0000
@@ -137,6 +137,7 @@
             "\u0e17\u0e30\u0e2d\u0e34\u0e42\u0e0a",
             "\u0e42\u0e0a\u0e27\u0e30",
             "\u0e40\u0e2e\u0e40\u0e0b",
+            "\u0e40\u0e23\u0e27\u0e30",
         };
 
         final String[] sharedShortEras = {
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_zh.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_zh.java	Tue Jul 16 16:24:54 2019 +0000
@@ -176,6 +176,7 @@
             "\u5927\u6b63",
             "\u662d\u548c",
             "\u5e73\u6210",
+            "\u4ee4\u548c",
         };
 
         final String[] sharedJavaTimeShortEras2 = {
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_zh_TW.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_zh_TW.java	Tue Jul 16 16:24:54 2019 +0000
@@ -135,6 +135,7 @@
             "\u5927\u6b63",
             "\u662d\u548c",
             "\u5e73\u6210",
+            "\u4ee4\u548c",
         };
 
         final String[] sharedJavaTimeShortEras2 = {
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java	Tue Jul 16 16:24:54 2019 +0000
@@ -48,7 +48,6 @@
  *
  * @author Steve Drach
  */
-
 class JarFileSystem extends ZipFileSystem {
     private Function<byte[],byte[]> lookup;
 
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystemProvider.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystemProvider.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,21 +25,13 @@
 
 package jdk.nio.zipfs;
 
-import java.nio.file.*;
-import java.nio.file.spi.*;
-import java.nio.file.attribute.*;
-import java.nio.file.spi.FileSystemProvider;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.file.FileSystem;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 
-import java.net.URI;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.nio.channels.FileChannel;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-class JarFileSystemProvider extends ZipFileSystemProvider
-{
+class JarFileSystemProvider extends ZipFileSystemProvider {
 
     @Override
     public String getScheme() {
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipCoder.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipCoder.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,15 +34,14 @@
 import java.nio.charset.CodingErrorAction;
 import java.util.Arrays;
 
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static java.nio.charset.StandardCharsets.ISO_8859_1;
 
 /**
  * Utility class for zipfile name and comment decoding and encoding
  *
- * @author  Xueming Shen
+ * @author Xueming Shen
  */
-
 class ZipCoder {
 
     static class UTF8 extends ZipCoder {
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipConstants.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipConstants.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,8 @@
 package jdk.nio.zipfs;
 
 /**
- *
  * @author Xueming Shen
  */
-
 class ZipConstants {
     /*
      * Compression methods
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipDirectoryStream.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipDirectoryStream.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,18 @@
 
 package jdk.nio.zipfs;
 
+import java.io.IOException;
+import java.nio.file.ClosedDirectoryStreamException;
 import java.nio.file.DirectoryStream;
-import java.nio.file.ClosedDirectoryStreamException;
 import java.nio.file.NotDirectoryException;
 import java.nio.file.Path;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
-import java.io.IOException;
 
 /**
  *
- * @author  Xueming Shen, Rajendra Gutupalli, Jaya Hangal
+ * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal
  */
-
 class ZipDirectoryStream implements DirectoryStream<Path> {
 
     private final ZipFileSystem zipfs;
@@ -70,8 +69,8 @@
         } catch (IOException e) {
             throw new IllegalStateException(e);
         }
+
         return new Iterator<Path>() {
-            private Path next;
             @Override
             public boolean hasNext() {
                 if (isClosed)
@@ -97,5 +96,4 @@
     public synchronized void close() throws IOException {
         isClosed = true;
     }
-
 }
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,17 @@
 
 package jdk.nio.zipfs;
 
-import java.nio.file.attribute.*;
 import java.io.IOException;
+import java.nio.file.attribute.BasicFileAttributeView;
+import java.nio.file.attribute.FileAttributeView;
+import java.nio.file.attribute.FileTime;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
-/*
- * @author  Xueming Shen, Rajendra Gutupalli, Jaya Hangal
+/**
+ * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal
  */
-
-class ZipFileAttributeView implements BasicFileAttributeView
-{
+class ZipFileAttributeView implements BasicFileAttributeView {
     private static enum AttrID {
         size,
         creationTime,
@@ -85,8 +85,7 @@
         return isZipView ? "zip" : "basic";
     }
 
-    public ZipFileAttributes readAttributes() throws IOException
-    {
+    public ZipFileAttributes readAttributes() throws IOException {
         return path.getAttributes();
     }
 
@@ -104,11 +103,11 @@
     {
         try {
             if (AttrID.valueOf(attribute) == AttrID.lastModifiedTime)
-                setTimes ((FileTime)value, null, null);
+                setTimes((FileTime)value, null, null);
             if (AttrID.valueOf(attribute) == AttrID.lastAccessTime)
-                setTimes (null, (FileTime)value, null);
+                setTimes(null, (FileTime)value, null);
             if (AttrID.valueOf(attribute) == AttrID.creationTime)
-                setTimes (null, null, (FileTime)value);
+                setTimes(null, null, (FileTime)value);
             return;
         } catch (IllegalArgumentException x) {}
         throw new UnsupportedOperationException("'" + attribute +
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileAttributes.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileAttributes.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,10 +28,10 @@
 import java.nio.file.attribute.BasicFileAttributes;
 
 /**
+ * The attributes of a file stored in a zip file.
  *
- * @author  Xueming Shen, Rajendra Gutupalli,Jaya Hangal
+ * @author Xueming Shen, Rajendra Gutupalli,Jaya Hangal
  */
-
 interface ZipFileAttributes extends BasicFileAttributes {
     public long compressedSize();
     public long crc();
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileStore.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileStore.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,21 +26,17 @@
 package jdk.nio.zipfs;
 
 import java.io.IOException;
-import java.nio.file.Files;
 import java.nio.file.FileStore;
 import java.nio.file.FileSystems;
+import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.attribute.BasicFileAttributeView;
 import java.nio.file.attribute.FileAttributeView;
 import java.nio.file.attribute.FileStoreAttributeView;
-import java.nio.file.attribute.BasicFileAttributeView;
-import java.util.Formatter;
 
-/*
- *
- * @author  Xueming Shen, Rajendra Gutupalli, Jaya Hangal
+/**
+ * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal
  */
-
 class ZipFileStore extends FileStore {
 
     private final ZipFileSystem zfs;
@@ -76,7 +72,6 @@
     }
 
     @Override
-    @SuppressWarnings("unchecked")
     public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) {
         if (type == null)
             throw new NullPointerException();
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,17 +29,22 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.EOFException;
-import java.io.File;
 import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
 import java.nio.MappedByteBuffer;
-import java.nio.channels.*;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.SeekableByteChannel;
+import java.nio.channels.WritableByteChannel;
 import java.nio.file.*;
-import java.nio.file.attribute.*;
-import java.nio.file.spi.*;
+import java.nio.file.attribute.FileAttribute;
+import java.nio.file.attribute.FileTime;
+import java.nio.file.attribute.UserPrincipalLookupService;
+import java.nio.file.spi.FileSystemProvider;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
@@ -49,25 +54,30 @@
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.regex.Pattern;
 import java.util.zip.CRC32;
+import java.util.zip.Deflater;
+import java.util.zip.DeflaterOutputStream;
 import java.util.zip.Inflater;
-import java.util.zip.Deflater;
 import java.util.zip.InflaterInputStream;
-import java.util.zip.DeflaterOutputStream;
 import java.util.zip.ZipException;
-import static java.lang.Boolean.*;
+
+import static java.lang.Boolean.TRUE;
+import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES;
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+import static java.nio.file.StandardOpenOption.APPEND;
+import static java.nio.file.StandardOpenOption.CREATE;
+import static java.nio.file.StandardOpenOption.CREATE_NEW;
+import static java.nio.file.StandardOpenOption.READ;
+import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
+import static java.nio.file.StandardOpenOption.WRITE;
 import static jdk.nio.zipfs.ZipConstants.*;
 import static jdk.nio.zipfs.ZipUtils.*;
-import static java.nio.file.StandardOpenOption.*;
-import static java.nio.file.StandardCopyOption.*;
 
 /**
  * A FileSystem built on a zip file
  *
  * @author Xueming Shen
  */
-
 class ZipFileSystem extends FileSystem {
-
     private final ZipFileSystemProvider provider;
     private final Path zfpath;
     final ZipCoder zc;
@@ -79,15 +89,15 @@
     private final boolean useTempFile;   // use a temp file for newOS, default
                                          // is to use BAOS for better performance
     private static final boolean isWindows = AccessController.doPrivileged(
-            (PrivilegedAction<Boolean>) () -> System.getProperty("os.name")
-                                                    .startsWith("Windows"));
+            (PrivilegedAction<Boolean>)() -> System.getProperty("os.name")
+                                                   .startsWith("Windows"));
     private final boolean forceEnd64;
     private final int defaultMethod;     // METHOD_STORED if "noCompression=true"
                                          // METHOD_DEFLATED otherwise
 
     ZipFileSystem(ZipFileSystemProvider provider,
                   Path zfpath,
-                  Map<String, ?> env)  throws IOException
+                  Map<String, ?> env) throws IOException
     {
         // default encoding for name/comment
         String nameEncoding = env.containsKey("encoding") ?
@@ -269,12 +279,12 @@
         }
         if (!streams.isEmpty()) {    // unlock and close all remaining streams
             Set<InputStream> copy = new HashSet<>(streams);
-            for (InputStream is: copy)
+            for (InputStream is : copy)
                 is.close();
         }
         beginWrite();                // lock and sync
         try {
-            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
+            AccessController.doPrivileged((PrivilegedExceptionAction<Void>)() -> {
                 sync(); return null;
             });
             ch.close();              // close the ch just in case no update
@@ -296,7 +306,7 @@
 
         IOException ioe = null;
         synchronized (tmppaths) {
-            for (Path p: tmppaths) {
+            for (Path p : tmppaths) {
                 try {
                     AccessController.doPrivileged(
                         (PrivilegedExceptionAction<Boolean>)() -> Files.deleteIfExists(p));
@@ -521,7 +531,7 @@
         boolean hasCreate = false;
         boolean hasAppend = false;
         boolean hasTruncate = false;
-        for (OpenOption opt: options) {
+        for (OpenOption opt : options) {
             if (opt == READ)
                 throw new IllegalArgumentException("READ not allowed");
             if (opt == CREATE_NEW)
@@ -590,11 +600,11 @@
             throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
     }
 
-
     // Returns an output SeekableByteChannel for either
     // (1) writing the contents of a new entry, if the entry doesn't exit, or
     // (2) updating/replacing the contents of an existing entry.
-    // Note: The content is not compressed.
+    // Note: The content of the channel is not compressed until the
+    // channel is closed
     private class EntryOutputChannel extends ByteArrayChannel {
         Entry e;
 
@@ -613,19 +623,19 @@
 
         @Override
         public void close() throws IOException {
-            e.bytes = toByteArray();
-            e.size = e.bytes.length;
-            e.crc = -1;
+            // will update the entry
+            try (OutputStream os = getOutputStream(e)) {
+                os.write(toByteArray());
+            }
             super.close();
-            update(e);
         }
     }
 
-    private int getCompressMethod(FileAttribute<?>... attrs) {
+    private int getCompressMethod() {
          return defaultMethod;
     }
 
-    // Returns a Writable/ReadByteChannel for now. Might consdier to use
+    // Returns a Writable/ReadByteChannel for now. Might consider to use
     // newFileChannel() instead, which dump the entry data into a regular
     // file on the default file system and create a FileChannel on top of
     // it.
@@ -638,10 +648,9 @@
         if (options.contains(StandardOpenOption.WRITE) ||
             options.contains(StandardOpenOption.APPEND)) {
             checkWritable();
-            beginRead();    // only need a readlock, the "update()" will obtain
-                            // thewritelock when the channel is closed
+            beginRead();    // only need a read lock, the "update()" will obtain
+                            // the write lock when the channel is closed
             try {
-                ensureOpen();
                 Entry e = getEntry(path);
                 if (e != null) {
                     if (e.isDir() || options.contains(CREATE_NEW))
@@ -666,8 +675,7 @@
                     throw new NoSuchFileException(getString(path));
                 checkParents(path);
                 return new EntryOutputChannel(
-                    new Entry(path, Entry.NEW, false, getCompressMethod(attrs)));
-
+                    new Entry(path, Entry.NEW, false, getCompressMethod()));
             } finally {
                 endRead();
             }
@@ -734,7 +742,7 @@
             final Entry u = isFCH ? e : new Entry(path, tmpfile, Entry.FILECH);
             if (forWrite) {
                 u.flag = FLAG_DATADESCR;
-                u.method = getCompressMethod(attrs);
+                u.method = getCompressMethod();
             }
             // is there a better way to hook into the FileChannel's close method?
             return new FileChannel() {
@@ -835,7 +843,11 @@
 
     // the outstanding input streams that need to be closed
     private Set<InputStream> streams =
-        Collections.synchronizedSet(new HashSet<InputStream>());
+        Collections.synchronizedSet(new HashSet<>());
+
+    // the ex-channel and ex-path that need to close when their outstanding
+    // input streams are all closed by the obtainers.
+    private Set<ExistingChannelCloser> exChClosers = new HashSet<>();
 
     private Set<Path> tmppaths = Collections.synchronizedSet(new HashSet<Path>());
     private Path getTempPathForEntry(byte[] path) throws IOException {
@@ -1193,25 +1205,20 @@
         return written;
     }
 
-    private long writeEntry(Entry e, OutputStream os, byte[] buf)
+    private long writeEntry(Entry e, OutputStream os)
         throws IOException {
 
         if (e.bytes == null && e.file == null)    // dir, 0-length data
             return 0;
 
         long written = 0;
-        try (OutputStream os2 = e.method == METHOD_STORED ?
-            new EntryOutputStreamCRC32(e, os) : new EntryOutputStreamDef(e, os)) {
-            if (e.bytes != null) {                 // in-memory
-                os2.write(e.bytes, 0, e.bytes.length);
-            } else if (e.file != null) {           // tmp file
-                if (e.type == Entry.NEW || e.type == Entry.FILECH) {
-                    try (InputStream is = Files.newInputStream(e.file)) {
-                        is.transferTo(os2);
-                    }
-                }
-                Files.delete(e.file);
-                tmppaths.remove(e.file);
+        if (e.csize > 0 && (e.crc != 0 || e.size == 0)) {
+            // pre-compressed entry, write directly to output stream
+            writeTo(e, os);
+        } else {
+            try (OutputStream os2 = (e.method == METHOD_STORED) ?
+                    new EntryOutputStreamCRC32(e, os) : new EntryOutputStreamDef(e, os)) {
+                writeTo(e, os2);
             }
         }
         written += e.csize;
@@ -1221,18 +1228,38 @@
         return written;
     }
 
+    private void writeTo(Entry e, OutputStream os) throws IOException {
+        if (e.bytes != null) {
+            os.write(e.bytes, 0, e.bytes.length);
+        } else if (e.file != null) {
+            if (e.type == Entry.NEW || e.type == Entry.FILECH) {
+                try (InputStream is = Files.newInputStream(e.file)) {
+                    is.transferTo(os);
+                }
+            }
+            Files.delete(e.file);
+            tmppaths.remove(e.file);
+        }
+    }
+
     // sync the zip file system, if there is any udpate
     private void sync() throws IOException {
-
+        // check ex-closer
+        if (!exChClosers.isEmpty()) {
+            for (ExistingChannelCloser ecc : exChClosers) {
+                if (ecc.closeAndDeleteIfDone()) {
+                    exChClosers.remove(ecc);
+                }
+            }
+        }
         if (!hasUpdate)
             return;
         Path tmpFile = createTempFileInSameDirectoryAs(zfpath);
-        try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(tmpFile, WRITE)))
-        {
+        try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(tmpFile, WRITE))) {
             ArrayList<Entry> elist = new ArrayList<>(inodes.size());
             long written = 0;
-            byte[] buf = new byte[8192];
-            Entry e = null;
+            byte[] buf = null;
+            Entry e;
 
             // write loc
             for (IndexNode inode : inodes.values()) {
@@ -1245,11 +1272,13 @@
                             // LOC in new file and simply copy the rest (data and
                             // ext) without enflating/deflating from the old zip
                             // file LOC entry.
+                            if (buf == null)
+                                buf = new byte[8192];
                             written += copyLOCEntry(e, true, os, written, buf);
                         } else {                          // NEW, FILECH or CEN
                             e.locoff = written;
                             written += e.writeLOC(os);    // write loc header
-                            written += writeEntry(e, os, buf);
+                            written += writeEntry(e, os);
                         }
                         elist.add(e);
                     } catch (IOException x) {
@@ -1265,6 +1294,8 @@
                     }
                     e = Entry.readCEN(this, inode);
                     try {
+                        if (buf == null)
+                            buf = new byte[8192];
                         written += copyLOCEntry(e, false, os, written, buf);
                         elist.add(e);
                     } catch (IOException x) {
@@ -1282,9 +1313,23 @@
             end.cenlen = written - end.cenoff;
             end.write(os, written, forceEnd64);
         }
+        if (!streams.isEmpty()) {
+            //
+            // There are outstanding input streams open on existing "ch",
+            // so, don't close the "cha" and delete the "file for now, let
+            // the "ex-channel-closer" to handle them
+            Path path = createTempFileInSameDirectoryAs(zfpath);
+            ExistingChannelCloser ecc = new ExistingChannelCloser(path,
+                                                                  ch,
+                                                                  streams);
+            Files.move(zfpath, path, REPLACE_EXISTING);
+            exChClosers.add(ecc);
+            streams = Collections.synchronizedSet(new HashSet<>());
+        } else {
+            ch.close();
+            Files.delete(zfpath);
+        }
 
-        ch.close();
-        Files.delete(zfpath);
         Files.move(tmpFile, zfpath, REPLACE_EXISTING);
         hasUpdate = false;    // clear
     }
@@ -1342,11 +1387,15 @@
         } else {
             os = new ByteArrayOutputStream((e.size > 0)? (int)e.size : 8192);
         }
-        return new EntryOutputStream(e, os);
+        if (e.method == METHOD_DEFLATED) {
+            return new DeflatingEntryOutputStream(e, os);
+        } else {
+            return new EntryOutputStream(e, os);
+        }
     }
 
     private class EntryOutputStream extends FilterOutputStream {
-        private Entry e;
+        private final Entry e;
         private long written;
         private boolean isClosed;
 
@@ -1383,13 +1432,56 @@
         }
     }
 
+    // Output stream returned when writing "deflated" entries into memory,
+    // to enable eager (possibly parallel) deflation and reduce memory required.
+    private class DeflatingEntryOutputStream extends DeflaterOutputStream {
+        private final CRC32 crc;
+        private final Entry e;
+        private boolean isClosed;
+
+        DeflatingEntryOutputStream(Entry e, OutputStream os) throws IOException {
+            super(os, getDeflater());
+            this.e = Objects.requireNonNull(e, "Zip entry is null");
+            this.crc = new CRC32();
+        }
+
+        @Override
+        public synchronized void write(int b) throws IOException {
+            super.write(b);
+            crc.update(b);
+        }
+
+        @Override
+        public synchronized void write(byte b[], int off, int len)
+                throws IOException {
+            super.write(b, off, len);
+            crc.update(b, off, len);
+        }
+
+        @Override
+        public synchronized void close() throws IOException {
+            if (isClosed)
+                return;
+            isClosed = true;
+            finish();
+            e.size  = def.getBytesRead();
+            e.csize = def.getBytesWritten();
+            e.crc = crc.getValue();
+            if (out instanceof ByteArrayOutputStream)
+                e.bytes = ((ByteArrayOutputStream)out).toByteArray();
+            super.close();
+            update(e);
+            releaseDeflater(def);
+        }
+    }
+
     // Wrapper output stream class to write out a "stored" entry.
     // (1) this class does not close the underlying out stream when
     //     being closed.
     // (2) no need to be "synchronized", only used by sync()
     private class EntryOutputStreamCRC32 extends FilterOutputStream {
-        private Entry e;
-        private CRC32 crc;
+        private final CRC32 crc;
+        private final Entry e;
         private long written;
         private boolean isClosed;
 
@@ -1429,8 +1521,8 @@
     //     being closed.
     // (2) no need to be "synchronized", only used by sync()
     private class EntryOutputStreamDef extends DeflaterOutputStream {
-        private CRC32 crc;
-        private Entry e;
+        private final CRC32 crc;
+        private final Entry e;
         private boolean isClosed;
 
         EntryOutputStreamDef(Entry e, OutputStream os) throws IOException {
@@ -1455,20 +1547,19 @@
             e.size  = def.getBytesRead();
             e.csize = def.getBytesWritten();
             e.crc = crc.getValue();
+            releaseDeflater(def);
         }
     }
 
     private InputStream getInputStream(Entry e)
         throws IOException
     {
-        InputStream eis = null;
-
+        InputStream eis;
         if (e.type == Entry.NEW) {
-            // now bytes & file is uncompressed.
             if (e.bytes != null)
-                return new ByteArrayInputStream(e.bytes);
+                eis = new ByteArrayInputStream(e.bytes);
             else if (e.file != null)
-                return Files.newInputStream(e.file);
+                eis = Files.newInputStream(e.file);
             else
                 throw new ZipException("update entry data is missing");
         } else if (e.type == Entry.FILECH) {
@@ -1477,7 +1568,7 @@
             // TBD: wrap to hook close()
             // streams.add(eis);
             return eis;
-        } else {  // untouced  CEN or COPY
+        } else {  // untouched CEN or COPY
             eis = new EntryInputStream(e, ch);
         }
         if (e.method == METHOD_DEFLATED) {
@@ -1539,14 +1630,12 @@
                                           // point to a new channel after sync()
         private   long pos;               // current position within entry data
         protected long rem;               // number of remaining bytes within entry
-        protected final long size;        // uncompressed size of this entry
 
         EntryInputStream(Entry e, SeekableByteChannel zfch)
             throws IOException
         {
             this.zfch = zfch;
             rem = e.csize;
-            size = e.size;
             pos = e.locoff;
             if (pos == -1) {
                 Entry e2 = getEntry(e.name);
@@ -1571,7 +1660,7 @@
                 len = (int) rem;
             }
             // readFullyAt()
-            long n = 0;
+            long n;
             ByteBuffer bb = ByteBuffer.wrap(b);
             bb.position(off);
             bb.limit(off + len);
@@ -1613,10 +1702,6 @@
             return rem > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) rem;
         }
 
-        public long size() {
-            return size;
-        }
-
         public void close() {
             rem = 0;
             streams.remove(this);
@@ -1672,7 +1757,7 @@
     // List of available Deflater objects for compression
     private final List<Deflater> deflaters = new ArrayList<>();
 
-    // Gets an deflater from the list of available deflaters or allocates
+    // Gets a deflater from the list of available deflaters or allocates
     // a new one.
     private Deflater getDeflater() {
         synchronized (deflaters) {
@@ -1901,7 +1986,7 @@
             this.type = type;
         }
 
-        Entry (Entry e, int type) {
+        Entry(Entry e, int type) {
             name(e.name);
             this.isdir     = e.isdir;
             this.version   = e.version;
@@ -1924,7 +2009,7 @@
             this.type      = type;
         }
 
-        Entry (byte[] name, Path file, int type) {
+        Entry(byte[] name, Path file, int type) {
             this(name, type, false, METHOD_STORED);
             this.file = file;
         }
@@ -1985,9 +2070,7 @@
             return this;
         }
 
-        int writeCEN(OutputStream os) throws IOException
-        {
-            int written  = CENHDR;
+        int writeCEN(OutputStream os) throws IOException {
             int version0 = version();
             long csize0  = csize;
             long size0   = size;
@@ -2101,9 +2184,7 @@
         ///////////////////// LOC //////////////////////
 
         int writeLOC(OutputStream os) throws IOException {
-            writeInt(os, LOCSIG);               // LOC header signature
-            int version = version();
-
+            int version0 = version();
             byte[] zname = isdir ? toDirectoryPath(name) : name;
             int nlen = (zname != null) ? zname.length - 1 : 0; // [0] is slash
             int elen = (extra != null) ? extra.length : 0;
@@ -2112,8 +2193,9 @@
             int elen64 = 0;
             int elenEXTT = 0;
             int elenNTFS = 0;
+            writeInt(os, LOCSIG);               // LOC header signature
             if ((flag & FLAG_DATADESCR) != 0) {
-                writeShort(os, version());      // version needed to extract
+                writeShort(os, version0);       // version needed to extract
                 writeShort(os, flag);           // general purpose bit flag
                 writeShort(os, method);         // compression method
                 // last modification time
@@ -2128,7 +2210,7 @@
                     elen64 = 20;    //headid(2) + size(2) + size(8) + csize(8)
                     writeShort(os, 45);         // ver 4.5 for zip64
                 } else {
-                    writeShort(os, version());  // version needed to extract
+                    writeShort(os, version0);   // version needed to extract
                 }
                 writeShort(os, flag);           // general purpose bit flag
                 writeShort(os, method);         // compression method
@@ -2423,6 +2505,36 @@
         }
     }
 
+    private static class ExistingChannelCloser {
+        private final Path path;
+        private final SeekableByteChannel ch;
+        private final Set<InputStream> streams;
+        ExistingChannelCloser(Path path,
+                              SeekableByteChannel ch,
+                              Set<InputStream> streams) {
+            this.path = path;
+            this.ch = ch;
+            this.streams = streams;
+        }
+
+        /**
+         * If there are no more outstanding streams, close the channel and
+         * delete the backing file
+         *
+         * @return true if we're done and closed the backing file,
+         *         otherwise false
+         * @throws IOException
+         */
+        public boolean closeAndDeleteIfDone() throws IOException {
+            if (streams.isEmpty()) {
+                ch.close();
+                Files.delete(path);
+                return true;
+            }
+            return false;
+        }
+    }
+
     // ZIP directory has two issues:
     // (1) ZIP spec does not require the ZIP file to include
     //     directory entry
@@ -2430,7 +2542,6 @@
     //     structure.
     // A possible solution is to build the node tree ourself as
     // implemented below.
-    private IndexNode root;
 
     // default time stamp for pseudo entries
     private long zfsDefaultTimeStamp = System.currentTimeMillis();
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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,28 +25,31 @@
 
 package jdk.nio.zipfs;
 
-import java.io.*;
-import java.nio.channels.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.channels.AsynchronousFileChannel;
+import java.nio.channels.FileChannel;
+import java.nio.channels.SeekableByteChannel;
 import java.nio.file.*;
 import java.nio.file.DirectoryStream.Filter;
-import java.nio.file.attribute.*;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.attribute.FileAttribute;
+import java.nio.file.attribute.FileAttributeView;
 import java.nio.file.spi.FileSystemProvider;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ExecutorService;
 import java.util.zip.ZipException;
-import java.util.concurrent.ExecutorService;
 
-/*
- *
- * @author  Xueming Shen, Rajendra Gutupalli, Jaya Hangal
+/**
+ * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal
  */
-
 public class ZipFileSystemProvider extends FileSystemProvider {
 
-
     private final Map<Path, ZipFileSystem> filesystems = new HashMap<>();
 
     public ZipFileSystemProvider() {}
@@ -98,7 +101,7 @@
                 if (filesystems.containsKey(realPath))
                     throw new FileSystemAlreadyExistsException();
             }
-            ZipFileSystem zipfs = null;
+            ZipFileSystem zipfs;
             try {
                 if (env.containsKey("multi-release")) {
                     zipfs = new JarFileSystem(this, path, env);
@@ -125,13 +128,13 @@
         throws IOException
     {
         ensureFile(path);
-         try {
-             ZipFileSystem zipfs;
-             if (env.containsKey("multi-release")) {
-                 zipfs = new JarFileSystem(this, path, env);
-             } else {
-                 zipfs = new ZipFileSystem(this, path, env);
-             }
+        try {
+            ZipFileSystem zipfs;
+            if (env.containsKey("multi-release")) {
+                zipfs = new JarFileSystem(this, path, env);
+            } else {
+                zipfs = new ZipFileSystem(this, path, env);
+            }
             return zipfs;
         } catch (ZipException ze) {
             String pname = path.toString();
@@ -202,7 +205,6 @@
     }
 
     @Override
-    @SuppressWarnings("unchecked")
     public <V extends FileAttributeView> V
         getFileAttributeView(Path path, Class<V> type, LinkOption... options)
     {
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipInfo.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipInfo.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,15 +28,17 @@
 import java.nio.file.Paths;
 import java.util.Collections;
 import java.util.Map;
+
 import static jdk.nio.zipfs.ZipConstants.*;
-import static jdk.nio.zipfs.ZipUtils.*;
+import static jdk.nio.zipfs.ZipUtils.dosToJavaTime;
+import static jdk.nio.zipfs.ZipUtils.unixToJavaTime;
+import static jdk.nio.zipfs.ZipUtils.winToJavaTime;
 
 /**
  * Print all loc and cen headers of the ZIP file
  *
- * @author  Xueming Shen
+ * @author Xueming Shen
  */
-
 public class ZipInfo {
 
     public static void main(String[] args) throws Throwable {
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,22 +25,36 @@
 
 package jdk.nio.zipfs;
 
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.URI;
-import java.nio.channels.*;
+import java.nio.channels.FileChannel;
+import java.nio.channels.SeekableByteChannel;
 import java.nio.file.*;
 import java.nio.file.DirectoryStream.Filter;
-import java.nio.file.attribute.*;
-import java.util.*;
+import java.nio.file.attribute.BasicFileAttributeView;
+import java.nio.file.attribute.FileAttribute;
+import java.nio.file.attribute.FileTime;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static java.nio.file.StandardOpenOption.*;
-import static java.nio.file.StandardCopyOption.*;
+import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES;
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+import static java.nio.file.StandardOpenOption.CREATE;
+import static java.nio.file.StandardOpenOption.READ;
+import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
+import static java.nio.file.StandardOpenOption.WRITE;
 
 /**
- *
- * @author  Xueming Shen, Rajendra Gutupalli,Jaya Hangal
+ * @author Xueming Shen, Rajendra Gutupalli,Jaya Hangal
  */
-
 final class ZipPath implements Path {
 
     private final ZipFileSystem zfs;
@@ -522,7 +536,6 @@
     private byte[] normalize(String path, int off, int len) {
         StringBuilder to = new StringBuilder(len);
         to.append(path, 0, off);
-        int m = off;
         char prevC = 0;
         while (off < len) {
             char c = path.charAt(off++);
@@ -663,7 +676,7 @@
 
     @Override
     public Iterator<Path> iterator() {
-        return new Iterator<Path>() {
+        return new Iterator<>() {
             private int i = 0;
 
             @Override
@@ -733,8 +746,8 @@
     void setAttribute(String attribute, Object value, LinkOption... options)
         throws IOException
     {
-        String type = null;
-        String attr = null;
+        String type;
+        String attr;
         int colonPos = attribute.indexOf(':');
         if (colonPos == -1) {
             type = "basic";
@@ -759,8 +772,8 @@
         throws IOException
 
     {
-        String view = null;
-        String attrs = null;
+        String view;
+        String attrs;
         int colonPos = attributes.indexOf(':');
         if (colonPos == -1) {
             view = "basic";
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipUtils.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipUtils.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,14 +33,12 @@
 import java.time.ZoneId;
 import java.util.Arrays;
 import java.util.Date;
+import java.util.concurrent.TimeUnit;
 import java.util.regex.PatternSyntaxException;
-import java.util.concurrent.TimeUnit;
 
 /**
- *
  * @author Xueming Shen
  */
-
 class ZipUtils {
 
     /*
@@ -155,7 +153,6 @@
             ldt.getSecond() >> 1) & 0xffffffffL;
     }
 
-
     // used to adjust values between Windows and java epoch
     private static final long WINDOWS_EPOCH_IN_MICROSECONDS = -11644473600000000L;
     public static final long winToJavaTime(long wtime) {
--- a/test/hotspot/gtest/memory/test_virtualSpaceNode.cpp	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/gtest/memory/test_virtualSpaceNode.cpp	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 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,6 +28,9 @@
 #include "utilities/formatBuffer.hpp"
 #include "unittest.hpp"
 
+// include as last, or otherwise we pull in an incompatible "assert" macro
+#include <vector>
+
 using namespace metaspace;
 
 namespace {
@@ -71,24 +74,55 @@
 
 // removes all the chunks added to the ChunkManager since creation of ChunkManagerRestorer
 class ChunkManagerRestorer {
-  ChunkManager* const _cm;
-  Metachunk* _chunks[NumberOfFreeLists];
- public:
-  ChunkManagerRestorer(ChunkManager* cm) : _cm(cm) {
-    for (ChunkIndex i = ZeroIndex; i < NumberOfFreeLists; i = next_chunk_index(i)) {
-      ChunkList* l = ChunkManagerTest::free_chunks(_cm, i);
-      _chunks[i] = l->tail();
+  metaspace::ChunkManager* const _cm;
+  std::vector<metaspace::Metachunk*>* _free_chunks[metaspace::NumberOfFreeLists];
+  int _count_pre_existing;
+public:
+  ChunkManagerRestorer(metaspace::ChunkManager* cm) : _cm(cm), _count_pre_existing(0) {
+    _cm->locked_verify();
+    for (metaspace::ChunkIndex i = metaspace::ZeroIndex; i < metaspace::NumberOfFreeLists; i = next_chunk_index(i)) {
+      metaspace::ChunkList* l = ChunkManagerTest::free_chunks(_cm, i);
+      _count_pre_existing += l->count();
+      std::vector<metaspace::Metachunk*> *v = new std::vector<metaspace::Metachunk*>(l->count());
+      metaspace::Metachunk* c = l->head();
+      while (c) {
+        v->push_back(c);
+        c = c->next();
+      }
+      _free_chunks[i] = v;
     }
   }
   ~ChunkManagerRestorer() {
+    _cm->locked_verify();
+    for (metaspace::ChunkIndex i = metaspace::ZeroIndex; i < metaspace::NumberOfFreeLists; i = next_chunk_index(i)) {
+      metaspace::ChunkList* l = ChunkManagerTest::free_chunks(_cm, i);
+      std::vector<metaspace::Metachunk*> *v = _free_chunks[i];
+      ssize_t count = l->count();
+      for (ssize_t j = 0; j < count; j++) {
+        metaspace::Metachunk* c = l->head();
+        while (c) {
+          bool found = false;
+          for (size_t k = 0; k < v->size() && !found; k++) {
+            found = (c == v->at(k));
+          }
+          if (found) {
+            c = c->next();
+          } else {
+            _cm->remove_chunk(c);
+            break;
+          }
+        }
+      }
+      delete _free_chunks[i];
+      _free_chunks[i] = NULL;
+   }
+    int count_after_cleanup = 0;
     for (ChunkIndex i = ZeroIndex; i < NumberOfFreeLists; i = next_chunk_index(i)) {
       ChunkList* l = ChunkManagerTest::free_chunks(_cm, i);
-      Metachunk* t = l->tail();
-      while (t != _chunks[i]) {
-        _cm->remove_chunk(t);
-        t = l->tail();
-      }
+      count_after_cleanup += l->count();
     }
+    EXPECT_EQ(_count_pre_existing, count_after_cleanup);
+    _cm->locked_verify();
   }
 };
 
@@ -121,7 +155,6 @@
 
   // committed - used = words left to retire
   const size_t words_left = page_chunks - SmallChunk - SpecializedChunk;
-
   size_t num_medium_chunks, num_small_chunks, num_spec_chunks;
   chunk_up(words_left, num_medium_chunks, num_small_chunks, num_spec_chunks);
 
@@ -155,7 +188,6 @@
 
 TEST_VM(VirtualSpaceNodeTest, all_vsn_is_committed_half_is_used_by_chunks) {
   MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
-
   ChunkManager cm(false);
   VirtualSpaceNode vsn(false, vsn_test_size_bytes);
   ChunkManagerRestorer c(Metaspace::get_chunk_manager(false));
@@ -165,6 +197,7 @@
   vsn.get_chunk_vs(MediumChunk);
   vsn.get_chunk_vs(MediumChunk);
   vsn.retire(&cm);
+
   // DISABLED: checks started to fail after 8198423
   // EXPECT_EQ(2UL, ChunkManagerTest::sum_free_chunks_count(&cm)) << "should have been memory left for 2 chunks";
   // EXPECT_EQ(2UL * MediumChunk, ChunkManagerTest::sum_free_chunks(&cm)) << "sizes should add up";
@@ -172,13 +205,13 @@
 
 TEST_VM(VirtualSpaceNodeTest, no_committed_memory) {
   MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
-
   ChunkManager cm(false);
   VirtualSpaceNode vsn(false, vsn_test_size_bytes);
   ChunkManagerRestorer c(Metaspace::get_chunk_manager(false));
 
   vsn.initialize();
   vsn.retire(&cm);
+
   ASSERT_EQ(0UL, ChunkManagerTest::sum_free_chunks_count(&cm)) << "did not commit any memory in the VSN";
 }
 
--- a/test/hotspot/jtreg/applications/ctw/modules/generate.bash	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/generate.bash	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_base.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_base_2.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_compiler.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_datatransfer.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_desktop.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_desktop_2.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_instrument.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_logging.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_management.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_management_rmi.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_naming.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_prefs.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_rmi.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_scripting.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_security_jgss.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_security_sasl.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_smartcardio.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_sql.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_sql_rowset.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_xml.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/java_xml_crypto.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_accessibility.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_aot.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_attach.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_charsets.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_compiler.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_cryptoki.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_mscapi.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ucrypto.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_dynalink.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_editpad.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_hotspot_agent.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_httpserver.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ /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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_ed.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_jvmstat.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_le.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_opt.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_ci.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_internal_vm_compiler_management.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jartool.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_javadoc.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jcmd.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jconsole.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jdeps.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jdi.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jfr.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jlink.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jshell.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jsobject.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_jstatd.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_management.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_management_agent.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_management_jfr.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_dns.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_naming_rmi.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_net.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ /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 Jul 16 16:20:54 2019 +0000
+++ /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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_rmic.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_scripting_nashorn_shell.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_sctp.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_security_auth.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_security_jgss.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_unsupported.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_xml_dom.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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 Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/applications/ctw/modules/jdk_zipfs.java	Tue Jul 16 16:24:54 2019 +0000
@@ -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
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/codegen/TestOopCmp.java	Tue Jul 16 16:24:54 2019 +0000
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8221083
+ * @requires vm.gc.Serial
+ * @requires vm.bits == 64 & vm.opt.final.UseCompressedOops == true
+ * @summary On ppc64, C1 erroneously emits a 32-bit compare instruction for oop compares.
+ * @modules java.base/jdk.internal.misc:+open
+ * @library /test/lib /
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbatch -XX:-UseTLAB -Xmx4m -XX:+UseSerialGC -XX:HeapBaseMinAddress=0x700000000
+ *      -XX:CompileCommand=compileonly,compiler.codegen.TestOopCmp::nullTest
+ *      -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ *      compiler.codegen.TestOopCmp
+ * @author volker.simonis@gmail.com
+ */
+
+package compiler.codegen;
+
+import sun.hotspot.WhiteBox;
+
+public class TestOopCmp {
+
+    private static Object nullObj = null;
+
+    public static boolean nullTest(Object o) {
+        if (o == nullObj) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public static void main(String args[]) {
+
+        WhiteBox WB = WhiteBox.getWhiteBox();
+
+        // The test is started with -XX:HeapBaseMinAddress=0x700000000 and a
+        // small heap of only 4mb. This works pretty reliable and at least on
+        // Linux/Windows/Solaris we will get a heap starting at 0x700000000.
+        // The test also runs with -XX:+UseSerialGC which means that we'll get
+        // eden starting at 0x700000000.
+        // Calling 'System.gc()' will clean up all the objects from eden, so if
+        // eden starts at 0x700000000 the first allocation right after the
+        // system GC will be allcoated right at address 0x700000000.
+        System.gc();
+        String s = new String("I'm not null!!!");
+        if (WB.getObjectAddress(s) == 0x700000000L) {
+            System.out.println("Got object at address 0x700000000");
+        }
+
+        // We call 'nullTest()' with the newly allocated String object. If it was
+        // allocated at 0x700000000, its 32 least-significant bits will be 0 and a
+        // 32-bit comparison with 'nullObj' (which is 'null') will yield true and
+        // result in a test failure.
+        // If the code generated for 'nullTest()' correctly performs a 64-bit
+        // comparison or if we didn't manage to allcoate 's' at 0x700000000 the
+        // test will always succeed.
+        for (int i = 0; i < 30_000; i++) {
+            if (nullTest(s)) {
+                throw new RuntimeException("Comparing non-null object with null returned 'true'");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMining.java	Tue Jul 16 16:24:54 2019 +0000
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2019, SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8220374
+ * @summary C2: LoopStripMining doesn't strip as expected
+ * @requires vm.compiler2.enabled
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+SafepointTimeout -XX:+SafepointALot
+ *                   -XX:+AbortVMOnSafepointTimeout -XX:SafepointTimeoutDelay=500 -XX:GuaranteedSafepointInterval=500
+ *                   -XX:-TieredCompilation -XX:+UseCountedLoopSafepoints -XX:LoopStripMiningIter=1000
+ *                   -XX:LoopUnrollLimit=0 -XX:CompileCommand=compileonly,CheckLoopStripMining::test_loop -Xcomp CheckLoopStripMining
+ *
+ */
+
+public class CheckLoopStripMining {
+
+  public static int test_loop(int x) {
+      int sum = 0;
+      if (x != 0) {
+          for (int y = 1; y < Integer.MAX_VALUE; ++y) {
+              if (y % x == 0) ++sum;
+          }
+      }
+      return sum;
+  }
+
+  public static void main(String args[]) {
+    int sum = test_loop(3);
+    System.out.println("sum: " + sum);
+  }
+}
--- a/test/hotspot/jtreg/gc/TestHumongousReferenceObject.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/TestHumongousReferenceObject.java	Tue Jul 16 16:24:54 2019 +0000
@@ -39,7 +39,7 @@
 /*
  * @test TestHumongousReferenceObjectShenandoah
  * @summary Test that verifies that iteration over large, plain Java objects, that potentially cross region boundaries, with references in them works.
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @bug 8151499 8153734
  * @modules java.base/jdk.internal.vm.annotation
  * @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahHeapRegionSize=8M -XX:ContendedPaddingWidth=8192 TestHumongousReferenceObject
--- a/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java	Tue Jul 16 16:24:54 2019 +0000
@@ -56,7 +56,7 @@
 
 /* @test TestMetaspacePerfCountersShenandoah
  * @bug 8014659
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib /
  * @summary Tests that performance counters for metaspace and compressed class
  *          space exists and works.
--- a/test/hotspot/jtreg/gc/shenandoah/TestAllocHumongousFragment.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocHumongousFragment.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestAllocHumongousFragment
  * @summary Make sure Shenandoah can recover from humongous allocation fragmentation
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048 -XX:ShenandoahGCHeuristics=passive    -XX:-ShenandoahDegeneratedGC     -XX:+ShenandoahVerify TestAllocHumongousFragment
  * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048 -XX:ShenandoahGCHeuristics=passive    -XX:+ShenandoahDegeneratedGC     -XX:+ShenandoahVerify TestAllocHumongousFragment
--- a/test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestAllocIntArrays
  * @summary Acceptance tests: collector can withstand allocation
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:+ShenandoahDegeneratedGC     -XX:+ShenandoahVerify TestAllocIntArrays
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:-ShenandoahDegeneratedGC     -XX:+ShenandoahVerify TestAllocIntArrays
--- a/test/hotspot/jtreg/gc/shenandoah/TestAllocObjectArrays.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocObjectArrays.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestAllocObjectArrays
  * @summary Acceptance tests: collector can withstand allocation
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:+ShenandoahDegeneratedGC     -XX:+ShenandoahVerify TestAllocObjectArrays
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:-ShenandoahDegeneratedGC     -XX:+ShenandoahVerify TestAllocObjectArrays
--- a/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestAllocObjects
  * @summary Acceptance tests: collector can withstand allocation
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:+ShenandoahDegeneratedGC     -XX:+ShenandoahVerify TestAllocObjects
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:-ShenandoahDegeneratedGC     -XX:+ShenandoahVerify TestAllocObjects
--- a/test/hotspot/jtreg/gc/shenandoah/TestArrayCopyCheckCast.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestArrayCopyCheckCast.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestArrayCopyCheckCast
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:TieredStopAtLevel=0 -Xmx16m TestArrayCopyCheckCast
  */
--- a/test/hotspot/jtreg/gc/shenandoah/TestArrayCopyStress.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestArrayCopyStress.java	Tue Jul 16 16:24:54 2019 +0000
@@ -26,7 +26,7 @@
 /*
  * @test TestArrayCopyStress
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:TieredStopAtLevel=0 -Xmx16m TestArrayCopyStress
  */
--- a/test/hotspot/jtreg/gc/shenandoah/TestElasticTLAB.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestElasticTLAB.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestElasticTLAB
  * @summary Test that Shenandoah is able to work with elastic TLABs
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:-UseTLAB -XX:-ShenandoahElasticTLAB -XX:+ShenandoahVerify TestElasticTLAB
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:-UseTLAB -XX:-ShenandoahElasticTLAB                       TestElasticTLAB
--- a/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestEvilSyncBug
  * @summary Tests for crash/assert when attaching init thread during shutdown
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/shenandoah/TestGCThreadGroups.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestGCThreadGroups.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestGCThreadGroups
  * @summary Test Shenandoah GC uses concurrent/parallel threads correctly
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4 -Xmx16m                                         -Dtarget=1000 TestGCThreadGroups
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:-UseDynamicNumberOfGCThreads            -Xmx16m                                         -Dtarget=1000 TestGCThreadGroups
--- a/test/hotspot/jtreg/gc/shenandoah/TestHeapUncommit.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestHeapUncommit.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestHeapUncommit
  * @summary Acceptance tests: collector can withstand allocation
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:+ShenandoahUncommit -XX:ShenandoahUncommitDelay=0 -XX:ShenandoahGCHeuristics=passive                 -XX:+ShenandoahDegeneratedGC -XX:+ShenandoahVerify TestHeapUncommit
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:+ShenandoahUncommit -XX:ShenandoahUncommitDelay=0 -XX:ShenandoahGCHeuristics=passive                 -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify TestHeapUncommit
--- a/test/hotspot/jtreg/gc/shenandoah/TestHumongousThreshold.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestHumongousThreshold.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,15 +24,78 @@
 /*
  * @test TestHumongousThreshold
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g                                      -XX:+ShenandoahVerify TestHumongousThreshold
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:ShenandoahHumongousThreshold=50  -XX:+ShenandoahVerify TestHumongousThreshold
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:ShenandoahHumongousThreshold=90  -XX:+ShenandoahVerify TestHumongousThreshold
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:ShenandoahHumongousThreshold=99  -XX:+ShenandoahVerify TestHumongousThreshold
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:ShenandoahHumongousThreshold=100 -XX:+ShenandoahVerify TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:+ShenandoahVerify
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=50
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=90
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=99
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=100
+ *                   TestHumongousThreshold
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -XX:ShenandoahHumongousThreshold=90  -XX:ShenandoahGCHeuristics=aggressive TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:+ShenandoahVerify
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=50
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=90
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=99
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=100
+ *                   TestHumongousThreshold
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=50
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=90
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=99
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=100
+ *                   TestHumongousThreshold
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=50
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=90
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=99
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:ObjectAlignmentInBytes=16 -XX:+ShenandoahVerify -XX:ShenandoahHumongousThreshold=100
+ *                   TestHumongousThreshold
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:ShenandoahHumongousThreshold=90 -XX:ShenandoahGCHeuristics=aggressive
+ *                   TestHumongousThreshold
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g
+ *                   -XX:-UseTLAB -XX:ShenandoahHumongousThreshold=90 -XX:ShenandoahGCHeuristics=aggressive
+ *                   TestHumongousThreshold
  */
 
 import java.util.Random;
--- a/test/hotspot/jtreg/gc/shenandoah/TestLargeObjectAlignment.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestLargeObjectAlignment.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestLargeObjectAlignment
  * @summary Shenandoah crashes with -XX:ObjectAlignmentInBytes=16
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ObjectAlignmentInBytes=16 -Xint                   TestLargeObjectAlignment
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ObjectAlignmentInBytes=16 -XX:-TieredCompilation  TestLargeObjectAlignment
--- a/test/hotspot/jtreg/gc/shenandoah/TestLotsOfCycles.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestLotsOfCycles.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestLotsOfCycles
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm/timeout=480 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx16m -XX:ShenandoahGCHeuristics=passive      -Dtarget=10000 -XX:+ShenandoahDegeneratedGC     TestLotsOfCycles
  * @run main/othervm/timeout=480 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx16m -XX:ShenandoahGCHeuristics=passive      -Dtarget=10000 -XX:-ShenandoahDegeneratedGC     TestLotsOfCycles
--- a/test/hotspot/jtreg/gc/shenandoah/TestParallelRefprocSanity.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestParallelRefprocSanity.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestParallelRefprocSanity
  * @summary Test that reference processing works with both parallel and non-parallel variants.
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g                              TestParallelRefprocSanity
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g  -XX:-ParallelRefProcEnabled TestParallelRefprocSanity
--- a/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestPeriodicGC
  * @summary Test that periodic GC is working
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run driver TestPeriodicGC
  */
--- a/test/hotspot/jtreg/gc/shenandoah/TestRefprocSanity.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestRefprocSanity.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestRefprocSanity
  * @summary Test that null references/referents work fine
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g                                                             TestRefprocSanity
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:+ShenandoahVerify                                       TestRefprocSanity
--- a/test/hotspot/jtreg/gc/shenandoah/TestRegionSampling.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestRegionSampling.java	Tue Jul 16 16:24:54 2019 +0000
@@ -23,7 +23,7 @@
 
 /*
  * @test TestRegionSampling
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g                                         -XX:+ShenandoahRegionSampling TestRegionSampling
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:+ShenandoahRegionSampling TestRegionSampling
--- a/test/hotspot/jtreg/gc/shenandoah/TestRetainObjects.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestRetainObjects.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestRetainObjects
  * @summary Acceptance tests: collector can deal with retained objects
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:+ShenandoahDegeneratedGC -XX:+ShenandoahVerify TestRetainObjects
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify TestRetainObjects
--- a/test/hotspot/jtreg/gc/shenandoah/TestSieveObjects.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestSieveObjects.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestSieveObjects
  * @summary Acceptance tests: collector can deal with retained objects
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:+ShenandoahDegeneratedGC -XX:+ShenandoahVerify TestSieveObjects
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g -XX:ShenandoahGCHeuristics=passive      -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify TestSieveObjects
--- a/test/hotspot/jtreg/gc/shenandoah/TestSmallHeap.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestSmallHeap.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestSmallHeap
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC         TestSmallHeap
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx64m TestSmallHeap
--- a/test/hotspot/jtreg/gc/shenandoah/TestStringDedup.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestStringDedup.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestStringDedup
  * @summary Test Shenandoah string deduplication implementation
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc:open
  * @modules java.base/java.lang:open
--- a/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,65 +25,79 @@
  * @test TestStringDedupStress
  * @summary Test Shenandoah string deduplication implementation
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc:open
  * @modules java.base/java.lang:open
  *          java.management
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -DtargetStrings=3000000
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=aggressive -DtargetStrings=2000000
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=aggressive -XX:+ShenandoahOOMDuringEvacALot -DtargetStrings=2000000
+ *                   -Xlog:gc
  *                    TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=static -DtargetStrings=4000000
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=compact
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
- *                   -XX:ShenandoahGCHeuristics=passive -XX:+ShenandoahDegeneratedGC -DtargetOverwrites=40000000
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
+ *                   -XX:ShenandoahGCHeuristics=passive -XX:+ShenandoahDegeneratedGC
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
- *                   -XX:ShenandoahGCHeuristics=passive -XX:-ShenandoahDegeneratedGC -DtargetOverwrites=40000000
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
+ *                   -XX:ShenandoahGCHeuristics=passive -XX:-ShenandoahDegeneratedGC
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=traversal
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahUpdateRefsEarly=off -DtargetStrings=3000000
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=compact -XX:ShenandoahUpdateRefsEarly=off -DtargetStrings=2000000
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=aggressive -XX:ShenandoahUpdateRefsEarly=off -DtargetStrings=2000000
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
- *                   -XX:ShenandoahGCHeuristics=static -XX:ShenandoahUpdateRefsEarly=off -DtargetOverwrites=4000000
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
+ *                   -XX:ShenandoahGCHeuristics=static -XX:ShenandoahUpdateRefsEarly=off
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=aggressive -XX:ShenandoahUpdateRefsEarly=off -XX:+ShenandoahOOMDuringEvacALot -DtargetStrings=2000000
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  *
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx512M -Xlog:gc+stats
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UseStringDeduplication -Xmx1g -Xlog:gc+stats
  *                   -XX:ShenandoahGCHeuristics=traversal -XX:+ShenandoahOOMDuringEvacALot -DtargetStrings=2000000
+ *                   -Xlog:gc
  *                   TestStringDedupStress
  */
 
@@ -97,9 +111,9 @@
     private static Field valueField;
     private static Unsafe unsafe;
 
-    private static long TARGET_STRINGS = Long.getLong("targetStrings", 2_500_000);
-    private static long TARGET_OVERWRITES = Long.getLong("targetOverwrites", 600_000);
+    private static final int TARGET_STRINGS = Integer.getInteger("targetStrings", 2_500_000);
     private static final long MAX_REWRITE_GC_CYCLES = 6;
+    private static final long MAX_REWRITE_TIME = 30*1000; // ms
 
     private static final int UNIQUE_STRINGS = 20;
 
@@ -151,8 +165,8 @@
         }
     }
 
-    private static int verifyDedepString(ArrayList<StringAndId> strs) {
-        HashMap<Object, StringAndId> seen = new HashMap<>();
+    private static int verifyDedupString(ArrayList<StringAndId> strs) {
+        Map<Object, StringAndId> seen = new HashMap<>(TARGET_STRINGS*2);
         int total = 0;
         int dedup = 0;
 
@@ -195,14 +209,16 @@
         }
 
         // Generate roughly TARGET_STRINGS strings, only UNIQUE_STRINGS are unique
-        long genIters = TARGET_STRINGS / UNIQUE_STRINGS;
-        for (long index = 0; index < genIters; index++) {
+        int genIters = TARGET_STRINGS / UNIQUE_STRINGS;
+        for (int index = 0; index < genIters; index++) {
             generateStrings(astrs, UNIQUE_STRINGS);
         }
 
         long cycleBeforeRewrite = gcCycleMBean.getCollectionCount();
+        long timeBeforeRewrite = System.currentTimeMillis();
 
-        for (long loop = 1; loop < TARGET_OVERWRITES; loop++) {
+        long loop = 1;
+        while (true) {
             int arrSize = astrs.size();
             int index = rn.nextInt(arrSize);
             StringAndId item = astrs.get(index);
@@ -210,13 +226,18 @@
             item.str = "Unique String " + n;
             item.id = n;
 
-            if (loop % 1000 == 0) {
+            if (loop++ % 1000 == 0) {
                 // enough GC cycles for rewritten strings to be deduplicated
                 if (gcCycleMBean.getCollectionCount() - cycleBeforeRewrite >= MAX_REWRITE_GC_CYCLES) {
                     break;
                 }
+
+                // enough time is spent waiting for GC to happen
+                if (System.currentTimeMillis() - timeBeforeRewrite >= MAX_REWRITE_TIME) {
+                    break;
+                }
             }
         }
-        verifyDedepString(astrs);
+        verifyDedupString(astrs);
     }
 }
--- a/test/hotspot/jtreg/gc/shenandoah/TestStringInternCleanup.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestStringInternCleanup.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestStringInternCleanup
  * @summary Check that Shenandoah cleans up interned strings
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ClassUnloadingWithConcurrentMark -Xmx64m -XX:ShenandoahGCHeuristics=passive      -XX:+ShenandoahDegeneratedGC -XX:+ShenandoahVerify TestStringInternCleanup
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ClassUnloadingWithConcurrentMark -Xmx64m -XX:ShenandoahGCHeuristics=passive      -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify TestStringInternCleanup
--- a/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestVerifyJCStress
  * @summary Tests that we pass at least one jcstress-like test with all verification turned on
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @modules java.base/jdk.internal.misc
  *          java.management
  * @run main/othervm  -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions
--- a/test/hotspot/jtreg/gc/shenandoah/TestVerifyLevels.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestVerifyLevels.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestVerifyLevels
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockDiagnosticVMOptions -Xmx128m -XX:+ShenandoahVerify -XX:ShenandoahVerifyLevel=0 TestVerifyLevels
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockDiagnosticVMOptions -Xmx128m -XX:+ShenandoahVerify -XX:ShenandoahVerifyLevel=1 TestVerifyLevels
--- a/test/hotspot/jtreg/gc/shenandoah/TestWithLogLevel.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestWithLogLevel.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestWithLogLevel
  * @summary Test Shenandoah with different log levels
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms256M -Xmx1G -Xlog:gc*=error   TestWithLogLevel
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms256M -Xmx1G -Xlog:gc*=warning TestWithLogLevel
--- a/test/hotspot/jtreg/gc/shenandoah/TestWrongArrayMember.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/TestWrongArrayMember.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestWrongArrayMember
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC                                      TestWrongArrayMember
  * @run main/othervm -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=traversal TestWrongArrayMember
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestC1ArrayCopyNPE.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestC1ArrayCopyNPE.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /* @test TestC1ArrayCopyNPE
  * @summary test C1 arraycopy intrinsic
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @run main/othervm -XX:TieredStopAtLevel=1 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive TestC1ArrayCopyNPE
  */
 
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestC1VectorizedMismatch.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestC1VectorizedMismatch.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /* @test TestC1VectorizedMismatch
  * @summary test C1 vectorized mismatch intrinsic
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @run main/othervm -XX:TieredStopAtLevel=1 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive TestC1VectorizedMismatch
  */
 
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestCommonGCLoads.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestCommonGCLoads.java	Tue Jul 16 16:24:54 2019 +0000
@@ -26,7 +26,7 @@
  * @summary Test GC state load commoning works
  * @key gc
  * @requires vm.flavor == "server"
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation
  *                   -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC
  *                   -XX:-ShenandoahCommonGCStateLoads
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestExpandedWBLostNullCheckDep.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestExpandedWBLostNullCheckDep.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestExpandedWBLostNullCheckDep
  * @summary Logic that moves a null check in the expanded barrier may cause a memory access that doesn't depend on the barrier to bypass the null check
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @requires vm.flavor == "server"
  * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestMaybeNullUnsafeAccess.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestMaybeNullUnsafeAccess.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestMaybeNullUnsafeAccess
  * @summary cast before unsafe access moved in dominating null check null path causes crash
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @modules java.base/jdk.internal.misc:+open
  *
  * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestNullCheck.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestNullCheck.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestNullCheck
  * @summary implicit null check on brooks pointer must not cause crash
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation
  *                   -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC
  *                   -Xmx4G -XX:HeapBaseMinAddress=0x800000000 TestNullCheck
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestReferenceCAS.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestReferenceCAS.java	Tue Jul 16 16:24:54 2019 +0000
@@ -29,7 +29,7 @@
  * @test TestReferenceCAS
  * @summary Shenandoah reference CAS test
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @modules java.base/jdk.internal.misc:+open
  *
  * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC                                                 TestReferenceCAS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestUnsafeOffheapSwap.java	Tue Jul 16 16:24:54 2019 +0000
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test TestUnsafeOffheapSwap
+ * @summary Miscompilation in Unsafe off-heap swap routines
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
+ * @modules java.base/jdk.internal.misc:+open
+ *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation
+ *                   -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC
+ *                   TestUnsafeOffheapSwap
+ */
+
+import java.util.*;
+import jdk.internal.misc.Unsafe;
+
+public class TestUnsafeOffheapSwap {
+
+    static final int SIZE = 10000;
+    static final long SEED = 1;
+
+    static final jdk.internal.misc.Unsafe UNSAFE = Unsafe.getUnsafe();
+    static final int SCALE = UNSAFE.ARRAY_INT_INDEX_SCALE;
+
+    static Memory mem;
+    static int[] arr;
+
+    public static void main(String[] args) throws Exception {
+        // Bug is exposed when memory.addr is not known statically
+        mem = new Memory(SIZE*SCALE);
+        arr = new int[SIZE];
+
+        for (int i = 0; i < 10; i++) {
+            test();
+        }
+    }
+
+    static void test() {
+        Random rnd = new Random(SEED);
+        for (int i = 0; i < SIZE; i++) {
+            int value = rnd.nextInt();
+            mem.setInt(i, value);
+            arr[i] = value;
+        }
+
+        for (int i = 0; i < SIZE; i++) {
+            if (arr[i] != mem.getInt(i)) {
+                throw new IllegalStateException("TESTBUG: Values mismatch before swaps");
+            }
+        }
+
+        for (int i = 1; i < SIZE; i++) {
+            mem.swap(i - 1, i);
+            int tmp = arr[i - 1];
+            arr[i - 1] = arr[i];
+            arr[i] = tmp;
+        }
+
+        for (int i = 0; i < SIZE; i++) {
+            if (arr[i] != mem.getInt(i)) {
+                throw new IllegalStateException("Values mismatch after swaps");
+            }
+        }
+    }
+
+    static class Memory {
+        private final long addr;
+
+        Memory(int size) {
+            addr = UNSAFE.allocateMemory(size);
+        }
+
+        public int getInt(int idx) {
+            return UNSAFE.getInt(addr + idx*SCALE);
+        }
+
+        public void setInt(int idx, int val) {
+            UNSAFE.putInt(addr + idx*SCALE, val);
+        }
+
+        public void swap(int a, int b) {
+            int tmp = getInt(a);
+            setInt(a, getInt(b));
+            setInt(b, tmp);
+        }
+    }
+}
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestWriteBarrierClearControl.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestWriteBarrierClearControl.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestWriteBarrierClearControl
  * @summary Clearing control during final graph reshape causes memory barrier to loose dependency on null check
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation
  *                   -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM -XX:+StressGCM
--- a/test/hotspot/jtreg/gc/shenandoah/jni/TestJNICritical.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/jni/TestJNICritical.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /* @test TestJNICritical
  * @summary test JNI critical arrays support in Shenandoah
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ShenandoahVerify                 TestJNICritical
  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive TestJNICritical
--- a/test/hotspot/jtreg/gc/shenandoah/jni/TestJNIGlobalRefs.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/jni/TestJNIGlobalRefs.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /* @test TestJNIGlobalRefs
  * @summary Test JNI Global Refs with Shenandoah
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xlog:gc -XX:ShenandoahGCHeuristics=aggressive -XX:+ShenandoahVerify TestJNIGlobalRefs
  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xlog:gc -XX:ShenandoahGCHeuristics=aggressive                       TestJNIGlobalRefs
  */
--- a/test/hotspot/jtreg/gc/shenandoah/jni/TestPinnedGarbage.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/jni/TestPinnedGarbage.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /* @test TestPinnedGarbage
  * @summary Test that garbage in the pinned region does not crash VM
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx512m -XX:+ShenandoahVerify -XX:ShenandoahGCHeuristics=passive    -XX:+ShenandoahDegeneratedGC TestPinnedGarbage
  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx512m -XX:+ShenandoahVerify -XX:ShenandoahGCHeuristics=passive    -XX:-ShenandoahDegeneratedGC TestPinnedGarbage
--- a/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestHeapDump
  * @summary Tests JVMTI heap dumps
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @compile TestHeapDump.java
  * @run main/othervm/native/timeout=300 -agentlib:TestHeapDump -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx128m -XX:ShenandoahGCHeuristics=aggressive -XX:+UseCompressedOops TestHeapDump
  * @run main/othervm/native/timeout=300 -agentlib:TestHeapDump -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx128m -XX:ShenandoahGCHeuristics=aggressive -XX:-UseCompressedOops TestHeapDump
--- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestChurnNotifications
  * @summary Check that MX notifications are reported for all cycles
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive      -XX:+ShenandoahDegeneratedGC -Dprecise=true  TestChurnNotifications
  * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive      -XX:-ShenandoahDegeneratedGC -Dprecise=true  TestChurnNotifications
--- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryMXBeans.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryMXBeans.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,12 +25,14 @@
  * @test TestMemoryMXBeans
  * @summary Test JMX memory beans
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @modules java.base/jdk.internal.misc
  *          java.management
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC          -Xmx1g TestMemoryMXBeans   -1 1024
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms1g   -Xmx1g TestMemoryMXBeans 1024 1024
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms128m -Xmx1g TestMemoryMXBeans  128 1024
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms1g   -Xmx1g -XX:ShenandoahUncommitDelay=0 TestMemoryMXBeans 1024 1024
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms128m -Xmx1g -XX:ShenandoahUncommitDelay=0 TestMemoryMXBeans  128 1024
  */
 
 import java.lang.management.*;
@@ -46,6 +48,9 @@
         long initSize = 1L * Integer.parseInt(args[0]) * 1024 * 1024;
         long maxSize  = 1L * Integer.parseInt(args[1]) * 1024 * 1024;
 
+        // wait for GC to uncommit
+        Thread.sleep(1000);
+
         testMemoryBean(initSize, maxSize);
     }
 
@@ -65,7 +70,15 @@
             throw new IllegalStateException("Max heap size is wrong: " + heapMax + " vs " + maxSize);
         }
         if (initSize > 0 && maxSize > 0 && initSize != maxSize && heapCommitted == heapMax) {
-            throw new IllegalStateException("Init committed heap size is wrong: " + heapCommitted +
+            throw new IllegalStateException("Committed heap size is max: " + heapCommitted +
+                                            " (init: " + initSize + ", max: " + maxSize + ")");
+        }
+        if (initSize > 0 && maxSize > 0 && initSize == maxSize && heapCommitted != heapMax) {
+            throw new IllegalStateException("Committed heap size is not max: " + heapCommitted +
+                                            " (init: " + initSize + ", max: " + maxSize + ")");
+        }
+        if (initSize > 0 && heapCommitted < initSize) {
+            throw new IllegalStateException("Committed heap size is below min: " + heapCommitted +
                                             " (init: " + initSize + ", max: " + maxSize + ")");
         }
     }
--- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryPools.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryPools.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestMemoryPools
  * @summary Test JMX memory pools
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @modules java.base/jdk.internal.misc
  *          java.management
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx1g -Xms1g TestMemoryPools
--- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestPauseNotifications
  * @summary Check that MX notifications are reported for all cycles
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive       -XX:+ShenandoahDegeneratedGC TestPauseNotifications
  * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive       -XX:-ShenandoahDegeneratedGC TestPauseNotifications
--- a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargeObj.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestAllocLargeObj
  * @summary Test allocation of small object to result OOM, but not to crash JVM
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run main TestAllocLargeObj
  */
--- a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocLargerThanHeap.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestAllocLargerThanHeap
  * @summary Test that allocation of the object larger than heap fails predictably
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run main TestAllocLargerThanHeap
  */
--- a/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestAllocSmallObj.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestAllocSmallObj
  * @summary Test allocation of small object to result OOM, but not to crash JVM
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run main TestAllocSmallObj
  */
--- a/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestClassLoaderLeak
  * @summary Test OOME in due to classloader leak
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run main TestClassLoaderLeak
  */
--- a/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestThreadFailure.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestThreadFailure
  * @summary Test OOME in separate thread is recoverable
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run main TestThreadFailure
  */
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestAlwaysPreTouch.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestAlwaysPreTouch.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestAlwaysPreTouch
  * @summary Check that Shenandoah's AlwaysPreTouch does not fire asserts
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+AlwaysPreTouch                                  -Xmx1g TestAlwaysPreTouch
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+AlwaysPreTouch -XX:ConcGCThreads=2              -Xmx1g TestAlwaysPreTouch
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestArgumentRanges.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestArgumentRanges
  * @summary Test that Shenandoah arguments are checked for ranges where applicable
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestClassUnloadingArguments.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestClassUnloadingArguments
  * @summary Test that loop mining arguments are sane
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run driver TestClassUnloadingArguments
  */
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestCodeCacheRootStyles.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestCodeCacheRootStyles.java	Tue Jul 16 16:24:54 2019 +0000
@@ -23,7 +23,7 @@
 
 /* @test TestCodeCacheRootStyles
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahCodeRootsStyle=0 TestCodeCacheRootStyles
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahCodeRootsStyle=1 TestCodeCacheRootStyles
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahCodeRootsStyle=2 TestCodeCacheRootStyles
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestCriticalControlThreadPriority.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestCriticalControlThreadPriority.java	Tue Jul 16 16:24:54 2019 +0000
@@ -26,7 +26,7 @@
  * @summary Check that ShenandoahCriticalControlThreadPriority works
  * @bug 8217343
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:-ShenandoahCriticalControlThreadPriority -Xmx1g TestCriticalControlThreadPriority
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ShenandoahCriticalControlThreadPriority -Xmx1g TestCriticalControlThreadPriority
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestEnabled.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestEnabled.java	Tue Jul 16 16:24:54 2019 +0000
@@ -27,7 +27,7 @@
 /*
  * @test TestEnabled
  * @key gc
- * @requires vm.gc.Shenandoah & vm.gc == "null"
+ * @requires vm.gc.Shenandoah & vm.gc == "null" & !vm.graal.enabled
  * @run main/othervm -Dexpected=false -Xmx64m                                                       TestEnabled
  * @run main/othervm -Dexpected=true  -Xmx64m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestEnabled
  */
@@ -35,7 +35,7 @@
 /*
  * @test TestEnabledAlready
  * @key gc
- * @requires vm.gc.Shenandoah & vm.gc == "Shenandoah"
+ * @requires vm.gc.Shenandoah & vm.gc == "Shenandoah" & !vm.graal.enabled
  * @run main/othervm -Dexpected=true -Xmx64m                                                        TestEnabled
  */
 public class TestEnabled {
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestExplicitGC
  * @summary Test that Shenandoah reacts to explicit GC flags appropriately
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGCNoConcurrent.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestExplicitGCNoConcurrent
  * @summary Test that Shenandoah reacts to explicit GC flags appropriately
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestHeuristicsUnlock
  * @summary Test that Shenandoah heuristics are unlocked properly
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestHumongousThresholdArgs.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestHumongousThresholdArgs
  * @summary Test that Shenandoah humongous threshold args are checked
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestLoopMiningArguments
  * @summary Test that loop mining arguments are sane
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run driver TestLoopMiningArguments
  */
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestObjectAlignment.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestObjectAlignment.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestObjectAlignment
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ObjectAlignmentInBytes=16          TestObjectAlignment
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ObjectAlignmentInBytes=16 -Xmx16m  TestObjectAlignment
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestPacing.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestPacing.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestPacing
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:-ShenandoahPacing -Xmx128m TestPacing
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ShenandoahPacing -Xmx128m TestPacing
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestParallelRegionStride.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestParallelRegionStride.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
  * @test TestParallelRegionStride
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  *
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahParallelRegionStride=1    -Xmx128m TestParallelRegionStride
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahParallelRegionStride=10   -Xmx128m TestParallelRegionStride
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestRegionSizeArgs.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @test TestRegionSizeArgs
  * @summary Test that Shenandoah region size args are checked
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
@@ -47,17 +47,6 @@
         {
             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions",
                     "-XX:+UseShenandoahGC",
-                    "-Xms2m",
-                    "-Xmx1g",
-                    "-version");
-            OutputAnalyzer output = new OutputAnalyzer(pb.start());
-            output.shouldMatch("Initial heap size");
-            output.shouldHaveExitValue(1);
-        }
-
-        {
-            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions",
-                    "-XX:+UseShenandoahGC",
                     "-Xms4m",
                     "-Xmx1g",
                     "-version");
@@ -92,18 +81,6 @@
                     "-XX:+UseShenandoahGC",
                     "-Xms100m",
                     "-Xmx1g",
-                    "-XX:ShenandoahHeapRegionSize=11m",
-                    "-version");
-            OutputAnalyzer output = new OutputAnalyzer(pb.start());
-            output.shouldMatch("Invalid -XX:ShenandoahHeapRegionSize option");
-            output.shouldHaveExitValue(1);
-        }
-
-        {
-            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions",
-                    "-XX:+UseShenandoahGC",
-                    "-Xms100m",
-                    "-Xmx1g",
                     "-XX:ShenandoahHeapRegionSize=9m",
                     "-version");
             OutputAnalyzer output = new OutputAnalyzer(pb.start());
@@ -223,18 +200,6 @@
                     "-XX:+UseShenandoahGC",
                     "-Xms100m",
                     "-Xmx1g",
-                    "-XX:ShenandoahMinRegionSize=11m",
-                    "-version");
-            OutputAnalyzer output = new OutputAnalyzer(pb.start());
-            output.shouldMatch("Invalid -XX:ShenandoahMinRegionSize option");
-            output.shouldHaveExitValue(1);
-        }
-
-        {
-            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockExperimentalVMOptions",
-                    "-XX:+UseShenandoahGC",
-                    "-Xms100m",
-                    "-Xmx1g",
                     "-XX:ShenandoahMinRegionSize=9m",
                     "-version");
             OutputAnalyzer output = new OutputAnalyzer(pb.start());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestSafepointWorkers.java	Tue Jul 16 16:24:54 2019 +0000
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+ * @test TestSingleSafepointWorker
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
+ *
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahParallelSafepointThreads=1 -Xmx128m TestSafepointWorkers
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahParallelSafepointThreads=2 -Xmx128m TestSafepointWorkers
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahParallelSafepointThreads=4 -Xmx128m TestSafepointWorkers
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahParallelSafepointThreads=8 -Xmx128m TestSafepointWorkers
+ */
+
+public class TestSafepointWorkers {
+    static final long TARGET_MB = Long.getLong("target", 1000); // 1 Gb allocation
+
+    static volatile Object sink;
+
+    public static void main(String[] args) throws Exception {
+        long count = TARGET_MB * 1024 * 1024 / 16;
+        for (long c = 0; c < count; c++) {
+            sink = new Object();
+        }
+    }
+}
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
  * @summary Test selective barrier enabling works, by aggressively compiling HelloWorld with combinations
  *          of barrier flags
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run main/othervm TestSelectiveBarrierFlags -Xint
  * @run main/othervm TestSelectiveBarrierFlags -Xbatch -XX:CompileThreshold=100 -XX:TieredStopAtLevel=1
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestSingleThreaded.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestSingleThreaded.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /* @test TestSingleThreaded
  * @summary test single worker threaded Shenandoah
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
  *                   -XX:ParallelGCThreads=1 -XX:ConcGCThreads=1 TestSingleThreaded
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /* @test TestWrongBarrierDisable
  * @summary Test that disabling wrong barriers fails early
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @library /test/lib
  * @run main/othervm TestWrongBarrierDisable
  */
--- a/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/startup_warnings/TestShenandoah.java	Tue Jul 16 16:24:54 2019 +0000
@@ -24,7 +24,7 @@
 /*
 * @test TestShenandoah
 * @key gc
-* @requires vm.gc.Shenandoah
+* @requires vm.gc.Shenandoah & !vm.graal.enabled
 * @bug 8006398
 * @summary Test that the Shenandoah collector does not print a warning message
 * @library /test/lib
--- a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithShenandoah.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithShenandoah.java	Tue Jul 16 16:24:54 2019 +0000
@@ -27,7 +27,7 @@
  * @test TestGCBasherWithShenandoah
  * @key gc
  * @key stress
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled
  * @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects.
  *
--- a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithShenandoah.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithShenandoah.java	Tue Jul 16 16:24:54 2019 +0000
@@ -25,7 +25,7 @@
 /*
  * @test TestGCLockerWithShenandoah
  * @key gc
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @summary Stress Shenandoah's JNI handling by calling GetPrimitiveArrayCritical while concurrently filling up old gen.
  * @run main/native/othervm/timeout=200 -Xlog:gc*=info -Xms1500m -Xmx1500m -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+ShenandoahVerify -XX:+UseShenandoahGC TestGCLockerWithShenandoah
  * @run main/native/othervm/timeout=200 -Xlog:gc*=info -Xms1500m -Xmx1500m -XX:+UnlockExperimentalVMOptions                                                      -XX:+UseShenandoahGC TestGCLockerWithShenandoah
--- a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithShenandoah.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithShenandoah.java	Tue Jul 16 16:24:54 2019 +0000
@@ -26,7 +26,7 @@
  * @test TestSystemGCWithShenandoah
  * @key gc
  * @key stress
- * @requires vm.gc.Shenandoah
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
  * @summary Stress the Shenandoah GC full GC by allocating objects of different lifetimes concurrently with System.gc().
  * @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+ShenandoahVerify -XX:+UseShenandoahGC TestSystemGCWithShenandoah 270
  * @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+ShenandoahVerify -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=traversal TestSystemGCWithShenandoah 270
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/serviceability/ReplaceCriticalClasses.java	Tue Jul 16 16:20:54 2019 +0000
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/serviceability/ReplaceCriticalClasses.java	Tue Jul 16 16:24:54 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 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
@@ -47,6 +47,15 @@
 
     public void process(String args[]) throws Throwable {
         if (args.length == 0) {
+            // Dump the shared archive in case it was not generated during the JDK build.
+            // Put the archive at separate file to avoid clashes with concurrent tests.
+            CDSOptions opts = new CDSOptions()
+                .setXShareMode("dump")
+                .setArchiveName(ReplaceCriticalClasses.class.getName() + ".jsa")
+                .setUseVersion(false)
+                .addSuffix("-showversion");
+            CDSTestUtils.run(opts).assertNormalExit("");
+
             launchChildProcesses(getTests());
         } else if (args.length == 3 && args[0].equals("child")) {
             Class klass = Class.forName(args[2].replace("/", "."));
@@ -152,7 +161,7 @@
 
         CDSOptions opts = (new CDSOptions())
             .setXShareMode("auto")
-            .setUseSystemArchive(true)
+            .setArchiveName(ReplaceCriticalClasses.class.getName() + ".jsa")
             .setUseVersion(false)
             .addSuffix("-showversion",
                        "-Xlog:cds",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java	Tue Jul 16 16:24:54 2019 +0000
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8216970
+ * @summary Ensure escape analysis can handle an ldc of a dynamic
+ *          constant whose return type is an array of boolean.
+ * @modules java.base/jdk.internal.misc
+ * @library /test/lib
+ * @compile TestEscapeThroughInvokeWithCondy$A.jasm
+ * @compile TestEscapeThroughInvokeWithCondy.jasm
+ * @compile TestEscapeCondy.java
+ * @run main/othervm TestEscapeCondy
+ */
+
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
+
+public class TestEscapeCondy {