Merge
authorpsadhukhan
Mon, 04 Feb 2019 11:01:04 +0530
changeset 53680 0c339d151cdc
parent 53679 ec5e5bc74f17 (current diff)
parent 53627 d997c227e968 (diff)
child 53681 fa0d9fc371bb
child 53793 9bb638b282bc
Merge
src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java
test/hotspot/jtreg/gc/g1/TestStringTableStats.java
test/jdk/ProblemList.txt
test/langtools/jdk/javadoc/doclet/testHtmlWarning/TestHtmlWarning.java
--- a/.hgtags	Sat Feb 02 10:00:05 2019 -0800
+++ b/.hgtags	Mon Feb 04 11:01:04 2019 +0530
@@ -538,3 +538,5 @@
 659b004b6a1bd8c31e766cbdf328d8f8473fd4d7 jdk-12+28
 e3ed960609927b5fdfd0a797159835cd83a81a31 jdk-13+5
 44f41693631f9b5ac78ff4d2bfabd6734fe46df2 jdk-12+29
+b5f05fe4a6f8b3996a000c20078b356d991ca8ec jdk-13+6
+6c377af36a5c4203f16aed8a5e4c2ecc08fcd8bd jdk-12+30
--- a/make/GenerateLinkOptData.gmk	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/GenerateLinkOptData.gmk	Mon Feb 04 11:01:04 2019 +0530
@@ -59,6 +59,8 @@
   INTERIM_IMAGE_DIR := $(BUILD_JDK)
 endif
 
+# Save the stderr output of the command and print it along with stdout in case
+# something goes wrong.
 $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
 	$(call MakeDir, $(LINK_OPT_DIR))
 	$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
@@ -67,7 +69,14 @@
 	    -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
 	    -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
 	    build.tools.classlist.HelloClasslist \
-	    $(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE)
+	    2> $(LINK_OPT_DIR)/stderr > $(JLI_TRACE_FILE) \
+	    || ( \
+	        exitcode=$$? ; \
+	        $(ECHO) "ERROR: Failed to generate link optimization data." \
+	            "This is likely a problem with the newly built JVM/JDK." ; \
+	        $(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \
+	        exit $$exitcode \
+	    )
 	$(GREP) -v HelloClasslist $@.raw > $@
 
 # The jli trace is created by the same recipe as classlist. By declaring these
--- a/make/autoconf/build-performance.m4	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/autoconf/build-performance.m4	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, 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
@@ -42,8 +42,11 @@
     NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu`
     FOUND_CORES=yes
   elif test "x$OPENJDK_BUILD_OS" = xaix ; then
-    NUM_CORES=`/usr/sbin/prtconf | grep "^Number Of Processors" | awk '{ print [$]4 }'`
-    FOUND_CORES=yes
+    NUM_LCPU=`lparstat -m 2> /dev/null | $GREP -o "lcpu=[[0-9]]*" | $CUT -d "=" -f 2`
+    if test -n "$NUM_LCPU"; then
+      NUM_CORES=$NUM_LCPU
+      FOUND_CORES=yes
+    fi
   elif test -n "$NUMBER_OF_PROCESSORS"; then
     # On windows, look in the env
     NUM_CORES=$NUMBER_OF_PROCESSORS
--- a/make/autoconf/compare.sh.in	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/autoconf/compare.sh.in	Mon Feb 04 11:01:04 2019 +0530
@@ -76,12 +76,15 @@
 if [ "@COMPILE_TYPE@" != "cross" ]; then
   export JAVAP="@FIXPATH@ $OUTPUTDIR/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
   export JIMAGE="@FIXPATH@ $OUTPUTDIR/jdk/bin/jimage"
+  export JMOD="@FIXPATH@ $OUTPUTDIR/jdk/bin/jmod"
 elif [ "@CREATE_BUILDJDK@" = "true" ]; then
   export JAVAP="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
   export JIMAGE="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jimage"
+  export JMOD="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jmod"
 else
   export JAVAP="@FIXPATH@ @BUILD_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
   export JIMAGE="@FIXPATH@ @BUILD_JDK@/bin/jimage"
+  export JMOD="@FIXPATH@ @BUILD_JDK@/bin/jmod"
 fi
 
 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
--- a/make/autoconf/lib-freetype.m4	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/autoconf/lib-freetype.m4	Mon Feb 04 11:01:04 2019 +0530
@@ -92,7 +92,7 @@
 
   # This setup is to verify access to system installed freetype header and libraries.
   # On Windows and MacOS this does not apply and using these options will report an error.
-  # On other platforms (Linux, Solaris, and perhaps AIX), they will default to using
+  # On other platforms (Linux, Solaris), they will default to using
   # the system libraries. If they are found automatically, nothing need be done.
   # If they are not found, the configure "--with-freetype-*" options may be used to fix that.
   # If the preference is to bundle on these platforms then use --with-freetype=bundled
@@ -102,11 +102,12 @@
 
   if (test "x$with_freetype_include" = "x"  && test "x$with_freetype_lib" != "x") || \
      (test "x$with_freetype_include" != "x"  && test "x$with_freetype_lib" = "x"); then
-       AC_MSG_ERROR(['must specify both or neither of --with_freetype_include and --with_freetype_lib])
+       AC_MSG_ERROR(['must specify both or neither of --with-freetype-include and --with-freetype-lib])
   fi
 
   FREETYPE_TO_USE=bundled
-  if (test "x$OPENJDK_TARGET_OS" != "xwindows" && test "x$OPENJDK_TARGET_OS" != "xmacosx"); then
+  if (test "x$OPENJDK_TARGET_OS" != "xwindows" && test "x$OPENJDK_TARGET_OS" != "xmacosx" \
+      && test "x$OPENJDK_TARGET_OS" != "xaix"); then
     FREETYPE_TO_USE=system
   fi
   if (test "x$with_freetype" != "x"); then
@@ -115,7 +116,7 @@
     elif (test "x$with_freetype" = "xbundled"); then
       FREETYPE_TO_USE=bundled
       if (test "x$with_freetype_include" != "x"  || test "x$with_freetype_lib" != "x"); then
-        AC_MSG_ERROR(['bundled' cannot be specified with --with_freetype_include and --with_freetype_lib])
+        AC_MSG_ERROR(['bundled' cannot be specified with --with-freetype-include and --with-freetype-lib])
       fi
     else
        AC_MSG_ERROR(['valid values for --with-freetype are 'system' and 'bundled'])
--- a/make/conf/jib-profiles.js	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/conf/jib-profiles.js	Mon Feb 04 11:01:04 2019 +0530
@@ -866,8 +866,8 @@
         solaris_x64: "SS12u4-Solaris11u1+1.0",
         solaris_sparcv9: "SS12u6-Solaris11u3+1.0",
         windows_x64: "VS2017-15.5.5+1.0",
-        linux_aarch64: "gcc7.3.0-Fedora27+1.1",
-        linux_arm: "gcc7.3.0-Fedora27+1.1"
+        linux_aarch64: "gcc7.3.0-Fedora27+1.2",
+        linux_arm: "gcc7.3.0-Fedora27+1.2"
     };
 
     var devkit_platform = (input.target_cpu == "x86"
--- a/make/data/charsetmapping/stdcs-aix	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/data/charsetmapping/stdcs-aix	Mon Feb 04 11:01:04 2019 +0530
@@ -5,7 +5,6 @@
 Big5_Solaris
 Big5_HKSCS
 EUC_CN
-EUC_JP
 EUC_KR
 GBK
 GB18030
--- a/make/data/lsrdata/language-subtag-registry.txt	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/data/lsrdata/language-subtag-registry.txt	Mon Feb 04 11:01:04 2019 +0530
@@ -1,4 +1,4 @@
-File-Date: 2018-10-31
+File-Date: 2018-11-30
 %%
 Type: language
 Subtag: aa
@@ -593,6 +593,7 @@
 Type: language
 Subtag: lg
 Description: Ganda
+Description: Luganda
 Added: 2005-10-16
 %%
 Type: language
--- a/make/devkit/Tools.gmk	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/devkit/Tools.gmk	Mon Feb 04 11:01:04 2019 +0530
@@ -103,7 +103,7 @@
 GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.xz
 BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.xz
 CCACHE := https://samba.org/ftp/ccache/$(ccache_ver).tar.xz
-MPFR := http://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2
+MPFR := https://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2
 GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2
 MPC := http://ftp.gnu.org/pub/gnu/mpc/${mpc_ver}.tar.gz
 GDB := http://ftp.gnu.org/gnu/gdb/${gdb_ver}.tar.xz
@@ -355,6 +355,7 @@
 $(BUILDDIR)/$(binutils_ver)/Makefile : CONFIG += --enable-64-bit-bfd --libdir=$(PREFIX)/$(word 1,$(LIBDIRS))
 
 # Makefile creation. Simply run configure in build dir.
+# Setting CFLAGS to -O2 generates a much faster ld.
 $(bfdmakes) \
 $(BUILDDIR)/$(binutils_ver)/Makefile \
     : $(BINUTILS_CFG)
@@ -362,7 +363,7 @@
 	@mkdir -p $(@D)
 	( \
 	  cd $(@D) ; \
-	  $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \
+	  $(PATHPRE) $(ENVS) CFLAGS="-O2 $(CFLAGS)" \
 	      $(BINUTILS_CFG) \
 	      $(CONFIG) \
 	      --with-sysroot=$(SYSROOT) \
@@ -370,6 +371,7 @@
 	      --program-prefix=$(TARGET)- \
 	      --enable-multilib \
 	      --enable-gold \
+	      --enable-threads \
 	      --enable-plugins \
 	) > $(@D)/log.config 2>&1
 	@echo 'done'
--- a/make/hotspot/gensrc/GensrcAdlc.gmk	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/hotspot/gensrc/GensrcAdlc.gmk	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -142,6 +142,12 @@
       )))
   endif
 
+  ifeq ($(call check-jvm-feature, zgc), true)
+    AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
+        $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/z/z_$(HOTSPOT_TARGET_CPU).ad \
+      )))
+  endif
+
   SINGLE_AD_SRCFILE := $(ADLC_SUPPORT_DIR)/all-ad-src.ad
 
   INSERT_FILENAME_AWK_SCRIPT := \
--- a/make/jdk/src/classes/build/tools/cldrconverter/CalendarType.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/jdk/src/classes/build/tools/cldrconverter/CalendarType.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
         {0,   2},   // generic
         {0,   2},   // gregorian
         {0,   1},   // buddhist
-        {232, 4},   // japanese (eras from Meiji)
+        {232, 5},   // japanese (eras from Meiji)
         {0,   2},   // roc (Minguo)
         {0,   1},   // islamic (Hijrah)
         {0,   1},   // islamic-civil (same as islamic)
--- a/make/scripts/compare.sh	Sat Feb 02 10:00:05 2019 -0800
+++ b/make/scripts/compare.sh	Mon Feb 04 11:01:04 2019 +0530
@@ -340,7 +340,9 @@
 
     echo -n File types...
     found=""
-    for f in `cd $OTHER_DIR && $FIND . ! -type d`
+    # The file command does not know about jmod files and this sometimes results
+    # in different types being detected more or less randomly.
+    for f in $(cd $OTHER_DIR && $FIND . ! -type d -a ! -name "*.jmod")
     do
         if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
         if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
@@ -494,7 +496,7 @@
     $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
     $MKDIR -p $THIS_UNZIPDIR
     $MKDIR -p $OTHER_UNZIPDIR
-    if [ "$TYPE" = "jar" -o "$TYPE" = "war" -o "$TYPE" = "zip" -o "$TYPE" = "jmod" ]
+    if [ "$TYPE" = "jar" -o "$TYPE" = "war" -o "$TYPE" = "zip" ]
     then
         (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
         (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
@@ -502,6 +504,10 @@
     then
         (cd $THIS_UNZIPDIR && $GUNZIP -c $THIS_ZIP | $TAR xf -)
         (cd $OTHER_UNZIPDIR && $GUNZIP -c $OTHER_ZIP | $TAR xf -)
+    elif [ "$TYPE" = "jmod" ]
+    then
+        (cd $THIS_UNZIPDIR && $JMOD extract $THIS_ZIP)
+        (cd $OTHER_UNZIPDIR && $JMOD extract $OTHER_ZIP)
     else
         (cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
         (cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
@@ -559,16 +565,16 @@
         return_value=1
     fi
 
-    if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
-        DIFFING_FILES=$($GREP -e 'differ$' -e '^diff ' $CONTENTS_DIFF_FILE \
-            | $SED -e 's/^Files //g' -e 's/diff -r //g' | $CUT -f 1 -d ' ' \
-            | $SED "s|$OTHER_UNZIPDIR/||g")
-    else
-        DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \
-            | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
-    fi
+    if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then
+        if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
+            DIFFING_FILES=$($GREP -e 'differ$' -e '^diff ' $CONTENTS_DIFF_FILE \
+                | $SED -e 's/^Files //g' -e 's/diff -r //g' | $CUT -f 1 -d ' ' \
+                | $SED "s|$OTHER_UNZIPDIR/||g")
+        else
+            DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \
+                | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
+        fi
 
-    if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then
         $RM -f $WORK_DIR/$ZIP_FILE.diffs
         for file in $DIFFING_FILES; do
             if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then
@@ -600,6 +606,48 @@
     return $return_value
 }
 
+################################################################################
+# Compare jmod file
+
+compare_jmod_file() {
+    THIS_DIR=$1
+    OTHER_DIR=$2
+    WORK_DIR=$3
+    JMOD_FILE=$4
+
+    THIS_JMOD=$THIS_DIR/$JMOD_FILE
+    OTHER_JMOD=$OTHER_DIR/$JMOD_FILE
+
+    if $CMP $OTHER_JMOD $THIS_JMOD > /dev/null; then
+        return 0
+    fi
+
+    THIS_JMOD_LIST=$WORK_DIR/$JMOD_FILE.list.this
+    OTHER_JMOD_LIST=$WORK_DIR/$JMOD_FILE.list.other
+    mkdir -p $(dirname $THIS_JMOD_LIST) $(dirname $OTHER_JMOD_LIST)
+
+    $JMOD list $THIS_JMOD | sort > $THIS_JMOD_LIST
+    $JMOD list $OTHER_JMOD | sort > $OTHER_JMOD_LIST
+    JMOD_LIST_DIFF_FILE=$WORK_DIR/$JMOD_FILE.list.diff
+    LC_ALL=C $DIFF $THIS_JMOD_LIST $OTHER_JMOD_LIST > $JMOD_LIST_DIFF_FILE
+
+    ONLY_THIS=$($GREP "^<" $JMOD_LIST_DIFF_FILE)
+    ONLY_OTHER=$($GREP "^>" $JMOD_LIST_DIFF_FILE)
+
+    if [ -n "$ONLY_OTHER" ]; then
+        echo "        Only OTHER $JMOD_FILE contains:"
+        echo "$ONLY_OTHER" | sed "s|^>|            |"g | sed 's|: |/|g'
+        return_value=1
+    fi
+
+    if [ -n "$ONLY_THIS" ]; then
+        echo "        Only THIS $JMOD_FILE contains:"
+        echo "$ONLY_THIS" | sed "s|^<|            |"g | sed 's|: |/|g'
+        return_value=1
+    fi
+
+    return $return_value
+}
 
 ################################################################################
 # Compare all zip files
@@ -631,6 +679,34 @@
 }
 
 ################################################################################
+# Compare all jmod files
+
+compare_all_jmod_files() {
+    THIS_DIR=$1
+    OTHER_DIR=$2
+    WORK_DIR=$3
+
+    JMODS=$(cd $THIS_DIR && $FIND . -type f -name "*.jmod" | $SORT | $FILTER )
+
+    if [ -n "$JMODS" ]; then
+        echo Jmod files...
+
+        return_value=0
+        for f in $JMODS; do
+            if [ -f "$OTHER_DIR/$f" ]; then
+                compare_jmod_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
+                if [ "$?" != "0" ]; then
+                    return_value=1
+                    REGRESSIONS=true
+                fi
+            fi
+        done
+    fi
+
+    return $return_value
+}
+
+################################################################################
 # Compare all jar files
 
 compare_all_jar_files() {
@@ -1141,6 +1217,7 @@
     echo "-zips               Compare the contents of all zip files and files in them"
     echo "-zips-names         Compare the file names inside all zip files"
     echo "-jars               Compare the contents of all jar files"
+    echo "-jmods              Compare the listings of all jmod files"
     echo "-libs               Compare all native libraries"
     echo "-execs              Compare all executables"
     echo "-v                  Verbose output, does not hide known differences"
@@ -1169,6 +1246,7 @@
 CMP_ZIPS=false
 CMP_ZIPS_CONTENTS=true
 CMP_JARS=false
+CMP_JMODS=false
 CMP_LIBS=false
 CMP_EXECS=false
 
@@ -1194,6 +1272,7 @@
             CMP_GENERAL=true
             CMP_ZIPS=true
             CMP_JARS=true
+            CMP_JMODS=true
             CMP_LIBS=true
             CMP_EXECS=true
             ;;
@@ -1220,6 +1299,9 @@
         -jars)
             CMP_JARS=true
             ;;
+        -jmods)
+            CMP_JMODS=true
+            ;;
         -libs)
             CMP_LIBS=true
             ;;
@@ -1264,6 +1346,7 @@
             CMP_TYPES=false
             CMP_ZIPS=true
             CMP_JARS=true
+            CMP_JMODS=true
             CMP_LIBS=true
             CMP_EXECS=true
 
@@ -1317,13 +1400,22 @@
     exit
 fi
 
-if [ "$CMP_NAMES" = "false" ] && [ "$CMP_TYPES" = "false" ] && [ "$CMP_PERMS" = "false" ] && [ "$CMP_GENERAL" = "false" ] && [ "$CMP_ZIPS" = "false" ] && [ "$CMP_JARS" = "false" ] && [ "$CMP_LIBS" = "false" ] && [ "$CMP_EXECS" = "false" ]; then
+if [ "$CMP_NAMES" = "false" ] \
+       && [ "$CMP_TYPES" = "false" ] \
+       && [ "$CMP_PERMS" = "false" ] \
+       && [ "$CMP_GENERAL" = "false" ] \
+       && [ "$CMP_ZIPS" = "false" ] \
+       && [ "$CMP_JARS" = "false" ] \
+       && [ "$CMP_JMODS" = "false" ] \
+       && [ "$CMP_LIBS" = "false" ] \
+       && [ "$CMP_EXECS" = "false" ]; then
     CMP_NAMES=true
     CMP_PERMS=true
     CMP_TYPES=true
     CMP_GENERAL=true
     CMP_ZIPS=true
     CMP_JARS=true
+    CMP_JMODS=true
     CMP_LIBS=true
     CMP_EXECS=true
 fi
@@ -1373,6 +1465,7 @@
         OTHER_JDK="$OTHER/images/jdk"
         # Rewrite the path to tools that are used from the build
         JIMAGE="$(echo "$JIMAGE" | $SED "s|$OLD_THIS|$THIS|g")"
+        JMOD="$(echo "$JMOD" | $SED "s|$OLD_THIS|$THIS|g")"
         JAVAP="$(echo "$JAVAP" | $SED "s|$OLD_THIS|$THIS|g")"
     else
         echo "No common images found."
@@ -1613,6 +1706,15 @@
     fi
 fi
 
+if [ "$CMP_JMODS" = "true" ]; then
+    if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
+        compare_all_jmod_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
+    fi
+    if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
+        compare_all_jmod_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
+    fi
+fi
+
 if [ "$CMP_PERMS" = "true" ]; then
     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
         echo -n "JDK "
--- a/src/hotspot/cpu/aarch64/frame_aarch64.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/aarch64/frame_aarch64.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -34,7 +34,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/monitorChunk.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -137,11 +137,6 @@
 // frame.
 inline intptr_t* frame::id(void) const { return unextended_sp(); }
 
-// Relationals on frames based
-// Return true if the frame is younger (more recent activation) than the frame represented by id
-inline bool frame::is_younger(intptr_t* id) const { assert(this->id() != NULL && id != NULL, "NULL frame id");
-                                                    return this->id() < id ; }
-
 // Return true if the frame is older (less recent activation) than the frame represented by id
 inline bool frame::is_older(intptr_t* id) const   { assert(this->id() != NULL && id != NULL, "NULL frame id");
                                                     return this->id() > id ; }
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -2720,7 +2720,7 @@
   {
     Label notVolatile;
     __ tbz(r5, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
-    __ membar(MacroAssembler::StoreStore);
+    __ membar(MacroAssembler::StoreStore | MacroAssembler::LoadStore);
     __ bind(notVolatile);
   }
 
--- a/src/hotspot/cpu/arm/frame_arm.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/arm/frame_arm.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -32,6 +32,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/monitorChunk.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/src/hotspot/cpu/arm/frame_arm.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/arm/frame_arm.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -120,17 +120,11 @@
 // frame.
 inline intptr_t* frame::id(void) const { return unextended_sp(); }
 
-// Relationals on frames based
-// Return true if the frame is younger (more recent activation) than the frame represented by id
-inline bool frame::is_younger(intptr_t* id) const { assert(this->id() != NULL && id != NULL, "NULL frame id");
-                                                    return this->id() < id ; }
-
 // Return true if the frame is older (less recent activation) than the frame represented by id
 inline bool frame::is_older(intptr_t* id) const   { assert(this->id() != NULL && id != NULL, "NULL frame id");
                                                     return this->id() > id ; }
 
 
-
 inline intptr_t* frame::link() const              { return (intptr_t*) *(intptr_t **)addr_at(link_offset); }
 
 inline intptr_t* frame::unextended_sp() const     { return _unextended_sp; }
--- a/src/hotspot/cpu/ppc/frame_ppc.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/ppc/frame_ppc.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -34,6 +34,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.inline.hpp"
 #include "runtime/monitorChunk.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/src/hotspot/cpu/s390/frame_s390.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/s390/frame_s390.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -32,6 +32,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/monitorChunk.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/src/hotspot/cpu/s390/frame_s390.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/s390/frame_s390.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -111,14 +111,6 @@
   return _fp;
 }
 
-// Return true if this frame is younger (more recent activation) than
-// the frame represented by id.
-inline bool frame::is_younger(intptr_t* id) const {
-  assert(this->id() != NULL && id != NULL, "NULL frame id");
-  // Stack grows towards smaller addresses on z/Architecture.
-  return this->id() < id;
-}
-
 // Return true if this frame is older (less recent activation) than
 // the frame represented by id.
 inline bool frame::is_older(intptr_t* id) const {
--- a/src/hotspot/cpu/sparc/frame_sparc.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/sparc/frame_sparc.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -57,11 +57,6 @@
 // frame.
 inline intptr_t* frame::id(void) const { return unextended_sp(); }
 
-// Relationals on frames based
-// Return true if the frame is younger (more recent activation) than the frame represented by id
-inline bool frame::is_younger(intptr_t* id) const { assert(this->id() != NULL && id != NULL, "NULL frame id");
-                                                    return this->id() < id ; }
-
 // Return true if the frame is older (less recent activation) than the frame represented by id
 inline bool frame::is_older(intptr_t* id) const   { assert(this->id() != NULL && id != NULL, "NULL frame id");
                                                     return this->id() > id ; }
--- a/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -4219,7 +4219,7 @@
     // save F48:F54 in temp registers
     __ movdtox(F54,G2);
     __ movdtox(F52,G3);
-    __ movdtox(F50,G6);
+    __ movdtox(F50,L6);
     __ movdtox(F48,G1);
     for ( int i = 46;  i >= 14; i -= 8 ) {
       __ aes_dround23(as_FloatRegister(i), F0, F2, F4);
@@ -4247,7 +4247,7 @@
     // re-init F48:F54 with their original values
     __ movxtod(G2,F54);
     __ movxtod(G3,F52);
-    __ movxtod(G6,F50);
+    __ movxtod(L6,F50);
     __ movxtod(G1,F48);
 
     __ movxtod(L0,F6);
--- a/src/hotspot/cpu/x86/frame_x86.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/x86/frame_x86.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -133,11 +133,6 @@
 // frame.
 inline intptr_t* frame::id(void) const { return unextended_sp(); }
 
-// Relationals on frames based
-// Return true if the frame is younger (more recent activation) than the frame represented by id
-inline bool frame::is_younger(intptr_t* id) const { assert(this->id() != NULL && id != NULL, "NULL frame id");
-                                                    return this->id() < id ; }
-
 // Return true if the frame is older (less recent activation) than the frame represented by id
 inline bool frame::is_older(intptr_t* id) const   { assert(this->id() != NULL && id != NULL, "NULL frame id");
                                                     return this->id() > id ; }
--- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -278,20 +278,21 @@
 
   Register ref = stub->ref()->as_register();
   Register ref_addr = noreg;
+  Register tmp = noreg;
 
-  if (stub->ref_addr()->is_register()) {
-    // Address already in register
-    ref_addr = stub->ref_addr()->as_pointer_register();
-  } else {
+  if (stub->tmp()->is_valid()) {
     // Load address into tmp register
     ce->leal(stub->ref_addr(), stub->tmp());
-    ref_addr = stub->tmp()->as_pointer_register();
+    ref_addr = tmp = stub->tmp()->as_pointer_register();
+  } else {
+    // Address already in register
+    ref_addr = stub->ref_addr()->as_address_ptr()->base()->as_pointer_register();
   }
 
   assert_different_registers(ref, ref_addr, noreg);
 
-  // Save rax unless it is the result register
-  if (ref != rax) {
+  // Save rax unless it is the result or tmp register
+  if (ref != rax && tmp != rax) {
     __ push(rax);
   }
 
@@ -305,9 +306,13 @@
   // Verify result
   __ verify_oop(rax, "Bad oop");
 
-  // Restore rax unless it is the result register
+  // Move result into place
   if (ref != rax) {
     __ movptr(ref, rax);
+  }
+
+  // Restore rax unless it is the result or tmp register
+  if (ref != rax && tmp != rax) {
     __ pop(rax);
   }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,155 @@
+//
+// 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
+// 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.
+//
+
+source %{
+
+#include "gc/z/zBarrierSetAssembler.hpp"
+
+static void z_load_barrier_slow_reg(MacroAssembler& _masm, Register dst, Address src, bool weak) {
+  assert(dst != r12, "Invalid register");
+  assert(dst != r15, "Invalid register");
+  assert(dst != rsp, "Invalid register");
+
+  const address stub = weak ? ZBarrierSet::assembler()->load_barrier_weak_slow_stub(dst)
+                            : ZBarrierSet::assembler()->load_barrier_slow_stub(dst);
+  __ lea(dst, src);
+  __ call(RuntimeAddress(stub));
+}
+
+%}
+
+// For XMM and YMM enabled processors
+instruct zLoadBarrierSlowRegXmmAndYmm(rRegP dst, memory src, rFlagsReg cr,
+                                      rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
+                                      rxmm4 x4, rxmm5 x5, rxmm6 x6, rxmm7 x7,
+                                      rxmm8 x8, rxmm9 x9, rxmm10 x10, rxmm11 x11,
+                                      rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15) %{
+
+  match(Set dst (LoadBarrierSlowReg src));
+  predicate(UseAVX <= 2);
+
+  effect(DEF dst, KILL cr,
+         KILL x0, KILL x1, KILL x2, KILL x3,
+         KILL x4, KILL x5, KILL x6, KILL x7,
+         KILL x8, KILL x9, KILL x10, KILL x11,
+         KILL x12, KILL x13, KILL x14, KILL x15);
+
+  format %{ "zLoadBarrierSlowRegXmmAndYmm $dst, $src" %}
+
+  ins_encode %{
+    z_load_barrier_slow_reg(_masm, $dst$$Register, $src$$Address, false /* weak */);
+  %}
+
+  ins_pipe(pipe_slow);
+%}
+
+// For ZMM enabled processors
+instruct zLoadBarrierSlowRegZmm(rRegP dst, memory src, rFlagsReg cr,
+                                rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
+                                rxmm4 x4, rxmm5 x5, rxmm6 x6, rxmm7 x7,
+                                rxmm8 x8, rxmm9 x9, rxmm10 x10, rxmm11 x11,
+                                rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15,
+                                rxmm16 x16, rxmm17 x17, rxmm18 x18, rxmm19 x19,
+                                rxmm20 x20, rxmm21 x21, rxmm22 x22, rxmm23 x23,
+                                rxmm24 x24, rxmm25 x25, rxmm26 x26, rxmm27 x27,
+                                rxmm28 x28, rxmm29 x29, rxmm30 x30, rxmm31 x31) %{
+
+  match(Set dst (LoadBarrierSlowReg src));
+  predicate(UseAVX == 3);
+
+  effect(DEF dst, KILL cr,
+         KILL x0, KILL x1, KILL x2, KILL x3,
+         KILL x4, KILL x5, KILL x6, KILL x7,
+         KILL x8, KILL x9, KILL x10, KILL x11,
+         KILL x12, KILL x13, KILL x14, KILL x15,
+         KILL x16, KILL x17, KILL x18, KILL x19,
+         KILL x20, KILL x21, KILL x22, KILL x23,
+         KILL x24, KILL x25, KILL x26, KILL x27,
+         KILL x28, KILL x29, KILL x30, KILL x31);
+
+  format %{ "zLoadBarrierSlowRegZmm $dst, $src" %}
+
+  ins_encode %{
+    z_load_barrier_slow_reg(_masm, $dst$$Register, $src$$Address, false /* weak */);
+  %}
+
+  ins_pipe(pipe_slow);
+%}
+
+// For XMM and YMM enabled processors
+instruct zLoadBarrierWeakSlowRegXmmAndYmm(rRegP dst, memory src, rFlagsReg cr,
+                                          rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
+                                          rxmm4 x4, rxmm5 x5, rxmm6 x6, rxmm7 x7,
+                                          rxmm8 x8, rxmm9 x9, rxmm10 x10, rxmm11 x11,
+                                          rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15) %{
+
+  match(Set dst (LoadBarrierWeakSlowReg src));
+  predicate(UseAVX <= 2);
+
+  effect(DEF dst, KILL cr,
+         KILL x0, KILL x1, KILL x2, KILL x3,
+         KILL x4, KILL x5, KILL x6, KILL x7,
+         KILL x8, KILL x9, KILL x10, KILL x11,
+         KILL x12, KILL x13, KILL x14, KILL x15);
+
+  format %{ "zLoadBarrierWeakSlowRegXmmAndYmm $dst, $src" %}
+
+  ins_encode %{
+    z_load_barrier_slow_reg(_masm, $dst$$Register, $src$$Address, true /* weak */);
+  %}
+
+  ins_pipe(pipe_slow);
+%}
+
+// For ZMM enabled processors
+instruct zLoadBarrierWeakSlowRegZmm(rRegP dst, memory src, rFlagsReg cr,
+                                    rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
+                                    rxmm4 x4, rxmm5 x5, rxmm6 x6, rxmm7 x7,
+                                    rxmm8 x8, rxmm9 x9, rxmm10 x10, rxmm11 x11,
+                                    rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15,
+                                    rxmm16 x16, rxmm17 x17, rxmm18 x18, rxmm19 x19,
+                                    rxmm20 x20, rxmm21 x21, rxmm22 x22, rxmm23 x23,
+                                    rxmm24 x24, rxmm25 x25, rxmm26 x26, rxmm27 x27,
+                                    rxmm28 x28, rxmm29 x29, rxmm30 x30, rxmm31 x31) %{
+
+  match(Set dst (LoadBarrierWeakSlowReg src));
+  predicate(UseAVX == 3);
+
+  effect(DEF dst, KILL cr,
+         KILL x0, KILL x1, KILL x2, KILL x3,
+         KILL x4, KILL x5, KILL x6, KILL x7,
+         KILL x8, KILL x9, KILL x10, KILL x11,
+         KILL x12, KILL x13, KILL x14, KILL x15,
+         KILL x16, KILL x17, KILL x18, KILL x19,
+         KILL x20, KILL x21, KILL x22, KILL x23,
+         KILL x24, KILL x25, KILL x26, KILL x27,
+         KILL x28, KILL x29, KILL x30, KILL x31);
+
+  format %{ "zLoadBarrierWeakSlowRegZmm $dst, $src" %}
+
+  ins_encode %{
+    z_load_barrier_slow_reg(_masm, $dst$$Register, $src$$Address, true /* weak */);
+  %}
+
+  ins_pipe(pipe_slow);
+%}
--- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -3709,8 +3709,6 @@
     // Round to nearest, 24-bit mode, exceptions masked
     StubRoutines::_fpu_cntrl_wrd_24    = 0x007F;
     // Round to nearest, 64-bit mode, exceptions masked
-    StubRoutines::_fpu_cntrl_wrd_64    = 0x037F;
-    // Round to nearest, 64-bit mode, exceptions masked
     StubRoutines::_mxcsr_std           = 0x1F80;
     // Note: the following two constants are 80-bit values
     //       layout is critical for correct loading by FPU.
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -5721,8 +5721,6 @@
     // Round to nearest, 24-bit mode, exceptions masked
     StubRoutines::_fpu_cntrl_wrd_24    = 0x007F;
     // Round to nearest, 64-bit mode, exceptions masked
-    StubRoutines::_fpu_cntrl_wrd_64    = 0x037F;
-    // Round to nearest, 64-bit mode, exceptions masked
     StubRoutines::_mxcsr_std           = 0x1F80;
     // Note: the following two constants are 80-bit values
     //       layout is critical for correct loading by FPU.
--- a/src/hotspot/cpu/x86/x86.ad	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/x86/x86.ad	Mon Feb 04 11:01:04 2019 +0530
@@ -1685,26 +1685,24 @@
     case Op_VecS: // copy whole register
     case Op_VecD:
     case Op_VecX:
-#ifndef LP64
+#ifndef _LP64
       __ movdqu(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]));
 #else
       if ((UseAVX < 3) || VM_Version::supports_avx512vl()) {
         __ movdqu(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]));
       } else {
-        __ vpxor(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[dst_lo]), 2);
-        __ vinserti32x4(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]), 0x0);
+        __ vextractf32x4(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]), 0x0);
      }
 #endif
       break;
     case Op_VecY:
-#ifndef LP64
+#ifndef _LP64
       __ vmovdqu(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]));
 #else
       if ((UseAVX < 3) || VM_Version::supports_avx512vl()) {
         __ vmovdqu(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]));
       } else {
-        __ vpxor(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[dst_lo]), 2);
-        __ vinserti64x4(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]), 0x0);
+        __ vextractf64x4(as_XMMRegister(Matcher::_regEncode[dst_lo]), as_XMMRegister(Matcher::_regEncode[src_lo]), 0x0);
      }
 #endif
       break;
@@ -1758,26 +1756,26 @@
         __ movq(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset));
         break;
       case Op_VecX:
-#ifndef LP64
+#ifndef _LP64
         __ movdqu(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset));
 #else
         if ((UseAVX < 3) || VM_Version::supports_avx512vl()) {
           __ movdqu(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset));
         } else {
-          __ vpxor(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 2);
-          __ vinserti32x4(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset),0x0);
+          __ vpxor(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 2);
+          __ vinsertf32x4(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset),0x0);
         }
 #endif
         break;
       case Op_VecY:
-#ifndef LP64
+#ifndef _LP64
         __ vmovdqu(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset));
 #else
         if ((UseAVX < 3) || VM_Version::supports_avx512vl()) {
           __ vmovdqu(as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset));
         } else {
-          __ vpxor(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 2);
-          __ vinserti64x4(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset),0x0);
+          __ vpxor(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 2);
+          __ vinsertf64x4(as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), Address(rsp, stack_offset),0x0);
         }
 #endif
         break;
@@ -1796,26 +1794,26 @@
         __ movq(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]));
         break;
       case Op_VecX:
-#ifndef LP64
+#ifndef _LP64
         __ movdqu(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]));
 #else
         if ((UseAVX < 3) || VM_Version::supports_avx512vl()) {
           __ movdqu(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]));
         }
         else {
-          __ vextracti32x4(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 0x0);
+          __ vextractf32x4(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]), 0x0);
         }
 #endif
         break;
       case Op_VecY:
-#ifndef LP64
+#ifndef _LP64
         __ vmovdqu(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]));
 #else
         if ((UseAVX < 3) || VM_Version::supports_avx512vl()) {
           __ vmovdqu(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]));
         }
         else {
-          __ vextracti64x4(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]), as_XMMRegister(Matcher::_regEncode[reg]), 0x0);
+          __ vextractf64x4(Address(rsp, stack_offset), as_XMMRegister(Matcher::_regEncode[reg]), 0x0);
         }
 #endif
         break;
--- a/src/hotspot/cpu/x86/x86_64.ad	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/x86/x86_64.ad	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 //
 // This code is free software; you can redistribute it and/or modify it
@@ -526,12 +526,6 @@
 
 %}
 
-source_hpp %{
-#if INCLUDE_ZGC
-#include "gc/z/zBarrierSetAssembler.hpp"
-#endif
-%}
-
 //----------SOURCE BLOCK-------------------------------------------------------
 // This is a block of C++ code which provides values, functions, and
 // definitions necessary in the rest of the architecture description
@@ -12711,170 +12705,6 @@
   ins_pipe(pipe_jmp);
 %}
 
-//
-// Execute ZGC load barrier (strong) slow path
-//
-
-// For XMM and YMM enabled processors
-instruct loadBarrierSlowRegXmmAndYmm(rRegP dst, memory mem, rFlagsReg cr,
-                                     rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
-                                     rxmm4 x4, rxmm5 x5, rxmm6 x6, rxmm7 x7,
-                                     rxmm8 x8, rxmm9 x9, rxmm10 x10, rxmm11 x11,
-                                     rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15) %{
-
-  match(Set dst (LoadBarrierSlowReg mem));
-  predicate(UseAVX <= 2);
-
-  effect(DEF dst, KILL cr,
-         KILL x0, KILL x1, KILL x2, KILL x3,
-         KILL x4, KILL x5, KILL x6, KILL x7,
-         KILL x8, KILL x9, KILL x10, KILL x11,
-         KILL x12, KILL x13, KILL x14, KILL x15);
-
-  format %{"LoadBarrierSlowRegXmmAndYmm $dst, $mem" %}
-  ins_encode %{
-#if INCLUDE_ZGC
-    Register d = $dst$$Register;
-    ZBarrierSetAssembler* bs = (ZBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
-
-    assert(d != r12, "Can't be R12!");
-    assert(d != r15, "Can't be R15!");
-    assert(d != rsp, "Can't be RSP!");
-
-    __ lea(d, $mem$$Address);
-    __ call(RuntimeAddress(bs->load_barrier_slow_stub(d)));
-#else
-    ShouldNotReachHere();
-#endif
-  %}
-  ins_pipe(pipe_slow);
-%}
-
-// For ZMM enabled processors
-instruct loadBarrierSlowRegZmm(rRegP dst, memory mem, rFlagsReg cr,
-                               rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
-                               rxmm4 x4, rxmm5 x5, rxmm6 x6, rxmm7 x7,
-                               rxmm8 x8, rxmm9 x9, rxmm10 x10, rxmm11 x11,
-                               rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15,
-                               rxmm16 x16, rxmm17 x17, rxmm18 x18, rxmm19 x19,
-                               rxmm20 x20, rxmm21 x21, rxmm22 x22, rxmm23 x23,
-                               rxmm24 x24, rxmm25 x25, rxmm26 x26, rxmm27 x27,
-                               rxmm28 x28, rxmm29 x29, rxmm30 x30, rxmm31 x31) %{
-
-  match(Set dst (LoadBarrierSlowReg mem));
-  predicate(UseAVX == 3);
-
-  effect(DEF dst, KILL cr,
-         KILL x0, KILL x1, KILL x2, KILL x3,
-         KILL x4, KILL x5, KILL x6, KILL x7,
-         KILL x8, KILL x9, KILL x10, KILL x11,
-         KILL x12, KILL x13, KILL x14, KILL x15,
-         KILL x16, KILL x17, KILL x18, KILL x19,
-         KILL x20, KILL x21, KILL x22, KILL x23,
-         KILL x24, KILL x25, KILL x26, KILL x27,
-         KILL x28, KILL x29, KILL x30, KILL x31);
-
-  format %{"LoadBarrierSlowRegZmm $dst, $mem" %}
-  ins_encode %{
-#if INCLUDE_ZGC
-    Register d = $dst$$Register;
-    ZBarrierSetAssembler* bs = (ZBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
-
-    assert(d != r12, "Can't be R12!");
-    assert(d != r15, "Can't be R15!");
-    assert(d != rsp, "Can't be RSP!");
-
-    __ lea(d, $mem$$Address);
-    __ call(RuntimeAddress(bs->load_barrier_slow_stub(d)));
-#else
-    ShouldNotReachHere();
-#endif
-  %}
-  ins_pipe(pipe_slow);
-%}
-
-//
-// Execute ZGC load barrier (weak) slow path
-//
-
-// For XMM and YMM enabled processors
-instruct loadBarrierWeakSlowRegXmmAndYmm(rRegP dst, memory mem, rFlagsReg cr,
-                                         rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
-                                         rxmm4 x4, rxmm5 x5, rxmm6 x6, rxmm7 x7,
-                                         rxmm8 x8, rxmm9 x9, rxmm10 x10, rxmm11 x11,
-                                         rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15) %{
-
-  match(Set dst (LoadBarrierWeakSlowReg mem));
-  predicate(UseAVX <= 2);
-
-  effect(DEF dst, KILL cr,
-         KILL x0, KILL x1, KILL x2, KILL x3,
-         KILL x4, KILL x5, KILL x6, KILL x7,
-         KILL x8, KILL x9, KILL x10, KILL x11,
-         KILL x12, KILL x13, KILL x14, KILL x15);
-
-  format %{"LoadBarrierWeakSlowRegXmmAndYmm $dst, $mem" %}
-  ins_encode %{
-#if INCLUDE_ZGC
-    Register d = $dst$$Register;
-    ZBarrierSetAssembler* bs = (ZBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
-
-    assert(d != r12, "Can't be R12!");
-    assert(d != r15, "Can't be R15!");
-    assert(d != rsp, "Can't be RSP!");
-
-    __ lea(d,$mem$$Address);
-    __ call(RuntimeAddress(bs->load_barrier_weak_slow_stub(d)));
-#else
-    ShouldNotReachHere();
-#endif
-  %}
-  ins_pipe(pipe_slow);
-%}
-
-// For ZMM enabled processors
-instruct loadBarrierWeakSlowRegZmm(rRegP dst, memory mem, rFlagsReg cr,
-                                   rxmm0 x0, rxmm1 x1, rxmm2 x2,rxmm3 x3,
-                                   rxmm4 x4, rxmm5 x5, rxmm6 x6, rxmm7 x7,
-                                   rxmm8 x8, rxmm9 x9, rxmm10 x10, rxmm11 x11,
-                                   rxmm12 x12, rxmm13 x13, rxmm14 x14, rxmm15 x15,
-                                   rxmm16 x16, rxmm17 x17, rxmm18 x18, rxmm19 x19,
-                                   rxmm20 x20, rxmm21 x21, rxmm22 x22, rxmm23 x23,
-                                   rxmm24 x24, rxmm25 x25, rxmm26 x26, rxmm27 x27,
-                                   rxmm28 x28, rxmm29 x29, rxmm30 x30, rxmm31 x31) %{
-
-  match(Set dst (LoadBarrierWeakSlowReg mem));
-  predicate(UseAVX == 3);
-
-  effect(DEF dst, KILL cr,
-         KILL x0, KILL x1, KILL x2, KILL x3,
-         KILL x4, KILL x5, KILL x6, KILL x7,
-         KILL x8, KILL x9, KILL x10, KILL x11,
-         KILL x12, KILL x13, KILL x14, KILL x15,
-         KILL x16, KILL x17, KILL x18, KILL x19,
-         KILL x20, KILL x21, KILL x22, KILL x23,
-         KILL x24, KILL x25, KILL x26, KILL x27,
-         KILL x28, KILL x29, KILL x30, KILL x31);
-
-  format %{"LoadBarrierWeakSlowRegZmm $dst, $mem" %}
-  ins_encode %{
-#if INCLUDE_ZGC
-    Register d = $dst$$Register;
-    ZBarrierSetAssembler* bs = (ZBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
-
-    assert(d != r12, "Can't be R12!");
-    assert(d != r15, "Can't be R15!");
-    assert(d != rsp, "Can't be RSP!");
-
-    __ lea(d,$mem$$Address);
-    __ call(RuntimeAddress(bs->load_barrier_weak_slow_stub(d)));
-#else
-    ShouldNotReachHere();
-#endif
-  %}
-  ins_pipe(pipe_slow);
-%}
-
 // ============================================================================
 // This name is KNOWN by the ADLC and cannot be changed.
 // The ADLC forces a 'TypeRawPtr::BOTTOM' output type
--- a/src/hotspot/cpu/zero/cppInterpreter_zero.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/cpu/zero/cppInterpreter_zero.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -41,6 +41,7 @@
 #include "runtime/atomic.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
 #include "runtime/orderAccess.hpp"
--- a/src/hotspot/os/linux/os_linux.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os/linux/os_linux.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1856,6 +1856,36 @@
   return true;
 }
 
+#if defined(S390)
+// keywords_to_match - NULL terminated array of keywords
+static bool print_matching_lines_from_sysinfo_file(outputStream* st, const char* keywords_to_match[]) {
+  const char* filename = "/proc/sysinfo";
+  char* line = NULL;
+  size_t length = 0;
+  FILE* fp = fopen(filename, "r");
+  if (fp == NULL) {
+    return false;
+  }
+
+  st->print_cr("Virtualization information:");
+  while (getline(&line, &length, fp) != -1) {
+    int i = 0;
+    while (keywords_to_match[i] != NULL) {
+      if (strncmp(line, keywords_to_match[i], strlen(keywords_to_match[i])) == 0) {
+        st->print("%s", line);
+        break;
+      }
+      i++;
+    }
+  }
+
+  free(line);
+  fclose(fp);
+
+  return true;
+}
+#endif
+
 void os::print_dll_info(outputStream *st) {
   st->print_cr("Dynamic libraries:");
 
@@ -1939,6 +1969,8 @@
   os::Linux::print_ld_preload_file(st);
 
   os::Linux::print_container_info(st);
+
+  os::Linux::print_virtualization_info(st);
 }
 
 // Try to identify popular distros.
@@ -2152,6 +2184,20 @@
   st->cr();
 }
 
+void os::Linux::print_virtualization_info(outputStream* st) {
+#if defined(S390)
+  // /proc/sysinfo contains interesting information about
+  // - LPAR
+  // - whole "Box" (CPUs )
+  // - z/VM / KVM (VM<nn>); this is not available in an LPAR-only setup
+  const char* kw[] = { "LPAR", "CPUs", "VM", NULL };
+
+  if (! print_matching_lines_from_sysinfo_file(st, kw)) {
+    st->print_cr("  </proc/sysinfo Not Available>");
+  }
+#endif
+}
+
 void os::print_memory_info(outputStream* st) {
 
   st->print("Memory:");
--- a/src/hotspot/os/linux/os_linux.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os/linux/os_linux.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -110,6 +110,7 @@
 
   static void print_full_memory_info(outputStream* st);
   static void print_container_info(outputStream* st);
+  static void print_virtualization_info(outputStream* st);
   static void print_distro_info(outputStream* st);
   static void print_libversion_info(outputStream* st);
   static void print_proc_sys_info(outputStream* st);
--- a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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_sparc/os_linux_sparc.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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) {
--- a/src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -779,8 +779,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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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/aot/aotLoader.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/aot/aotLoader.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 #include "memory/allocation.inline.hpp"
 #include "oops/method.hpp"
 #include "runtime/handles.inline.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/timerTrace.hpp"
 
 GrowableArray<AOTCodeHeap*>* AOTLoader::_heaps = new(ResourceObj::C_HEAP, mtCode) GrowableArray<AOTCodeHeap*> (2, true);
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1942,7 +1942,8 @@
       // Use CHA on the receiver to select a more precise method.
       cha_monomorphic_target = target->find_monomorphic_target(calling_klass, callee_holder, actual_recv);
     } else if (code == Bytecodes::_invokeinterface && callee_holder->is_loaded() && receiver != NULL) {
-      // if there is only one implementor of this interface then we
+      assert(callee_holder->is_interface(), "invokeinterface to non interface?");
+      // If there is only one implementor of this interface then we
       // may be able bind this invoke directly to the implementing
       // klass but we need both a dependence on the single interface
       // and on the method we bind to.  Additionally since all we know
@@ -1950,53 +1951,44 @@
       // interface we have to insert a check that it's the class we
       // expect.  Interface types are not checked by the verifier so
       // they are roughly equivalent to Object.
+      // The number of implementors for declared_interface is less or
+      // equal to the number of implementors for target->holder() so
+      // if number of implementors of target->holder() == 1 then
+      // number of implementors for decl_interface is 0 or 1. If
+      // it's 0 then no class implements decl_interface and there's
+      // no point in inlining.
       ciInstanceKlass* singleton = NULL;
-      if (target->holder()->nof_implementors() == 1) {
-        singleton = target->holder()->implementor();
-        assert(singleton != NULL && singleton != target->holder(),
-               "just checking");
-
-        assert(holder->is_interface(), "invokeinterface to non interface?");
-        ciInstanceKlass* decl_interface = (ciInstanceKlass*)holder;
-        // the number of implementors for decl_interface is less or
-        // equal to the number of implementors for target->holder() so
-        // if number of implementors of target->holder() == 1 then
-        // number of implementors for decl_interface is 0 or 1. If
-        // it's 0 then no class implements decl_interface and there's
-        // no point in inlining.
-        if (!holder->is_loaded() || decl_interface->nof_implementors() != 1 || decl_interface->has_nonstatic_concrete_methods()) {
-          singleton = NULL;
-        }
-      }
-      if (singleton) {
-        cha_monomorphic_target = target->find_monomorphic_target(calling_klass, target->holder(), singleton);
+      ciInstanceKlass* declared_interface = callee_holder;
+      if (declared_interface->nof_implementors() == 1 &&
+          (!target->is_default_method() || target->is_overpass()) /* CHA doesn't support default methods yet. */) {
+        singleton = declared_interface->implementor();
+        assert(singleton != NULL && singleton != declared_interface, "");
+        cha_monomorphic_target = target->find_monomorphic_target(calling_klass, declared_interface, singleton);
         if (cha_monomorphic_target != NULL) {
-          // If CHA is able to bind this invoke then update the class
-          // to match that class, otherwise klass will refer to the
-          // interface.
-          klass = cha_monomorphic_target->holder();
-          actual_recv = target->holder();
-
-          // insert a check it's really the expected class.
-          CheckCast* c = new CheckCast(klass, receiver, copy_state_for_exception());
-          c->set_incompatible_class_change_check();
-          c->set_direct_compare(klass->is_final());
-          // pass the result of the checkcast so that the compiler has
-          // more accurate type info in the inlinee
-          better_receiver = append_split(c);
+          if (cha_monomorphic_target->holder() != compilation()->env()->Object_klass()) {
+            // If CHA is able to bind this invoke then update the class
+            // to match that class, otherwise klass will refer to the
+            // interface.
+            klass = cha_monomorphic_target->holder();
+            actual_recv = declared_interface;
+
+            // insert a check it's really the expected class.
+            CheckCast* c = new CheckCast(klass, receiver, copy_state_for_exception());
+            c->set_incompatible_class_change_check();
+            c->set_direct_compare(klass->is_final());
+            // pass the result of the checkcast so that the compiler has
+            // more accurate type info in the inlinee
+            better_receiver = append_split(c);
+          } else {
+            cha_monomorphic_target = NULL; // subtype check against Object is useless
+          }
         }
       }
     }
   }
 
   if (cha_monomorphic_target != NULL) {
-    if (cha_monomorphic_target->is_abstract()) {
-      // Do not optimize for abstract methods
-      cha_monomorphic_target = NULL;
-    }
-  }
-
-  if (cha_monomorphic_target != NULL) {
+    assert(!cha_monomorphic_target->is_abstract(), "");
     if (!(target->is_final_method())) {
       // If we inlined because CHA revealed only a single target method,
       // then we are dependent on that target method not getting overridden
--- a/src/hotspot/share/c1/c1_Runtime1.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/c1/c1_Runtime1.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -57,6 +57,7 @@
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/share/ci/ciArray.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciArray.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -73,7 +73,6 @@
 
   // What kind of ciObject is this?
   bool is_array()        { return true; }
-  bool is_java_object()  { return true; }
 };
 
 #endif // SHARE_CI_CIARRAY_HPP
--- a/src/hotspot/share/ci/ciCallProfile.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciCallProfile.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -79,17 +79,6 @@
     assert(i < _limit, "out of Call Profile MorphismLimit");
     return _receiver[i];
   }
-
-  // Rescale the current profile based on the incoming scale
-  ciCallProfile rescale(double scale) {
-    assert(scale >= 0 && scale <= 1.0, "out of range");
-    ciCallProfile call = *this;
-    call._count = (int)(call._count * scale);
-    for (int i = 0; i < _morphism; i++) {
-      call._receiver_count[i] = (int)(call._receiver_count[i] * scale);
-    }
-    return call;
-  }
 };
 
 #endif // SHARE_CI_CICALLPROFILE_HPP
--- a/src/hotspot/share/ci/ciCallSite.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciCallSite.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, 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
@@ -32,12 +32,6 @@
 bool ciCallSite::is_constant_call_site() {
   return klass()->is_subclass_of(CURRENT_ENV->ConstantCallSite_klass());
 }
-bool ciCallSite::is_mutable_call_site() {
-  return klass()->is_subclass_of(CURRENT_ENV->MutableCallSite_klass());
-}
-bool ciCallSite::is_volatile_call_site() {
-  return klass()->is_subclass_of(CURRENT_ENV->VolatileCallSite_klass());
-}
 
 // ------------------------------------------------------------------
 // ciCallSite::get_target
--- a/src/hotspot/share/ci/ciCallSite.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciCallSite.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -38,8 +38,6 @@
   bool is_call_site() const { return true; }
 
   bool is_constant_call_site();
-  bool is_mutable_call_site();
-  bool is_volatile_call_site();
 
   // Return the target MethodHandle of this CallSite.
   ciMethodHandle* get_target() const;
--- a/src/hotspot/share/ci/ciEnv.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciEnv.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -55,6 +55,7 @@
 #include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/reflection.hpp"
 #include "runtime/jniHandles.inline.hpp"
--- a/src/hotspot/share/ci/ciInstanceKlass.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciInstanceKlass.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -72,7 +72,7 @@
   // The possible values of the _implementor fall into following three cases:
   //   NULL: no implementor.
   //   A ciInstanceKlass that's not itself: one implementor.
-  //   Itsef: more than one implementors.
+  //   Itself: more than one implementor.
   ciInstanceKlass*       _implementor;
 
   void compute_injected_fields();
--- a/src/hotspot/share/ci/ciMethod.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciMethod.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -46,6 +46,7 @@
 #include "oops/oop.inline.hpp"
 #include "prims/nativeLookup.hpp"
 #include "runtime/deoptimization.hpp"
+#include "runtime/handles.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 #include "utilities/xmlstream.hpp"
 #ifdef COMPILER2
@@ -89,6 +90,7 @@
   _is_c2_compilable   = !h_m()->is_not_c2_compilable();
   _can_be_parsed      = true;
   _has_reserved_stack_access = h_m()->has_reserved_stack_access();
+  _is_overpass        = h_m()->is_overpass();
   // Lazy fields, filled in on demand.  Require allocation.
   _code               = NULL;
   _exception_handlers = NULL;
@@ -718,7 +720,7 @@
   VM_ENTRY_MARK;
 
   // Disable CHA for default methods for now
-  if (root_m->get_Method()->is_default_method()) {
+  if (root_m->is_default_method()) {
     return NULL;
   }
 
@@ -758,6 +760,7 @@
     // with the same name but different vtable indexes.
     return NULL;
   }
+  assert(!target()->is_abstract(), "not allowed");
   return CURRENT_THREAD_ENV->get_method(target());
 }
 
@@ -874,6 +877,14 @@
 }
 
 // ------------------------------------------------------------------
+ciKlass* ciMethod::get_declared_method_holder_at_bci(int bci) {
+  ciBytecodeStream iter(this);
+  iter.reset_to_bci(bci);
+  iter.next();
+  return iter.get_declared_method_holder();
+}
+
+// ------------------------------------------------------------------
 // Adjust a CounterData count to be commensurate with
 // interpreter_invocation_count.  If the MDO exists for
 // only 25% of the time the method exists, then the
--- a/src/hotspot/share/ci/ciMethod.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciMethod.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -89,6 +89,7 @@
   bool _can_be_parsed;
   bool _can_be_statically_bound;
   bool _has_reserved_stack_access;
+  bool _is_overpass;
 
   // Lazy fields, filled in on demand
   address              _code;
@@ -265,6 +266,8 @@
     return get_method_at_bci(bci, ignored_will_link, &ignored_declared_signature);
   }
 
+  ciKlass*      get_declared_method_holder_at_bci(int bci);
+
   ciSignature*  get_declared_signature_at_bci(int bci) {
     bool ignored_will_link;
     ciSignature* declared_signature;
@@ -333,6 +336,9 @@
   bool is_empty_method() const;
   bool is_vanilla_constructor() const;
   bool is_final_method() const                   { return is_final() || holder()->is_final(); }
+  bool is_default_method() const                 { return !is_abstract() && !is_private() &&
+                                                          holder()->is_interface(); }
+  bool is_overpass    () const                   { check_is_loaded(); return _is_overpass; }
   bool has_loops      () const;
   bool has_jsrs       () const;
   bool is_getter      () const;
--- a/src/hotspot/share/ci/ciMethodData.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciMethodData.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, 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
@@ -208,15 +208,17 @@
   // Snapshot the data -- actually, take an approximate snapshot of
   // the data.  Any concurrently executing threads may be changing the
   // data as we copy it.
-  Copy::disjoint_words((HeapWord*) mdo,
-                       (HeapWord*) &_orig,
-                       sizeof(_orig) / HeapWordSize);
+  Copy::disjoint_words_atomic((HeapWord*) mdo,
+                              (HeapWord*) &_orig,
+                              sizeof(_orig) / HeapWordSize);
   Arena* arena = CURRENT_ENV->arena();
   _data_size = mdo->data_size();
   _extra_data_size = mdo->extra_data_size();
   int total_size = _data_size + _extra_data_size;
   _data = (intptr_t *) arena->Amalloc(total_size);
-  Copy::disjoint_words((HeapWord*) mdo->data_base(), (HeapWord*) _data, total_size / HeapWordSize);
+  Copy::disjoint_words_atomic((HeapWord*) mdo->data_base(),
+                              (HeapWord*) _data,
+                              total_size / HeapWordSize);
 
   // Traverse the profile data, translating any oops into their
   // ci equivalents.
@@ -535,10 +537,6 @@
   set_bits(_eflags, f);
 }
 
-void ciMethodData::clear_eflag(MethodData::EscapeFlag f) {
-  clear_bits(_eflags, f);
-}
-
 bool ciMethodData::eflag_set(MethodData::EscapeFlag f) const {
   return mask_bits(_eflags, f) != 0;
 }
--- a/src/hotspot/share/ci/ciMethodData.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciMethodData.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -271,11 +271,6 @@
     }
   }
 
-  intptr_t argument_type(int i) const {
-    assert(has_arguments(), "no arg type profiling data");
-    return args()->type(i);
-  }
-
   ciKlass* valid_argument_type(int i) const {
     assert(has_arguments(), "no arg type profiling data");
     return args()->valid_type(i);
@@ -315,11 +310,6 @@
   ciBranchData(DataLayout* layout) : BranchData(layout) {};
 };
 
-class ciArrayData : public ArrayData {
-public:
-  ciArrayData(DataLayout* layout) : ArrayData(layout) {};
-};
-
 class ciMultiBranchData : public MultiBranchData {
 public:
   ciMultiBranchData(DataLayout* layout) : MultiBranchData(layout) {};
@@ -471,10 +461,6 @@
 
   ciArgInfoData *arg_info() const;
 
-  address data_base() const {
-    return (address) _data;
-  }
-
   void prepare_metadata();
   void load_extra_data();
   ciProfileData* bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots);
@@ -574,7 +560,6 @@
   void update_escape_info();
 
   void set_eflag(MethodData::EscapeFlag f);
-  void clear_eflag(MethodData::EscapeFlag f);
   bool eflag_set(MethodData::EscapeFlag f) const;
 
   void set_arg_local(int i);
--- a/src/hotspot/share/ci/ciNullObject.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciNullObject.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -42,9 +42,6 @@
   void print_impl(outputStream* st);
 
 public:
-  // Is this ciObject a Java Language Object?  That is,
-  // is the ciObject an instance or an array
-  bool is_java_object() { return true; }
 
   // What kind of ciObject is this?
   bool is_null_object() const { return true; }
--- a/src/hotspot/share/ci/ciObject.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciObject.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -115,7 +115,6 @@
   // What kind of ciObject is this?
   virtual bool is_null_object()       const { return false; }
   virtual bool is_call_site()         const { return false; }
-  virtual bool is_cpcache()           const { return false; }
   virtual bool is_instance()                { return false; }
   virtual bool is_member_name()       const { return false; }
   virtual bool is_method_handle()     const { return false; }
--- a/src/hotspot/share/ci/ciReplay.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciReplay.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
 #include "oops/method.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/macros.hpp"
 
--- a/src/hotspot/share/ci/ciStreams.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciStreams.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -224,14 +224,6 @@
 }
 
 // ------------------------------------------------------------------
-// ciBytecodeStream::get_constant_cache_index
-// Return the CP cache index, or -1 if there isn't any.
-int ciBytecodeStream::get_constant_cache_index() const {
-  // work-alike for Bytecode_loadconstant::cache_index()
-  return has_cache_index() ? get_constant_raw_index() : -1;
-}
-
-// ------------------------------------------------------------------
 // ciBytecodeStream::get_constant
 //
 // If this bytecode is one of the ldc variants, get the referenced
@@ -318,36 +310,12 @@
 }
 
 // ------------------------------------------------------------------
-// ciBytecodeStream::get_field_signature_index
-//
-// Get the constant pool index of the signature of the field
-// referenced by the current bytecode.  Used for generating
-// deoptimization information.
-int ciBytecodeStream::get_field_signature_index() {
-  VM_ENTRY_MARK;
-  ConstantPool* cpool = _holder->get_instanceKlass()->constants();
-  int nt_index = cpool->name_and_type_ref_index_at(get_field_index());
-  return cpool->signature_ref_index_at(nt_index);
-}
-
-// ------------------------------------------------------------------
 // ciBytecodeStream::get_method_index
 //
 // If this is a method invocation bytecode, get the constant pool
 // index of the invoked method.
 int ciBytecodeStream::get_method_index() {
-#ifdef ASSERT
-  switch (cur_bc()) {
-  case Bytecodes::_invokeinterface:
-  case Bytecodes::_invokevirtual:
-  case Bytecodes::_invokespecial:
-  case Bytecodes::_invokestatic:
-  case Bytecodes::_invokedynamic:
-    break;
-  default:
-    ShouldNotReachHere();
-  }
-#endif
+  assert(Bytecodes::is_invoke(cur_bc()), "invalid bytecode: %s", Bytecodes::name(cur_bc()));
   if (has_index_u4())
     return get_index_u4();  // invokedynamic
   return get_index_u2_cpcache();
@@ -474,13 +442,3 @@
   )
 }
 
-// ------------------------------------------------------------------
-// ciBytecodeStream::get_resolved_references
-ciObjArray* ciBytecodeStream::get_resolved_references() {
-    VM_ENTRY_MARK;
-    // Get the constant pool.
-  ConstantPool*        cpool   = _holder->get_instanceKlass()->constants();
-
-  // Create a resolved references array and return it.
-  return CURRENT_ENV->get_object(cpool->resolved_references())->as_obj_array();
-  }
--- a/src/hotspot/share/ci/ciStreams.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciStreams.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -70,12 +70,6 @@
     _start = _pc = base; _end = base + size;
   }
 
-  void assert_wide(bool require_wide) const {
-    if (require_wide)
-         { assert(is_wide(),  "must be a wide instruction"); }
-    else { assert(!is_wide(), "must not be a wide instruction"); }
-  }
-
   Bytecode bytecode() const { return Bytecode(this, _bc_start); }
   Bytecode next_bytecode() const { return Bytecode(this, _pc); }
 
@@ -155,10 +149,6 @@
     return bytecode().get_index_u1(cur_bc_raw());
   }
 
-  int get_index_u1_cpcache() const {
-    return bytecode().get_index_u1_cpcache(cur_bc_raw());
-  }
-
   // Get a byte index following this bytecode.
   // If prefixed with a wide bytecode, get a wide index.
   int get_index() const {
@@ -218,16 +208,12 @@
   int get_int_table( int index ) const {
     return Bytes::get_Java_u4((address)&_table_base[index]); }
 
-  // For tableswitch - get length of offset part
-  int get_tableswitch_length()  { return get_int_table(2)-get_int_table(1)+1; }
-
   int get_dest_table( int index ) const {
     return cur_bci() + get_int_table(index); }
 
   // --- Constant pool access ---
   int get_constant_raw_index() const;
   int get_constant_pool_index() const;
-  int get_constant_cache_index() const;
   int get_field_index();
   int get_method_index();
 
@@ -255,7 +241,6 @@
 
   ciInstanceKlass* get_declared_field_holder();
   int      get_field_holder_index();
-  int      get_field_signature_index();
 
   ciMethod*     get_method(bool& will_link, ciSignature* *declared_signature_result);
   bool          has_appendix();
@@ -266,8 +251,6 @@
   int           get_method_holder_index();
   int           get_method_signature_index(const constantPoolHandle& cpool);
 
-  // Get the resolved references arrays from the constant pool
-  ciObjArray* get_resolved_references();
 };
 
 
--- a/src/hotspot/share/ci/ciTypeFlow.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciTypeFlow.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -2427,22 +2427,6 @@
 }
 
 // ------------------------------------------------------------------
-// ciTypeFlow::PostOrderLoops::next
-//
-// Advance to next loop tree using a postorder, left-to-right traversal.
-void ciTypeFlow::PostorderLoops::next() {
-  assert(!done(), "must not be done.");
-  if (_current->sibling() != NULL) {
-    _current = _current->sibling();
-    while (_current->child() != NULL) {
-      _current = _current->child();
-    }
-  } else {
-    _current = _current->parent();
-  }
-}
-
-// ------------------------------------------------------------------
 // ciTypeFlow::PreOrderLoops::next
 //
 // Advance to next loop tree using a preorder, left-to-right traversal.
--- a/src/hotspot/share/ci/ciTypeFlow.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciTypeFlow.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -765,22 +765,6 @@
     void print(outputStream* st = tty, int indent = 0) const PRODUCT_RETURN;
   };
 
-  // Postorder iteration over the loop tree.
-  class PostorderLoops : public StackObj {
-  private:
-    Loop* _root;
-    Loop* _current;
-  public:
-    PostorderLoops(Loop* root) : _root(root), _current(root) {
-      while (_current->child() != NULL) {
-        _current = _current->child();
-      }
-    }
-    bool done() { return _current == NULL; }  // Finished iterating?
-    void next();                            // Advance to next loop
-    Loop* current() { return _current; }      // Return current loop.
-  };
-
   // Preorder iteration over the loop tree.
   class PreorderLoops : public StackObj {
   private:
@@ -857,7 +841,6 @@
   int start_block_num() const       { return 0; }
   Block* rpo_at(int rpo) const      { assert(0 <= rpo && rpo < block_count(), "out of bounds");
                                       return _block_map[rpo]; }
-  int next_pre_order()              { return _next_pre_order; }
   int inc_next_pre_order()          { return _next_pre_order++; }
 
 private:
--- a/src/hotspot/share/ci/ciUtilities.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciUtilities.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, 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
@@ -42,13 +42,6 @@
 }
 
 // ------------------------------------------------------------------
-// basictype_to_char
-const char basictype_to_char(BasicType t) {
-  char c = type2char(t);
-  return c ? c : 'X';
-}
-
-// ------------------------------------------------------------------
 // card_table_base
 jbyte *ci_card_table_address() {
   BarrierSet* bs = BarrierSet::barrier_set();
--- a/src/hotspot/share/ci/ciUtilities.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/ci/ciUtilities.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -49,7 +49,6 @@
 }
 
 const char* basictype_to_str(BasicType t);
-const char  basictype_to_char(BasicType t);
 
 jbyte *ci_card_table_address();
 template <typename T> T ci_card_table_address_as() {
--- a/src/hotspot/share/classfile/classLoader.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/classfile/classLoader.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -56,7 +56,6 @@
 #include "prims/jvm_misc.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/compilationPolicy.hpp"
-#include "runtime/handles.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
--- a/src/hotspot/share/classfile/dictionary.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/classfile/dictionary.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -198,41 +198,6 @@
   }
 }
 
-// During class loading we may have cached a protection domain that has
-// since been unreferenced, so this entry should be cleared.
-void Dictionary::clean_cached_protection_domains(DictionaryEntry* probe) {
-  assert_locked_or_safepoint(SystemDictionary_lock);
-
-  ProtectionDomainEntry* current = probe->pd_set();
-  ProtectionDomainEntry* prev = NULL;
-  while (current != NULL) {
-    if (current->object_no_keepalive() == NULL) {
-      LogTarget(Debug, protectiondomain) lt;
-      if (lt.is_enabled()) {
-        ResourceMark rm;
-        // Print out trace information
-        LogStream ls(lt);
-        ls.print_cr("PD in set is not alive:");
-        ls.print("class loader: "); loader_data()->class_loader()->print_value_on(&ls);
-        ls.print(" loading: "); probe->instance_klass()->print_value_on(&ls);
-        ls.cr();
-      }
-      if (probe->pd_set() == current) {
-        probe->set_pd_set(current->next());
-      } else {
-        assert(prev != NULL, "should be set by alive entry");
-        prev->set_next(current->next());
-      }
-      ProtectionDomainEntry* to_delete = current;
-      current = current->next();
-      delete to_delete;
-    } else {
-      prev = current;
-      current = current->next();
-    }
-  }
-}
-
 //   Just the classes from defining class loaders
 void Dictionary::classes_do(void f(InstanceKlass*)) {
   for (int index = 0; index < table_size(); index++) {
--- a/src/hotspot/share/classfile/dictionary.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/classfile/dictionary.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -51,8 +51,6 @@
 
   DictionaryEntry* get_entry(int index, unsigned int hash, Symbol* name);
 
-  void clean_cached_protection_domains(DictionaryEntry* probe);
-
 public:
   Dictionary(ClassLoaderData* loader_data, int table_size, bool resizable = false);
   Dictionary(ClassLoaderData* loader_data, int table_size, HashtableBucket<mtClass>* t, int number_of_entries, bool resizable = false);
--- a/src/hotspot/share/classfile/stringTable.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/classfile/stringTable.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -376,68 +376,11 @@
   } while(true);
 }
 
-// GC support
-class StringTableIsAliveCounter : public BoolObjectClosure {
-  BoolObjectClosure* _real_boc;
- public:
-  size_t _count;
-  size_t _count_total;
-  StringTableIsAliveCounter(BoolObjectClosure* boc) : _real_boc(boc), _count(0),
-                                                      _count_total(0) {}
-  bool do_object_b(oop obj) {
-    bool ret = _real_boc->do_object_b(obj);
-    if (!ret) {
-      ++_count;
-    }
-    ++_count_total;
-    return ret;
-  }
-};
-
-void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f,
-                                    size_t* processed, size_t* removed) {
-  DoNothingClosure dnc;
-  assert(is_alive != NULL, "No closure");
-  StringTableIsAliveCounter stiac(is_alive);
-  OopClosure* tmp = f != NULL ? f : &dnc;
-
-  StringTable::the_table()->_weak_handles->weak_oops_do(&stiac, tmp);
-
-  // This is the serial case without ParState.
-  // Just set the correct number and check for a cleaning phase.
-  the_table()->_uncleaned_items_count = stiac._count;
-  StringTable::the_table()->check_concurrent_work();
-
-  if (processed != NULL) {
-    *processed = stiac._count_total;
-  }
-  if (removed != NULL) {
-    *removed = stiac._count;
-  }
-}
-
 void StringTable::oops_do(OopClosure* f) {
   assert(f != NULL, "No closure");
   StringTable::the_table()->_weak_handles->oops_do(f);
 }
 
-void StringTable::possibly_parallel_unlink(
-   OopStorage::ParState<false, false>* _par_state_string, BoolObjectClosure* cl,
-   size_t* processed, size_t* removed)
-{
-  DoNothingClosure dnc;
-  assert(cl != NULL, "No closure");
-  StringTableIsAliveCounter stiac(cl);
-
-  _par_state_string->weak_oops_do(&stiac, &dnc);
-
-  // Accumulate the dead strings.
-  the_table()->add_items_to_clean(stiac._count);
-
-  *processed = stiac._count_total;
-  *removed = stiac._count;
-}
-
 void StringTable::possibly_parallel_oops_do(
    OopStorage::ParState<false /* concurrent */, false /* const */>*
    _par_state_string, OopClosure* f)
@@ -525,7 +468,7 @@
   if ((dead_factor > load_factor) ||
       (load_factor > PREF_AVG_LIST_LEN) ||
       (dead_factor > CLEAN_DEAD_HIGH_WATER_MARK)) {
-    log_debug(stringtable)("Concurrent work triggered, live factor:%g dead factor:%g",
+    log_debug(stringtable)("Concurrent work triggered, live factor: %g dead factor: %g",
                            load_factor, dead_factor);
     trigger_concurrent_work();
   }
--- a/src/hotspot/share/classfile/stringTable.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/classfile/stringTable.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -128,20 +128,10 @@
     the_table()->add_items_to_clean(ndead);
   }
 
-  //   Delete pointers to otherwise-unreachable objects.
-  static void unlink(BoolObjectClosure* cl) {
-    unlink_or_oops_do(cl);
-  }
-  static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f = NULL,
-                                size_t* processed = NULL, size_t* removed = NULL);
-
   // Serially invoke "f->do_oop" on the locations of all oops in the table.
   static void oops_do(OopClosure* f);
 
   // Possibly parallel versions of the above
-  static void possibly_parallel_unlink(
-     OopStorage::ParState<false /* concurrent */, false /* const*/>* par_state_string,
-     BoolObjectClosure* cl, size_t* processed, size_t* removed);
   static void possibly_parallel_oops_do(
      OopStorage::ParState<false /* concurrent */, false /* const*/>* par_state_string,
      OopClosure* f);
--- a/src/hotspot/share/classfile/symbolTable.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/classfile/symbolTable.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,10 +49,6 @@
 const size_t END_SIZE = 17;
 // If a chain gets to 100 something might be wrong
 const size_t REHASH_LEN = 100;
-// We only get a chance to check whether we need
-// to clean infrequently (on class unloading),
-// so if we have even one dead entry then mark table for cleaning
-const double CLEAN_DEAD_HIGH_WATER_MARK = 0.0;
 
 const size_t ON_STACK_BUFFER_LENGTH = 128;
 
@@ -142,7 +138,7 @@
 SymbolTable::SymbolTable() :
   _symbols_removed(0), _symbols_counted(0), _local_table(NULL),
   _current_size(0), _has_work(0), _needs_rehashing(false),
-  _items_count(0), _uncleaned_items_count(0) {
+  _items_count(0), _has_items_to_clean(false) {
 
   size_t start_size_log_2 = ceil_log2(SymbolTableSize);
   _current_size = ((size_t)1) << start_size_log_2;
@@ -171,22 +167,14 @@
   }
 }
 
+void SymbolTable::reset_has_items_to_clean() { Atomic::store(false, &_has_items_to_clean); }
+void SymbolTable::mark_has_items_to_clean()  { Atomic::store(true, &_has_items_to_clean); }
+bool SymbolTable::has_items_to_clean() const { return Atomic::load(&_has_items_to_clean); }
+
 void SymbolTable::item_added() {
   Atomic::inc(&(SymbolTable::the_table()->_items_count));
 }
 
-void SymbolTable::set_item_clean_count(size_t ncl) {
-  Atomic::store(ncl, &(SymbolTable::the_table()->_uncleaned_items_count));
-  log_trace(symboltable)("Set uncleaned items:" SIZE_FORMAT, SymbolTable::the_table()->_uncleaned_items_count);
-}
-
-// Mark one item as needing to be cleaned, but only if no other items are marked yet
-void SymbolTable::mark_item_clean_count() {
-  if (Atomic::cmpxchg((size_t)1, &(SymbolTable::the_table()->_uncleaned_items_count), (size_t)0) == 0) {
-    log_trace(symboltable)("Marked uncleaned items:" SIZE_FORMAT, SymbolTable::the_table()->_uncleaned_items_count);
-  }
-}
-
 void SymbolTable::item_removed() {
   Atomic::inc(&(SymbolTable::the_table()->_symbols_removed));
   Atomic::dec(&(SymbolTable::the_table()->_items_count));
@@ -196,15 +184,11 @@
   return (double)_items_count/_current_size;
 }
 
-double SymbolTable::get_dead_factor() const {
-  return (double)_uncleaned_items_count/_current_size;
-}
-
 size_t SymbolTable::table_size() {
   return ((size_t)1) << _local_table->get_size_log2(Thread::current());
 }
 
-void SymbolTable::trigger_concurrent_work() {
+void SymbolTable::trigger_cleanup() {
   MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
   SymbolTable::the_table()->_has_work = true;
   Service_lock->notify_all();
@@ -490,12 +474,7 @@
   update_needs_rehash(rehash_warning);
 
   if (clean_hint) {
-    // we just found out that there is a dead item,
-    // which we were unable to clean right now,
-    // but we have no way of telling whether it's
-    // been previously counted or not, so mark
-    // it only if no other items were found yet
-    mark_item_clean_count();
+    mark_has_items_to_clean();
     check_concurrent_work();
   }
 
@@ -697,7 +676,7 @@
       }
       bdt.cont(jt);
     }
-    SymbolTable::the_table()->set_item_clean_count(0);
+    SymbolTable::the_table()->reset_has_items_to_clean();
     bdt.done(jt);
   }
 
@@ -711,17 +690,13 @@
   if (_has_work) {
     return;
   }
-  double load_factor = SymbolTable::get_load_factor();
-  double dead_factor = SymbolTable::get_dead_factor();
-  // We should clean/resize if we have more dead than alive,
+  // We should clean/resize if we have
   // more items than preferred load factor or
   // more dead items than water mark.
-  if ((dead_factor > load_factor) ||
-      (load_factor > PREF_AVG_LIST_LEN) ||
-      (dead_factor > CLEAN_DEAD_HIGH_WATER_MARK)) {
-    log_debug(symboltable)("Concurrent work triggered, live factor:%f dead factor:%f",
-                           load_factor, dead_factor);
-    trigger_concurrent_work();
+  if (has_items_to_clean() || (get_load_factor() > PREF_AVG_LIST_LEN)) {
+    log_debug(symboltable)("Concurrent work triggered, load factor: %f, items to clean: %s",
+                           get_load_factor(), has_items_to_clean() ? "true" : "false");
+    trigger_cleanup();
   }
 }
 
@@ -737,34 +712,6 @@
   _has_work = false;
 }
 
-class CountDead : StackObj {
-  size_t _count;
-public:
-  CountDead() : _count(0) {}
-  bool operator()(Symbol** value) {
-    assert(value != NULL, "expected valid value");
-    assert(*value != NULL, "value should point to a symbol");
-    Symbol* sym = *value;
-    if (sym->refcount() == 0) {
-      _count++;
-    }
-    return true;
-  };
-  size_t get_dead_count() const {
-    return _count;
-  }
-};
-
-void SymbolTable::do_check_concurrent_work() {
-  CountDead counter;
-  if (!SymbolTable::the_table()->_local_table->try_scan(Thread::current(), counter)) {
-    log_info(symboltable)("count dead unavailable at this moment");
-  } else {
-    SymbolTable::the_table()->set_item_clean_count(counter.get_dead_count());
-    SymbolTable::the_table()->check_concurrent_work();
-  }
-}
-
 void SymbolTable::do_concurrent_work(JavaThread* jt) {
   SymbolTable::the_table()->concurrent_work(jt);
 }
@@ -800,7 +747,7 @@
   if (get_load_factor() > PREF_AVG_LIST_LEN &&
       !_local_table->is_max_size_reached()) {
     log_debug(symboltable)("Choosing growing over rehashing.");
-    trigger_concurrent_work();
+    trigger_cleanup();
     _needs_rehashing = false;
     return;
   }
@@ -808,7 +755,7 @@
   // Already rehashed.
   if (rehashed) {
     log_warning(symboltable)("Rehashing already done, still long lists.");
-    trigger_concurrent_work();
+    trigger_cleanup();
     _needs_rehashing = false;
     return;
   }
--- a/src/hotspot/share/classfile/symbolTable.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/classfile/symbolTable.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -123,18 +123,19 @@
   volatile bool _needs_rehashing;
 
   volatile size_t _items_count;
-  volatile size_t _uncleaned_items_count;
+  volatile bool   _has_items_to_clean;
 
   double get_load_factor() const;
-  double get_dead_factor() const;
 
   void check_concurrent_work();
-  void trigger_concurrent_work();
 
   static void item_added();
   static void item_removed();
-  static void set_item_clean_count(size_t ncl);
-  static void mark_item_clean_count();
+
+  // For cleaning
+  void reset_has_items_to_clean();
+  void mark_has_items_to_clean();
+  bool has_items_to_clean() const;
 
   SymbolTable();
 
@@ -190,12 +191,9 @@
     initialize_symbols(symbol_alloc_arena_size);
   }
 
-  static void unlink() {
-    do_check_concurrent_work();
-  }
-  static void do_check_concurrent_work();
   static void do_concurrent_work(JavaThread* jt);
   static bool has_work() { return the_table()->_has_work; }
+  static void trigger_cleanup();
 
   // Probing
   static Symbol* lookup(const char* name, int len, TRAPS);
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1825,40 +1825,27 @@
     if (unloading_occurred) {
       MutexLockerEx ml2(is_concurrent ? Module_lock : NULL);
       JFR_ONLY(Jfr::on_unloading_classes();)
+
       MutexLockerEx ml1(is_concurrent ? SystemDictionary_lock : NULL);
       ClassLoaderDataGraph::clean_module_and_package_info();
-    }
-  }
-
-  // Cleanup ResolvedMethodTable even if no unloading occurred.
-  {
-    GCTraceTime(Debug, gc, phases) t("ResolvedMethodTable", gc_timer);
-    ResolvedMethodTable::trigger_cleanup();
-  }
-
-  if (unloading_occurred) {
-    {
-      GCTraceTime(Debug, gc, phases) t("SymbolTable", gc_timer);
-      // Check if there's work to do in the SymbolTable
-      SymbolTable::do_check_concurrent_work();
-    }
-
-    {
-      MutexLockerEx ml(is_concurrent ? SystemDictionary_lock : NULL);
-      GCTraceTime(Debug, gc, phases) t("Dictionary", gc_timer);
       constraints()->purge_loader_constraints();
       resolution_errors()->purge_resolution_errors();
     }
-
-    {
-      GCTraceTime(Debug, gc, phases) t("ResolvedMethodTable", gc_timer);
-      // Oops referenced by the protection domain cache table may get unreachable independently
-      // of the class loader (eg. cached protection domain oops). So we need to
-      // explicitly unlink them here.
-      // All protection domain oops are linked to the caller class, so if nothing
-      // unloads, this is not needed.
-      _pd_cache_table->trigger_cleanup();
-    }
+  }
+
+  GCTraceTime(Debug, gc, phases) t("Trigger cleanups", gc_timer);
+  // Trigger cleaning the ResolvedMethodTable even if no unloading occurred.
+  ResolvedMethodTable::trigger_cleanup();
+
+  if (unloading_occurred) {
+    SymbolTable::trigger_cleanup();
+
+    // Oops referenced by the protection domain cache table may get unreachable independently
+    // of the class loader (eg. cached protection domain oops). So we need to
+    // explicitly unlink them here.
+    // All protection domain oops are linked to the caller class, so if nothing
+    // unloads, this is not needed.
+    _pd_cache_table->trigger_cleanup();
   }
 
   return unloading_occurred;
--- a/src/hotspot/share/code/codeHeapState.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/code/codeHeapState.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -78,43 +78,134 @@
 //  - direct output into an argument-passed outputStream and
 //  - buffered output into a bufferedStream with subsequent flush
 //    of the filled buffer to the outputStream.
-#define USE_STRINGSTREAM
-#define HEX32_FORMAT  "0x%x"  // just a helper format string used below multiple times
-//
+#define USE_BUFFEREDSTREAM
+
+// There are instances when composing an output line or a small set of
+// output lines out of many tty->print() calls creates significant overhead.
 // Writing to a bufferedStream buffer first has a significant advantage:
-// It uses noticeably less cpu cycles and reduces (when wirting to a
-// network file) the required bandwidth by at least a factor of ten.
+// It uses noticeably less cpu cycles and reduces (when writing to a
+// network file) the required bandwidth by at least a factor of ten. Observed on MacOS.
 // That clearly makes up for the increased code complexity.
-#if defined(USE_STRINGSTREAM)
-#define STRINGSTREAM_DECL(_anyst, _outst)                 \
-    /* _anyst  name of the stream as used in the code */  \
-    /* _outst  stream where final output will go to   */  \
-    ResourceMark rm;                                      \
-    bufferedStream   _sstobj = bufferedStream(4*K);       \
-    bufferedStream*  _sstbuf = &_sstobj;                  \
-    outputStream*    _outbuf = _outst;                    \
-    bufferedStream*  _anyst  = &_sstobj; /* any stream. Use this to just print - no buffer flush.  */
+//
+// Conversion of existing code is easy and straightforward, if the code already
+// uses a parameterized output destination, e.g. "outputStream st".
+//  - rename the formal parameter to any other name, e.g. out_st.
+//  - at a suitable place in your code, insert
+//      BUFFEREDSTEAM_DECL(buf_st, out_st)
+// This will provide all the declarations necessary. After that, all
+// buf_st->print() (and the like) calls will be directed to a bufferedStream object.
+// Once a block of output (a line or a small set of lines) is composed, insert
+//      BUFFEREDSTREAM_FLUSH(termstring)
+// to flush the bufferedStream to the final destination out_st. termstring is just
+// an arbitrary string (e.g. "\n") which is appended to the bufferedStream before
+// being written to out_st. Be aware that the last character written MUST be a '\n'.
+// Otherwise, buf_st->position() does not correspond to out_st->position() any longer.
+//      BUFFEREDSTREAM_FLUSH_LOCKED(termstring)
+// does the same thing, protected by the ttyLocker lock.
+//      BUFFEREDSTREAM_FLUSH_IF(termstring, remSize)
+// does a flush only if the remaining buffer space is less than remSize.
+//
+// To activate, #define USE_BUFFERED_STREAM before including this header.
+// If not activated, output will directly go to the originally used outputStream
+// with no additional overhead.
+//
+#if defined(USE_BUFFEREDSTREAM)
+// All necessary declarations to print via a bufferedStream
+// This macro must be placed before any other BUFFEREDSTREAM*
+// macro in the function.
+#define BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, _capa)       \
+    ResourceMark         _rm;                                 \
+    /* _anyst  name of the stream as used in the code */      \
+    /* _outst  stream where final output will go to   */      \
+    /* _capa   allocated capacity of stream buffer    */      \
+    size_t           _nflush = 0;                             \
+    size_t     _nforcedflush = 0;                             \
+    size_t      _nsavedflush = 0;                             \
+    size_t     _nlockedflush = 0;                             \
+    size_t     _nflush_bytes = 0;                             \
+    size_t         _capacity = _capa;                         \
+    bufferedStream   _sstobj = bufferedStream(_capa);         \
+    bufferedStream*  _sstbuf = &_sstobj;                      \
+    outputStream*    _outbuf = _outst;                        \
+    bufferedStream*   _anyst = &_sstobj; /* any stream. Use this to just print - no buffer flush.  */
+
+// Same as above, but with fixed buffer size.
+#define BUFFEREDSTREAM_DECL(_anyst, _outst)                   \
+    BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, 4*K);
 
-#define STRINGSTREAM_FLUSH(termString)                    \
-    _sstbuf->print("%s", termString);                     \
-    _outbuf->print("%s", _sstbuf->as_string());           \
-    _sstbuf->reset();
+// Flush the buffer contents unconditionally.
+// No action if the buffer is empty.
+#define BUFFEREDSTREAM_FLUSH(_termString)                     \
+    if (((_termString) != NULL) && (strlen(_termString) > 0)){\
+      _sstbuf->print("%s", _termString);                      \
+    }                                                         \
+    if (_sstbuf != _outbuf) {                                 \
+      if (_sstbuf->size() != 0) {                             \
+        _nforcedflush++; _nflush_bytes += _sstbuf->size();    \
+        _outbuf->print("%s", _sstbuf->as_string());           \
+        _sstbuf->reset();                                     \
+      }                                                       \
+    }
 
-#define STRINGSTREAM_FLUSH_LOCKED(termString)             \
-    { ttyLocker ttyl;/* keep this output block together */\
-      STRINGSTREAM_FLUSH(termString)                      \
+// Flush the buffer contents if the remaining capacity is
+// less than the given threshold.
+#define BUFFEREDSTREAM_FLUSH_IF(_termString, _remSize)        \
+    if (((_termString) != NULL) && (strlen(_termString) > 0)){\
+      _sstbuf->print("%s", _termString);                      \
+    }                                                         \
+    if (_sstbuf != _outbuf) {                                 \
+      if ((_capacity - _sstbuf->size()) < (size_t)(_remSize)){\
+        _nflush++; _nforcedflush--;                           \
+        BUFFEREDSTREAM_FLUSH("")                              \
+      } else {                                                \
+        _nsavedflush++;                                       \
+      }                                                       \
     }
+
+// Flush the buffer contents if the remaining capacity is less
+// than the calculated threshold (256 bytes + capacity/16)
+// That should suffice for all reasonably sized output lines.
+#define BUFFEREDSTREAM_FLUSH_AUTO(_termString)                \
+    BUFFEREDSTREAM_FLUSH_IF(_termString, 256+(_capacity>>4))
+
+#define BUFFEREDSTREAM_FLUSH_LOCKED(_termString)              \
+    { ttyLocker ttyl;/* keep this output block together */    \
+      _nlockedflush++;                                        \
+      BUFFEREDSTREAM_FLUSH(_termString)                       \
+    }
+
+// #define BUFFEREDSTREAM_FLUSH_STAT()                           \
+//     if (_sstbuf != _outbuf) {                                 \
+//       _outbuf->print_cr("%ld flushes (buffer full), %ld forced, %ld locked, %ld bytes total, %ld flushes saved", _nflush, _nforcedflush, _nlockedflush, _nflush_bytes, _nsavedflush); \
+//    }
+
+#define BUFFEREDSTREAM_FLUSH_STAT()
 #else
-#define STRINGSTREAM_DECL(_anyst, _outst)                 \
-    outputStream*  _outbuf = _outst;                      \
+#define BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, _capa)       \
+    size_t       _capacity = _capa;                           \
+    outputStream*  _outbuf = _outst;                          \
     outputStream*  _anyst  = _outst;   /* any stream. Use this to just print - no buffer flush.  */
 
-#define STRINGSTREAM_FLUSH(termString)                    \
-    _outbuf->print("%s", termString);
+#define BUFFEREDSTREAM_DECL(_anyst, _outst)                   \
+    BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, 4*K)
+
+#define BUFFEREDSTREAM_FLUSH(_termString)                     \
+    if (((_termString) != NULL) && (strlen(_termString) > 0)){\
+      _outbuf->print("%s", _termString);                      \
+    }
 
-#define STRINGSTREAM_FLUSH_LOCKED(termString)             \
-    _outbuf->print("%s", termString);
+#define BUFFEREDSTREAM_FLUSH_IF(_termString, _remSize)        \
+    BUFFEREDSTREAM_FLUSH(_termString)
+
+#define BUFFEREDSTREAM_FLUSH_AUTO(_termString)                \
+    BUFFEREDSTREAM_FLUSH(_termString)
+
+#define BUFFEREDSTREAM_FLUSH_LOCKED(_termString)              \
+    BUFFEREDSTREAM_FLUSH(_termString)
+
+#define BUFFEREDSTREAM_FLUSH_STAT()
 #endif
+#define HEX32_FORMAT  "0x%x"  // just a helper format string used below multiple times
 
 const char  blobTypeChar[] = {' ', 'C', 'N', 'I', 'X', 'Z', 'U', 'R', '?', 'D', 'T', 'E', 'S', 'A', 'M', 'B', 'L' };
 const char* blobTypeName[] = {"noType"
@@ -461,7 +552,7 @@
                                   // results in StatArray size of 24M (= max_granules * 48 Bytes per element)
                                   // For a 1GB CodeHeap, the granule size must be at least 2kB to not violate the max_granles limit.
   const char* heapName   = get_heapName(heap);
-  STRINGSTREAM_DECL(ast, out)
+  BUFFEREDSTREAM_DECL(ast, out)
 
   if (!initialization_complete) {
     memset(CodeHeapStatArray, 0, sizeof(CodeHeapStatArray));
@@ -477,7 +568,7 @@
                   "   to help them understand and solve issues in customer systems.\n"
                   "   It is not intended for use and interpretation by other persons.\n"
                   "   \n");
-    STRINGSTREAM_FLUSH("")
+    BUFFEREDSTREAM_FLUSH("")
   }
   get_HeapStatGlobals(out, heapName);
 
@@ -493,13 +584,13 @@
 
   if (seg_size == 0) {
     printBox(ast, '-', "Heap not fully initialized yet, segment size is zero for segment ", heapName);
-    STRINGSTREAM_FLUSH("")
+    BUFFEREDSTREAM_FLUSH("")
     return;
   }
 
   if (!CodeCache_lock->owned_by_self()) {
     printBox(ast, '-', "aggregate function called without holding the CodeCache_lock for ", heapName);
-    STRINGSTREAM_FLUSH("")
+    BUFFEREDSTREAM_FLUSH("")
     return;
   }
 
@@ -555,7 +646,7 @@
   ast->print_cr("   CodeHeap (committed part) is mapped to " SIZE_FORMAT " granules of size " SIZE_FORMAT " bytes.", granules, granularity);
   ast->print_cr("   Each granule takes " SIZE_FORMAT " bytes of C heap, that is " SIZE_FORMAT "K in total for statistics data.", sizeof(StatElement), (sizeof(StatElement)*granules)/(size_t)K);
   ast->print_cr("   The number of granules is limited to %dk, requiring a granules size of at least %d bytes for a 1GB heap.", (unsigned int)(max_granules/K), (unsigned int)(G/max_granules));
-  STRINGSTREAM_FLUSH("\n")
+  BUFFEREDSTREAM_FLUSH("\n")
 
 
   while (!done) {
@@ -644,7 +735,7 @@
         insane = true; ast->print_cr("Sanity check: end index (%d) lower than begin index (%d)", ix_end, ix_beg);
       }
       if (insane) {
-        STRINGSTREAM_FLUSH("")
+        BUFFEREDSTREAM_FLUSH("")
         continue;
       }
 
@@ -1033,7 +1124,7 @@
         avgTemp = 0;
         ast->print_cr("No hotness data available");
       }
-      STRINGSTREAM_FLUSH("\n")
+      BUFFEREDSTREAM_FLUSH("\n")
 
       // This loop is intentionally printing directly to "out".
       // It should not print anything, anyway.
@@ -1115,7 +1206,7 @@
                   "   Subsequent print functions create their output based on this snapshot.\n");
     ast->print_cr("   Free space in %s is distributed over %d free blocks.", heapName, nBlocks_free);
     ast->print_cr("   Each free block takes " SIZE_FORMAT " bytes of C heap for statistics data, that is " SIZE_FORMAT "K in total.", sizeof(FreeBlk), (sizeof(FreeBlk)*nBlocks_free)/K);
-    STRINGSTREAM_FLUSH("\n")
+    BUFFEREDSTREAM_FLUSH("\n")
 
     //----------------------------------------
     //--  Prepare the FreeArray of FreeBlks --
@@ -1151,7 +1242,7 @@
     if (ix != alloc_freeBlocks) {
       ast->print_cr("Free block count mismatch. Expected %d free blocks, but found %d.", alloc_freeBlocks, ix);
       ast->print_cr("I will update the counter and retry data collection");
-      STRINGSTREAM_FLUSH("\n")
+      BUFFEREDSTREAM_FLUSH("\n")
       nBlocks_free = ix;
       continue;
     }
@@ -1165,7 +1256,7 @@
       ast->print_cr("Free block count mismatch could not be resolved.");
       ast->print_cr("Try to run \"aggregate\" function to update counters");
     }
-    STRINGSTREAM_FLUSH("")
+    BUFFEREDSTREAM_FLUSH("")
 
     //---< discard old array and update global values  >---
     discard_FreeArray(out);
@@ -1199,7 +1290,7 @@
   set_HeapStatGlobals(out, heapName);
 
   printBox(ast, '=', "C O D E   H E A P   A N A L Y S I S   C O M P L E T E   for segment ", heapName);
-  STRINGSTREAM_FLUSH("\n")
+  BUFFEREDSTREAM_FLUSH("\n")
 }
 
 
@@ -1214,7 +1305,7 @@
   if ((StatArray == NULL) || (TopSizeArray == NULL) || (used_topSizeBlocks == 0)) {
     return;
   }
-  STRINGSTREAM_DECL(ast, out)
+  BUFFEREDSTREAM_DECL(ast, out)
 
   {
     printBox(ast, '=', "U S E D   S P A C E   S T A T I S T I C S   for ", heapName);
@@ -1226,7 +1317,7 @@
                   "      is not continuously held, the displayed name might be wrong or no name\n"
                   "      might be found at all. The likelihood for that to happen increases\n"
                   "      over time passed between analysis and print step.\n", used_topSizeBlocks);
-    STRINGSTREAM_FLUSH_LOCKED("\n")
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n")
   }
 
   //----------------------------
@@ -1246,7 +1337,7 @@
     ast->fill_to(66);
     ast->print_cr("%6s", "method");
     ast->print_cr("%18s %13s %17s %4s %9s  %5s %s",      "Addr(module)      ", "offset", "size", "type", " type lvl", " temp", "Name");
-    STRINGSTREAM_FLUSH_LOCKED("")
+    BUFFEREDSTREAM_FLUSH_LOCKED("")
 
     //---<  print Top Ten Used Blocks  >---
     if (used_topSizeBlocks > 0) {
@@ -1324,17 +1415,17 @@
           ast->fill_to(67+6);
           ast->print("%s", blob_name);
         }
-        STRINGSTREAM_FLUSH_LOCKED("\n")
+        ast->cr();
+        BUFFEREDSTREAM_FLUSH_AUTO("")
       }
       if (used_topSizeBlocks != printed_topSizeBlocks) {
         ast->print_cr("used blocks: %d, printed blocks: %d", used_topSizeBlocks, printed_topSizeBlocks);
-        STRINGSTREAM_FLUSH("")
         for (unsigned int i = 0; i < alloc_topSizeBlocks; i++) {
           ast->print_cr("  TopSizeArray[%d].index = %d, len = %d", i, TopSizeArray[i].index, TopSizeArray[i].len);
-          STRINGSTREAM_FLUSH("")
+          BUFFEREDSTREAM_FLUSH_AUTO("")
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("\n\n")
+      BUFFEREDSTREAM_FLUSH("\n\n")
     }
   }
 
@@ -1359,7 +1450,7 @@
                     "      %ld characters are printed per percentage point.\n", pctFactor/100);
       ast->print_cr("total size   of all blocks: %7ldM", (total_size<<log2_seg_size)/M);
       ast->print_cr("total number of all blocks: %7ld\n", total_count);
-      STRINGSTREAM_FLUSH_LOCKED("")
+      BUFFEREDSTREAM_FLUSH_LOCKED("")
 
       ast->print_cr("[Size Range)------avg.-size-+----count-+");
       for (unsigned int i = 0; i < nSizeDistElements; i++) {
@@ -1388,9 +1479,10 @@
           ast->print("%c", (j%((pctFactor/100)*10) == 0) ? ('0'+j/(((unsigned int)pctFactor/100)*10)) : '*');
         }
         ast->cr();
+        BUFFEREDSTREAM_FLUSH_AUTO("")
       }
-      ast->print_cr("----------------------------+----------+\n\n");
-      STRINGSTREAM_FLUSH_LOCKED("\n")
+      ast->print_cr("----------------------------+----------+");
+      BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
 
       printBox(ast, '-', "Contribution per size range to total size for ", heapName);
       ast->print_cr("Note: The histogram indicates how much space (as a percentage of all\n"
@@ -1398,7 +1490,7 @@
                     "      %ld characters are printed per percentage point.\n", pctFactor/100);
       ast->print_cr("total size   of all blocks: %7ldM", (total_size<<log2_seg_size)/M);
       ast->print_cr("total number of all blocks: %7ld\n", total_count);
-      STRINGSTREAM_FLUSH_LOCKED("")
+      BUFFEREDSTREAM_FLUSH_LOCKED("")
 
       ast->print_cr("[Size Range)------avg.-size-+----count-+");
       for (unsigned int i = 0; i < nSizeDistElements; i++) {
@@ -1427,9 +1519,10 @@
           ast->print("%c", (j%((pctFactor/100)*10) == 0) ? ('0'+j/(((unsigned int)pctFactor/100)*10)) : '*');
         }
         ast->cr();
+        BUFFEREDSTREAM_FLUSH_AUTO("")
       }
       ast->print_cr("----------------------------+----------+");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
+      BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
     }
   }
 }
@@ -1446,7 +1539,7 @@
   if ((StatArray == NULL) || (FreeArray == NULL) || (alloc_granules == 0)) {
     return;
   }
-  STRINGSTREAM_DECL(ast, out)
+  BUFFEREDSTREAM_DECL(ast, out)
 
   {
     printBox(ast, '=', "F R E E   S P A C E   S T A T I S T I C S   for ", heapName);
@@ -1455,12 +1548,11 @@
                   "      unoccupied, e.g. by class unloading. Then, the two adjacent free\n"
                   "      blocks, together with the now unoccupied space, form a new, large\n"
                   "      free block.");
-    STRINGSTREAM_FLUSH_LOCKED("\n")
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n")
   }
 
   {
     printBox(ast, '-', "List of all Free Blocks in ", heapName);
-    STRINGSTREAM_FLUSH_LOCKED("")
 
     unsigned int ix = 0;
     for (ix = 0; ix < alloc_freeBlocks-1; ix++) {
@@ -1472,10 +1564,11 @@
       if (FreeArray[ix].stubs_in_gap) {
         ast->print(" !! permanent gap, contains stubs and/or blobs !!");
       }
-      STRINGSTREAM_FLUSH_LOCKED("\n")
+      ast->cr();
+      BUFFEREDSTREAM_FLUSH_AUTO("")
     }
     ast->print_cr(INTPTR_FORMAT ": Len[%4d] = " HEX32_FORMAT, p2i(FreeArray[ix].start), ix, FreeArray[ix].len);
-    STRINGSTREAM_FLUSH_LOCKED("\n\n")
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n")
   }
 
 
@@ -1519,7 +1612,7 @@
       }
     }
   }
-  STRINGSTREAM_FLUSH_LOCKED("")
+  BUFFEREDSTREAM_FLUSH_AUTO("")
 
   {
     printBox(ast, '-', "Top Ten Free Blocks in ", heapName);
@@ -1536,9 +1629,10 @@
         ast->print("#blocks (in gap) %d", FreeTopTen[iy]->n_gapBlocks);
       }
       ast->cr();
+      BUFFEREDSTREAM_FLUSH_AUTO("")
     }
-    STRINGSTREAM_FLUSH_LOCKED("\n\n")
   }
+  BUFFEREDSTREAM_FLUSH_LOCKED("\n\n")
 
 
   //--------------------------------------------------------
@@ -1583,7 +1677,7 @@
       }
     }
   }
-  STRINGSTREAM_FLUSH_LOCKED("")
+  BUFFEREDSTREAM_FLUSH_AUTO("")
 
   {
     printBox(ast, '-', "Top Ten Free-Occupied-Free Triples in ", heapName);
@@ -1601,9 +1695,10 @@
       ast->fill_to(63);
       ast->print("#blocks (in gap) %d", FreeTopTenTriple[iy]->n_gapBlocks);
       ast->cr();
+      BUFFEREDSTREAM_FLUSH_AUTO("")
     }
-    STRINGSTREAM_FLUSH_LOCKED("\n\n")
   }
+  BUFFEREDSTREAM_FLUSH_LOCKED("\n\n")
 }
 
 
@@ -1618,7 +1713,7 @@
   if ((StatArray == NULL) || (alloc_granules == 0)) {
     return;
   }
-  STRINGSTREAM_DECL(ast, out)
+  BUFFEREDSTREAM_DECL(ast, out)
 
   unsigned int granules_per_line = 32;
   char*        low_bound         = heap->low_boundary();
@@ -1634,13 +1729,12 @@
                     "  Occupied granules show their BlobType character, see legend.\n");
       print_blobType_legend(ast);
     }
-    STRINGSTREAM_FLUSH_LOCKED("")
+    BUFFEREDSTREAM_FLUSH_LOCKED("")
   }
 
   {
     if (segment_granules) {
       printBox(ast, '-', "Total (all types) count for granule size == segment size", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1649,7 +1743,6 @@
       }
     } else {
       printBox(ast, '-', "Total (all tiers) count, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1659,13 +1752,12 @@
         print_count_single(ast, count);
       }
     }
-    STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+    BUFFEREDSTREAM_FLUSH_LOCKED("|\n\n\n")
   }
 
   {
     if (nBlocks_t1 > 0) {
       printBox(ast, '-', "Tier1 nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1676,17 +1768,16 @@
           print_count_single(ast, StatArray[ix].t1_count);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Tier1 nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_t2 > 0) {
       printBox(ast, '-', "Tier2 nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1697,17 +1788,16 @@
           print_count_single(ast, StatArray[ix].t2_count);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Tier2 nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_alive > 0) {
       printBox(ast, '-', "not_used/not_entrant/not_installed nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1718,17 +1808,16 @@
           print_count_single(ast, StatArray[ix].tx_count);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No not_used/not_entrant nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_stub > 0) {
       printBox(ast, '-', "Stub & Blob count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1739,17 +1828,16 @@
           print_count_single(ast, StatArray[ix].stub_count);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Stubs and Blobs found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_dead > 0) {
       printBox(ast, '-', "Dead nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1760,17 +1848,16 @@
           print_count_single(ast, StatArray[ix].dead_count);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No dead nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (!segment_granules) { // Prevent totally redundant printouts
       printBox(ast, '-', "Count by tier (combined, no dead blocks): <#t1>:<#t2>:<#s>, 0x0..0xf. '*' indicates >= 16 blocks", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 24;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1787,7 +1874,7 @@
         }
         ast->print(" ");
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      BUFFEREDSTREAM_FLUSH_LOCKED("|\n\n\n")
     }
   }
 }
@@ -1804,7 +1891,7 @@
   if ((StatArray == NULL) || (alloc_granules == 0)) {
     return;
   }
-  STRINGSTREAM_DECL(ast, out)
+  BUFFEREDSTREAM_DECL(ast, out)
 
   unsigned int granules_per_line = 32;
   char*        low_bound         = heap->low_boundary();
@@ -1823,13 +1910,12 @@
       ast->print_cr("  These digits represent a fill percentage range (see legend).\n");
       print_space_legend(ast);
     }
-    STRINGSTREAM_FLUSH_LOCKED("")
+    BUFFEREDSTREAM_FLUSH_LOCKED("")
   }
 
   {
     if (segment_granules) {
       printBox(ast, '-', "Total (all types) space consumption for granule size == segment size", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1838,7 +1924,6 @@
       }
     } else {
       printBox(ast, '-', "Total (all types) space consumption. ' ' indicates empty, '*' indicates full.", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1848,13 +1933,12 @@
         print_space_single(ast, space);
       }
     }
-    STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+    BUFFEREDSTREAM_FLUSH_LOCKED("|\n\n\n")
   }
 
   {
     if (nBlocks_t1 > 0) {
       printBox(ast, '-', "Tier1 space consumption. ' ' indicates empty, '*' indicates full", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1865,17 +1949,16 @@
           print_space_single(ast, StatArray[ix].t1_space);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Tier1 nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_t2 > 0) {
       printBox(ast, '-', "Tier2 space consumption. ' ' indicates empty, '*' indicates full", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1886,11 +1969,11 @@
           print_space_single(ast, StatArray[ix].t2_space);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Tier2 nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
@@ -1906,17 +1989,16 @@
           print_space_single(ast, StatArray[ix].tx_space);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Tier2 nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_stub > 0) {
       printBox(ast, '-', "Stub and Blob space consumption. ' ' indicates empty, '*' indicates full", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1927,34 +2009,32 @@
           print_space_single(ast, StatArray[ix].stub_space);
         }
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Stubs and Blobs found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_dead > 0) {
       printBox(ast, '-', "Dead space consumption. ' ' indicates empty, '*' indicates full", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
         print_line_delim(out, ast, low_bound, ix, granules_per_line);
         print_space_single(ast, StatArray[ix].dead_space);
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No dead nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (!segment_granules) { // Prevent totally redundant printouts
       printBox(ast, '-', "Space consumption by tier (combined): <t1%>:<t2%>:<s%>. ' ' indicates empty, '*' indicates full", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 24;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -1979,7 +2059,8 @@
         }
         ast->print(" ");
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
+      BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
     }
   }
 }
@@ -1995,7 +2076,7 @@
   if ((StatArray == NULL) || (alloc_granules == 0)) {
     return;
   }
-  STRINGSTREAM_DECL(ast, out)
+  BUFFEREDSTREAM_DECL(ast, out)
 
   unsigned int granules_per_line = 32;
   char*        low_bound         = heap->low_boundary();
@@ -2009,12 +2090,11 @@
                   "  Information for the youngest method (highest ID) in the granule is printed.\n"
                   "  Refer to the legend to learn how method age is mapped to the displayed digit.");
     print_age_legend(ast);
-    STRINGSTREAM_FLUSH_LOCKED("")
+    BUFFEREDSTREAM_FLUSH_LOCKED("")
   }
 
   {
     printBox(ast, '-', "Age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
-    STRINGSTREAM_FLUSH_LOCKED("")
 
     granules_per_line = 128;
     for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -2026,64 +2106,61 @@
       age       = age > agex ? age : agex;
       print_age_single(ast, age);
     }
-    STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+    ast->print("|");
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_t1 > 0) {
       printBox(ast, '-', "Tier1 age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
         print_line_delim(out, ast, low_bound, ix, granules_per_line);
         print_age_single(ast, StatArray[ix].t1_age);
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Tier1 nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_t2 > 0) {
       printBox(ast, '-', "Tier2 age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
         print_line_delim(out, ast, low_bound, ix, granules_per_line);
         print_age_single(ast, StatArray[ix].t2_age);
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Tier2 nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (nBlocks_alive > 0) {
       printBox(ast, '-', "not_used/not_entrant/not_installed age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 128;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
         print_line_delim(out, ast, low_bound, ix, granules_per_line);
         print_age_single(ast, StatArray[ix].tx_age);
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
     } else {
       ast->print("No Tier2 nMethods found in CodeHeap.");
-      STRINGSTREAM_FLUSH_LOCKED("\n\n\n")
     }
+    BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
   }
 
   {
     if (!segment_granules) { // Prevent totally redundant printouts
       printBox(ast, '-', "age distribution by tier <a1>:<a2>. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
-      STRINGSTREAM_FLUSH_LOCKED("")
 
       granules_per_line = 32;
       for (unsigned int ix = 0; ix < alloc_granules; ix++) {
@@ -2093,7 +2170,8 @@
         print_age_single(ast, StatArray[ix].t2_age);
         ast->print(" ");
       }
-      STRINGSTREAM_FLUSH_LOCKED("|\n\n\n")
+      ast->print("|");
+      BUFFEREDSTREAM_FLUSH_LOCKED("\n\n\n")
     }
   }
 }
@@ -2110,7 +2188,7 @@
   if ((StatArray == NULL) || (alloc_granules == 0)) {
     return;
   }
-  STRINGSTREAM_DECL(ast, out)
+  BUFFEREDSTREAM_DECL(ast, out)
 
   unsigned int granules_per_line   = 128;
   char*        low_bound           = heap->low_boundary();
@@ -2129,7 +2207,7 @@
                 "  is not continuously held, the displayed name might be wrong or no name\n"
                 "  might be found at all. The likelihood for that to happen increases\n"
                 "  over time passed between aggregtion and print steps.\n");
-  STRINGSTREAM_FLUSH_LOCKED("")
+  BUFFEREDSTREAM_FLUSH_LOCKED("")
 
   for (unsigned int ix = 0; ix < alloc_granules; ix++) {
     //---<  print a new blob on a new line  >---
@@ -2144,7 +2222,7 @@
       ast->print_cr("--------------------------------------------------------------------");
       ast->print_cr("Address range [" INTPTR_FORMAT "," INTPTR_FORMAT "), " SIZE_FORMAT "k", p2i(low_bound+ix*granule_size), p2i(low_bound + end_ix*granule_size), (end_ix - ix)*granule_size/(size_t)K);
       ast->print_cr("--------------------------------------------------------------------");
-      STRINGSTREAM_FLUSH_LOCKED("")
+      BUFFEREDSTREAM_FLUSH_AUTO("")
     }
     // Only check granule if it contains at least one blob.
     unsigned int nBlobs  = StatArray[ix].t1_count   + StatArray[ix].t2_count + StatArray[ix].tx_count +
@@ -2192,7 +2270,7 @@
           ast->fill_to(61);
           ast->print_cr("%6s", "method");
           ast->print_cr("%18s %13s %17s %9s  %5s %18s  %s", "Addr(module)      ", "offset", "size", " type lvl", " temp", "blobType          ", "Name");
-          STRINGSTREAM_FLUSH_LOCKED("")
+          BUFFEREDSTREAM_FLUSH_AUTO("")
         }
 
         //---<  print line prefix (address and offset from CodeHeap start)  >---
@@ -2248,15 +2326,15 @@
           ast->fill_to(62+6);
           ast->print("<stale blob>");
         }
-        STRINGSTREAM_FLUSH_LOCKED("\n")
+        ast->cr();
+        BUFFEREDSTREAM_FLUSH_AUTO("")
       } else if (!blob_is_safe && (this_blob != last_blob) && (this_blob != NULL)) {
         last_blob          = this_blob;
-        STRINGSTREAM_FLUSH_LOCKED("\n")
       }
     }
     } // nBlobs > 0
   }
-  STRINGSTREAM_FLUSH_LOCKED("\n\n")
+  BUFFEREDSTREAM_FLUSH_LOCKED("\n\n")
 }
 
 
@@ -2393,7 +2471,11 @@
     }
     ast->cr();
 
-    { // can't use STRINGSTREAM_FLUSH_LOCKED("") here.
+    // can't use BUFFEREDSTREAM_FLUSH_IF("", 512) here.
+    // can't use this expression. bufferedStream::capacity() does not exist.
+    // if ((ast->capacity() - ast->size()) < 512) {
+    // Assume instead that default bufferedStream capacity (4K) was used.
+    if (ast->size() > 3*K) {
       ttyLocker ttyl;
       out->print("%s", ast->as_string());
       ast->reset();
--- a/src/hotspot/share/compiler/compileBroker.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/compiler/compileBroker.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -48,6 +48,7 @@
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/compilationPolicy.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
--- a/src/hotspot/share/compiler/compilerDefinitions.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/compiler/compilerDefinitions.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@
     FLAG_SET_ERGO(uintx, CodeCacheExpansionSize, 32*K);
   }
   if (FLAG_IS_DEFAULT(MetaspaceSize)) {
-    FLAG_SET_ERGO(size_t, MetaspaceSize, 12*M);
+    FLAG_SET_ERGO(size_t, MetaspaceSize, MIN2(12*M, MaxMetaspaceSize));
   }
   if (FLAG_IS_DEFAULT(MaxRAM)) {
     // Do not use FLAG_SET_ERGO to update MaxRAM, as this will impact
@@ -264,7 +264,7 @@
       FLAG_SET_DEFAULT(InitialCodeCacheSize, MAX2(16*M, InitialCodeCacheSize));
     }
     if (FLAG_IS_DEFAULT(MetaspaceSize)) {
-      FLAG_SET_DEFAULT(MetaspaceSize, MAX2(12*M, MetaspaceSize));
+      FLAG_SET_DEFAULT(MetaspaceSize, MIN2(MAX2(12*M, MetaspaceSize), MaxMetaspaceSize));
     }
     if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) {
       FLAG_SET_DEFAULT(NewSizeThreadIncrease, MAX2(4*K, NewSizeThreadIncrease));
--- a/src/hotspot/share/gc/cms/cmsHeap.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/cms/cmsHeap.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -225,15 +225,11 @@
                                 ScanningOption so,
                                 bool only_strong_roots,
                                 OopsInGenClosure* root_closure,
-                                CLDClosure* cld_closure,
-                                OopStorage::ParState<false, false>* par_state_string) {
+                                CLDClosure* cld_closure) {
   MarkingCodeBlobClosure mark_code_closure(root_closure, !CodeBlobToOopClosure::FixRelocations);
   CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
 
   process_roots(scope, so, root_closure, cld_closure, weak_cld_closure, &mark_code_closure);
-  if (!only_strong_roots) {
-    process_string_table_roots(scope, root_closure, par_state_string);
-  }
 
   if (young_gen_as_roots &&
       _process_strong_tasks->try_claim_task(GCH_PS_younger_gens)) {
--- a/src/hotspot/share/gc/cms/cmsHeap.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/cms/cmsHeap.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -91,8 +91,7 @@
                          ScanningOption so,
                          bool only_strong_roots,
                          OopsInGenClosure* root_closure,
-                         CLDClosure* cld_closure,
-                         OopStorage::ParState<false, false>* par_state_string = NULL);
+                         CLDClosure* cld_closure);
 
   GCMemoryManager* old_manager() const { return _old_manager; }
 
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -4333,8 +4333,7 @@
                           GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
                           _collector->should_unload_classes(),
                           &par_mri_cl,
-                          &cld_closure,
-                          &_par_state_string);
+                          &cld_closure);
 
   assert(_collector->should_unload_classes()
          || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
@@ -4464,8 +4463,7 @@
                           GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
                           _collector->should_unload_classes(),
                           &par_mrias_cl,
-                          NULL,     // The dirty klasses will be handled below
-                          &_par_state_string);
+                          NULL);     // The dirty klasses will be handled below
 
   assert(_collector->should_unload_classes()
          || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
@@ -5271,18 +5269,6 @@
       // Prune dead klasses from subklass/sibling/implementor lists.
       Klass::clean_weak_klass_links(purged_class);
     }
-
-    {
-      GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", _gc_timer_cm);
-      // Clean up unreferenced symbols in symbol table.
-      SymbolTable::unlink();
-    }
-
-    {
-      GCTraceTime(Debug, gc, phases) t("Scrub String Table", _gc_timer_cm);
-      // Delete entries for dead interned strings.
-      StringTable::unlink(&_is_alive_closure);
-    }
   }
 
   // Restore any preserved marks as a result of mark stack or
--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -59,7 +59,6 @@
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/handles.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/thread.inline.hpp"
@@ -606,8 +605,7 @@
   heap->young_process_roots(_strong_roots_scope,
                            &par_scan_state.to_space_root_closure(),
                            &par_scan_state.older_gen_closure(),
-                           &cld_scan_closure,
-                           &_par_state_string);
+                           &cld_scan_closure);
 
   par_scan_state.end_strong_roots();
 
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -3362,24 +3362,54 @@
 
 void G1CollectedHeap::complete_cleaning(BoolObjectClosure* is_alive,
                                         bool class_unloading_occurred) {
-  uint n_workers = workers()->active_workers();
-
-  G1StringDedupUnlinkOrOopsDoClosure dedup_closure(is_alive, NULL, false);
-  ParallelCleaningTask g1_unlink_task(is_alive, &dedup_closure, n_workers, class_unloading_occurred);
-  workers()->run_task(&g1_unlink_task);
+  uint num_workers = workers()->active_workers();
+  ParallelCleaningTask unlink_task(is_alive, num_workers, class_unloading_occurred, false);
+  workers()->run_task(&unlink_task);
 }
 
-void G1CollectedHeap::partial_cleaning(BoolObjectClosure* is_alive,
-                                       bool process_strings,
-                                       bool process_string_dedup) {
-  if (!process_strings && !process_string_dedup) {
-    // Nothing to clean.
-    return;
+// Clean string dedup data structures.
+// Ideally we would prefer to use a StringDedupCleaningTask here, but we want to
+// record the durations of the phases. Hence the almost-copy.
+class G1StringDedupCleaningTask : public AbstractGangTask {
+  BoolObjectClosure* _is_alive;
+  OopClosure* _keep_alive;
+  G1GCPhaseTimes* _phase_times;
+
+public:
+  G1StringDedupCleaningTask(BoolObjectClosure* is_alive,
+                            OopClosure* keep_alive,
+                            G1GCPhaseTimes* phase_times) :
+    AbstractGangTask("Partial Cleaning Task"),
+    _is_alive(is_alive),
+    _keep_alive(keep_alive),
+    _phase_times(phase_times)
+  {
+    assert(G1StringDedup::is_enabled(), "String deduplication disabled.");
+    StringDedup::gc_prologue(true);
   }
 
-  G1StringDedupUnlinkOrOopsDoClosure dedup_closure(is_alive, NULL, false);
-  StringCleaningTask g1_unlink_task(is_alive, process_string_dedup ? &dedup_closure : NULL, process_strings);
-  workers()->run_task(&g1_unlink_task);
+  ~G1StringDedupCleaningTask() {
+    StringDedup::gc_epilogue();
+  }
+
+  void work(uint worker_id) {
+    StringDedupUnlinkOrOopsDoClosure cl(_is_alive, _keep_alive);
+    {
+      G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupQueueFixup, worker_id);
+      StringDedupQueue::unlink_or_oops_do(&cl);
+    }
+    {
+      G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupTableFixup, worker_id);
+      StringDedupTable::unlink_or_oops_do(&cl, worker_id);
+    }
+  }
+};
+
+void G1CollectedHeap::string_dedup_cleaning(BoolObjectClosure* is_alive,
+                                            OopClosure* keep_alive,
+                                            G1GCPhaseTimes* phase_times) {
+  G1StringDedupCleaningTask cl(is_alive, keep_alive, phase_times);
+  workers()->run_task(&cl);
 }
 
 class G1RedirtyLoggedCardsTask : public AbstractGangTask {
@@ -3911,11 +3941,6 @@
   // not copied during the pause.
   process_discovered_references(per_thread_states);
 
-  // FIXME
-  // CM's reference processing also cleans up the string table.
-  // Should we do that here also? We could, but it is a serial operation
-  // and could significantly increase the pause time.
-
   G1STWIsAliveClosure is_alive(this);
   G1KeepAliveClosure keep_alive(this);
 
@@ -3923,12 +3948,12 @@
                               g1_policy()->phase_times()->weak_phase_times());
 
   if (G1StringDedup::is_enabled()) {
-    double fixup_start = os::elapsedTime();
-
-    G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive, true, g1_policy()->phase_times());
-
-    double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
-    g1_policy()->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
+    double string_dedup_time_ms = os::elapsedTime();
+
+    string_dedup_cleaning(&is_alive, &keep_alive, g1_policy()->phase_times());
+
+    double string_cleanup_time_ms = (os::elapsedTime() - string_dedup_time_ms) * 1000.0;
+    g1_policy()->phase_times()->record_string_deduplication_time(string_cleanup_time_ms);
   }
 
   if (evacuation_failed()) {
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1332,14 +1332,12 @@
   // after a full GC.
   void rebuild_strong_code_roots();
 
-  // Partial cleaning used when class unloading is disabled.
-  // Let the caller choose what structures to clean out:
-  // - StringTable
-  // - StringDeduplication structures
-  void partial_cleaning(BoolObjectClosure* is_alive, bool unlink_strings, bool unlink_string_dedup);
+  // Partial cleaning of VM internal data structures.
+  void string_dedup_cleaning(BoolObjectClosure* is_alive,
+                             OopClosure* keep_alive,
+                             G1GCPhaseTimes* phase_times = NULL);
 
-  // Complete cleaning used when class unloading is enabled.
-  // Cleans out all structures handled by partial_cleaning and also the CodeCache.
+  // Performs cleaning of data structures after class unloading.
   void complete_cleaning(BoolObjectClosure* is_alive, bool class_unloading_occurred);
 
   // Redirty logged cards in the refinement queue.
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -588,7 +588,7 @@
   _num_active_tasks = active_tasks;
   // Need to update the three data structures below according to the
   // number of active threads for this phase.
-  _terminator = TaskTerminator((int) active_tasks, _task_queues);
+  _terminator.terminator()->reset_for_reuse((int) active_tasks);
   _first_overflow_barrier_sync.set_n_workers((int) active_tasks);
   _second_overflow_barrier_sync.set_n_workers((int) active_tasks);
 }
@@ -1655,11 +1655,9 @@
     GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
     bool purged_classes = SystemDictionary::do_unloading(_gc_timer_cm);
     _g1h->complete_cleaning(&g1_is_alive, purged_classes);
-  } else {
-    GCTraceTime(Debug, gc, phases) debug("Cleanup", _gc_timer_cm);
-    // No need to clean string table as it is treated as strong roots when
-    // class unloading is disabled.
-    _g1h->partial_cleaning(&g1_is_alive, false, G1StringDedup::is_enabled());
+  } else if (StringDedup::is_enabled()) {
+    GCTraceTime(Debug, gc, phases) debug("String Deduplication", _gc_timer_cm);
+    _g1h->string_dedup_cleaning(&g1_is_alive, NULL);
   }
 }
 
--- a/src/hotspot/share/gc/g1/g1FullCollector.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -224,10 +224,10 @@
     // Unload classes and purge the SystemDictionary.
     bool purged_class = SystemDictionary::do_unloading(scope()->timer());
     _heap->complete_cleaning(&_is_alive, purged_class);
-  } else {
-    GCTraceTime(Debug, gc, phases) debug("Phase 1: String and Symbol Tables Cleanup", scope()->timer());
-    // If no class unloading just clean out strings.
-    _heap->partial_cleaning(&_is_alive, true, G1StringDedup::is_enabled());
+  } else if (G1StringDedup::is_enabled()) {
+    GCTraceTime(Debug, gc, phases) debug("Phase 1: String Dedup Cleanup", scope()->timer());
+    // If no class unloading just clean out string deduplication data.
+    _heap->string_dedup_cleaning(&_is_alive, NULL);
   }
 
   scope()->tracer()->report_object_count_after_gc(&_is_alive);
--- a/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@
     _weak_proc_task(collector->workers()),
     _hrclaimer(collector->workers()),
     _adjust(),
-    _adjust_string_dedup(NULL, &_adjust, G1StringDedup::is_enabled()) {
+    _string_dedup_cleaning_task(NULL, &_adjust, false) {
   // Need cleared claim bits for the roots processing
   ClassLoaderDataGraph::clear_claimed_marks();
 }
@@ -110,15 +110,10 @@
 
   CLDToOopClosure adjust_cld(&_adjust, ClassLoaderData::_claim_strong);
   CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);
-  _root_processor.process_all_roots(
-      &_adjust,
-      &adjust_cld,
-      &adjust_code);
+  _root_processor.process_all_roots(&_adjust, &adjust_cld, &adjust_code);
 
-  // Adjust string dedup if enabled.
-  if (G1StringDedup::is_enabled()) {
-    G1StringDedup::parallel_unlink(&_adjust_string_dedup, worker_id);
-  }
+  // Adjust string dedup data structures.
+  _string_dedup_cleaning_task.work(worker_id);
 
   // Now adjust pointers region by region
   G1AdjustRegionClosure blk(collector()->mark_bitmap(), worker_id);
--- a/src/hotspot/share/gc/g1/g1FullGCAdjustTask.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1FullGCAdjustTask.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 #include "gc/g1/g1RootProcessor.hpp"
 #include "gc/g1/g1StringDedup.hpp"
 #include "gc/g1/heapRegionManager.hpp"
+#include "gc/shared/parallelCleaning.hpp"
 #include "gc/shared/weakProcessorPhaseTimes.hpp"
 #include "gc/shared/weakProcessor.hpp"
 #include "utilities/ticks.hpp"
@@ -42,7 +43,7 @@
   WeakProcessor::Task      _weak_proc_task;
   HeapRegionClaimer        _hrclaimer;
   G1AdjustClosure          _adjust;
-  G1StringDedupUnlinkOrOopsDoClosure _adjust_string_dedup;
+  StringDedupCleaningTask  _string_dedup_cleaning_task;
 
 public:
   G1FullGCAdjustTask(G1FullCollector* collector);
--- a/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,15 +49,13 @@
   MarkingCodeBlobClosure code_closure(marker->mark_closure(), !CodeBlobToOopClosure::FixRelocations);
 
   if (ClassUnloading) {
-    _root_processor.process_strong_roots(
-        marker->mark_closure(),
-        marker->cld_closure(),
-        &code_closure);
+    _root_processor.process_strong_roots(marker->mark_closure(),
+                                         marker->cld_closure(),
+                                         &code_closure);
   } else {
-    _root_processor.process_all_roots_no_string_table(
-        marker->mark_closure(),
-        marker->cld_closure(),
-        &code_closure);
+    _root_processor.process_all_roots(marker->mark_closure(),
+                                      marker->cld_closure(),
+                                      &code_closure);
   }
 
   // Mark stack is populated, now process and drain it.
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,6 @@
 
   // Root scanning phases
   _gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms):");
-  _gc_par_phases[StringTableRoots] = new WorkerDataArray<double>(max_gc_threads, "StringTable Roots (ms):");
   _gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms):");
   _gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms):");
   _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms):");
@@ -136,7 +135,7 @@
   _cur_strong_code_root_purge_time_ms = 0.0;
   _cur_evac_fail_recalc_used = 0.0;
   _cur_evac_fail_remove_self_forwards = 0.0;
-  _cur_string_dedup_fixup_time_ms = 0.0;
+  _cur_string_deduplication_time_ms = 0.0;
   _cur_prepare_tlab_time_ms = 0.0;
   _cur_resize_tlab_time_ms = 0.0;
   _cur_derived_pointer_table_update_time_ms = 0.0;
@@ -290,12 +289,12 @@
   }
 }
 
-void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase) const {
+void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase, uint extra_indent) const {
   LogTarget(Debug, gc, phases) lt;
   if (lt.is_enabled()) {
     ResourceMark rm;
     LogStream ls(lt);
-    log_phase(phase, 2, &ls, true);
+    log_phase(phase, 2 + extra_indent, &ls, true);
   }
 }
 
@@ -417,7 +416,7 @@
                         _recorded_total_free_cset_time_ms +
                         _cur_fast_reclaim_humongous_time_ms +
                         _cur_expand_heap_time_ms +
-                        _cur_string_dedup_fixup_time_ms;
+                        _cur_string_deduplication_time_ms;
 
   info_time("Post Evacuate Collection Set", sum_ms);
 
@@ -430,9 +429,9 @@
   _weak_phase_times.log_print(2);
 
   if (G1StringDedup::is_enabled()) {
-    debug_time("String Dedup Fixup", _cur_string_dedup_fixup_time_ms);
-    debug_phase(_gc_par_phases[StringDedupQueueFixup]);
-    debug_phase(_gc_par_phases[StringDedupTableFixup]);
+    debug_time("String Deduplication", _cur_string_deduplication_time_ms);
+    debug_phase(_gc_par_phases[StringDedupQueueFixup], 1);
+    debug_phase(_gc_par_phases[StringDedupTableFixup], 1);
   }
 
   if (G1CollectedHeap::heap()->evacuation_failed()) {
@@ -497,7 +496,6 @@
       "GCWorkerStart",
       "ExtRootScan",
       "ThreadRoots",
-      "StringTableRoots",
       "UniverseRoots",
       "JNIRoots",
       "ObjectSynchronizerRoots",
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -48,7 +48,6 @@
     GCWorkerStart,
     ExtRootScan,
     ThreadRoots,
-    StringTableRoots,
     UniverseRoots,
     JNIRoots,
     ObjectSynchronizerRoots,
@@ -104,8 +103,6 @@
  private:
   // Markers for grouping the phases in the GCPhases enum above
   static const int GCMainParPhasesLast = GCWorkerEnd;
-  static const int StringDedupPhasesFirst = StringDedupQueueFixup;
-  static const int StringDedupPhasesLast = StringDedupTableFixup;
 
   WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
 
@@ -134,7 +131,7 @@
   double _cur_evac_fail_recalc_used;
   double _cur_evac_fail_remove_self_forwards;
 
-  double _cur_string_dedup_fixup_time_ms;
+  double _cur_string_deduplication_time_ms;
 
   double _cur_prepare_tlab_time_ms;
   double _cur_resize_tlab_time_ms;
@@ -187,7 +184,7 @@
   void details(T* phase, const char* indent) const;
 
   void log_phase(WorkerDataArray<double>* phase, uint indent, outputStream* out, bool print_sum) const;
-  void debug_phase(WorkerDataArray<double>* phase) const;
+  void debug_phase(WorkerDataArray<double>* phase, uint extra_indent = 0) const;
   void trace_phase(WorkerDataArray<double>* phase, bool print_sum = true) const;
 
   void info_time(const char* name, double value) const;
@@ -272,8 +269,8 @@
     _cur_evac_fail_remove_self_forwards = ms;
   }
 
-  void record_string_dedup_fixup_time(double ms) {
-    _cur_string_dedup_fixup_time_ms = ms;
+  void record_string_deduplication_time(double ms) {
+    _cur_string_deduplication_time_ms = ms;
   }
 
   void record_ref_proc_time(double ms) {
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -490,9 +490,7 @@
 
   {
     G1RootProcessor root_processor(_g1h, 1);
-    root_processor.process_all_roots(&rootsCl,
-                                     &cldCl,
-                                     &blobsCl);
+    root_processor.process_all_roots(&rootsCl, &cldCl, &blobsCl);
   }
 
   bool failures = rootsCl.failures() || codeRootsCl.failures();
--- a/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,6 @@
   }
 
   process_vm_roots(closures, phase_times, worker_i);
-  process_string_table_roots(closures, phase_times, worker_i);
 
   {
     // Now the CM ref_processor roots.
@@ -188,34 +187,17 @@
 
 void G1RootProcessor::process_all_roots(OopClosure* oops,
                                         CLDClosure* clds,
-                                        CodeBlobClosure* blobs,
-                                        bool process_string_table) {
+                                        CodeBlobClosure* blobs) {
   AllRootsClosures closures(oops, clds);
 
   process_java_roots(&closures, NULL, 0);
   process_vm_roots(&closures, NULL, 0);
 
-  if (process_string_table) {
-    process_string_table_roots(&closures, NULL, 0);
-  }
   process_code_cache_roots(blobs, NULL, 0);
 
   _process_strong_tasks.all_tasks_completed(n_workers());
 }
 
-void G1RootProcessor::process_all_roots(OopClosure* oops,
-                                        CLDClosure* clds,
-                                        CodeBlobClosure* blobs) {
-  process_all_roots(oops, clds, blobs, true);
-}
-
-void G1RootProcessor::process_all_roots_no_string_table(OopClosure* oops,
-                                                        CLDClosure* clds,
-                                                        CodeBlobClosure* blobs) {
-  assert(!ClassUnloading, "Should only be used when class unloading is disabled");
-  process_all_roots(oops, clds, blobs, false);
-}
-
 void G1RootProcessor::process_java_roots(G1RootClosures* closures,
                                          G1GCPhaseTimes* phase_times,
                                          uint worker_i) {
@@ -295,16 +277,6 @@
   }
 }
 
-void G1RootProcessor::process_string_table_roots(G1RootClosures* closures,
-                                                 G1GCPhaseTimes* phase_times,
-                                                 uint worker_i) {
-  assert(closures->weak_oops() != NULL, "Should only be called when all roots are processed");
-  G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
-  // All threads execute the following. A specific chunk of buckets
-  // from the StringTable are the individual tasks.
-  StringTable::possibly_parallel_oops_do(&_par_state_string, closures->weak_oops());
-}
-
 void G1RootProcessor::process_code_cache_roots(CodeBlobClosure* code_closure,
                                                G1GCPhaseTimes* phase_times,
                                                uint worker_i) {
--- a/src/hotspot/share/gc/g1/g1RootProcessor.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -75,11 +75,6 @@
   void worker_has_discovered_all_strong_classes();
   void wait_until_all_strong_classes_discovered();
 
-  void process_all_roots(OopClosure* oops,
-                         CLDClosure* clds,
-                         CodeBlobClosure* blobs,
-                         bool process_string_table);
-
   void process_java_roots(G1RootClosures* closures,
                           G1GCPhaseTimes* phase_times,
                           uint worker_i);
@@ -88,10 +83,6 @@
                         G1GCPhaseTimes* phase_times,
                         uint worker_i);
 
-  void process_string_table_roots(G1RootClosures* closures,
-                                  G1GCPhaseTimes* phase_times,
-                                  uint worker_i);
-
   void process_code_cache_roots(CodeBlobClosure* code_closure,
                                 G1GCPhaseTimes* phase_times,
                                 uint worker_i);
@@ -101,7 +92,7 @@
 
   // Apply correct closures from pss to the strongly and weakly reachable roots in the system
   // in a single pass.
-  // Record and report timing measurements for sub phases using the worker_i
+  // Record and report timing measurements for sub phases using worker_id.
   void evacuate_roots(G1ParScanThreadState* pss, uint worker_id);
 
   // Apply oops, clds and blobs to all strongly reachable roots in the system
@@ -114,13 +105,6 @@
                          CLDClosure* clds,
                          CodeBlobClosure* blobs);
 
-  // Apply oops, clds and blobs to strongly and weakly reachable roots in the system,
-  // the only thing different from process_all_roots is that we skip the string table
-  // to avoid keeping every string live when doing class unloading.
-  void process_all_roots_no_string_table(OopClosure* oops,
-                                         CLDClosure* clds,
-                                         CodeBlobClosure* blobs);
-
   // Number of worker threads used by the root processor.
   uint n_workers() const;
 };
--- a/src/hotspot/share/gc/g1/g1StringDedup.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1StringDedup.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,53 +89,3 @@
   }
 }
 
-void G1StringDedup::oops_do(OopClosure* keep_alive) {
-  assert(is_enabled(), "String deduplication not enabled");
-  unlink_or_oops_do(NULL, keep_alive, true /* allow_resize_and_rehash */);
-}
-
-void G1StringDedup::parallel_unlink(G1StringDedupUnlinkOrOopsDoClosure* unlink, uint worker_id) {
-  assert(is_enabled(), "String deduplication not enabled");
-  StringDedupQueue::unlink_or_oops_do(unlink);
-  StringDedupTable::unlink_or_oops_do(unlink, worker_id);
-}
-
-//
-// Task for parallel unlink_or_oops_do() operation on the deduplication queue
-// and table.
-//
-class G1StringDedupUnlinkOrOopsDoTask : public AbstractGangTask {
-private:
-  G1StringDedupUnlinkOrOopsDoClosure _cl;
-  G1GCPhaseTimes* _phase_times;
-
-public:
-  G1StringDedupUnlinkOrOopsDoTask(BoolObjectClosure* is_alive,
-                                  OopClosure* keep_alive,
-                                  bool allow_resize_and_rehash,
-                                  G1GCPhaseTimes* phase_times) :
-    AbstractGangTask("G1StringDedupUnlinkOrOopsDoTask"),
-    _cl(is_alive, keep_alive, allow_resize_and_rehash), _phase_times(phase_times) { }
-
-  virtual void work(uint worker_id) {
-    {
-      G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupQueueFixup, worker_id);
-      StringDedupQueue::unlink_or_oops_do(&_cl);
-    }
-    {
-      G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupTableFixup, worker_id);
-      StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
-    }
-  }
-};
-
-void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive,
-                                      OopClosure* keep_alive,
-                                      bool allow_resize_and_rehash,
-                                      G1GCPhaseTimes* phase_times) {
-  assert(is_enabled(), "String deduplication not enabled");
-
-  G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash, phase_times);
-  G1CollectedHeap* g1h = G1CollectedHeap::heap();
-  g1h->workers()->run_task(&task);
-}
--- a/src/hotspot/share/gc/g1/g1StringDedup.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1StringDedup.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -78,35 +78,6 @@
   static void enqueue_from_mark(oop java_string, uint worker_id);
   static void enqueue_from_evacuation(bool from_young, bool to_young,
                                       unsigned int queue, oop java_string);
-
-  static void oops_do(OopClosure* keep_alive);
-  static void parallel_unlink(G1StringDedupUnlinkOrOopsDoClosure* unlink, uint worker_id);
-  static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive,
-                                bool allow_resize_and_rehash, G1GCPhaseTimes* phase_times = NULL);
-};
-
-//
-// This closure encapsulates the state and the closures needed when scanning
-// the deduplication queue and table during the unlink_or_oops_do() operation.
-// A single instance of this closure is created and then shared by all worker
-// threads participating in the scan.
-//
-class G1StringDedupUnlinkOrOopsDoClosure : public StringDedupUnlinkOrOopsDoClosure {
-public:
-  G1StringDedupUnlinkOrOopsDoClosure(BoolObjectClosure* is_alive,
-                                     OopClosure* keep_alive,
-                                     bool allow_resize_and_rehash) :
-    StringDedupUnlinkOrOopsDoClosure(is_alive, keep_alive) {
-      if (G1StringDedup::is_enabled()) {
-        G1StringDedup::gc_prologue(allow_resize_and_rehash);
-      }
-    }
-
-  ~G1StringDedupUnlinkOrOopsDoClosure() {
-    if (G1StringDedup::is_enabled()) {
-      G1StringDedup::gc_epilogue();
-    }
-  }
 };
 
 #endif // SHARE_GC_G1_G1STRINGDEDUP_HPP
--- a/src/hotspot/share/gc/parallel/psMarkSweep.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/parallel/psMarkSweep.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -566,18 +566,6 @@
     Klass::clean_weak_klass_links(purged_class);
   }
 
-  {
-    GCTraceTime(Debug, gc, phases) t("Scrub String Table", _gc_timer);
-    // Delete entries for dead interned strings.
-    StringTable::unlink(is_alive_closure());
-  }
-
-  {
-    GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", _gc_timer);
-    // Clean up unreferenced symbols in symbol table.
-    SymbolTable::unlink();
-  }
-
   _gc_tracer->report_object_count_after_gc(is_alive_closure());
 }
 
@@ -630,7 +618,6 @@
   CodeBlobToOopClosure adjust_from_blobs(adjust_pointer_closure(), CodeBlobToOopClosure::FixRelocations);
   CodeCache::blobs_do(&adjust_from_blobs);
   AOTLoader::oops_do(adjust_pointer_closure());
-  StringTable::oops_do(adjust_pointer_closure());
   ref_processor()->weak_oops_do(adjust_pointer_closure());
   PSScavenge::reference_processor()->weak_oops_do(adjust_pointer_closure());
 
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -2184,18 +2184,6 @@
     Klass::clean_weak_klass_links(purged_class);
   }
 
-  {
-    GCTraceTime(Debug, gc, phases) t("Scrub String Table", &_gc_timer);
-    // Delete entries for dead interned strings.
-    StringTable::unlink(is_alive_closure());
-  }
-
-  {
-    GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", &_gc_timer);
-    // Clean up unreferenced symbols in symbol table.
-    SymbolTable::unlink();
-  }
-
   _gc_tracer.report_object_count_after_gc(is_alive_closure());
 }
 
@@ -2226,7 +2214,6 @@
   CodeBlobToOopClosure adjust_from_blobs(&oop_closure, CodeBlobToOopClosure::FixRelocations);
   CodeCache::blobs_do(&adjust_from_blobs);
   AOTLoader::oops_do(&oop_closure);
-  StringTable::oops_do(&oop_closure);
   ref_processor()->weak_oops_do(&oop_closure);
   // Roots were visited so references into the young gen in roots
   // may have been scanned.  Process them also.
--- a/src/hotspot/share/gc/parallel/psScavenge.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/parallel/psScavenge.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -430,12 +430,6 @@
       WeakProcessor::weak_oops_do(&_is_alive_closure, &root_closure);
     }
 
-    {
-      GCTraceTime(Debug, gc, phases) tm("Scrub String Table", &_gc_timer);
-      // Unlink any dead interned Strings and process the remaining live ones.
-      StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure);
-    }
-
     // Verify that usage of root_closure didn't copy any objects.
     assert(promotion_manager->stacks_empty(),"stacks should be empty at this point");
 
--- a/src/hotspot/share/gc/serial/genMarkSweep.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/serial/genMarkSweep.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -239,18 +239,6 @@
     Klass::clean_weak_klass_links(purged_class);
   }
 
-  {
-    GCTraceTime(Debug, gc, phases) t("Scrub String Table", gc_timer());
-    // Delete entries for dead interned strings.
-    StringTable::unlink(&is_alive);
-  }
-
-  {
-    GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", gc_timer());
-    // Clean up unreferenced symbols in symbol table.
-    SymbolTable::unlink();
-  }
-
   gc_tracer()->report_object_count_after_gc(&is_alive);
 }
 
--- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -849,33 +849,14 @@
   }
 }
 
-void GenCollectedHeap::process_string_table_roots(StrongRootsScope* scope,
-                                                  OopClosure* root_closure,
-                                                  OopStorage::ParState<false, false>* par_state_string) {
-  assert(root_closure != NULL, "Must be set");
-  // All threads execute the following. A specific chunk of buckets
-  // from the StringTable are the individual tasks.
-
-  // Either we should be single threaded or have a ParState
-  assert((scope->n_threads() <= 1) || par_state_string != NULL, "Parallel but no ParState");
-
-  if (scope->n_threads() > 1) {
-    StringTable::possibly_parallel_oops_do(par_state_string, root_closure);
-  } else {
-    StringTable::oops_do(root_closure);
-  }
-}
-
 void GenCollectedHeap::young_process_roots(StrongRootsScope* scope,
                                            OopsInGenClosure* root_closure,
                                            OopsInGenClosure* old_gen_closure,
-                                           CLDClosure* cld_closure,
-                                           OopStorage::ParState<false, false>* par_state_string) {
+                                           CLDClosure* cld_closure) {
   MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
 
   process_roots(scope, SO_ScavengeCodeCache, root_closure,
                 cld_closure, cld_closure, &mark_code_closure);
-  process_string_table_roots(scope, root_closure, par_state_string);
 
   if (_process_strong_tasks->try_claim_task(GCH_PS_younger_gens)) {
     root_closure->reset_generation();
@@ -895,19 +876,11 @@
                                           ScanningOption so,
                                           bool only_strong_roots,
                                           OopsInGenClosure* root_closure,
-                                          CLDClosure* cld_closure,
-                                          OopStorage::ParState<false, false>* par_state_string) {
+                                          CLDClosure* cld_closure) {
   MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
   CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
 
   process_roots(scope, so, root_closure, cld_closure, weak_cld_closure, &mark_code_closure);
-  if (is_adjust_phase) {
-    // We never treat the string table as roots during marking
-    // for the full gc, so we only need to process it during
-    // the adjust phase.
-    process_string_table_roots(scope, root_closure, par_state_string);
-  }
-
   _process_strong_tasks->all_tasks_completed(scope->n_threads());
 }
 
--- a/src/hotspot/share/gc/shared/genCollectedHeap.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -400,10 +400,6 @@
                      CLDClosure* weak_cld_closure,
                      CodeBlobToOopClosure* code_roots);
 
-  void process_string_table_roots(StrongRootsScope* scope,
-                                  OopClosure* root_closure,
-                                  OopStorage::ParState<false, false>* par_state_string);
-
   // Accessor for memory state verification support
   NOT_PRODUCT(
     virtual size_t skip_header_HeapWords() { return 0; }
@@ -416,16 +412,14 @@
   void young_process_roots(StrongRootsScope* scope,
                            OopsInGenClosure* root_closure,
                            OopsInGenClosure* old_gen_closure,
-                           CLDClosure* cld_closure,
-                           OopStorage::ParState<false, false>* par_state_string = NULL);
+                           CLDClosure* cld_closure);
 
   void full_process_roots(StrongRootsScope* scope,
                           bool is_adjust_phase,
                           ScanningOption so,
                           bool only_strong_roots,
                           OopsInGenClosure* root_closure,
-                          CLDClosure* cld_closure,
-                          OopStorage::ParState<false, false>* par_state_string = NULL);
+                          CLDClosure* cld_closure);
 
   // Apply "root_closure" to all the weak roots of the system.
   // These include JNI weak roots, string table,
--- a/src/hotspot/share/gc/shared/owstTaskTerminator.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/owstTaskTerminator.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -38,15 +38,17 @@
   // Single worker, done
   if (_n_threads == 1) {
     _offered_termination = 1;
+    assert(!peek_in_queue_set(), "Precondition");
     return true;
   }
 
   _blocker->lock_without_safepoint_check();
+  _offered_termination++;
   // All arrived, done
-  _offered_termination++;
   if (_offered_termination == _n_threads) {
     _blocker->notify_all();
     _blocker->unlock();
+    assert(!peek_in_queue_set(), "Precondition");
     return true;
   }
 
@@ -59,21 +61,31 @@
 
       if (do_spin_master_work(terminator)) {
         assert(_offered_termination == _n_threads, "termination condition");
+        assert(!peek_in_queue_set(), "Precondition");
         return true;
       } else {
         _blocker->lock_without_safepoint_check();
+        // There is possibility that termination is reached between dropping the lock
+        // before returning from do_spin_master_work() and acquiring lock above.
+        if (_offered_termination == _n_threads) {
+          _blocker->unlock();
+          assert(!peek_in_queue_set(), "Precondition");
+          return true;
+        }
       }
     } else {
       _blocker->wait(true, WorkStealingSleepMillis);
 
       if (_offered_termination == _n_threads) {
         _blocker->unlock();
+        assert(!peek_in_queue_set(), "Precondition");
         return true;
       }
     }
 
     size_t tasks = tasks_in_queue_set();
     if (exit_termination(tasks, terminator)) {
+      assert_lock_strong(_blocker);
       _offered_termination--;
       _blocker->unlock();
       return false;
@@ -153,19 +165,24 @@
       _total_peeks++;
 #endif
     size_t tasks = tasks_in_queue_set();
-    if (exit_termination(tasks, terminator)) {
+    bool exit = exit_termination(tasks, terminator);
+    {
       MonitorLockerEx locker(_blocker, Mutex::_no_safepoint_check_flag);
-      if (tasks >= _offered_termination - 1) {
-        locker.notify_all();
-      } else {
-        for (; tasks > 1; tasks--) {
-          locker.notify();
+      // Termination condition reached
+      if (_offered_termination == _n_threads) {
+        _spin_master = NULL;
+        return true;
+      } else if (exit) {
+        if (tasks >= _offered_termination - 1) {
+          locker.notify_all();
+        } else {
+          for (; tasks > 1; tasks--) {
+            locker.notify();
+          }
         }
+        _spin_master = NULL;
+        return false;
       }
-      _spin_master = NULL;
-      return false;
-    } else if (_offered_termination == _n_threads) {
-      return true;
     }
   }
 }
--- a/src/hotspot/share/gc/shared/owstTaskTerminator.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/owstTaskTerminator.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -55,6 +55,7 @@
   }
 
   virtual ~OWSTTaskTerminator() {
+    assert(_spin_master == NULL, "Should have been reset");
     assert(_blocker != NULL, "Can not be NULL");
     delete _blocker;
   }
--- a/src/hotspot/share/gc/shared/parallelCleaning.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/parallelCleaning.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -31,48 +31,35 @@
 #include "memory/resourceArea.hpp"
 #include "logging/log.hpp"
 
-StringCleaningTask::StringCleaningTask(BoolObjectClosure* is_alive, StringDedupUnlinkOrOopsDoClosure* dedup_closure, bool process_strings) :
-  AbstractGangTask("String Unlinking"),
-  _is_alive(is_alive),
-  _dedup_closure(dedup_closure),
-  _par_state_string(StringTable::weak_storage()),
-  _initial_string_table_size((int) StringTable::the_table()->table_size()),
-  _process_strings(process_strings), _strings_processed(0), _strings_removed(0) {
+StringDedupCleaningTask::StringDedupCleaningTask(BoolObjectClosure* is_alive,
+                                                 OopClosure* keep_alive,
+                                                 bool resize_table) :
+  AbstractGangTask("String Dedup Cleaning"),
+  _dedup_closure(is_alive, keep_alive) {
 
-  if (process_strings) {
-    StringTable::reset_dead_counter();
+  if (StringDedup::is_enabled()) {
+    StringDedup::gc_prologue(resize_table);
   }
 }
 
-StringCleaningTask::~StringCleaningTask() {
-  log_info(gc, stringtable)(
-      "Cleaned string table, "
-      "strings: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed",
-      strings_processed(), strings_removed());
-  if (_process_strings) {
-    StringTable::finish_dead_counter();
+StringDedupCleaningTask::~StringDedupCleaningTask() {
+  if (StringDedup::is_enabled()) {
+    StringDedup::gc_epilogue();
   }
 }
 
-void StringCleaningTask::work(uint worker_id) {
-  size_t strings_processed = 0;
-  size_t strings_removed = 0;
-  if (_process_strings) {
-    StringTable::possibly_parallel_unlink(&_par_state_string, _is_alive, &strings_processed, &strings_removed);
-    Atomic::add(strings_processed, &_strings_processed);
-    Atomic::add(strings_removed, &_strings_removed);
-  }
-  if (_dedup_closure != NULL) {
-    StringDedup::parallel_unlink(_dedup_closure, worker_id);
+void StringDedupCleaningTask::work(uint worker_id) {
+  if (StringDedup::is_enabled()) {
+    StringDedup::parallel_unlink(&_dedup_closure, worker_id);
   }
 }
 
 CodeCacheUnloadingTask::CodeCacheUnloadingTask(uint num_workers, BoolObjectClosure* is_alive, bool unloading_occurred) :
-      _unloading_scope(is_alive),
-      _unloading_occurred(unloading_occurred),
-      _num_workers(num_workers),
-      _first_nmethod(NULL),
-      _claimed_nmethod(NULL) {
+  _unloading_scope(is_alive),
+  _unloading_occurred(unloading_occurred),
+  _num_workers(num_workers),
+  _first_nmethod(NULL),
+  _claimed_nmethod(NULL) {
   // Get first alive nmethod
   CompiledMethodIterator iter(CompiledMethodIterator::only_alive);
   if(iter.next()) {
@@ -175,10 +162,12 @@
 }
 
 ParallelCleaningTask::ParallelCleaningTask(BoolObjectClosure* is_alive,
-  StringDedupUnlinkOrOopsDoClosure* dedup_closure, uint num_workers, bool unloading_occurred) :
+                                           uint num_workers,
+                                           bool unloading_occurred,
+                                           bool resize_dedup_table) :
   AbstractGangTask("Parallel Cleaning"),
   _unloading_occurred(unloading_occurred),
-  _string_task(is_alive, StringDedup::is_enabled() ? dedup_closure : NULL, true),
+  _string_dedup_task(is_alive, NULL, resize_dedup_table),
   _code_cache_task(num_workers, is_alive, unloading_occurred),
   _klass_cleaning_task() {
 }
@@ -188,8 +177,8 @@
   // Do first pass of code cache cleaning.
   _code_cache_task.work(worker_id);
 
-  // Clean the Strings and Symbols.
-  _string_task.work(worker_id);
+  // Clean the string dedup data structures.
+  _string_dedup_task.work(worker_id);
 
   // Clean all klasses that were not unloaded.
   // The weak metadata in klass doesn't need to be
--- a/src/hotspot/share/gc/shared/parallelCleaning.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/parallelCleaning.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -33,27 +33,14 @@
 
 class ParallelCleaningTask;
 
-class StringCleaningTask : public AbstractGangTask {
-private:
-  BoolObjectClosure* _is_alive;
-  StringDedupUnlinkOrOopsDoClosure * const _dedup_closure;
-
-  OopStorage::ParState<false /* concurrent */, false /* const */> _par_state_string;
-
-  int _initial_string_table_size;
-
-  bool            _process_strings;
-  volatile size_t _strings_processed;
-  volatile size_t _strings_removed;
+class StringDedupCleaningTask : public AbstractGangTask {
+  StringDedupUnlinkOrOopsDoClosure _dedup_closure;
 
 public:
-  StringCleaningTask(BoolObjectClosure* is_alive, StringDedupUnlinkOrOopsDoClosure* dedup_closure, bool process_strings);
-  ~StringCleaningTask();
+  StringDedupCleaningTask(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool resize_table);
+  ~StringDedupCleaningTask();
 
   void work(uint worker_id);
-
-  size_t strings_processed() const { return _strings_processed; }
-  size_t strings_removed()   const { return _strings_removed; }
 };
 
 class CodeCacheUnloadingTask {
@@ -100,18 +87,21 @@
   void work();
 };
 
-// To minimize the remark pause times, the tasks below are done in parallel.
+// Do cleanup of some weakly held data in the same parallel task.
+// Assumes a non-moving context.
 class ParallelCleaningTask : public AbstractGangTask {
 private:
-  bool                        _unloading_occurred;
-  StringCleaningTask          _string_task;
-  CodeCacheUnloadingTask      _code_cache_task;
-  KlassCleaningTask           _klass_cleaning_task;
+  bool                    _unloading_occurred;
+  StringDedupCleaningTask _string_dedup_task;
+  CodeCacheUnloadingTask  _code_cache_task;
+  KlassCleaningTask       _klass_cleaning_task;
 
 public:
   // The constructor is run in the VMThread.
-  ParallelCleaningTask(BoolObjectClosure* is_alive, StringDedupUnlinkOrOopsDoClosure* dedup_closure,
-    uint num_workers, bool unloading_occurred);
+  ParallelCleaningTask(BoolObjectClosure* is_alive,
+                       uint num_workers,
+                       bool unloading_occurred,
+                       bool resize_dedup_table);
 
   void work(uint worker_id);
 };
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedup.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedup.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,6 @@
   StringDedupTable::deduplicate(java_string, &dummy);
 }
 
-
 void StringDedup::parallel_unlink(StringDedupUnlinkOrOopsDoClosure* unlink, uint worker_id) {
   assert(is_enabled(), "String deduplication not enabled");
   StringDedupQueue::unlink_or_oops_do(unlink);
@@ -80,5 +79,8 @@
 
 StringDedupUnlinkOrOopsDoClosure::StringDedupUnlinkOrOopsDoClosure(BoolObjectClosure* is_alive,
                                                                    OopClosure* keep_alive) :
-  _is_alive(is_alive), _keep_alive(keep_alive) {
+  _always_true(),
+  _do_nothing(),
+  _is_alive(is_alive != NULL ? is_alive : &_always_true),
+  _keep_alive(keep_alive != NULL ? keep_alive : &_do_nothing) {
 }
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedup.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedup.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -113,30 +113,18 @@
 // the deduplication queue and table during the unlink_or_oops_do() operation.
 //
 class StringDedupUnlinkOrOopsDoClosure : public StackObj {
-private:
+  AlwaysTrueClosure   _always_true;
+  DoNothingClosure    _do_nothing;
   BoolObjectClosure*  _is_alive;
   OopClosure*         _keep_alive;
 
 public:
   StringDedupUnlinkOrOopsDoClosure(BoolObjectClosure* is_alive,
-                                     OopClosure* keep_alive);
+                                   OopClosure* keep_alive);
 
-  // Applies and returns the result from the is_alive closure, or
-  // returns true if no such closure was provided.
-  bool is_alive(oop o) {
-    if (_is_alive != NULL) {
-      return _is_alive->do_object_b(o);
-    }
-    return true;
-  }
+  bool is_alive(oop o) { return _is_alive->do_object_b(o); }
 
-  // Applies the keep_alive closure, or does nothing if no such
-  // closure was provided.
-  void keep_alive(oop* p) {
-    if (_keep_alive != NULL) {
-      _keep_alive->do_oop(p);
-    }
-  }
+  void keep_alive(oop* p) { _keep_alive->do_oop(p); }
 };
 
 #endif // SHARE_GC_SHARED_STRINGDEDUP_STRINGDEDUP_HPP
--- a/src/hotspot/share/gc/shared/taskqueue.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/taskqueue.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -118,6 +118,11 @@
   _queue_set(queue_set),
   _offered_termination(0) {}
 
+ParallelTaskTerminator::~ParallelTaskTerminator() {
+  assert(_offered_termination == 0 || !peek_in_queue_set(), "Precondition");
+  assert(_offered_termination == 0 || _offered_termination == _n_threads, "Terminated or aborted" );
+}
+
 bool ParallelTaskTerminator::peek_in_queue_set() {
   return _queue_set->peek();
 }
@@ -162,6 +167,7 @@
     assert(_offered_termination <= _n_threads, "Invariant");
     // Are all threads offering termination?
     if (_offered_termination == _n_threads) {
+      assert(!peek_in_queue_set(), "Precondition");
       return true;
     } else {
       // Look for more work.
@@ -211,9 +217,7 @@
 #endif
       if (peek_in_queue_set() ||
           (terminator != NULL && terminator->should_exit_termination())) {
-        Atomic::dec(&_offered_termination);
-        assert(_offered_termination < _n_threads, "Invariant");
-        return false;
+        return complete_or_exit_termination();
       }
     }
   }
@@ -229,6 +233,23 @@
 }
 #endif
 
+bool ParallelTaskTerminator::complete_or_exit_termination() {
+  // If termination is ever reached, terminator should stay in such state,
+  // so that all threads see the same state
+  uint current_offered = _offered_termination;
+  uint expected_value;
+  do {
+    if (current_offered == _n_threads) {
+      assert(!peek_in_queue_set(), "Precondition");
+      return true;
+    }
+    expected_value = current_offered;
+  } while ((current_offered = Atomic::cmpxchg(current_offered - 1, &_offered_termination, current_offered)) != expected_value);
+
+  assert(_offered_termination < _n_threads, "Invariant");
+  return false;
+}
+
 void ParallelTaskTerminator::reset_for_reuse() {
   if (_offered_termination != 0) {
     assert(_offered_termination == _n_threads,
@@ -260,13 +281,3 @@
   }
 }
 
-// Move assignment
-TaskTerminator& TaskTerminator::operator=(const TaskTerminator& o) {
-  if (_terminator != NULL) {
-    delete _terminator;
-  }
-  _terminator = o.terminator();
-  const_cast<TaskTerminator&>(o)._terminator = NULL;
-  return *this;
-}
-
--- a/src/hotspot/share/gc/shared/taskqueue.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/taskqueue.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -451,7 +451,10 @@
 protected:
   uint _n_threads;
   TaskQueueSetSuper* _queue_set;
+
+  DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0);
   volatile uint _offered_termination;
+  DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile uint));
 
 #ifdef TRACESPINNING
   static uint _total_yields;
@@ -464,11 +467,18 @@
   virtual void yield();
   void sleep(uint millis);
 
+  // Called when exiting termination is requested.
+  // When the request is made, terminator may have already terminated
+  // (e.g. all threads are arrived and offered termination). In this case,
+  // it should ignore the request and complete the termination.
+  // Return true if termination is completed. Otherwise, return false.
+  bool complete_or_exit_termination();
 public:
 
   // "n_threads" is the number of threads to be terminated.  "queue_set" is a
   // queue sets of work queues of other threads.
   ParallelTaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set);
+  virtual ~ParallelTaskTerminator();
 
   // The current thread has no work, and is ready to terminate if everyone
   // else is.  If returns "true", all threads are terminated.  If returns
@@ -500,37 +510,21 @@
 #endif
 };
 
-#ifdef _MSC_VER
-#pragma warning(push)
-// warning C4521: multiple copy constructors specified
-#pragma warning(disable:4521)
-// warning C4522: multiple assignment operators specified
-#pragma warning(disable:4522)
-#endif
-
 class TaskTerminator : public StackObj {
 private:
   ParallelTaskTerminator*  _terminator;
 
-  // Disable following copy constructors and assignment operator
-  TaskTerminator(TaskTerminator& o) { }
-  TaskTerminator(const TaskTerminator& o) { }
-  TaskTerminator& operator=(TaskTerminator& o) { return *this; }
+  // Noncopyable.
+  TaskTerminator(const TaskTerminator&);
+  TaskTerminator& operator=(const TaskTerminator&);
 public:
   TaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set);
   ~TaskTerminator();
 
-  // Move assignment
-  TaskTerminator& operator=(const TaskTerminator& o);
-
   ParallelTaskTerminator* terminator() const {
     return _terminator;
   }
 };
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
 
 typedef GenericTaskQueue<oop, mtGC>             OopTaskQueue;
 typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
--- a/src/hotspot/share/gc/shared/weakProcessor.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/weakProcessor.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,9 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/stringTable.hpp"
 #include "gc/shared/oopStorage.inline.hpp"
 #include "gc/shared/oopStorageParState.inline.hpp"
-#include "gc/shared/weakProcessor.hpp"
 #include "gc/shared/weakProcessor.inline.hpp"
 #include "gc/shared/weakProcessorPhases.hpp"
 #include "gc/shared/weakProcessorPhaseTimes.hpp"
@@ -35,13 +35,19 @@
 #include "utilities/macros.hpp"
 
 void WeakProcessor::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive) {
+  StringTable::reset_dead_counter();
+  CountingIsAliveClosure<BoolObjectClosure> cl(is_alive);
   FOR_EACH_WEAK_PROCESSOR_PHASE(phase) {
     if (WeakProcessorPhases::is_serial(phase)) {
-      WeakProcessorPhases::processor(phase)(is_alive, keep_alive);
+      WeakProcessorPhases::processor(phase)(&cl, keep_alive);
     } else {
-      WeakProcessorPhases::oop_storage(phase)->weak_oops_do(is_alive, keep_alive);
+      WeakProcessorPhases::oop_storage(phase)->weak_oops_do(&cl, keep_alive);
+    }
+    if (WeakProcessorPhases::is_stringtable(phase)) {
+      StringTable::inc_dead_counter(cl.num_dead());
     }
   }
+  StringTable::finish_dead_counter();
 }
 
 void WeakProcessor::oops_do(OopClosure* closure) {
@@ -93,6 +99,7 @@
     OopStorage* storage = WeakProcessorPhases::oop_storage(phase);
     new (states++) StorageState(storage, _nworkers);
   }
+  StringTable::reset_dead_counter();
 }
 
 WeakProcessor::Task::Task(uint nworkers) :
@@ -122,6 +129,7 @@
     }
     FREE_C_HEAP_ARRAY(StorageState, _storage_states);
   }
+  StringTable::finish_dead_counter();
 }
 
 void WeakProcessor::GangTask::work(uint worker_id) {
--- a/src/hotspot/share/gc/shared/weakProcessor.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/weakProcessor.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -25,6 +25,7 @@
 #ifndef SHARE_GC_SHARED_WEAKPROCESSOR_INLINE_HPP
 #define SHARE_GC_SHARED_WEAKPROCESSOR_INLINE_HPP
 
+#include "classfile/stringTable.hpp"
 #include "gc/shared/oopStorage.inline.hpp"
 #include "gc/shared/oopStorageParState.inline.hpp"
 #include "gc/shared/weakProcessor.hpp"
@@ -36,6 +37,27 @@
 class BoolObjectClosure;
 class OopClosure;
 
+template<typename T>
+class CountingIsAliveClosure : public BoolObjectClosure {
+  T* _inner;
+
+  size_t _num_dead;
+  size_t _num_total;
+
+public:
+  CountingIsAliveClosure(T* cl) : _inner(cl), _num_dead(0), _num_total(0) { }
+
+  virtual bool do_object_b(oop obj) {
+    bool result = _inner->do_object_b(obj);
+    _num_dead += !result;
+    _num_total++;
+    return result;
+  }
+
+  size_t num_dead() const { return _num_dead; }
+  size_t num_total() const { return _num_total; }
+};
+
 template<typename IsAlive, typename KeepAlive>
 void WeakProcessor::Task::work(uint worker_id,
                                IsAlive* is_alive,
@@ -45,16 +67,26 @@
          worker_id, _nworkers);
 
   FOR_EACH_WEAK_PROCESSOR_PHASE(phase) {
+    CountingIsAliveClosure<IsAlive> cl(is_alive);
     if (WeakProcessorPhases::is_serial(phase)) {
       uint serial_index = WeakProcessorPhases::serial_index(phase);
       if (_serial_phases_done.try_claim_task(serial_index)) {
         WeakProcessorPhaseTimeTracker pt(_phase_times, phase);
-        WeakProcessorPhases::processor(phase)(is_alive, keep_alive);
+        WeakProcessorPhases::processor(phase)(&cl, keep_alive);
+        if (_phase_times != NULL) {
+          _phase_times->record_phase_items(phase, cl.num_dead(), cl.num_total());
+        }
       }
     } else {
       WeakProcessorPhaseTimeTracker pt(_phase_times, phase, worker_id);
       uint storage_index = WeakProcessorPhases::oop_storage_index(phase);
-      _storage_states[storage_index].weak_oops_do(is_alive, keep_alive);
+      _storage_states[storage_index].weak_oops_do(&cl, keep_alive);
+      if (_phase_times != NULL) {
+        _phase_times->record_worker_items(worker_id, phase, cl.num_dead(), cl.num_total());
+      }
+    }
+    if (WeakProcessorPhases::is_stringtable(phase)) {
+      StringTable::inc_dead_counter(cl.num_dead());
     }
   }
 
--- a/src/hotspot/share/gc/shared/weakProcessorPhaseTimes.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/weakProcessorPhaseTimes.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -49,6 +49,7 @@
 
 #ifdef ASSERT
 static bool is_initialized_time(double t) { return t >= 0.0; }
+static bool is_initialized_items(size_t i) { return i != 0; }
 #endif // ASSERT
 
 static void reset_times(double* times, size_t ntimes) {
@@ -57,28 +58,43 @@
   }
 }
 
+static void reset_items(size_t* items, size_t nitems) {
+  for (size_t i = 0; i < nitems; ++i) {
+    items[i] = 0;
+  }
+}
+
 WeakProcessorPhaseTimes::WeakProcessorPhaseTimes(uint max_threads) :
   _max_threads(max_threads),
   _active_workers(0),
   _total_time_sec(uninitialized_time),
-  _worker_phase_times_sec()
+  _worker_data(),
+  _worker_dead_items(),
+  _worker_total_items()
 {
   assert(_max_threads > 0, "max_threads must not be zero");
 
   reset_times(_phase_times_sec, ARRAY_SIZE(_phase_times_sec));
+  reset_items(_phase_dead_items, ARRAY_SIZE(_phase_dead_items));
+  reset_items(_phase_total_items, ARRAY_SIZE(_phase_total_items));
 
   if (_max_threads > 1) {
-    WorkerDataArray<double>** wpt = _worker_phase_times_sec;
+    WorkerDataArray<double>** wpt = _worker_data;
     FOR_EACH_WEAK_PROCESSOR_OOP_STORAGE_PHASE(phase) {
       const char* description = WeakProcessorPhases::description(phase);
-      *wpt++ = new WorkerDataArray<double>(_max_threads, description);
+      *wpt = new WorkerDataArray<double>(_max_threads, description);
+      (*wpt)->link_thread_work_items(new WorkerDataArray<size_t>(_max_threads, "Dead"), DeadItems);
+      (*wpt)->link_thread_work_items(new WorkerDataArray<size_t>(_max_threads, "Total"), TotalItems);
+      wpt++;
     }
   }
 }
 
 WeakProcessorPhaseTimes::~WeakProcessorPhaseTimes() {
-  for (size_t i = 0; i < ARRAY_SIZE(_worker_phase_times_sec); ++i) {
-    delete _worker_phase_times_sec[i];
+  for (size_t i = 0; i < ARRAY_SIZE(_worker_data); ++i) {
+    delete _worker_data[i];
+    delete _worker_dead_items[i];
+    delete _worker_total_items[i];
   }
 }
 
@@ -100,9 +116,11 @@
   _active_workers = 0;
   _total_time_sec = uninitialized_time;
   reset_times(_phase_times_sec, ARRAY_SIZE(_phase_times_sec));
+  reset_items(_phase_dead_items, ARRAY_SIZE(_phase_dead_items));
+  reset_items(_phase_total_items, ARRAY_SIZE(_phase_total_items));
   if (_max_threads > 1) {
-    for (size_t i = 0; i < ARRAY_SIZE(_worker_phase_times_sec); ++i) {
-      _worker_phase_times_sec[i]->reset();
+    for (size_t i = 0; i < ARRAY_SIZE(_worker_data); ++i) {
+      _worker_data[i]->reset();
     }
   }
 }
@@ -129,10 +147,20 @@
   _phase_times_sec[phase_index(phase)] = time_sec;
 }
 
+void WeakProcessorPhaseTimes::record_phase_items(WeakProcessorPhase phase, size_t num_dead, size_t num_total) {
+  uint p = phase_index(phase);
+  assert(!is_initialized_items(_phase_dead_items[p]),
+         "Already set dead items for phase %u", p);
+  assert(!is_initialized_items(_phase_total_items[p]),
+         "Already set total items for phase %u", p);
+  _phase_dead_items[p] = num_dead;
+  _phase_total_items[p] = num_total;
+}
+
 WorkerDataArray<double>* WeakProcessorPhaseTimes::worker_data(WeakProcessorPhase phase) const {
   assert_oop_storage_phase(phase);
   assert(active_workers() > 1, "No worker data when single-threaded");
-  return _worker_phase_times_sec[WeakProcessorPhases::oop_storage_index(phase)];
+  return _worker_data[WeakProcessorPhases::oop_storage_index(phase)];
 }
 
 double WeakProcessorPhaseTimes::worker_time_sec(uint worker_id, WeakProcessorPhase phase) const {
@@ -155,6 +183,18 @@
   }
 }
 
+void WeakProcessorPhaseTimes::record_worker_items(uint worker_id,
+                                                  WeakProcessorPhase phase,
+                                                  size_t num_dead,
+                                                  size_t num_total) {
+  if (active_workers() == 1) {
+    record_phase_items(phase, num_dead, num_total);
+  } else {
+    worker_data(phase)->set_or_add_thread_work_item(worker_id, num_dead, DeadItems);
+    worker_data(phase)->set_or_add_thread_work_item(worker_id, num_total, TotalItems);
+  }
+}
+
 static double elapsed_time_sec(Ticks start_time, Ticks end_time) {
   return (end_time - start_time).seconds();
 }
@@ -223,6 +263,16 @@
                         indent_str(indent),
                         WeakProcessorPhases::description(phase),
                         phase_time_sec(phase) * MILLIUNITS);
+
+  log_debug(gc, phases)("%s%s: " SIZE_FORMAT,
+                        indent_str(indent + 1),
+                        "Dead",
+                        _phase_dead_items[phase_index(phase)]);
+
+  log_debug(gc, phases)("%s%s: " SIZE_FORMAT,
+                        indent_str(indent + 1),
+                        "Total",
+                        _phase_total_items[phase_index(phase)]);
 }
 
 void WeakProcessorPhaseTimes::log_mt_phase_summary(WeakProcessorPhase phase,
@@ -231,27 +281,36 @@
   LogStream ls(lt);
   ls.print("%s", indents[indent]);
   worker_data(phase)->print_summary_on(&ls, true);
+  log_mt_phase_details(worker_data(phase), indent + 1);
+
+  for (uint i = 0; i < worker_data(phase)->MaxThreadWorkItems; i++) {
+    WorkerDataArray<size_t>* work_items = worker_data(phase)->thread_work_items(i);
+    if (work_items != NULL) {
+      ls.print("%s", indents[indent + 1]);
+      work_items->print_summary_on(&ls, true);
+      log_mt_phase_details(work_items, indent + 1);
+    }
+  }
 }
 
-void WeakProcessorPhaseTimes::log_mt_phase_details(WeakProcessorPhase phase,
+template <typename T>
+void WeakProcessorPhaseTimes::log_mt_phase_details(WorkerDataArray<T>* data,
                                                    uint indent) const {
   LogTarget(Trace, gc, phases) lt;
-  LogStream ls(lt);
-  ls.print("%s", indents[indent]);
-  worker_data(phase)->print_details_on(&ls);
+  if (lt.is_enabled()) {
+    LogStream ls(lt);
+    ls.print("%s", indents[indent]);
+    data->print_details_on(&ls);
+  }
 }
 
 void WeakProcessorPhaseTimes::log_print_phases(uint indent) const {
   if (log_is_enabled(Debug, gc, phases)) {
-    bool details_enabled = log_is_enabled(Trace, gc, phases);
     FOR_EACH_WEAK_PROCESSOR_PHASE(phase) {
       if (is_serial_phase(phase) || (active_workers() == 1)) {
         log_st_phase(phase, indent);
       } else {
         log_mt_phase_summary(phase, indent);
-        if (details_enabled) {
-          log_mt_phase_details(phase, indent + 1);
-        }
       }
     }
   }
--- a/src/hotspot/share/gc/shared/weakProcessorPhaseTimes.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/weakProcessorPhaseTimes.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -33,6 +33,10 @@
 template<typename T> class WorkerDataArray;
 
 class WeakProcessorPhaseTimes : public CHeapObj<mtGC> {
+  enum {
+    DeadItems,
+    TotalItems
+  };
   uint _max_threads;
   uint _active_workers;
 
@@ -43,15 +47,20 @@
   // processed by multiple threads are unused, as are entries for
   // unexecuted phases.
   double _phase_times_sec[WeakProcessorPhases::phase_count];
+  size_t _phase_dead_items[WeakProcessorPhases::phase_count];
+  size_t _phase_total_items[WeakProcessorPhases::phase_count];
 
-  // Per-worker times, if multiple threads used and the phase was executed.
-  WorkerDataArray<double>* _worker_phase_times_sec[WeakProcessorPhases::oop_storage_phase_count];
+  // Per-worker times and linked items, if multiple threads used and the phase was executed.
+  WorkerDataArray<double>* _worker_data[WeakProcessorPhases::oop_storage_phase_count];
+  WorkerDataArray<size_t>* _worker_dead_items[WeakProcessorPhases::oop_storage_phase_count];
+  WorkerDataArray<size_t>* _worker_total_items[WeakProcessorPhases::oop_storage_phase_count];
 
   WorkerDataArray<double>* worker_data(WeakProcessorPhase phase) const;
 
   void log_st_phase(WeakProcessorPhase phase, uint indent) const;
   void log_mt_phase_summary(WeakProcessorPhase phase, uint indent) const;
-  void log_mt_phase_details(WeakProcessorPhase phase, uint indent) const;
+  template <typename T>
+  void log_mt_phase_details(WorkerDataArray<T>* data, uint indent) const;
 
 public:
   WeakProcessorPhaseTimes(uint max_threads);
@@ -67,7 +76,9 @@
 
   void record_total_time_sec(double time_sec);
   void record_phase_time_sec(WeakProcessorPhase phase, double time_sec);
+  void record_phase_items(WeakProcessorPhase phase, size_t num_dead, size_t num_total);
   void record_worker_time_sec(uint worker_id, WeakProcessorPhase phase, double time_sec);
+  void record_worker_items(uint worker_id, WeakProcessorPhase phase, size_t num_dead, size_t num_total);
 
   void reset();
 
--- a/src/hotspot/share/gc/shared/weakProcessorPhases.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/weakProcessorPhases.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "gc/shared/weakProcessorPhases.hpp"
 #include "runtime/jniHandles.hpp"
@@ -78,6 +79,7 @@
   JVMTI_ONLY(case jvmti: return "JVMTI weak processing";)
   JFR_ONLY(case jfr: return "JFR weak processing";)
   case jni: return "JNI weak processing";
+  case stringtable: return "StringTable weak processing";
   case vm: return "VM weak processing";
   default:
     ShouldNotReachHere();
@@ -98,9 +100,14 @@
 OopStorage* WeakProcessorPhases::oop_storage(Phase phase) {
   switch (phase) {
   case jni: return JNIHandles::weak_global_handles();
+  case stringtable: return StringTable::weak_storage();
   case vm: return SystemDictionary::vm_weak_oop_storage();
   default:
     ShouldNotReachHere();
     return NULL;
   }
 }
+
+bool WeakProcessorPhases::is_stringtable(Phase phase) {
+  return phase == stringtable;
+}
--- a/src/hotspot/share/gc/shared/weakProcessorPhases.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shared/weakProcessorPhases.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -44,6 +44,7 @@
 
     // OopStorage phases.
     jni,
+    stringtable,
     vm
   };
 
@@ -65,6 +66,8 @@
   static const char* description(Phase phase);
   static Processor processor(Phase phase); // Precondition: is_serial(phase)
   static OopStorage* oop_storage(Phase phase); // Precondition: is_oop_storage(phase)
+
+  static bool is_stringtable(Phase phase);
 };
 
 typedef WeakProcessorPhases::Phase WeakProcessorPhase;
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -46,6 +46,7 @@
 #include "memory/metaspace.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
 
 template<UpdateRefsMode UPDATE_REFS, StringDedupMode STRING_DEDUP>
 class ShenandoahInitMarkRootsClosure : public OopClosure {
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -65,6 +65,8 @@
 #include "gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp"
 
 #include "memory/metaspace.hpp"
+#include "runtime/interfaceSupport.inline.hpp"
+#include "runtime/safepointMechanism.hpp"
 #include "runtime/vmThread.hpp"
 #include "services/mallocTracker.hpp"
 
@@ -1863,6 +1865,22 @@
   return _free_set->used();
 }
 
+bool ShenandoahHeap::try_cancel_gc() {
+  while (true) {
+    jbyte prev = _cancelled_gc.cmpxchg(CANCELLED, CANCELLABLE);
+    if (prev == CANCELLABLE) return true;
+    else if (prev == CANCELLED) return false;
+    assert(ShenandoahSuspendibleWorkers, "should not get here when not using suspendible workers");
+    assert(prev == NOT_CANCELLED, "must be NOT_CANCELLED");
+    {
+      // We need to provide a safepoint here, otherwise we might
+      // spin forever if a SP is pending.
+      ThreadBlockInVM sp(JavaThread::current());
+      SpinPause();
+    }
+  }
+}
+
 void ShenandoahHeap::cancel_gc(GCCause::Cause cause) {
   if (try_cancel_gc()) {
     FormatBuffer<> msg("Cancelling GC: %s", GCCause::to_string(cause));
@@ -1923,8 +1941,7 @@
                             ShenandoahPhaseTimings::full_gc_purge_par :
                             ShenandoahPhaseTimings::purge_par);
     uint active = _workers->active_workers();
-    StringDedupUnlinkOrOopsDoClosure dedup_cl(is_alive, NULL);
-    ParallelCleaningTask unlink_task(is_alive, &dedup_cl, active, purged_class);
+    ParallelCleaningTask unlink_task(is_alive, active, purged_class, true);
     _workers->run_task(&unlink_task);
   }
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -380,7 +380,7 @@
   };
 
   ShenandoahSharedEnumFlag<CancelState> _cancelled_gc;
-  inline bool try_cancel_gc();
+  bool try_cancel_gc();
 
 public:
   static address cancelled_gc_addr();
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -31,7 +31,6 @@
 #include "gc/shenandoah/shenandoahAsserts.hpp"
 #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
 #include "gc/shenandoah/shenandoahBrooksPointer.inline.hpp"
-#include "gc/shenandoah/shenandoahCollectionSet.hpp"
 #include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
 #include "gc/shenandoah/shenandoahWorkGroup.hpp"
 #include "gc/shenandoah/shenandoahHeap.hpp"
@@ -42,8 +41,6 @@
 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/interfaceSupport.inline.hpp"
-#include "runtime/prefetch.hpp"
 #include "runtime/prefetch.inline.hpp"
 #include "runtime/thread.hpp"
 #include "utilities/copy.hpp"
@@ -216,22 +213,6 @@
   }
 }
 
-inline bool ShenandoahHeap::try_cancel_gc() {
-  while (true) {
-    jbyte prev = _cancelled_gc.cmpxchg(CANCELLED, CANCELLABLE);
-    if (prev == CANCELLABLE) return true;
-    else if (prev == CANCELLED) return false;
-    assert(ShenandoahSuspendibleWorkers, "should not get here when not using suspendible workers");
-    assert(prev == NOT_CANCELLED, "must be NOT_CANCELLED");
-    {
-      // We need to provide a safepoint here, otherwise we might
-      // spin forever if a SP is pending.
-      ThreadBlockInVM sp(JavaThread::current());
-      SpinPause();
-    }
-  }
-}
-
 inline void ShenandoahHeap::clear_cancelled_gc() {
   _cancelled_gc.set(CANCELLABLE);
   _oom_evac_handler.clear();
--- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -45,7 +45,6 @@
   f(scan_roots,                                     "  Scan Roots")                     \
   f(scan_thread_roots,                              "    S: Thread Roots")              \
   f(scan_code_roots,                                "    S: Code Cache Roots")          \
-  f(scan_string_table_roots,                        "    S: String Table Roots")        \
   f(scan_universe_roots,                            "    S: Universe Roots")            \
   f(scan_jni_roots,                                 "    S: JNI Roots")                 \
   f(scan_jni_weak_roots,                            "    S: JNI Weak Roots")            \
@@ -67,7 +66,6 @@
   f(update_roots,                                   "  Update Roots")                   \
   f(update_thread_roots,                            "    U: Thread Roots")              \
   f(update_code_roots,                              "    U: Code Cache Roots")          \
-  f(update_string_table_roots,                      "    U: String Table Roots")        \
   f(update_universe_roots,                          "    U: Universe Roots")            \
   f(update_jni_roots,                               "    U: JNI Roots")                 \
   f(update_jni_weak_roots,                          "    U: JNI Weak Roots")            \
@@ -97,7 +95,6 @@
   f(init_evac,                                      "  Initial Evacuation")             \
   f(evac_thread_roots,                              "    E: Thread Roots")              \
   f(evac_code_roots,                                "    E: Code Cache Roots")          \
-  f(evac_string_table_roots,                        "    E: String Table Roots")        \
   f(evac_universe_roots,                            "    E: Universe Roots")            \
   f(evac_jni_roots,                                 "    E: JNI Roots")                 \
   f(evac_jni_weak_roots,                            "    E: JNI Weak Roots")            \
@@ -124,7 +121,6 @@
   f(final_update_refs_roots,                         "  Update Roots")                  \
   f(final_update_refs_thread_roots,                  "    UR: Thread Roots")            \
   f(final_update_refs_code_roots,                    "    UR: Code Cache Roots")        \
-  f(final_update_refs_string_table_roots,            "    UR: String Table Roots")      \
   f(final_update_refs_universe_roots,                "    UR: Universe Roots")          \
   f(final_update_refs_jni_roots,                     "    UR: JNI Roots")               \
   f(final_update_refs_jni_weak_roots,                "    UR: JNI Weak Roots")          \
@@ -146,7 +142,6 @@
   f(degen_gc_update_roots,                           "  Degen Update Roots")            \
   f(degen_gc_update_thread_roots,                    "    DU: Thread Roots")            \
   f(degen_gc_update_code_roots,                      "    DU: Code Cache Roots")        \
-  f(degen_gc_update_string_table_roots,              "    DU: String Table Roots")      \
   f(degen_gc_update_universe_roots,                  "    DU: Universe Roots")          \
   f(degen_gc_update_jni_roots,                       "    DU: JNI Roots")               \
   f(degen_gc_update_jni_weak_roots,                  "    DU: JNI Weak Roots")          \
@@ -169,7 +164,6 @@
   f(init_traversal_gc_work,                          "  Work")                          \
   f(init_traversal_gc_thread_roots,                  "    TI: Thread Roots")            \
   f(init_traversal_gc_code_roots,                    "    TI: Code Cache Roots")        \
-  f(init_traversal_gc_string_table_roots,            "    TI: String Table Roots")      \
   f(init_traversal_gc_universe_roots,                "    TI: Universe Roots")          \
   f(init_traversal_gc_jni_roots,                     "    TI: JNI Roots")               \
   f(init_traversal_gc_jni_weak_roots,                "    TI: JNI Weak Roots")          \
@@ -189,7 +183,6 @@
   f(final_traversal_gc_work,                         "  Work")                          \
   f(final_traversal_gc_thread_roots,                 "    TF: Thread Roots")            \
   f(final_traversal_gc_code_roots,                   "    TF: Code Cache Roots")        \
-  f(final_traversal_gc_string_table_roots,           "    TF: String Table Roots")      \
   f(final_traversal_gc_universe_roots,               "    TF: Universe Roots")          \
   f(final_traversal_gc_jni_roots,                    "    TF: JNI Roots")               \
   f(final_traversal_gc_jni_weak_roots,               "    TF: JNI Weak Roots")          \
@@ -207,7 +200,6 @@
   f(final_traversal_update_roots,                    "  Update Roots")                  \
   f(final_traversal_update_thread_roots,             "    TU: Thread Roots")            \
   f(final_traversal_update_code_roots,               "    TU: Code Cache Roots")        \
-  f(final_traversal_update_string_table_roots,       "    TU: String Table Roots")      \
   f(final_traversal_update_universe_roots,           "    TU: Universe Roots")          \
   f(final_traversal_update_jni_roots,                "    TU: JNI Roots")               \
   f(final_traversal_update_jni_weak_roots,           "    TU: JNI Weak Roots")          \
@@ -231,7 +223,6 @@
   f(full_gc_roots,                                   "  Roots")                         \
   f(full_gc_thread_roots,                            "    F: Thread Roots")             \
   f(full_gc_code_roots,                              "    F: Code Cache Roots")         \
-  f(full_gc_string_table_roots,                      "    F: String Table Roots")       \
   f(full_gc_universe_roots,                          "    F: Universe Roots")           \
   f(full_gc_jni_roots,                               "    F: JNI Roots")                \
   f(full_gc_jni_weak_roots,                          "    F: JNI Weak Roots")           \
@@ -286,7 +277,6 @@
 #define SHENANDOAH_GC_PAR_PHASE_DO(f)                           \
   f(ThreadRoots,             "Thread Roots (ms):")              \
   f(CodeCacheRoots,          "CodeCache Roots (ms):")           \
-  f(StringTableRoots,        "StringTable Roots (ms):")         \
   f(UniverseRoots,           "Universe Roots (ms):")            \
   f(JNIRoots,                "JNI Handles Roots (ms):")         \
   f(JNIWeakRoots,            "JNI Weak Roots (ms):")            \
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -78,7 +78,6 @@
   WeakProcessor::oops_do(oops);
   ObjectSynchronizer::oops_do(oops);
   SystemDictionary::oops_do(oops);
-  StringTable::oops_do(oops);
 
   if (ShenandoahStringDedup::is_enabled()) {
     ShenandoahStringDedup::oops_do_slow(oops);
@@ -209,13 +208,6 @@
       ObjectSynchronizer::oops_do(strong_roots);
     }
   }
-
-  // All threads execute the following. A specific chunk of buckets
-  // from the StringTable are the individual tasks.
-  if (weak_roots != NULL) {
-    ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::StringTableRoots, worker_id);
-    StringTable::possibly_parallel_oops_do(&_par_state_string, weak_roots);
-  }
 }
 
 uint ShenandoahRootProcessor::n_workers() const {
--- a/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -38,21 +38,15 @@
     _tmp(LIR_OprFact::illegalOpr),
     _runtime_stub(runtime_stub) {
 
+  assert(_ref_addr->is_address(), "Must be an address");
+  assert(_ref->is_register(), "Must be a register");
+
   // Allocate tmp register if needed
-  if (!_ref_addr->is_register()) {
-    assert(_ref_addr->is_address(), "Must be an address");
-    if (_ref_addr->as_address_ptr()->index()->is_valid() ||
-        _ref_addr->as_address_ptr()->disp() != 0) {
-      // Has index or displacement, need tmp register to load address into
-      _tmp = access.gen()->new_pointer_register();
-    } else {
-      // No index or displacement, address available in base register
-      _ref_addr = _ref_addr->as_address_ptr()->base();
-    }
+  if (_ref_addr->as_address_ptr()->index()->is_valid() ||
+      _ref_addr->as_address_ptr()->disp() != 0) {
+    // Has index or displacement, need tmp register to load address into
+    _tmp = access.gen()->new_pointer_register();
   }
-
-  assert(_ref->is_register(), "Must be a register");
-  assert(_ref_addr->is_register() != _tmp->is_register(), "Only one should be a register");
 }
 
 DecoratorSet ZLoadBarrierStubC1::decorators() const {
--- a/src/hotspot/share/gc/z/zDriver.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/z/zDriver.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
 #include "precompiled.hpp"
 #include "gc/shared/gcId.hpp"
 #include "gc/shared/gcLocker.hpp"
-#include "gc/shared/gcVMOperations.hpp"
 #include "gc/shared/isGCActiveMark.hpp"
 #include "gc/z/zCollectedHeap.hpp"
 #include "gc/z/zDriver.hpp"
@@ -45,7 +44,6 @@
 static const ZStatPhaseConcurrent ZPhaseConcurrentProcessNonStrongReferences("Concurrent Process Non-Strong References");
 static const ZStatPhaseConcurrent ZPhaseConcurrentResetRelocationSet("Concurrent Reset Relocation Set");
 static const ZStatPhaseConcurrent ZPhaseConcurrentDestroyDetachedPages("Concurrent Destroy Detached Pages");
-static const ZStatPhasePause      ZPhasePauseVerify("Pause Verify");
 static const ZStatPhaseConcurrent ZPhaseConcurrentSelectRelocationSet("Concurrent Select Relocation Set");
 static const ZStatPhaseConcurrent ZPhaseConcurrentPrepareRelocationSet("Concurrent Prepare Relocation Set");
 static const ZStatPhasePause      ZPhasePauseRelocateStart("Pause Relocate Start");
@@ -53,41 +51,26 @@
 static const ZStatCriticalPhase   ZCriticalPhaseGCLockerStall("GC Locker Stall", false /* verbose */);
 static const ZStatSampler         ZSamplerJavaThreads("System", "Java Threads", ZStatUnitThreads);
 
-class ZOperationClosure : public StackObj {
+class VM_ZOperation : public VM_Operation {
+private:
+  const uint _gc_id;
+  bool       _gc_locked;
+  bool       _success;
+
 public:
-  virtual const char* name() const = 0;
+  VM_ZOperation() :
+      _gc_id(GCId::current()),
+      _gc_locked(false),
+      _success(false) {}
 
   virtual bool needs_inactive_gc_locker() const {
-    // An inactive GC locker is needed in operations where we change the good
-    // mask or move objects. Changing the good mask will invalidate all oops,
+    // An inactive GC locker is needed in operations where we change the bad
+    // mask or move objects. Changing the bad mask will invalidate all oops,
     // which makes it conceptually the same thing as moving all objects.
     return false;
   }
 
   virtual bool do_operation() = 0;
-};
-
-class VM_ZOperation : public VM_Operation {
-private:
-  ZOperationClosure* _cl;
-  uint               _gc_id;
-  bool               _gc_locked;
-  bool               _success;
-
-public:
-  VM_ZOperation(ZOperationClosure* cl) :
-      _cl(cl),
-      _gc_id(GCId::current()),
-      _gc_locked(false),
-      _success(false) {}
-
-  virtual VMOp_Type type() const {
-    return VMOp_ZOperation;
-  }
-
-  virtual const char* name() const {
-    return _cl->name();
-  }
 
   virtual bool doit_prologue() {
     Heap_lock->lock();
@@ -95,31 +78,28 @@
   }
 
   virtual void doit() {
-    assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
-
-    ZStatSample(ZSamplerJavaThreads, Threads::number_of_threads());
-
-    // JVMTI support
-    SvcGCMarker sgcm(SvcGCMarker::CONCURRENT);
+    // Abort if GC locker state is incompatible
+    if (needs_inactive_gc_locker() && GCLocker::check_active_before_gc()) {
+      _gc_locked = true;
+      return;
+    }
 
-    // Setup GC id
-    GCIdMark gcid(_gc_id);
+    // Setup GC id and active marker
+    GCIdMark gc_id_mark(_gc_id);
+    IsGCActiveMark gc_active_mark;
 
-    if (_cl->needs_inactive_gc_locker() && GCLocker::check_active_before_gc()) {
-      // GC locker is active, bail out
-      _gc_locked = true;
-    } else {
-      // Execute operation
-      IsGCActiveMark mark;
-      _success = _cl->do_operation();
-    }
+    // Execute operation
+    _success = do_operation();
+
+    // Update statistics
+    ZStatSample(ZSamplerJavaThreads, Threads::number_of_threads());
   }
 
   virtual void doit_epilogue() {
     Heap_lock->unlock();
   }
 
-  bool gc_locked() {
+  bool gc_locked() const {
     return _gc_locked;
   }
 
@@ -169,10 +149,10 @@
   return false;
 }
 
-class ZMarkStartClosure : public ZOperationClosure {
+class VM_ZMarkStart : public VM_ZOperation {
 public:
-  virtual const char* name() const {
-    return "ZMarkStart";
+  virtual VMOp_Type type() const {
+    return VMOp_ZMarkStart;
   }
 
   virtual bool needs_inactive_gc_locker() const {
@@ -198,37 +178,23 @@
   }
 };
 
-class ZMarkEndClosure : public ZOperationClosure {
+class VM_ZMarkEnd : public VM_ZOperation {
 public:
-  virtual const char* name() const {
-    return "ZMarkEnd";
+  virtual VMOp_Type type() const {
+    return VMOp_ZMarkEnd;
   }
 
   virtual bool do_operation() {
     ZStatTimer timer(ZPhasePauseMarkEnd);
     ZServiceabilityMarkEndTracer tracer;
-
     return ZHeap::heap()->mark_end();
   }
 };
 
-class ZVerifyClosure : public ZOperationClosure {
+class VM_ZRelocateStart : public VM_ZOperation {
 public:
-  virtual const char* name() const {
-    return "ZVerify";
-  }
-
-  virtual bool do_operation() {
-    ZStatTimer timer(ZPhasePauseVerify);
-    Universe::verify();
-    return true;
-  }
-};
-
-class ZRelocateStartClosure : public ZOperationClosure {
-public:
-  virtual const char* name() const {
-    return "ZRelocateStart";
+  virtual VMOp_Type type() const {
+    return VMOp_ZRelocateStart;
   }
 
   virtual bool needs_inactive_gc_locker() const {
@@ -238,7 +204,6 @@
   virtual bool do_operation() {
     ZStatTimer timer(ZPhasePauseRelocateStart);
     ZServiceabilityRelocateStartTracer tracer;
-
     ZHeap::heap()->relocate_start();
     return true;
   }
@@ -251,24 +216,6 @@
   create_and_start();
 }
 
-bool ZDriver::vm_operation(ZOperationClosure* cl) {
-  for (;;) {
-    VM_ZOperation op(cl);
-    VMThread::execute(&op);
-    if (op.gc_locked()) {
-      // Wait for GC to become unlocked and restart the VM operation
-      ZStatTimer timer(ZCriticalPhaseGCLockerStall);
-      _gc_locker_port.wait();
-      continue;
-    }
-
-    // Notify VM operation completed
-    _gc_locker_port.ack();
-
-    return op.success();
-  }
-}
-
 void ZDriver::collect(GCCause::Cause cause) {
   switch (cause) {
   case GCCause::_wb_young_gc:
@@ -306,19 +253,96 @@
   }
 }
 
-GCCause::Cause ZDriver::start_gc_cycle() {
-  // Wait for GC request
-  return _gc_cycle_port.receive();
+template <typename T>
+bool ZDriver::pause() {
+  for (;;) {
+    T op;
+    VMThread::execute(&op);
+    if (op.gc_locked()) {
+      // Wait for GC to become unlocked and restart the VM operation
+      ZStatTimer timer(ZCriticalPhaseGCLockerStall);
+      _gc_locker_port.wait();
+      continue;
+    }
+
+    // Notify VM operation completed
+    _gc_locker_port.ack();
+
+    return op.success();
+  }
+}
+
+void ZDriver::pause_mark_start() {
+  pause<VM_ZMarkStart>();
+}
+
+void ZDriver::concurrent_mark() {
+  ZStatTimer timer(ZPhaseConcurrentMark);
+  ZHeap::heap()->mark(true /* initial */);
+}
+
+bool ZDriver::pause_mark_end() {
+  return pause<VM_ZMarkEnd>();
+}
+
+void ZDriver::concurrent_mark_continue() {
+  ZStatTimer timer(ZPhaseConcurrentMarkContinue);
+  ZHeap::heap()->mark(false /* initial */);
+}
+
+void ZDriver::concurrent_process_non_strong_references() {
+  ZStatTimer timer(ZPhaseConcurrentProcessNonStrongReferences);
+  ZHeap::heap()->process_non_strong_references();
 }
 
-class ZDriverCycleScope : public StackObj {
+void ZDriver::concurrent_reset_relocation_set() {
+  ZStatTimer timer(ZPhaseConcurrentResetRelocationSet);
+  ZHeap::heap()->reset_relocation_set();
+}
+
+void ZDriver::concurrent_destroy_detached_pages() {
+  ZStatTimer timer(ZPhaseConcurrentDestroyDetachedPages);
+  ZHeap::heap()->destroy_detached_pages();
+}
+
+void ZDriver::pause_verify() {
+  if (VerifyBeforeGC || VerifyDuringGC || VerifyAfterGC) {
+    VM_Verify op;
+    VMThread::execute(&op);
+  }
+}
+
+void ZDriver::concurrent_select_relocation_set() {
+  ZStatTimer timer(ZPhaseConcurrentSelectRelocationSet);
+  ZHeap::heap()->select_relocation_set();
+}
+
+void ZDriver::concurrent_prepare_relocation_set() {
+  ZStatTimer timer(ZPhaseConcurrentPrepareRelocationSet);
+  ZHeap::heap()->prepare_relocation_set();
+}
+
+void ZDriver::pause_relocate_start() {
+  pause<VM_ZRelocateStart>();
+}
+
+void ZDriver::concurrent_relocate() {
+  ZStatTimer timer(ZPhaseConcurrentRelocated);
+  ZHeap::heap()->relocate();
+}
+
+void ZDriver::check_out_of_memory() {
+  ZHeap::heap()->check_out_of_memory();
+}
+
+class ZDriverGCScope : public StackObj {
 private:
   GCIdMark      _gc_id;
   GCCauseSetter _gc_cause_setter;
   ZStatTimer    _timer;
 
 public:
-  ZDriverCycleScope(GCCause::Cause cause) :
+  ZDriverGCScope(GCCause::Cause cause) :
       _gc_id(),
       _gc_cause_setter(ZCollectedHeap::heap(), cause),
       _timer(ZPhaseCycle) {
@@ -326,7 +350,7 @@
     ZStatCycle::at_start();
   }
 
-  ~ZDriverCycleScope() {
+  ~ZDriverGCScope() {
     // Calculate boost factor
     const double boost_factor = (double)ZHeap::heap()->nconcurrent_worker_threads() /
                                 (double)ZHeap::heap()->nconcurrent_no_boost_worker_threads();
@@ -339,96 +363,63 @@
   }
 };
 
-void ZDriver::run_gc_cycle(GCCause::Cause cause) {
-  ZDriverCycleScope scope(cause);
+void ZDriver::gc(GCCause::Cause cause) {
+  ZDriverGCScope scope(cause);
 
   // Phase 1: Pause Mark Start
-  {
-    ZMarkStartClosure cl;
-    vm_operation(&cl);
-  }
+  pause_mark_start();
 
   // Phase 2: Concurrent Mark
-  {
-    ZStatTimer timer(ZPhaseConcurrentMark);
-    ZHeap::heap()->mark(true /* initial */);
-  }
+  concurrent_mark();
 
   // Phase 3: Pause Mark End
-  {
-    ZMarkEndClosure cl;
-    while (!vm_operation(&cl)) {
-      // Phase 3.5: Concurrent Mark Continue
-      ZStatTimer timer(ZPhaseConcurrentMarkContinue);
-      ZHeap::heap()->mark(false /* initial */);
-    }
+  while (!pause_mark_end()) {
+    // Phase 3.5: Concurrent Mark Continue
+    concurrent_mark_continue();
   }
 
   // Phase 4: Concurrent Process Non-Strong References
-  {
-    ZStatTimer timer(ZPhaseConcurrentProcessNonStrongReferences);
-    ZHeap::heap()->process_non_strong_references();
-  }
+  concurrent_process_non_strong_references();
 
   // Phase 5: Concurrent Reset Relocation Set
-  {
-    ZStatTimer timer(ZPhaseConcurrentResetRelocationSet);
-    ZHeap::heap()->reset_relocation_set();
-  }
+  concurrent_reset_relocation_set();
 
   // Phase 6: Concurrent Destroy Detached Pages
-  {
-    ZStatTimer timer(ZPhaseConcurrentDestroyDetachedPages);
-    ZHeap::heap()->destroy_detached_pages();
-  }
+  concurrent_destroy_detached_pages();
 
   // Phase 7: Pause Verify
-  if (VerifyBeforeGC || VerifyDuringGC || VerifyAfterGC) {
-    ZVerifyClosure cl;
-    vm_operation(&cl);
-  }
+  pause_verify();
 
   // Phase 8: Concurrent Select Relocation Set
-  {
-    ZStatTimer timer(ZPhaseConcurrentSelectRelocationSet);
-    ZHeap::heap()->select_relocation_set();
-  }
+  concurrent_select_relocation_set();
 
   // Phase 9: Concurrent Prepare Relocation Set
-  {
-    ZStatTimer timer(ZPhaseConcurrentPrepareRelocationSet);
-    ZHeap::heap()->prepare_relocation_set();
-  }
+  concurrent_prepare_relocation_set();
 
   // Phase 10: Pause Relocate Start
-  {
-    ZRelocateStartClosure cl;
-    vm_operation(&cl);
-  }
+  pause_relocate_start();
 
   // Phase 11: Concurrent Relocate
-  {
-    ZStatTimer timer(ZPhaseConcurrentRelocated);
-    ZHeap::heap()->relocate();
-  }
-}
-
-void ZDriver::end_gc_cycle() {
-  // Notify GC cycle completed
-  _gc_cycle_port.ack();
-
-  // Check for out of memory condition
-  ZHeap::heap()->check_out_of_memory();
+  concurrent_relocate();
 }
 
 void ZDriver::run_service() {
   // Main loop
   while (!should_terminate()) {
-    const GCCause::Cause cause = start_gc_cycle();
-    if (cause != GCCause::_no_gc) {
-      run_gc_cycle(cause);
-      end_gc_cycle();
+    // Wait for GC request
+    const GCCause::Cause cause = _gc_cycle_port.receive();
+    if (cause == GCCause::_no_gc) {
+      continue;
     }
+
+    // Run GC
+    gc(cause);
+
+    // Notify GC completed
+    _gc_cycle_port.ack();
+
+    // Check for out of memory condition
+    check_out_of_memory();
   }
 }
 
--- a/src/hotspot/share/gc/z/zDriver.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/z/zDriver.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,18 +28,31 @@
 #include "gc/shared/gcCause.hpp"
 #include "gc/z/zMessagePort.hpp"
 
-class ZOperationClosure;
+class VM_ZOperation;
 
 class ZDriver : public ConcurrentGCThread {
 private:
   ZMessagePort<GCCause::Cause> _gc_cycle_port;
   ZRendezvousPort              _gc_locker_port;
 
-  bool vm_operation(ZOperationClosure* cl);
+  template <typename T> bool pause();
 
-  GCCause::Cause start_gc_cycle();
-  void run_gc_cycle(GCCause::Cause cause);
-  void end_gc_cycle();
+  void pause_mark_start();
+  void concurrent_mark();
+  bool pause_mark_end();
+  void concurrent_mark_continue();
+  void concurrent_process_non_strong_references();
+  void concurrent_reset_relocation_set();
+  void concurrent_destroy_detached_pages();
+  void pause_verify();
+  void concurrent_select_relocation_set();
+  void concurrent_prepare_relocation_set();
+  void pause_relocate_start();
+  void concurrent_relocate();
+
+  void check_out_of_memory();
+
+  void gc(GCCause::Cause cause);
 
 protected:
   virtual void run_service();
--- a/src/hotspot/share/gc/z/zFuture.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/z/zFuture.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 #define SHARE_GC_Z_ZFUTURE_INLINE_HPP
 
 #include "gc/z/zFuture.hpp"
-#include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/semaphore.inline.hpp"
 #include "runtime/thread.hpp"
 
--- a/src/hotspot/share/gc/z/zReferenceProcessor.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/z/zReferenceProcessor.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -39,45 +39,11 @@
 static const ZStatSubPhase ZSubPhaseConcurrentReferencesProcess("Concurrent References Process");
 static const ZStatSubPhase ZSubPhaseConcurrentReferencesEnqueue("Concurrent References Enqueue");
 
-ZReferenceProcessor::ZReferenceProcessor(ZWorkers* workers) :
-    _workers(workers),
-    _soft_reference_policy(NULL),
-    _encountered_count(),
-    _discovered_count(),
-    _enqueued_count(),
-    _discovered_list(NULL),
-    _pending_list(NULL),
-    _pending_list_tail(_pending_list.addr()) {}
-
-void ZReferenceProcessor::set_soft_reference_policy(bool clear) {
-  static AlwaysClearPolicy always_clear_policy;
-  static LRUMaxHeapPolicy lru_max_heap_policy;
-
-  if (clear) {
-    log_info(gc, ref)("Clearing All Soft References");
-    _soft_reference_policy = &always_clear_policy;
-  } else {
-    _soft_reference_policy = &lru_max_heap_policy;
-  }
-
-  _soft_reference_policy->setup();
+static ReferenceType reference_type(oop reference) {
+  return InstanceKlass::cast(reference->klass())->reference_type();
 }
 
-void ZReferenceProcessor::update_soft_reference_clock() const {
-  const jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
-  java_lang_ref_SoftReference::set_clock(now);
-}
-
-bool ZReferenceProcessor::is_inactive_final_reference(oop obj, ReferenceType type) const {
-  // A non-null next field for a FinalReference means the reference is inactive.
-  return (type == REF_FINAL) && (java_lang_ref_Reference::next(obj) != NULL);
-}
-
-ReferenceType ZReferenceProcessor::reference_type(oop obj) const {
-  return InstanceKlass::cast(obj->klass())->reference_type();
-}
-
-const char* ZReferenceProcessor::reference_type_name(ReferenceType type) const {
+static const char* reference_type_name(ReferenceType type) {
   switch (type) {
   case REF_SOFT:
     return "Soft";
@@ -97,53 +63,134 @@
   }
 }
 
-volatile oop* ZReferenceProcessor::reference_referent_addr(oop obj) const {
-  return (volatile oop*)java_lang_ref_Reference::referent_addr_raw(obj);
+static volatile oop* reference_referent_addr(oop reference) {
+  return (volatile oop*)java_lang_ref_Reference::referent_addr_raw(reference);
+}
+
+static oop reference_referent(oop reference) {
+  return *reference_referent_addr(reference);
+}
+
+static void reference_set_referent(oop reference, oop referent) {
+  java_lang_ref_Reference::set_referent_raw(reference, referent);
+}
+
+static oop* reference_discovered_addr(oop reference) {
+  return (oop*)java_lang_ref_Reference::discovered_addr_raw(reference);
+}
+
+static oop reference_discovered(oop reference) {
+  return *reference_discovered_addr(reference);
+}
+
+static void reference_set_discovered(oop reference, oop discovered) {
+  java_lang_ref_Reference::set_discovered_raw(reference, discovered);
+}
+
+static oop* reference_next_addr(oop reference) {
+  return (oop*)java_lang_ref_Reference::next_addr_raw(reference);
+}
+
+static oop reference_next(oop reference) {
+  return *reference_next_addr(reference);
+}
+
+static void reference_set_next(oop reference, oop next) {
+  java_lang_ref_Reference::set_next_raw(reference, next);
+}
+
+static void soft_reference_update_clock() {
+  const jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
+  java_lang_ref_SoftReference::set_clock(now);
 }
 
-oop ZReferenceProcessor::reference_referent(oop obj) const {
-  return *reference_referent_addr(obj);
+ZReferenceProcessor::ZReferenceProcessor(ZWorkers* workers) :
+    _workers(workers),
+    _soft_reference_policy(NULL),
+    _encountered_count(),
+    _discovered_count(),
+    _enqueued_count(),
+    _discovered_list(NULL),
+    _pending_list(NULL),
+    _pending_list_tail(_pending_list.addr()) {}
+
+void ZReferenceProcessor::set_soft_reference_policy(bool clear) {
+  static AlwaysClearPolicy always_clear_policy;
+  static LRUMaxHeapPolicy lru_max_heap_policy;
+
+  if (clear) {
+    log_info(gc, ref)("Clearing All SoftReferences");
+    _soft_reference_policy = &always_clear_policy;
+  } else {
+    _soft_reference_policy = &lru_max_heap_policy;
+  }
+
+  _soft_reference_policy->setup();
 }
 
-bool ZReferenceProcessor::is_referent_strongly_alive_or_null(oop obj, ReferenceType type) const {
-  // Check if the referent is strongly alive or null, in which case we don't want to
-  // discover the reference. It can only be null if the application called
-  // Reference.enqueue() or Reference.clear().
-  //
+bool ZReferenceProcessor::is_inactive(oop reference, oop referent, ReferenceType type) const {
+  if (type == REF_FINAL) {
+    // A FinalReference is inactive if its next field is non-null. An application can't
+    // call enqueue() or clear() on a FinalReference.
+    return reference_next(reference) != NULL;
+  } else {
+    // A non-FinalReference is inactive if the referent is null. The referent can only
+    // be null if the application called Reference.enqueue() or Reference.clear().
+    return referent == NULL;
+  }
+}
+
+bool ZReferenceProcessor::is_strongly_live(oop referent) const {
+  return ZHeap::heap()->is_object_strongly_live(ZOop::to_address(referent));
+}
+
+bool ZReferenceProcessor::is_softly_live(oop reference, ReferenceType type) const {
+  if (type != REF_SOFT) {
+    // Not a SoftReference
+    return false;
+  }
+
+  // Ask SoftReference policy
+  const jlong clock = java_lang_ref_SoftReference::clock();
+  assert(clock != 0, "Clock not initialized");
+  assert(_soft_reference_policy != NULL, "Policy not initialized");
+  return !_soft_reference_policy->should_clear_reference(reference, clock);
+}
+
+bool ZReferenceProcessor::should_discover(oop reference, ReferenceType type) const {
+  volatile oop* const referent_addr = reference_referent_addr(reference);
+  const oop referent = ZBarrier::weak_load_barrier_on_oop_field(referent_addr);
+
+  if (is_inactive(reference, referent, type)) {
+    return false;
+  }
+
+  if (is_strongly_live(referent)) {
+    return false;
+  }
+
+  if (is_softly_live(reference, type)) {
+    return false;
+  }
+
   // PhantomReferences with finalizable marked referents should technically not have
   // to be discovered. However, InstanceRefKlass::oop_oop_iterate_ref_processing()
   // does not know about the finalizable mark concept, and will therefore mark
   // referents in non-discovered PhantomReferences as strongly live. To prevent
   // this, we always discover PhantomReferences with finalizable marked referents.
   // They will automatically be dropped during the reference processing phase.
-
-  volatile oop* const p = reference_referent_addr(obj);
-  const oop o = ZBarrier::weak_load_barrier_on_oop_field(p);
-  return o == NULL || ZHeap::heap()->is_object_strongly_live(ZOop::to_address(o));
+  return true;
 }
 
-bool ZReferenceProcessor::is_referent_softly_alive(oop obj, ReferenceType type) const {
-  if (type != REF_SOFT) {
-    // Not a soft reference
-    return false;
-  }
-
-  // Ask soft reference policy
-  const jlong clock = java_lang_ref_SoftReference::clock();
-  assert(clock != 0, "Clock not initialized");
-  assert(_soft_reference_policy != NULL, "Policy not initialized");
-  return !_soft_reference_policy->should_clear_reference(obj, clock);
-}
-
-bool ZReferenceProcessor::should_drop_reference(oop obj, ReferenceType type) const {
+bool ZReferenceProcessor::should_drop(oop reference, ReferenceType type) const {
   // This check is racing with a call to Reference.clear() from the application.
   // If the application clears the reference after this check it will still end
   // up on the pending list, and there's nothing we can do about that without
   // changing the Reference.clear() API. This check is also racing with a call
   // to Reference.enqueue() from the application, which is unproblematic, since
   // the application wants the reference to be enqueued anyway.
-  const oop o = reference_referent(obj);
-  if (o == NULL) {
+  const oop referent = reference_referent(reference);
+  if (referent == NULL) {
     // Reference has been cleared, by a call to Reference.enqueue()
     // or Reference.clear() from the application, which means we
     // should drop the reference.
@@ -153,22 +200,14 @@
   // Check if the referent is still alive, in which case we should
   // drop the reference.
   if (type == REF_PHANTOM) {
-    return ZBarrier::is_alive_barrier_on_phantom_oop(o);
+    return ZBarrier::is_alive_barrier_on_phantom_oop(referent);
   } else {
-    return ZBarrier::is_alive_barrier_on_weak_oop(o);
+    return ZBarrier::is_alive_barrier_on_weak_oop(referent);
   }
 }
 
-bool ZReferenceProcessor::should_mark_referent(ReferenceType type) const {
-  // Referents of final references (and its reachable sub graph) are
-  // always marked finalizable during discovery. This avoids the problem
-  // of later having to mark those objects if the referent is still final
-  // reachable during processing.
-  return type == REF_FINAL;
-}
-
-void ZReferenceProcessor::keep_referent_alive(oop obj, ReferenceType type) const {
-  volatile oop* const p = reference_referent_addr(obj);
+void ZReferenceProcessor::keep_alive(oop reference, ReferenceType type) const {
+  volatile oop* const p = reference_referent_addr(reference);
   if (type == REF_PHANTOM) {
     ZBarrier::keep_alive_barrier_on_phantom_oop_field(p);
   } else {
@@ -176,82 +215,86 @@
   }
 }
 
-bool ZReferenceProcessor::discover_reference(oop obj, ReferenceType type) {
+void ZReferenceProcessor::make_inactive(oop reference, ReferenceType type) const {
+  if (type == REF_FINAL) {
+    // Don't clear referent. It is needed by the Finalizer thread to make the call
+    // to finalize(). A FinalReference is instead made inactive by self-looping the
+    // next field. An application can't call FinalReference.enqueue(), so there is
+    // no race to worry about when setting the next field.
+    assert(reference_next(reference) == NULL, "Already inactive");
+    reference_set_next(reference, reference);
+  } else {
+    // Clear referent
+    reference_set_referent(reference, NULL);
+  }
+}
+
+void ZReferenceProcessor::discover(oop reference, ReferenceType type) {
+  log_trace(gc, ref)("Discovered Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type));
+
+  // Update statistics
+  _discovered_count.get()[type]++;
+
+  if (type == REF_FINAL) {
+    // Mark referent (and its reachable subgraph) finalizable. This avoids
+    // the problem of later having to mark those objects if the referent is
+    // still final reachable during processing.
+    volatile oop* const referent_addr = reference_referent_addr(reference);
+    ZBarrier::mark_barrier_on_oop_field(referent_addr, true /* finalizable */);
+  }
+
+  // Add reference to discovered list
+  assert(reference_discovered(reference) == NULL, "Already discovered");
+  oop* const list = _discovered_list.addr();
+  reference_set_discovered(reference, *list);
+  *list = reference;
+}
+
+bool ZReferenceProcessor::discover_reference(oop reference, ReferenceType type) {
   if (!RegisterReferences) {
     // Reference processing disabled
     return false;
   }
 
-  log_trace(gc, ref)("Encountered Reference: " PTR_FORMAT " (%s)", p2i(obj), reference_type_name(type));
+  log_trace(gc, ref)("Encountered Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type));
 
   // Update statistics
   _encountered_count.get()[type]++;
 
-  if (is_referent_strongly_alive_or_null(obj, type) ||
-      is_inactive_final_reference(obj, type) ||
-      is_referent_softly_alive(obj, type)) {
+  if (!should_discover(reference, type)) {
     // Not discovered
     return false;
   }
 
-  discover(obj, type);
+  discover(reference, type);
 
   // Discovered
   return true;
 }
 
-void ZReferenceProcessor::discover(oop obj, ReferenceType type) {
-  log_trace(gc, ref)("Discovered Reference: " PTR_FORMAT " (%s)", p2i(obj), reference_type_name(type));
-
-  // Update statistics
-  _discovered_count.get()[type]++;
-
-  // Mark referent finalizable
-  if (should_mark_referent(type)) {
-    oop* const referent_addr = (oop*)java_lang_ref_Reference::referent_addr_raw(obj);
-    ZBarrier::mark_barrier_on_oop_field(referent_addr, true /* finalizable */);
-  }
-
-  // Add reference to discovered list
-  assert(java_lang_ref_Reference::discovered(obj) == NULL, "Already discovered");
-  oop* const list = _discovered_list.addr();
-  java_lang_ref_Reference::set_discovered(obj, *list);
-  *list = obj;
-}
-
-oop ZReferenceProcessor::drop(oop obj, ReferenceType type) {
-  log_trace(gc, ref)("Dropped Reference: " PTR_FORMAT " (%s)", p2i(obj), reference_type_name(type));
+oop ZReferenceProcessor::drop(oop reference, ReferenceType type) {
+  log_trace(gc, ref)("Dropped Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type));
 
   // Keep referent alive
-  keep_referent_alive(obj, type);
+  keep_alive(reference, type);
 
   // Unlink and return next in list
-  const oop next = java_lang_ref_Reference::discovered(obj);
-  java_lang_ref_Reference::set_discovered(obj, NULL);
+  const oop next = reference_discovered(reference);
+  reference_set_discovered(reference, NULL);
   return next;
 }
 
-oop* ZReferenceProcessor::keep(oop obj, ReferenceType type) {
-  log_trace(gc, ref)("Enqueued Reference: " PTR_FORMAT " (%s)", p2i(obj), reference_type_name(type));
+oop* ZReferenceProcessor::keep(oop reference, ReferenceType type) {
+  log_trace(gc, ref)("Enqueued Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type));
 
   // Update statistics
   _enqueued_count.get()[type]++;
 
-  if (type != REF_FINAL) {
-    // Clear referent
-    java_lang_ref_Reference::set_referent(obj, NULL);
-  } else {
-    // For a FinalReference, don't clear the referent, because it is
-    // needed for the finalize call.  Instead, make the reference
-    // inactive by self-looping the 'next' field.  FinalReference
-    // doesn't allow Reference.enqueue, so there's no race to worry
-    // about when setting 'next'.
-    assert(java_lang_ref_Reference::next(obj) == NULL, "enqueued FinalReference");
-    java_lang_ref_Reference::set_next_raw(obj, obj);
-  }
+  // Make reference inactive
+  make_inactive(reference, type);
 
   // Return next in list
-  return (oop*)java_lang_ref_Reference::discovered_addr_raw(obj);
+  return reference_discovered_addr(reference);
 }
 
 void ZReferenceProcessor::work() {
@@ -260,13 +303,13 @@
   oop* p = list;
 
   while (*p != NULL) {
-    const oop obj = *p;
-    const ReferenceType type = reference_type(obj);
+    const oop reference = *p;
+    const ReferenceType type = reference_type(reference);
 
-    if (should_drop_reference(obj, type)) {
-      *p = drop(obj, type);
+    if (should_drop(reference, type)) {
+      *p = drop(reference, type);
     } else {
-      p = keep(obj, type);
+      p = keep(reference, type);
     }
   }
 
@@ -390,8 +433,8 @@
   ZReferenceProcessorTask task(this);
   _workers->run_concurrent(&task);
 
-  // Update soft reference clock
-  update_soft_reference_clock();
+  // Update SoftReference clock
+  soft_reference_update_clock();
 
   // Collect, log and trace statistics
   collect_statistics();
--- a/src/hotspot/share/gc/z/zReferenceProcessor.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/z/zReferenceProcessor.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -46,22 +46,19 @@
   ZContended<oop>      _pending_list;
   oop*                 _pending_list_tail;
 
-  void update_soft_reference_clock() const;
+  bool is_inactive(oop reference, oop referent, ReferenceType type) const;
+  bool is_strongly_live(oop referent) const;
+  bool is_softly_live(oop reference, ReferenceType type) const;
 
-  ReferenceType reference_type(oop obj) const;
-  const char* reference_type_name(ReferenceType type) const;
-  volatile oop* reference_referent_addr(oop obj) const;
-  oop reference_referent(oop obj) const;
-  bool is_inactive_final_reference(oop obj, ReferenceType type) const;
-  bool is_referent_strongly_alive_or_null(oop obj, ReferenceType type) const;
-  bool is_referent_softly_alive(oop obj, ReferenceType type) const;
-  bool should_drop_reference(oop obj, ReferenceType type) const;
-  bool should_mark_referent(ReferenceType type) const;
-  void keep_referent_alive(oop obj, ReferenceType type) const;
+  bool should_discover(oop reference, ReferenceType type) const;
+  bool should_drop(oop reference, ReferenceType type) const;
+  void keep_alive(oop reference, ReferenceType type) const;
+  void make_inactive(oop reference, ReferenceType type) const;
 
-  void discover(oop obj, ReferenceType type);
-  oop drop(oop obj, ReferenceType type);
-  oop* keep(oop obj, ReferenceType type);
+  void discover(oop reference, ReferenceType type);
+
+  oop drop(oop reference, ReferenceType type);
+  oop* keep(oop reference, ReferenceType type);
 
   bool is_empty() const;
 
--- a/src/hotspot/share/gc/z/zServiceability.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/gc/z/zServiceability.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #define SHARE_GC_Z_ZSERVICEABILITY_HPP
 
 #include "gc/shared/collectorCounters.hpp"
+#include "gc/shared/gcVMOperations.hpp"
 #include "memory/allocation.hpp"
 #include "services/memoryManager.hpp"
 #include "services/memoryPool.hpp"
@@ -88,12 +89,14 @@
 template <bool IsGCStart, bool IsGCEnd>
 class ZServiceabilityTracer : public StackObj {
 private:
+  SvcGCMarker                       _svc_gc_marker;
   ZServiceabilityMemoryUsageTracker _memory_usage_tracker;
   ZServiceabilityManagerStatsTracer _manager_stats_tracer;
   ZServiceabilityCountersTracer     _counters_tracer;
 
 public:
   ZServiceabilityTracer() :
+      _svc_gc_marker(SvcGCMarker::CONCURRENT),
       _memory_usage_tracker(),
       _manager_stats_tracer(IsGCStart, IsGCEnd),
       _counters_tracer() {}
--- a/src/hotspot/share/interpreter/bytecodeStream.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/interpreter/bytecodeStream.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -211,7 +211,6 @@
     return _code;
   }
 
-  bool            is_active_breakpoint() const   { return Bytecodes::is_active_breakpoint_at(bcp()); }
   Bytecodes::Code code() const                   { return _code; }
 
   // Unsigned indices, widening
--- a/src/hotspot/share/interpreter/bytecodeTracer.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/interpreter/bytecodeTracer.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, 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
@@ -225,7 +225,6 @@
   int ilimit = constants->length();
   Bytecodes::Code code = raw_code();
 
-  ConstantPoolCache* cache = NULL;
   if (Bytecodes::uses_cp_cache(code)) {
     bool okay = true;
     switch (code) {
@@ -256,8 +255,7 @@
 
 bool BytecodePrinter::check_cp_cache_index(int i, int& cp_index, outputStream* st) {
   ConstantPool* constants = method()->constants();
-  int ilimit = constants->length(), climit = 0;
-  Bytecodes::Code code = raw_code();
+  int climit = 0;
 
   ConstantPoolCache* cache = constants->cache();
   // If rewriter hasn't run, the index is the cp_index
@@ -307,7 +305,6 @@
 
 
 bool BytecodePrinter::check_invokedynamic_index(int i, int& cp_index, outputStream* st) {
-  ConstantPool* constants = method()->constants();
   assert(ConstantPool::is_invokedynamic_index(i), "not secondary index?");
   i = ConstantPool::decode_invokedynamic_index(i) + ConstantPool::CPCACHE_INDEX_TAG;
 
--- a/src/hotspot/share/interpreter/bytecodes.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/interpreter/bytecodes.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -380,7 +380,6 @@
   static Code       code_or_bp_at(address bcp)    { return (Code)cast(*bcp); }
 
   static Code       code_at(Method* method, int bci);
-  static bool       is_active_breakpoint_at(address bcp) { return (Code)*bcp == _breakpoint; }
 
   // find a bytecode, behind a breakpoint if necessary:
   static Code       non_breakpoint_code_at(const Method* method, address bcp);
@@ -405,18 +404,12 @@
   // if 'end' is provided, it indicates the end of the code buffer which
   // should not be read past when parsing.
   static int         special_length_at(Bytecodes::Code code, address bcp, address end = NULL);
-  static int         special_length_at(Method* method, address bcp, address end = NULL) { return special_length_at(code_at(method, bcp), bcp, end); }
   static int         raw_special_length_at(address bcp, address end = NULL);
   static int         length_for_code_at(Bytecodes::Code code, address bcp)  { int l = length_for(code); return l > 0 ? l : special_length_at(code, bcp); }
   static int         length_at      (Method* method, address bcp)  { return length_for_code_at(code_at(method, bcp), bcp); }
   static int         java_length_at (Method* method, address bcp)  { return length_for_code_at(java_code_at(method, bcp), bcp); }
   static bool        is_java_code   (Code code)    { return 0 <= code && code < number_of_java_codes; }
 
-  static bool        is_aload       (Code code)    { return (code == _aload  || code == _aload_0  || code == _aload_1
-                                                                             || code == _aload_2  || code == _aload_3); }
-  static bool        is_astore      (Code code)    { return (code == _astore || code == _astore_0 || code == _astore_1
-                                                                             || code == _astore_2 || code == _astore_3); }
-
   static bool        is_store_into_local(Code code){ return (_istore <= code && code <= _astore_3); }
   static bool        is_const       (Code code)    { return (_aconst_null <= code && code <= _ldc2_w); }
   static bool        is_zero_const  (Code code)    { return (code == _aconst_null || code == _iconst_0
@@ -433,7 +426,6 @@
     assert(code == (u_char)code, "must be a byte");
     return _flags[code + (is_wide ? (1<<BitsPerByte) : 0)];
   }
-  static int         format_bits    (Code code, bool is_wide) { return flags(code, is_wide) & _all_fmt_bits; }
   static bool        has_all_flags  (Code code, int test_flags, bool is_wide) {
     return (flags(code, is_wide) & test_flags) == test_flags;
   }
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -135,11 +135,6 @@
   frame& get_frame()                             { return _last_frame; }
 };
 
-
-bool InterpreterRuntime::is_breakpoint(JavaThread *thread) {
-  return Bytecodes::code_or_bp_at(LastFrameAccessor(thread).bcp()) == Bytecodes::_breakpoint;
-}
-
 //------------------------------------------------------------------------------------------------------------------------
 // State accessors
 
--- a/src/hotspot/share/interpreter/interpreterRuntime.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/interpreter/interpreterRuntime.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -126,7 +126,6 @@
   static void _breakpoint(JavaThread* thread, Method* method, address bcp);
   static Bytecodes::Code get_original_bytecode_at(JavaThread* thread, Method* method, address bcp);
   static void            set_original_bytecode_at(JavaThread* thread, Method* method, address bcp, Bytecodes::Code new_code);
-  static bool is_breakpoint(JavaThread *thread);
 
   // Safepoints
   static void    at_safepoint(JavaThread* thread);
--- a/src/hotspot/share/interpreter/invocationCounter.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/interpreter/invocationCounter.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -78,10 +78,11 @@
 
 int                       InvocationCounter::_init  [InvocationCounter::number_of_states];
 InvocationCounter::Action InvocationCounter::_action[InvocationCounter::number_of_states];
+
+#ifdef CC_INTERP
 int                       InvocationCounter::InterpreterInvocationLimit;
 int                       InvocationCounter::InterpreterBackwardBranchLimit;
-int                       InvocationCounter::InterpreterProfileLimit;
-
+#endif
 
 const char* InvocationCounter::state_as_string(State state) {
   switch (state) {
@@ -136,8 +137,8 @@
   def(wait_for_nothing, 0, do_nothing);
   def(wait_for_compile, 0, do_decay);
 
+#ifdef CC_INTERP
   InterpreterInvocationLimit = CompileThreshold << number_of_noncount_bits;
-  InterpreterProfileLimit = ((CompileThreshold * InterpreterProfilePercentage) / 100)<< number_of_noncount_bits;
 
   // When methodData is collected, the backward branch limit is compared against a
   // methodData counter, rather than an InvocationCounter.  In the former case, we
@@ -149,12 +150,8 @@
     InterpreterBackwardBranchLimit = (int)(((int64_t)CompileThreshold * OnStackReplacePercentage / 100) << number_of_noncount_bits);
   }
 
-  assert(0 <= InterpreterBackwardBranchLimit,
-         "OSR threshold should be non-negative");
-  assert(0 <= InterpreterProfileLimit &&
-         InterpreterProfileLimit <= InterpreterInvocationLimit,
-         "profile threshold should be less than the compilation threshold "
-         "and non-negative");
+  assert(0 <= InterpreterBackwardBranchLimit, "OSR threshold should be non-negative");
+#endif
 }
 
 void invocationCounter_init() {
--- a/src/hotspot/share/interpreter/invocationCounter.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/interpreter/invocationCounter.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -57,10 +57,6 @@
   };
 
  public:
-  static int InterpreterInvocationLimit;        // CompileThreshold scaled for interpreter use
-  static int InterpreterBackwardBranchLimit;    // A separate threshold for on stack replacement
-  static int InterpreterProfileLimit;           // Profiling threshold scaled for interpreter use
-
   typedef address (*Action)(const methodHandle& method, TRAPS);
 
   enum PublicConstants {
@@ -95,11 +91,10 @@
   Action action() const                          { return _action[state()]; }
   int    count() const                           { return _counter >> number_of_noncount_bits; }
 
-  int   get_InvocationLimit() const              { return InterpreterInvocationLimit >> number_of_noncount_bits; }
-  int   get_BackwardBranchLimit() const          { return InterpreterBackwardBranchLimit >> number_of_noncount_bits; }
-  int   get_ProfileLimit() const                 { return InterpreterProfileLimit >> number_of_noncount_bits; }
+#ifdef CC_INTERP
+  static int InterpreterInvocationLimit;        // CompileThreshold scaled for interpreter use
+  static int InterpreterBackwardBranchLimit;    // A separate threshold for on stack replacement
 
-#ifdef CC_INTERP
   // Test counter using scaled limits like the asm interpreter would do rather than doing
   // the shifts to normalize the counter.
   // Checks sum of invocation_counter and backedge_counter as the template interpreter does.
@@ -111,11 +106,6 @@
     return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >=
            (unsigned int) InterpreterBackwardBranchLimit;
   }
-  // Do this just like asm interpreter does for max speed.
-  bool reached_ProfileLimit(InvocationCounter *back_edge_count) const {
-    return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >=
-           (unsigned int) InterpreterProfileLimit;
-  }
 #endif // CC_INTERP
 
   void increment()                               { _counter += count_increment; }
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 #include "jfr/jni/jfrJavaSupport.hpp"
 #include "jfr/recorder/repository/jfrChunkRotation.hpp"
 #include "jfr/recorder/repository/jfrChunkWriter.hpp"
+#include "runtime/handles.inline.hpp"
 
 static jobject chunk_monitor = NULL;
 static intptr_t threshold = 0;
--- a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -31,7 +31,7 @@
 #include "jfr/utilities/jfrTypes.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/atomic.hpp"
-#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/thread.hpp"
--- a/src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
-#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
 #include "runtime/thread.inline.hpp"
 
--- a/src/hotspot/share/jvmci/compilerRuntime.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/jvmci/compilerRuntime.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -22,6 +22,7 @@
  */
 
 #include "precompiled.hpp"
+#include "aot/aotLoader.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/symbolTable.hpp"
 #include "interpreter/linkResolver.hpp"
@@ -29,12 +30,12 @@
 #include "oops/cpCache.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/compilationPolicy.hpp"
+#include "runtime/deoptimization.hpp"
 #include "runtime/frame.inline.hpp"
-#include "runtime/deoptimization.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/vframe.inline.hpp"
 #include "utilities/sizes.hpp"
-#include "aot/aotLoader.hpp"
 
 // Resolve and allocate String
 JRT_BLOCK_ENTRY(void, CompilerRuntime::resolve_string_by_symbol(JavaThread *thread, void* string_result, const char* name))
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 #include "oops/oop.inline.hpp"
 #include "oops/objArrayOop.inline.hpp"
 #include "oops/typeArrayOop.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.inline.hpp"
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
 #include "runtime/fieldDescriptor.inline.hpp"
 #include "runtime/flags/jvmFlag.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
 #include "runtime/timerTrace.hpp"
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
 #include "oops/objArrayOop.inline.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
 #include "runtime/reflection.hpp"
--- a/src/hotspot/share/libadt/set.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/libadt/set.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, 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
@@ -35,22 +35,8 @@
 
 //-------------------------Virtual Functions-----------------------------------
 // These functions MUST be implemented by the inheriting class.
-class SparseSet;
-/* Removed for MCC BUG
-   Set::operator const SparseSet*() const { assert(0); return NULL; } */
-const SparseSet *Set::asSparseSet() const { assert(0); return NULL; }
 class VectorSet;
-/* Removed for MCC BUG
-   Set::operator const VectorSet*() const { assert(0); return NULL; } */
 const VectorSet *Set::asVectorSet() const { assert(0); return NULL; }
-class ListSet;
-/* Removed for MCC BUG
-   Set::operator const ListSet*() const { assert(0); return NULL; } */
-const ListSet *Set::asListSet() const { assert(0); return NULL; }
-class CoSet;
-/* Removed for MCC BUG
-   Set::operator const CoSet*() const { assert(0); return NULL; } */
-const CoSet *Set::asCoSet() const { assert(0); return NULL; }
 
 //------------------------------setstr-----------------------------------------
 // Create a string with a printable representation of a set.
--- a/src/hotspot/share/libadt/set.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/libadt/set.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -164,9 +164,6 @@
   virtual int operator <=(const Set &s) const=0;
   int operator >=(const Set &s) const { return s <= *this; }
 
-  // Return any member of the Set.  Undefined if the Set is empty.
-  virtual uint getelem(void) const=0;
-
   // Clear all the elements in the Set
   virtual void Clear(void)=0;
 
@@ -188,15 +185,7 @@
   virtual int parse(const char *s);
 
   // Convert a generic Set to a specific Set
-  /* Removed for MCC BUG
-     virtual operator const SparseSet* (void) const;
-     virtual operator const VectorSet* (void) const;
-     virtual operator const ListSet  * (void) const;
-     virtual operator const CoSet    * (void) const; */
-  virtual const SparseSet *asSparseSet(void) const;
   virtual const VectorSet *asVectorSet(void) const;
-  virtual const ListSet   *asListSet  (void) const;
-  virtual const CoSet     *asCoSet    (void) const;
 
   // Hash the set.  Sets of different types but identical elements will NOT
   // hash the same.  Same set type, same elements WILL hash the same.
@@ -204,16 +193,11 @@
 
 protected:
   friend class SetI;
-  friend class CoSet;
   virtual class SetI_ *iterate(uint&) const=0;
 
   // Need storeage for the set
   Arena *_set_arena;
 };
-typedef Set&((*Set_Constructor)(Arena *arena));
-extern Set &ListSet_Construct(Arena *arena);
-extern Set &VectorSet_Construct(Arena *arena);
-extern Set &SparseSet_Construct(Arena *arena);
 
 //------------------------------Iteration--------------------------------------
 // Loop thru all elements of the set, setting "elem" to the element numbers
--- a/src/hotspot/share/libadt/vectset.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/libadt/vectset.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, 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
@@ -60,12 +60,6 @@
   data[1] = 0;
 }
 
-//------------------------------Construct--------------------------------------
-Set &VectorSet_Construct(Arena *arena)
-{
-  return *(new VectorSet(arena));
-}
-
 //------------------------------operator=--------------------------------------
 Set &VectorSet::operator = (const Set &set)
 {
@@ -293,20 +287,6 @@
   return ((data[word] & mask))!=0;    // Return the sense of the bit
 }
 
-//------------------------------getelem----------------------------------------
-// Get any element from the set.
-uint VectorSet::getelem(void) const
-{
-  uint i;                       // Exit value of loop
-  for( i=0; i<size; i++ )
-    if( data[i] )
-      break;
-  uint32_t word = data[i];
-  int j;                        // Exit value of loop
-  for( j= -1; word; j++, word>>=1 );
-  return (i<<5)+j;
-}
-
 //------------------------------Clear------------------------------------------
 // Clear a set
 void VectorSet::Clear(void)
--- a/src/hotspot/share/libadt/vectset.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/libadt/vectset.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -95,7 +95,6 @@
   int disjoint   (const Set       &s) const;  // True if sets are disjoint
 
   int operator [](uint elem) const; // Test for membership
-  uint getelem(void) const;         // Return a random element
   void Clear(void);                 // Clear a set
   uint Size(void) const;            // Number of elements in the Set.
   void Sort(void);                  // Sort before iterating
--- a/src/hotspot/share/logging/logPrefix.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/logging/logPrefix.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -79,7 +79,6 @@
   LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ref, start)) \
   LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, reloc)) \
   LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, start)) \
-  LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, stringtable)) \
   LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, symboltable)) \
   LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, sweep)) \
   LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task)) \
--- a/src/hotspot/share/memory/binaryTreeDictionary.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/binaryTreeDictionary.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -120,7 +120,6 @@
   // node to point to the new node.
   TreeList<Chunk_t, FreeList_t>* remove_chunk_replace_if_needed(TreeChunk<Chunk_t, FreeList_t>* tc);
   // See FreeList.
-  void return_chunk_at_head(TreeChunk<Chunk_t, FreeList_t>* tc);
   void return_chunk_at_tail(TreeChunk<Chunk_t, FreeList_t>* tc);
 };
 
@@ -236,7 +235,6 @@
   size_t     num_free_blocks()  const;
   size_t     tree_height() const;
   size_t     tree_height_helper(TreeList<Chunk_t, FreeList_t>* tl) const;
-  size_t     total_nodes_in_tree(TreeList<Chunk_t, FreeList_t>* tl) const;
   size_t     total_nodes_helper(TreeList<Chunk_t, FreeList_t>* tl) const;
 
  public:
--- a/src/hotspot/share/memory/binaryTreeDictionary.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/binaryTreeDictionary.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -245,35 +245,6 @@
   assert(tail() == NULL || tail()->next() == NULL, "list invariant");
 }
 
-// Add this chunk at the head of the list.  "At the head of the list"
-// is defined to be after the chunk pointer to by head().  This is
-// because the TreeList<Chunk_t, FreeList_t> is embedded in the first TreeChunk<Chunk_t, FreeList_t> in the
-// list.  See the definition of TreeChunk<Chunk_t, FreeList_t>.
-template <class Chunk_t, class FreeList_t>
-void TreeList<Chunk_t, FreeList_t>::return_chunk_at_head(TreeChunk<Chunk_t, FreeList_t>* chunk) {
-  assert(chunk->list() == this, "list should be set for chunk");
-  assert(head() != NULL, "The tree list is embedded in the first chunk");
-  assert(chunk != NULL, "returning NULL chunk");
-  // This is expensive for metaspace
-  assert(!FLSVerifyDictionary || !this->verify_chunk_in_free_list(chunk), "Double entry");
-  assert(head() == NULL || head()->prev() == NULL, "list invariant");
-  assert(tail() == NULL || tail()->next() == NULL, "list invariant");
-
-  Chunk_t* fc = head()->next();
-  if (fc != NULL) {
-    chunk->link_after(fc);
-  } else {
-    assert(tail() == NULL, "List is inconsistent");
-    this->link_tail(chunk);
-  }
-  head()->link_after(chunk);
-  assert(!head() || size() == head()->size(), "Wrong sized chunk in list");
-  FreeList_t::increment_count();
-  debug_only(this->increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));)
-  assert(head() == NULL || head()->prev() == NULL, "list invariant");
-  assert(tail() == NULL || tail()->next() == NULL, "list invariant");
-}
-
 template <class Chunk_t, class FreeList_t>
 void TreeChunk<Chunk_t, FreeList_t>::assert_is_mangled() const {
   assert((ZapUnusedHeapArea &&
@@ -799,11 +770,6 @@
     total_nodes_helper(tl->right());
 }
 
-template <class Chunk_t, class FreeList_t>
-size_t BinaryTreeDictionary<Chunk_t, FreeList_t>::total_nodes_in_tree(TreeList<Chunk_t, FreeList_t>* tl) const {
-  return total_nodes_helper(root());
-}
-
 // Searches the tree for a chunk that ends at the
 // specified address.
 template <class Chunk_t, class FreeList_t>
--- a/src/hotspot/share/memory/heapShared.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/heapShared.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -191,9 +191,6 @@
   static void verify_subgraph_from(oop orig_obj) PRODUCT_RETURN;
 
   static KlassSubGraphInfo* get_subgraph_info(Klass *k);
-  static int num_of_subgraph_infos();
-
-  static void build_archived_subgraph_info_records(int num_records);
 
   static void init_subgraph_entry_fields(ArchivableStaticFieldInfo fields[],
                                          int num, Thread* THREAD);
@@ -321,10 +318,6 @@
 
   inline static bool is_archived_object(oop p) NOT_CDS_JAVA_HEAP_RETURN_(false);
 
-  static void archive_java_heap_objects() NOT_CDS_JAVA_HEAP_RETURN;
-
-  static char* read_archived_subgraph_infos(char* buffer) NOT_CDS_JAVA_HEAP_RETURN_(buffer);
-  static void write_archived_subgraph_infos() NOT_CDS_JAVA_HEAP_RETURN;
   static void initialize_from_archived_subgraph(Klass* k) NOT_CDS_JAVA_HEAP_RETURN;
 
   // NarrowOops stored in the CDS archive may use a different encoding scheme
--- a/src/hotspot/share/memory/metaspace.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/metaspace.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -132,7 +132,15 @@
   return value;
 }
 
-bool MetaspaceGC::inc_capacity_until_GC(size_t v, size_t* new_cap_until_GC, size_t* old_cap_until_GC) {
+// Try to increase the _capacity_until_GC limit counter by v bytes.
+// Returns true if it succeeded. It may fail if either another thread
+// concurrently increased the limit or the new limit would be larger
+// than MaxMetaspaceSize.
+// On success, optionally returns new and old metaspace capacity in
+// new_cap_until_GC and old_cap_until_GC respectively.
+// On error, optionally sets can_retry to indicate whether if there is
+// actually enough space remaining to satisfy the request.
+bool MetaspaceGC::inc_capacity_until_GC(size_t v, size_t* new_cap_until_GC, size_t* old_cap_until_GC, bool* can_retry) {
   assert_is_aligned(v, Metaspace::commit_alignment());
 
   size_t old_capacity_until_GC = _capacity_until_GC;
@@ -143,6 +151,16 @@
     new_value = align_down(max_uintx, Metaspace::commit_alignment());
   }
 
+  if (new_value > MaxMetaspaceSize) {
+    if (can_retry != NULL) {
+      *can_retry = false;
+    }
+    return false;
+  }
+
+  if (can_retry != NULL) {
+    *can_retry = true;
+  }
   size_t prev_value = Atomic::cmpxchg(new_value, &_capacity_until_GC, old_capacity_until_GC);
 
   if (old_capacity_until_GC != prev_value) {
@@ -236,7 +254,7 @@
 
   const double min_tmp = used_after_gc / maximum_used_percentage;
   size_t minimum_desired_capacity =
-    (size_t)MIN2(min_tmp, double(max_uintx));
+    (size_t)MIN2(min_tmp, double(MaxMetaspaceSize));
   // Don't shrink less than the initial generation size
   minimum_desired_capacity = MAX2(minimum_desired_capacity,
                                   MetaspaceSize);
@@ -283,7 +301,7 @@
     const double maximum_free_percentage = MaxMetaspaceFreeRatio / 100.0;
     const double minimum_used_percentage = 1.0 - maximum_free_percentage;
     const double max_tmp = used_after_gc / minimum_used_percentage;
-    size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx));
+    size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(MaxMetaspaceSize));
     maximum_desired_capacity = MAX2(maximum_desired_capacity,
                                     MetaspaceSize);
     log_trace(gc, metaspace)("    maximum_free_percentage: %6.2f  minimum_used_percentage: %6.2f",
@@ -586,15 +604,15 @@
   if (Metaspace::using_class_space()) {
     out->print("   Non-Class:  ");
   }
-  print_human_readable_size(out, Metaspace::chunk_manager_metadata()->free_chunks_total_words(), scale);
+  print_human_readable_size(out, Metaspace::chunk_manager_metadata()->free_chunks_total_bytes(), scale);
   out->cr();
   if (Metaspace::using_class_space()) {
     out->print("       Class:  ");
-    print_human_readable_size(out, Metaspace::chunk_manager_class()->free_chunks_total_words(), scale);
+    print_human_readable_size(out, Metaspace::chunk_manager_class()->free_chunks_total_bytes(), scale);
     out->cr();
     out->print("        Both:  ");
-    print_human_readable_size(out, Metaspace::chunk_manager_class()->free_chunks_total_words() +
-                              Metaspace::chunk_manager_metadata()->free_chunks_total_words(), scale);
+    print_human_readable_size(out, Metaspace::chunk_manager_class()->free_chunks_total_bytes() +
+                              Metaspace::chunk_manager_metadata()->free_chunks_total_bytes(), scale);
     out->cr();
   }
   out->cr();
@@ -873,19 +891,6 @@
   return vsn;
 }
 
-bool MetaspaceUtils::is_in_committed(const void* p) {
-#if INCLUDE_CDS
-  if (UseSharedSpaces) {
-    for (int idx = MetaspaceShared::ro; idx <= MetaspaceShared::mc; idx++) {
-      if (FileMapInfo::current_info()->is_in_shared_region(p, idx)) {
-        return true;
-      }
-    }
-  }
-#endif
-  return find_enclosing_virtual_space(p) != NULL;
-}
-
 bool MetaspaceUtils::is_range_in_committed(const void* from, const void* to) {
 #if INCLUDE_CDS
   if (UseSharedSpaces) {
@@ -1483,6 +1488,7 @@
 
   size_t before = 0;
   size_t after = 0;
+  bool can_retry = true;
   MetaWord* res;
   bool incremented;
 
@@ -1490,9 +1496,9 @@
   // the HWM, an allocation is still attempted. This is because another thread must then
   // have incremented the HWM and therefore the allocation might still succeed.
   do {
-    incremented = MetaspaceGC::inc_capacity_until_GC(delta_bytes, &after, &before);
+    incremented = MetaspaceGC::inc_capacity_until_GC(delta_bytes, &after, &before, &can_retry);
     res = allocate(word_size, mdtype);
-  } while (!incremented && res == NULL);
+  } while (!incremented && res == NULL && can_retry);
 
   if (incremented) {
     Metaspace::tracer()->report_gc_threshold(before, after,
--- a/src/hotspot/share/memory/metaspace.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/metaspace.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -333,7 +333,6 @@
   // Utils to check if a pointer or range is part of a committed metaspace region
   // without acquiring any locks.
   static metaspace::VirtualSpaceNode* find_enclosing_virtual_space(const void* p);
-  static bool is_in_committed(const void* p);
   static bool is_range_in_committed(const void* from, const void* to);
 
 public:
@@ -387,9 +386,6 @@
   }
 
   static size_t min_chunk_size_words();
-  static size_t min_chunk_size_bytes() {
-    return min_chunk_size_words() * BytesPerWord;
-  }
 
   // Flags for print_report().
   enum ReportFlag {
@@ -461,7 +457,8 @@
   static size_t capacity_until_GC();
   static bool inc_capacity_until_GC(size_t v,
                                     size_t* new_cap_until_GC = NULL,
-                                    size_t* old_cap_until_GC = NULL);
+                                    size_t* old_cap_until_GC = NULL,
+                                    bool* can_retry = NULL);
   static size_t dec_capacity_until_GC(size_t v);
 
   static bool should_concurrent_collect() { return _should_concurrent_collect; }
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -218,10 +218,6 @@
   return _ro_region.allocate(num_bytes);
 }
 
-char* MetaspaceShared::read_only_space_top() {
-  return _ro_region.top();
-}
-
 void MetaspaceShared::initialize_runtime_shared_and_meta_spaces() {
   assert(UseSharedSpaces, "Must be called when UseSharedSpaces is enabled");
 
--- a/src/hotspot/share/memory/metaspaceShared.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/metaspaceShared.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -168,14 +168,11 @@
 
   static bool try_link_class(InstanceKlass* ik, TRAPS);
   static void link_and_cleanup_shared_classes(TRAPS);
-  static void check_shared_class_loader_type(InstanceKlass* ik);
 
   // Allocate a block of memory from the "mc", "ro", or "rw" regions.
   static char* misc_code_space_alloc(size_t num_bytes);
   static char* read_only_space_alloc(size_t num_bytes);
 
-  static char* read_only_space_top();
-
   template <typename T>
   static Array<T>* new_ro_array(int length) {
 #if INCLUDE_CDS
--- a/src/hotspot/share/memory/universe.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/universe.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1286,14 +1286,6 @@
 #endif // PRODUCT
 
 
-void Universe::compute_verify_oop_data() {
-  verify_oop_mask();
-  verify_oop_bits();
-  verify_mark_mask();
-  verify_mark_bits();
-}
-
-
 void LatestMethodCache::init(Klass* k, Method* m) {
   if (!UseSharedSpaces) {
     _klass = k;
--- a/src/hotspot/share/memory/universe.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/universe.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -258,7 +258,6 @@
   static uintptr_t _verify_oop_bits;
 
   static void calculate_verify_data(HeapWord* low_boundary, HeapWord* high_boundary) PRODUCT_RETURN;
-  static void compute_verify_oop_data();
 
  public:
   // Known classes in the VM
@@ -392,8 +391,6 @@
   };
   static NARROW_OOP_MODE narrow_oop_mode();
   static const char* narrow_oop_mode_to_string(NARROW_OOP_MODE mode);
-  static char*    preferred_heap_base(size_t heap_size, size_t alignment, NARROW_OOP_MODE mode);
-  static char*    preferred_metaspace_base(size_t heap_size, NARROW_OOP_MODE mode);
   static address  narrow_oop_base()                  { return  _narrow_oop._base; }
   // Test whether bits of addr and possible offsets into the heap overlap.
   static bool     is_disjoint_heap_base_address(address addr) {
@@ -416,10 +413,8 @@
 
   // For UseCompressedClassPointers
   static address  narrow_klass_base()                     { return  _narrow_klass._base; }
-  static bool  is_narrow_klass_base(void* addr)           { return (narrow_klass_base() == (address)addr); }
   static uint64_t narrow_klass_range()                    { return  _narrow_klass_range; }
   static int      narrow_klass_shift()                    { return  _narrow_klass._shift; }
-  static bool     narrow_klass_use_implicit_null_checks() { return  _narrow_klass._use_implicit_null_checks; }
 
   static address* narrow_ptrs_base_addr()                 { return &_narrow_ptrs_base; }
   static void     set_narrow_ptrs_base(address a)         { _narrow_ptrs_base = a; }
@@ -441,7 +436,6 @@
   static ReservedSpace reserve_heap(size_t heap_size, size_t alignment);
 
   // Historic gc information
-  static size_t get_heap_capacity_at_last_gc()         { return _heap_capacity_at_last_gc; }
   static size_t get_heap_free_at_last_gc()             { return _heap_capacity_at_last_gc - _heap_used_at_last_gc; }
   static size_t get_heap_used_at_last_gc()             { return _heap_used_at_last_gc; }
   static void update_heap_info_at_gc();
@@ -517,25 +511,4 @@
   static int base_vtable_size()               { return _base_vtable_size; }
 };
 
-class DeferredObjAllocEvent : public CHeapObj<mtInternal> {
-  private:
-    oop    _oop;
-    size_t _bytesize;
-    jint   _arena_id;
-
-  public:
-    DeferredObjAllocEvent(const oop o, const size_t s, const jint id) {
-      _oop      = o;
-      _bytesize = s;
-      _arena_id = id;
-    }
-
-    ~DeferredObjAllocEvent() {
-    }
-
-    jint   arena_id() { return _arena_id; }
-    size_t bytesize() { return _bytesize; }
-    oop    get_oop()  { return _oop; }
-};
-
 #endif // SHARE_MEMORY_UNIVERSE_HPP
--- a/src/hotspot/share/memory/virtualspace.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/virtualspace.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -266,11 +266,6 @@
 }
 
 
-size_t ReservedSpace::allocation_align_size_down(size_t size) {
-  return align_down(size, os::vm_allocation_granularity());
-}
-
-
 void ReservedSpace::release() {
   if (is_reserved()) {
     char *real_base = _base - _noaccess_prefix;
--- a/src/hotspot/share/memory/virtualspace.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/memory/virtualspace.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -88,7 +88,6 @@
   static size_t page_align_size_up(size_t size);
   static size_t page_align_size_down(size_t size);
   static size_t allocation_align_size_up(size_t size);
-  static size_t allocation_align_size_down(size_t size);
   bool contains(const void* p) const {
     return (base() <= ((char*)p)) && (((char*)p) < (base() + size()));
   }
--- a/src/hotspot/share/oops/compiledICHolder.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/oops/compiledICHolder.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -65,9 +65,6 @@
   Klass*    holder_klass()  const     { return _holder_klass; }
   Metadata* holder_metadata() const   { return _holder_metadata; }
 
-  void set_holder_metadata(Metadata* m) { _holder_metadata = m; }
-  void set_holder_klass(Klass* k)     { _holder_klass = k; }
-
   static int holder_metadata_offset() { return offset_of(CompiledICHolder, _holder_metadata); }
   static int holder_klass_offset()    { return offset_of(CompiledICHolder, _holder_klass); }
 
--- a/src/hotspot/share/oops/constMethod.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/oops/constMethod.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -426,7 +426,6 @@
 
 void ConstMethod::print_on(outputStream* st) const {
   ResourceMark rm;
-  assert(is_constMethod(), "must be constMethod");
   st->print_cr("%s", internal_name());
   Method* m = method();
   st->print(" - method:       " INTPTR_FORMAT " ", p2i((address)m));
@@ -444,7 +443,6 @@
 // Short version of printing ConstMethod* - just print the name of the
 // method it belongs to.
 void ConstMethod::print_value_on(outputStream* st) const {
-  assert(is_constMethod(), "must be constMethod");
   st->print(" const part of method " );
   Method* m = method();
   if (m != NULL) {
@@ -487,8 +485,6 @@
 // Verification
 
 void ConstMethod::verify_on(outputStream* st) {
-  guarantee(is_constMethod(), "object must be constMethod");
-
   // Verification can occur during oop construction before the method or
   // other fields have been initialized.
   guarantee(method() != NULL && method()->is_method(), "should be method");
--- a/src/hotspot/share/oops/constMethod.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/oops/constMethod.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -241,8 +241,6 @@
                                MethodType mt,
                                TRAPS);
 
-  bool is_constMethod() const { return true; }
-
   // Inlined tables
   void set_inlined_tables_length(InlineTableSizes* sizes);
 
--- a/src/hotspot/share/oops/constantPool.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/oops/constantPool.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,7 @@
 #include "runtime/init.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/signature.hpp"
+#include "runtime/thread.inline.hpp"
 #include "runtime/vframe.inline.hpp"
 #include "utilities/copy.hpp"
 
@@ -448,6 +449,7 @@
 Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
                                    bool save_resolution_error, TRAPS) {
   assert(THREAD->is_Java_thread(), "must be a Java thread");
+  JavaThread* javaThread = (JavaThread*)THREAD;
 
   // A resolved constantPool entry will contain a Klass*, otherwise a Symbol*.
   // It is not safe to rely on the tag bit's here, since we don't have a lock, and
@@ -480,7 +482,14 @@
   Symbol* name = this_cp->symbol_at(name_index);
   Handle loader (THREAD, this_cp->pool_holder()->class_loader());
   Handle protection_domain (THREAD, this_cp->pool_holder()->protection_domain());
-  Klass* k = SystemDictionary::resolve_or_fail(name, loader, protection_domain, true, THREAD);
+
+  Klass* k;
+  {
+    // Turn off the single stepping while doing class resolution
+    JvmtiHideSingleStepping jhss(javaThread);
+    k = SystemDictionary::resolve_or_fail(name, loader, protection_domain, true, THREAD);
+  } //  JvmtiHideSingleStepping jhss(javaThread);
+
   if (!HAS_PENDING_EXCEPTION) {
     // preserve the resolved klass from unloading
     mirror_handle = Handle(THREAD, k->java_mirror());
@@ -817,9 +826,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;
 }
@@ -2515,11 +2524,6 @@
       guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count");
     }
   }
-  if (cache() != NULL) {
-    // Note: cache() can be NULL before a class is completely setup or
-    // in temporary constant pools used during constant pool merging
-    guarantee(cache()->is_constantPoolCache(), "should be constant pool cache");
-  }
   if (pool_holder() != NULL) {
     // Note: pool_holder() can be NULL in temporary constant pools
     // used during constant pool merging
--- a/src/hotspot/share/oops/cpCache.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/oops/cpCache.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -851,14 +851,12 @@
 // Printing
 
 void ConstantPoolCache::print_on(outputStream* st) const {
-  assert(is_constantPoolCache(), "obj must be constant pool cache");
   st->print_cr("%s", internal_name());
   // print constant pool cache entries
   for (int i = 0; i < length(); i++) entry_at(i)->print(st, i);
 }
 
 void ConstantPoolCache::print_value_on(outputStream* st) const {
-  assert(is_constantPoolCache(), "obj must be constant pool cache");
   st->print("cache [%d]", length());
   print_address_on(st);
   st->print(" for ");
@@ -869,7 +867,6 @@
 // Verification
 
 void ConstantPoolCache::verify_on(outputStream* st) {
-  guarantee(is_constantPoolCache(), "obj must be constant pool cache");
   // print constant pool cache entries
   for (int i = 0; i < length(); i++) entry_at(i)->verify(st);
 }
--- a/src/hotspot/share/oops/cpCache.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/oops/cpCache.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -444,7 +444,6 @@
                                      const intStack& cp_cache_map,
                                      const intStack& invokedynamic_cp_cache_map,
                                      const intStack& invokedynamic_references_map, TRAPS);
-  bool is_constantPoolCache() const { return true; }
 
   int length() const                      { return _length; }
   void metaspace_pointers_do(MetaspaceClosure* it);
--- a/src/hotspot/share/oops/method.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/oops/method.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -2403,7 +2403,6 @@
 void Method::verify_on(outputStream* st) {
   guarantee(is_method(), "object must be method");
   guarantee(constants()->is_constantPool(), "should be constant pool");
-  guarantee(constMethod()->is_constMethod(), "should be ConstMethod*");
   MethodData* md = method_data();
   guarantee(md == NULL ||
       md->is_methodData(), "should be method data");
--- a/src/hotspot/share/opto/c2_globals.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/c2_globals.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -516,7 +516,7 @@
           "Sets max value cached by the java.lang.Integer autobox cache")   \
           range(0, max_jint)                                                \
                                                                             \
-  experimental(bool, AggressiveUnboxing, false,                             \
+  experimental(bool, AggressiveUnboxing, true,                              \
           "Control optimizations for aggressive boxing elimination")        \
                                                                             \
   develop(bool, TracePostallocExpand, false, "Trace expanding nodes after"  \
--- a/src/hotspot/share/opto/c2compiler.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/c2compiler.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "runtime/handles.inline.hpp"
 #include "jfr/support/jfrIntrinsics.hpp"
 #include "opto/c2compiler.hpp"
 #include "opto/compile.hpp"
--- a/src/hotspot/share/opto/callGenerator.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/callGenerator.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -459,7 +459,7 @@
   C->set_has_loops(C->has_loops() || _inline_cg->method()->has_loops());
   C->env()->notice_inlined_method(_inline_cg->method());
   C->set_inlining_progress(true);
-
+  C->set_do_cleanup(kit.stopped()); // path is dead; needs cleanup
   kit.replace_call(call, result, true);
 }
 
@@ -652,11 +652,13 @@
   CallGenerator* _if_missed;
   CallGenerator* _if_hit;
   float          _hit_prob;
+  bool           _exact_check;
 
 public:
   PredictedCallGenerator(ciKlass* predicted_receiver,
                          CallGenerator* if_missed,
-                         CallGenerator* if_hit, float hit_prob)
+                         CallGenerator* if_hit, bool exact_check,
+                         float hit_prob)
     : CallGenerator(if_missed->method())
   {
     // The call profile data may predict the hit_prob as extreme as 0 or 1.
@@ -668,6 +670,7 @@
     _if_missed          = if_missed;
     _if_hit             = if_hit;
     _hit_prob           = hit_prob;
+    _exact_check        = exact_check;
   }
 
   virtual bool      is_virtual()   const    { return true; }
@@ -682,9 +685,16 @@
                                                  CallGenerator* if_missed,
                                                  CallGenerator* if_hit,
                                                  float hit_prob) {
-  return new PredictedCallGenerator(predicted_receiver, if_missed, if_hit, hit_prob);
+  return new PredictedCallGenerator(predicted_receiver, if_missed, if_hit,
+                                    /*exact_check=*/true, hit_prob);
 }
 
+CallGenerator* CallGenerator::for_guarded_call(ciKlass* guarded_receiver,
+                                               CallGenerator* if_missed,
+                                               CallGenerator* if_hit) {
+  return new PredictedCallGenerator(guarded_receiver, if_missed, if_hit,
+                                    /*exact_check=*/false, PROB_ALWAYS);
+}
 
 JVMState* PredictedCallGenerator::generate(JVMState* jvms) {
   GraphKit kit(jvms);
@@ -695,8 +705,8 @@
   Node* receiver = kit.argument(0);
   CompileLog* log = kit.C->log();
   if (log != NULL) {
-    log->elem("predicted_call bci='%d' klass='%d'",
-              jvms->bci(), log->identify(_predicted_receiver));
+    log->elem("predicted_call bci='%d' exact='%d' klass='%d'",
+              jvms->bci(), (_exact_check ? 1 : 0), log->identify(_predicted_receiver));
   }
 
   receiver = kit.null_check_receiver_before_call(method());
@@ -708,10 +718,15 @@
   ReplacedNodes replaced_nodes = kit.map()->replaced_nodes();
   replaced_nodes.clone();
 
-  Node* exact_receiver = receiver;  // will get updated in place...
-  Node* slow_ctl = kit.type_check_receiver(receiver,
-                                           _predicted_receiver, _hit_prob,
-                                           &exact_receiver);
+  Node* casted_receiver = receiver;  // will get updated in place...
+  Node* slow_ctl = NULL;
+  if (_exact_check) {
+    slow_ctl = kit.type_check_receiver(receiver, _predicted_receiver, _hit_prob,
+                                       &casted_receiver);
+  } else {
+    slow_ctl = kit.subtype_check_receiver(receiver, _predicted_receiver,
+                                          &casted_receiver);
+  }
 
   SafePointNode* slow_map = NULL;
   JVMState* slow_jvms = NULL;
@@ -736,7 +751,7 @@
   }
 
   // fall through if the instance exactly matches the desired type
-  kit.replace_in_map(receiver, exact_receiver);
+  kit.replace_in_map(receiver, casted_receiver);
 
   // Make the hot call:
   JVMState* new_jvms = _if_hit->generate(kit.sync_jvms());
--- a/src/hotspot/share/opto/callGenerator.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/callGenerator.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -144,6 +144,10 @@
                                            CallGenerator* if_hit,
                                            float hit_prob);
 
+  static CallGenerator* for_guarded_call(ciKlass* predicted_receiver,
+                                         CallGenerator* if_missed,
+                                         CallGenerator* if_hit);
+
   // How to make a call that optimistically assumes a MethodHandle target:
   static CallGenerator* for_predicted_dynamic_call(ciMethodHandle* predicted_method_handle,
                                                    CallGenerator* if_missed,
--- a/src/hotspot/share/opto/castnode.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/castnode.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -410,11 +410,11 @@
                                 Node* dispX,
                                 bool negate = false) {
   if (negate) {
-    dispX = new SubXNode(phase->MakeConX(0), phase->transform(dispX));
+    dispX = phase->transform(new SubXNode(phase->MakeConX(0), dispX));
   }
   return new AddPNode(phase->C->top(),
                       phase->transform(new CastX2PNode(base)),
-                      phase->transform(dispX));
+                      dispX);
 }
 
 Node *CastX2PNode::Ideal(PhaseGVN *phase, bool can_reshape) {
--- a/src/hotspot/share/opto/cfgnode.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/cfgnode.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -119,11 +119,13 @@
 // can turn PhiNodes into copys in-place by NULL'ing out their RegionNode
 // input in slot 0.
 class PhiNode : public TypeNode {
+  friend class PhaseRenumberLive;
+
   const TypePtr* const _adr_type; // non-null only for Type::MEMORY nodes.
   // The following fields are only used for data PhiNodes to indicate
   // that the PhiNode represents the value of a known instance field.
         int _inst_mem_id; // Instance memory id (node index of the memory Phi)
-  const int _inst_id;     // Instance id of the memory slice.
+        int _inst_id;     // Instance id of the memory slice.
   const int _inst_index;  // Alias index of the instance memory slice.
   // Array elements references have the same alias_idx but different offset.
   const int _inst_offset; // Offset of the instance memory slice.
--- a/src/hotspot/share/opto/compile.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/compile.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -648,6 +648,7 @@
                   _orig_pc_slot_offset_in_bytes(0),
                   _inlining_progress(false),
                   _inlining_incrementally(false),
+                  _do_cleanup(false),
                   _has_reserved_stack_access(target->has_reserved_stack_access()),
 #ifndef PRODUCT
                   _trace_opto_output(directive->TraceOptoOutputOption),
@@ -2051,52 +2052,49 @@
     }
     _boxing_late_inlines.trunc_to(0);
 
-    {
-      ResourceMark rm;
-      PhaseRemoveUseless pru(gvn, for_igvn());
-    }
-
-    igvn = PhaseIterGVN(gvn);
-    igvn.optimize();
-
-    set_inlining_progress(false);
+    inline_incrementally_cleanup(igvn);
+
     set_inlining_incrementally(false);
   }
 }
 
-void Compile::inline_incrementally_one(PhaseIterGVN& igvn) {
+bool Compile::inline_incrementally_one() {
   assert(IncrementalInline, "incremental inlining should be on");
-  PhaseGVN* gvn = initial_gvn();
+
+  TracePhase tp("incrementalInline_inline", &timers[_t_incrInline_inline]);
+  set_inlining_progress(false);
+  set_do_cleanup(false);
+  int i = 0;
+  for (; i <_late_inlines.length() && !inlining_progress(); i++) {
+    CallGenerator* cg = _late_inlines.at(i);
+    _late_inlines_pos = i+1;
+    cg->do_late_inline();
+    if (failing())  return false;
+  }
+  int j = 0;
+  for (; i < _late_inlines.length(); i++, j++) {
+    _late_inlines.at_put(j, _late_inlines.at(i));
+  }
+  _late_inlines.trunc_to(j);
+  assert(inlining_progress() || _late_inlines.length() == 0, "");
+
+  bool needs_cleanup = do_cleanup() || over_inlining_cutoff();
 
   set_inlining_progress(false);
-  for_igvn()->clear();
-  gvn->replace_with(&igvn);
-
-  {
-    TracePhase tp("incrementalInline_inline", &timers[_t_incrInline_inline]);
-    int i = 0;
-    for (; i <_late_inlines.length() && !inlining_progress(); i++) {
-      CallGenerator* cg = _late_inlines.at(i);
-      _late_inlines_pos = i+1;
-      cg->do_late_inline();
-      if (failing())  return;
-    }
-    int j = 0;
-    for (; i < _late_inlines.length(); i++, j++) {
-      _late_inlines.at_put(j, _late_inlines.at(i));
-    }
-    _late_inlines.trunc_to(j);
-  }
-
+  set_do_cleanup(false);
+  return (_late_inlines.length() > 0) && !needs_cleanup;
+}
+
+void Compile::inline_incrementally_cleanup(PhaseIterGVN& igvn) {
   {
     TracePhase tp("incrementalInline_pru", &timers[_t_incrInline_pru]);
     ResourceMark rm;
-    PhaseRemoveUseless pru(gvn, for_igvn());
+    PhaseRemoveUseless pru(initial_gvn(), for_igvn());
   }
-
   {
     TracePhase tp("incrementalInline_igvn", &timers[_t_incrInline_igvn]);
-    igvn = PhaseIterGVN(gvn);
+    igvn = PhaseIterGVN(initial_gvn());
+    igvn.optimize();
   }
 }
 
@@ -2104,14 +2102,10 @@
 void Compile::inline_incrementally(PhaseIterGVN& igvn) {
   TracePhase tp("incrementalInline", &timers[_t_incrInline]);
 
-  PhaseGVN* gvn = initial_gvn();
-
   set_inlining_incrementally(true);
-  set_inlining_progress(true);
   uint low_live_nodes = 0;
 
-  while(inlining_progress() && _late_inlines.length() > 0) {
-
+  while (_late_inlines.length() > 0) {
     if (live_nodes() > (uint)LiveNodeCountInliningCutoff) {
       if (low_live_nodes < (uint)LiveNodeCountInliningCutoff * 8 / 10) {
         TracePhase tp("incrementalInline_ideal", &timers[_t_incrInline_ideal]);
@@ -2125,22 +2119,23 @@
       }
 
       if (live_nodes() > (uint)LiveNodeCountInliningCutoff) {
-        break;
+        break; // finish
       }
     }
 
-    inline_incrementally_one(igvn);
-
-    if (failing())  return;
-
-    {
-      TracePhase tp("incrementalInline_igvn", &timers[_t_incrInline_igvn]);
-      igvn.optimize();
+    for_igvn()->clear();
+    initial_gvn()->replace_with(&igvn);
+
+    while (inline_incrementally_one()) {
+      assert(!failing(), "inconsistent");
     }
 
     if (failing())  return;
+
+    inline_incrementally_cleanup(igvn);
+
+    if (failing())  return;
   }
-
   assert( igvn._worklist.size() == 0, "should be done with igvn" );
 
   if (_string_late_inlines.length() > 0) {
@@ -2152,17 +2147,7 @@
 
     if (failing())  return;
 
-    {
-      TracePhase tp("incrementalInline_pru", &timers[_t_incrInline_pru]);
-      ResourceMark rm;
-      PhaseRemoveUseless pru(initial_gvn(), for_igvn());
-    }
-
-    {
-      TracePhase tp("incrementalInline_igvn", &timers[_t_incrInline_igvn]);
-      igvn = PhaseIterGVN(gvn);
-      igvn.optimize();
-    }
+    inline_incrementally_cleanup(igvn);
   }
 
   set_inlining_incrementally(false);
--- a/src/hotspot/share/opto/compile.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/compile.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -383,6 +383,7 @@
   int                   _major_progress;        // Count of something big happening
   bool                  _inlining_progress;     // progress doing incremental inlining?
   bool                  _inlining_incrementally;// Are we doing incremental inlining (post parse)
+  bool                  _do_cleanup;            // Cleanup is needed before proceeding with incremental inlining
   bool                  _has_loops;             // True if the method _may_ have some loops
   bool                  _has_split_ifs;         // True if the method _may_ have some split-if
   bool                  _has_unsafe_access;     // True if the method _may_ produce faults in unsafe loads or stores.
@@ -653,6 +654,8 @@
   int               inlining_progress() const   { return _inlining_progress; }
   void          set_inlining_incrementally(bool z) { _inlining_incrementally = z; }
   int               inlining_incrementally() const { return _inlining_incrementally; }
+  void          set_do_cleanup(bool z)          { _do_cleanup = z; }
+  int               do_cleanup() const          { return _do_cleanup; }
   void          set_major_progress()            { _major_progress++; }
   void        clear_major_progress()            { _major_progress = 0; }
   int               max_inline_size() const     { return _max_inline_size; }
@@ -1022,6 +1025,11 @@
                       ciMethodData* logmd = NULL);
   // Report if there were too many recompiles at a method and bci.
   bool too_many_recompiles(ciMethod* method, int bci, Deoptimization::DeoptReason reason);
+  // Report if there were too many traps or recompiles at a method and bci.
+  bool too_many_traps_or_recompiles(ciMethod* method, int bci, Deoptimization::DeoptReason reason) {
+    return too_many_traps(method, bci, reason) ||
+           too_many_recompiles(method, bci, reason);
+  }
   // Return a bitset with the reasons where deoptimization is allowed,
   // i.e., where there were not too many uncommon traps.
   int _allowed_reasons;
@@ -1075,7 +1083,11 @@
     if (!inlining_incrementally()) {
       return unique() > (uint)NodeCountInliningCutoff;
     } else {
-      return live_nodes() > (uint)LiveNodeCountInliningCutoff;
+      // Give some room for incremental inlining algorithm to "breathe"
+      // and avoid thrashing when live node count is close to the limit.
+      // Keep in mind that live_nodes() isn't accurate during inlining until
+      // dead node elimination step happens (see Compile::inline_incrementally).
+      return live_nodes() > (uint)LiveNodeCountInliningCutoff * 11 / 10;
     }
   }
 
@@ -1083,7 +1095,8 @@
   void dec_number_of_mh_late_inlines() { assert(_number_of_mh_late_inlines > 0, "_number_of_mh_late_inlines < 0 !"); _number_of_mh_late_inlines--; }
   bool has_mh_late_inlines() const     { return _number_of_mh_late_inlines > 0; }
 
-  void inline_incrementally_one(PhaseIterGVN& igvn);
+  bool inline_incrementally_one();
+  void inline_incrementally_cleanup(PhaseIterGVN& igvn);
   void inline_incrementally(PhaseIterGVN& igvn);
   void inline_string_calls(bool parse_time);
   void inline_boxing_calls(PhaseIterGVN& igvn);
--- a/src/hotspot/share/opto/doCall.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/doCall.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -209,7 +209,7 @@
 
       int morphism = profile.morphism();
       if (speculative_receiver_type != NULL) {
-        if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) {
+        if (!too_many_traps_or_recompiles(caller, bci, Deoptimization::Reason_speculate_class_check)) {
           // We have a speculative type, we should be able to resolve
           // the call. We do that before looking at the profiling at
           // this invoke because it may lead to bimorphic inlining which
@@ -262,7 +262,7 @@
                                                ? Deoptimization::Reason_bimorphic
                                                : Deoptimization::reason_class_check(speculative_receiver_type != NULL));
           if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) &&
-              !too_many_traps(caller, bci, reason)
+              !too_many_traps_or_recompiles(caller, bci, reason)
              ) {
             // Generate uncommon trap for class check failure path
             // in case of monomorphic or bimorphic virtual call site.
@@ -292,6 +292,51 @@
         }
       }
     }
+
+    // If there is only one implementor of this interface then we
+    // may be able to bind this invoke directly to the implementing
+    // klass but we need both a dependence on the single interface
+    // and on the method we bind to. Additionally since all we know
+    // about the receiver type is that it's supposed to implement the
+    // interface we have to insert a check that it's the class we
+    // expect.  Interface types are not checked by the verifier so
+    // they are roughly equivalent to Object.
+    // The number of implementors for declared_interface is less or
+    // equal to the number of implementors for target->holder() so
+    // if number of implementors of target->holder() == 1 then
+    // number of implementors for decl_interface is 0 or 1. If
+    // it's 0 then no class implements decl_interface and there's
+    // no point in inlining.
+    if (call_does_dispatch && bytecode == Bytecodes::_invokeinterface) {
+      ciInstanceKlass* declared_interface =
+          caller->get_declared_method_holder_at_bci(bci)->as_instance_klass();
+
+      if (declared_interface->nof_implementors() == 1 &&
+          (!callee->is_default_method() || callee->is_overpass()) /* CHA doesn't support default methods yet */) {
+        ciInstanceKlass* singleton = declared_interface->implementor();
+        ciMethod* cha_monomorphic_target =
+            callee->find_monomorphic_target(caller->holder(), declared_interface, singleton);
+
+        if (cha_monomorphic_target != NULL &&
+            cha_monomorphic_target->holder() != env()->Object_klass()) { // subtype check against Object is useless
+          ciKlass* holder = cha_monomorphic_target->holder();
+
+          // Try to inline the method found by CHA. Inlined method is guarded by the type check.
+          CallGenerator* hit_cg = call_generator(cha_monomorphic_target,
+              vtable_index, !call_does_dispatch, jvms, allow_inline, prof_factor);
+
+          // Deoptimize on type check fail. The interpreter will throw ICCE for us.
+          CallGenerator* miss_cg = CallGenerator::for_uncommon_trap(callee,
+              Deoptimization::Reason_class_check, Deoptimization::Action_none);
+
+          CallGenerator* cg = CallGenerator::for_guarded_call(holder, miss_cg, hit_cg);
+          if (hit_cg != NULL && cg != NULL) {
+            dependencies()->assert_unique_concrete_method(declared_interface, cha_monomorphic_target);
+            return cg;
+          }
+        }
+      }
+    }
   }
 
   // Nothing claimed the intrinsic, we go with straight-forward inlining
--- a/src/hotspot/share/opto/graphKit.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/graphKit.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -2794,6 +2794,22 @@
   return fail;
 }
 
+//------------------------------subtype_check_receiver-------------------------
+Node* GraphKit::subtype_check_receiver(Node* receiver, ciKlass* klass,
+                                       Node** casted_receiver) {
+  const TypeKlassPtr* tklass = TypeKlassPtr::make(klass);
+  Node* recv_klass = load_object_klass(receiver);
+  Node* want_klass = makecon(tklass);
+
+  Node* slow_ctl = gen_subtype_check(recv_klass, want_klass);
+
+  // Cast receiver after successful check
+  const TypeOopPtr* recv_type = tklass->cast_to_exactness(false)->is_klassptr()->as_instance_type();
+  Node* cast = new CheckCastPPNode(control(), receiver, recv_type);
+  (*casted_receiver) = _gvn.transform(cast);
+
+  return slow_ctl;
+}
 
 //------------------------------seems_never_null-------------------------------
 // Use null_seen information if it is available from the profile.
@@ -2836,7 +2852,7 @@
   Deoptimization::DeoptReason reason = Deoptimization::reason_class_check(spec_klass != NULL);
 
   // Make sure we haven't already deoptimized from this tactic.
-  if (too_many_traps(reason) || too_many_recompiles(reason))
+  if (too_many_traps_or_recompiles(reason))
     return NULL;
 
   // (No, this isn't a call, but it's enough like a virtual call
@@ -2891,9 +2907,8 @@
     Deoptimization::DeoptReason class_reason = Deoptimization::Reason_speculate_class_check;
     Deoptimization::DeoptReason null_reason = Deoptimization::Reason_speculate_null_check;
 
-    if (!too_many_traps(null_reason) && !too_many_recompiles(null_reason) &&
-        !too_many_traps(class_reason) &&
-        !too_many_recompiles(class_reason)) {
+    if (!too_many_traps_or_recompiles(null_reason) &&
+        !too_many_traps_or_recompiles(class_reason)) {
       Node* not_null_obj = NULL;
       // not_null is true if we know the object is not null and
       // there's no need for a null check
@@ -2918,8 +2933,7 @@
       obj = exact_obj;
     }
   } else {
-    if (!too_many_traps(Deoptimization::Reason_null_assert) &&
-        !too_many_recompiles(Deoptimization::Reason_null_assert)) {
+    if (!too_many_traps_or_recompiles(Deoptimization::Reason_null_assert)) {
       Node* exact_obj = null_assert(obj);
       replace_in_map(obj, exact_obj);
       obj = exact_obj;
--- a/src/hotspot/share/opto/graphKit.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/graphKit.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -751,6 +751,10 @@
     return C->too_many_recompiles(method(), bci(), reason);
   }
 
+  bool too_many_traps_or_recompiles(Deoptimization::DeoptReason reason) {
+      return C->too_many_traps_or_recompiles(method(), bci(), reason);
+  }
+
   // Returns the object (if any) which was created the moment before.
   Node* just_allocated_object(Node* current_control);
 
@@ -830,6 +834,10 @@
   Node* type_check_receiver(Node* receiver, ciKlass* klass, float prob,
                             Node* *casted_receiver);
 
+  // Inexact type check used for predicted calls.
+  Node* subtype_check_receiver(Node* receiver, ciKlass* klass,
+                               Node** casted_receiver);
+
   // implementation of object creation
   Node* set_output_for_allocation(AllocateNode* alloc,
                                   const TypeOopPtr* oop_type,
--- a/src/hotspot/share/opto/phaseX.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/phaseX.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -461,55 +461,115 @@
 PhaseRenumberLive::PhaseRenumberLive(PhaseGVN* gvn,
                                      Unique_Node_List* worklist, Unique_Node_List* new_worklist,
                                      PhaseNumber phase_num) :
-  PhaseRemoveUseless(gvn, worklist, Remove_Useless_And_Renumber_Live) {
-
+  PhaseRemoveUseless(gvn, worklist, Remove_Useless_And_Renumber_Live),
+  _new_type_array(C->comp_arena()),
+  _old2new_map(C->unique(), C->unique(), -1),
+  _delayed(Thread::current()->resource_area()),
+  _is_pass_finished(false),
+  _live_node_count(C->live_nodes())
+{
   assert(RenumberLiveNodes, "RenumberLiveNodes must be set to true for node renumbering to take place");
   assert(C->live_nodes() == _useful.size(), "the number of live nodes must match the number of useful nodes");
   assert(gvn->nodes_size() == 0, "GVN must not contain any nodes at this point");
+  assert(_delayed.size() == 0, "should be empty");
 
-  uint old_unique_count = C->unique();
-  uint live_node_count = C->live_nodes();
   uint worklist_size = worklist->size();
 
-  // Storage for the updated type information.
-  Type_Array new_type_array(C->comp_arena());
-
   // Iterate over the set of live nodes.
-  uint current_idx = 0; // The current new node ID. Incremented after every assignment.
-  for (uint i = 0; i < _useful.size(); i++) {
-    Node* n = _useful.at(i);
-    // Sanity check that fails if we ever decide to execute this phase after EA
-    assert(!n->is_Phi() || n->as_Phi()->inst_mem_id() == -1, "should not be linked to data Phi");
-    const Type* type = gvn->type_or_null(n);
-    new_type_array.map(current_idx, type);
+  for (uint current_idx = 0; current_idx < _useful.size(); current_idx++) {
+    Node* n = _useful.at(current_idx);
 
     bool in_worklist = false;
     if (worklist->member(n)) {
       in_worklist = true;
     }
 
+    const Type* type = gvn->type_or_null(n);
+    _new_type_array.map(current_idx, type);
+
+    assert(_old2new_map.at(n->_idx) == -1, "already seen");
+    _old2new_map.at_put(n->_idx, current_idx);
+
     n->set_idx(current_idx); // Update node ID.
 
     if (in_worklist) {
       new_worklist->push(n);
     }
 
-    current_idx++;
+    if (update_embedded_ids(n) < 0) {
+      _delayed.push(n); // has embedded IDs; handle later
+    }
   }
 
   assert(worklist_size == new_worklist->size(), "the new worklist must have the same size as the original worklist");
-  assert(live_node_count == current_idx, "all live nodes must be processed");
+  assert(_live_node_count == _useful.size(), "all live nodes must be processed");
+
+  _is_pass_finished = true; // pass finished; safe to process delayed updates
+
+  while (_delayed.size() > 0) {
+    Node* n = _delayed.pop();
+    int no_of_updates = update_embedded_ids(n);
+    assert(no_of_updates > 0, "should be updated");
+  }
 
   // Replace the compiler's type information with the updated type information.
-  gvn->replace_types(new_type_array);
+  gvn->replace_types(_new_type_array);
 
   // Update the unique node count of the compilation to the number of currently live nodes.
-  C->set_unique(live_node_count);
+  C->set_unique(_live_node_count);
 
   // Set the dead node count to 0 and reset dead node list.
   C->reset_dead_node_list();
 }
 
+int PhaseRenumberLive::new_index(int old_idx) {
+  assert(_is_pass_finished, "not finished");
+  if (_old2new_map.at(old_idx) == -1) { // absent
+    // Allocate a placeholder to preserve uniqueness
+    _old2new_map.at_put(old_idx, _live_node_count);
+    _live_node_count++;
+  }
+  return _old2new_map.at(old_idx);
+}
+
+int PhaseRenumberLive::update_embedded_ids(Node* n) {
+  int no_of_updates = 0;
+  if (n->is_Phi()) {
+    PhiNode* phi = n->as_Phi();
+    if (phi->_inst_id != -1) {
+      if (!_is_pass_finished) {
+        return -1; // delay
+      }
+      int new_idx = new_index(phi->_inst_id);
+      assert(new_idx != -1, "");
+      phi->_inst_id = new_idx;
+      no_of_updates++;
+    }
+    if (phi->_inst_mem_id != -1) {
+      if (!_is_pass_finished) {
+        return -1; // delay
+      }
+      int new_idx = new_index(phi->_inst_mem_id);
+      assert(new_idx != -1, "");
+      phi->_inst_mem_id = new_idx;
+      no_of_updates++;
+    }
+  }
+
+  const Type* type = _new_type_array.fast_lookup(n->_idx);
+  if (type != NULL && type->isa_oopptr() && type->is_oopptr()->is_known_instance()) {
+    if (!_is_pass_finished) {
+        return -1; // delay
+    }
+    int old_idx = type->is_oopptr()->instance_id();
+    int new_idx = new_index(old_idx);
+    const Type* new_type = type->is_oopptr()->with_instance_id(new_idx);
+    _new_type_array.map(n->_idx, new_type);
+    no_of_updates++;
+  }
+
+  return no_of_updates;
+}
 
 //=============================================================================
 //------------------------------PhaseTransform---------------------------------
--- a/src/hotspot/share/opto/phaseX.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/phaseX.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -157,6 +157,16 @@
 // Phase that first performs a PhaseRemoveUseless, then it renumbers compiler
 // structures accordingly.
 class PhaseRenumberLive : public PhaseRemoveUseless {
+protected:
+  Type_Array _new_type_array; // Storage for the updated type information.
+  GrowableArray<int> _old2new_map;
+  Node_List _delayed;
+  bool _is_pass_finished;
+  uint _live_node_count;
+
+  int update_embedded_ids(Node* n);
+  int new_index(int old_idx);
+
 public:
   PhaseRenumberLive(PhaseGVN* gvn,
                     Unique_Node_List* worklist, Unique_Node_List* new_worklist,
--- a/src/hotspot/share/opto/type.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/type.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -3436,6 +3436,12 @@
   return make(_ptr, _offset, _instance_id, _speculative, depth);
 }
 
+//------------------------------with_instance_id--------------------------------
+const TypePtr* TypeOopPtr::with_instance_id(int instance_id) const {
+  assert(_instance_id != -1, "should be known");
+  return make(_ptr, _offset, instance_id, _speculative, _inline_depth);
+}
+
 //------------------------------meet_instance_id--------------------------------
 int TypeOopPtr::meet_instance_id( int instance_id ) const {
   // Either is 'TOP' instance?  Return the other instance!
@@ -4044,6 +4050,11 @@
   return make(_ptr, klass(), klass_is_exact(), const_oop(), _offset, _instance_id, _speculative, depth);
 }
 
+const TypePtr *TypeInstPtr::with_instance_id(int instance_id) const {
+  assert(is_known_instance(), "should be known");
+  return make(_ptr, klass(), klass_is_exact(), const_oop(), _offset, instance_id, _speculative, _inline_depth);
+}
+
 //=============================================================================
 // Convenience common pre-built types.
 const TypeAryPtr *TypeAryPtr::RANGE;
@@ -4530,6 +4541,11 @@
   return make(_ptr, _const_oop, _ary->remove_speculative()->is_ary(), _klass, _klass_is_exact, _offset, _instance_id, _speculative, depth);
 }
 
+const TypePtr *TypeAryPtr::with_instance_id(int instance_id) const {
+  assert(is_known_instance(), "should be known");
+  return make(_ptr, _const_oop, _ary->remove_speculative()->is_ary(), _klass, _klass_is_exact, _offset, instance_id, _speculative, _inline_depth);
+}
+
 //=============================================================================
 
 //------------------------------hash-------------------------------------------
--- a/src/hotspot/share/opto/type.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/opto/type.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1045,6 +1045,8 @@
   virtual bool would_improve_type(ciKlass* exact_kls, int inline_depth) const;
   virtual const TypePtr* with_inline_depth(int depth) const;
 
+  virtual const TypePtr* with_instance_id(int instance_id) const;
+
   virtual const Type *xdual() const;    // Compute dual right now.
   // the core of the computation of the meet for TypeOopPtr and for its subclasses
   virtual const Type *xmeet_helper(const Type *t) const;
@@ -1123,6 +1125,7 @@
   // Speculative type helper methods.
   virtual const Type* remove_speculative() const;
   virtual const TypePtr* with_inline_depth(int depth) const;
+  virtual const TypePtr* with_instance_id(int instance_id) const;
 
   // the core of the computation of the meet of 2 types
   virtual const Type *xmeet_helper(const Type *t) const;
@@ -1212,6 +1215,7 @@
   // Speculative type helper methods.
   virtual const Type* remove_speculative() const;
   virtual const TypePtr* with_inline_depth(int depth) const;
+  virtual const TypePtr* with_instance_id(int instance_id) const;
 
   // the core of the computation of the meet of 2 types
   virtual const Type *xmeet_helper(const Type *t) const;
--- a/src/hotspot/share/prims/jni.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/jni.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -2591,9 +2591,10 @@
     ret = JNIHandles::make_local(env, a->obj_at(index));
     return ret;
   } else {
-    char buf[jintAsStringSize];
-    sprintf(buf, "%d", index);
-    THROW_MSG_0(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), buf);
+    ResourceMark rm(THREAD);
+    stringStream ss;
+    ss.print("Index %d out of bounds for length %d", index, a->length());
+    THROW_MSG_0(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string());
   }
 JNI_END
 
@@ -2624,9 +2625,10 @@
       THROW_MSG(vmSymbols::java_lang_ArrayStoreException(), ss.as_string());
     }
   } else {
-    char buf[jintAsStringSize];
-    sprintf(buf, "%d", index);
-    THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), buf);
+    ResourceMark rm(THREAD);
+    stringStream ss;
+    ss.print("Index %d out of bounds for length %d", index, a->length());
+    THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string());
   }
 JNI_END
 
@@ -2801,6 +2803,19 @@
                                   , HOTSPOT_JNI_RELEASEDOUBLEARRAYELEMENTS_ENTRY(env, array, (double *) buf, mode),
                                   HOTSPOT_JNI_RELEASEDOUBLEARRAYELEMENTS_RETURN())
 
+static void check_bounds(jsize start, jsize copy_len, jsize array_len, TRAPS) {
+  ResourceMark rm(THREAD);
+  if (copy_len < 0) {
+    stringStream ss;
+    ss.print("Length %d is negative", copy_len);
+    THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string());
+  } else if (start < 0 || (start > array_len - copy_len)) {
+    stringStream ss;
+    ss.print("Array region %d.." INT64_FORMAT " out of bounds for length %d",
+             start, (int64_t)start+(int64_t)copy_len, array_len);
+    THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string());
+  }
+}
 
 #define DEFINE_GETSCALARARRAYREGION(ElementTag,ElementType,Result, Tag \
                                     , EntryProbe, ReturnProbe); \
@@ -2814,12 +2829,9 @@
   EntryProbe; \
   DT_VOID_RETURN_MARK(Get##Result##ArrayRegion); \
   typeArrayOop src = typeArrayOop(JNIHandles::resolve_non_null(array)); \
-  if (start < 0 || len < 0 || (start > src->length() - len)) { \
-    THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); \
-  } else { \
-    if (len > 0) { \
-      ArrayAccess<>::arraycopy_to_native(src, typeArrayOopDesc::element_offset<ElementType>(start), buf, len); \
-    } \
+  check_bounds(start, len, src->length(), CHECK); \
+  if (len > 0) {    \
+    ArrayAccess<>::arraycopy_to_native(src, typeArrayOopDesc::element_offset<ElementType>(start), buf, len); \
   } \
 JNI_END
 
@@ -2861,12 +2873,9 @@
   EntryProbe; \
   DT_VOID_RETURN_MARK(Set##Result##ArrayRegion); \
   typeArrayOop dst = typeArrayOop(JNIHandles::resolve_non_null(array)); \
-  if (start < 0 || len < 0 || (start > dst->length() - len)) { \
-    THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); \
-  } else { \
-    if (len > 0) { \
-      ArrayAccess<>::arraycopy_from_native(buf, dst, typeArrayOopDesc::element_offset<ElementType>(start), len); \
-    } \
+  check_bounds(start, len, dst->length(), CHECK); \
+  if (len > 0) { \
+    ArrayAccess<>::arraycopy_from_native(buf, dst, typeArrayOopDesc::element_offset<ElementType>(start), len); \
   } \
 JNI_END
 
--- a/src/hotspot/share/prims/jvm.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/jvm.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -870,10 +870,6 @@
   Handle h_prot  (THREAD, protection_domain);
   jclass result = find_class_from_class_loader(env, h_name, init, h_loader,
                                                h_prot, true, thread);
-  if (result != NULL) {
-    oop mirror = JNIHandles::resolve_non_null(result);
-    Klass* to_class = java_lang_Class::as_Klass(mirror);
-  }
 
   if (log_is_enabled(Debug, class, resolve) && result != NULL) {
     // this function is generally only used for class loading during verification.
--- a/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,6 @@
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiCodeBlobEvents.hpp"
 #include "prims/jvmtiExport.hpp"
-#include "runtime/handles.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/vmThread.hpp"
 
--- a/src/hotspot/share/prims/jvmtiEnv.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,7 @@
 #include "runtime/arguments.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
--- a/src/hotspot/share/prims/jvmtiEnvBase.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@
 #include "runtime/biasedLocking.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
 #include "runtime/jniHandles.inline.hpp"
--- a/src/hotspot/share/prims/jvmtiExport.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/jvmtiExport.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
 #include "prims/jvmtiThreadState.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
-#include "runtime/handles.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.inline.hpp"
@@ -2426,7 +2426,7 @@
   Handle h(thread, object);
 
   EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_CONTENDED_ENTER,
-                     ("[%s] montior contended enter event triggered",
+                     ("[%s] monitor contended enter event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
@@ -2457,7 +2457,7 @@
   Handle h(thread, object);
 
   EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_CONTENDED_ENTERED,
-                     ("[%s] montior contended entered event triggered",
+                     ("[%s] monitor contended entered event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
@@ -2488,7 +2488,7 @@
   Handle h(thread, object);
 
   EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_WAIT,
-                     ("[%s] montior wait event triggered",
+                     ("[%s] monitor wait event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
@@ -2520,7 +2520,7 @@
   Handle h(thread, object);
 
   EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_WAITED,
-                     ("[%s] montior waited event triggered",
+                     ("[%s] monitor waited event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
--- a/src/hotspot/share/prims/jvmtiImpl.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/jvmtiImpl.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -297,25 +297,11 @@
   // lazily create _jvmti_breakpoints and _breakpoint_list
   static JvmtiBreakpoints& get_jvmti_breakpoints();
 
-  // quickly test whether the bcp matches a cached breakpoint in the list
-  static inline bool is_breakpoint(address bcp);
-
   static void oops_do(OopClosure* f);
   static void metadata_do(void f(Metadata*)) NOT_JVMTI_RETURN;
   static void gc_epilogue();
 };
 
-// quickly test whether the bcp matches a cached breakpoint in the list
-bool JvmtiCurrentBreakpoints::is_breakpoint(address bcp) {
-    address *bps = get_breakpoint_list();
-    if (bps == NULL) return false;
-    for ( ; (*bps) != NULL; bps++) {
-      if ((*bps) == bcp) return true;
-    }
-    return false;
-}
-
-
 ///////////////////////////////////////////////////////////////
 //
 // class VM_ChangeBreakpoints
--- a/src/hotspot/share/prims/jvmtiManageCapabilities.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/jvmtiManageCapabilities.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -107,6 +107,14 @@
 #ifndef ZERO
   jc.can_pop_frame = 1;
   jc.can_force_early_return = 1;
+  // Workaround for 8195635:
+  // disable pop_frame and force_early_return capabilities with Graal
+#if INCLUDE_JVMCI
+  if (UseJVMCICompiler) {
+    jc.can_pop_frame = 0;
+    jc.can_force_early_return = 0;
+  }
+#endif // INCLUDE_JVMCI
 #endif // !ZERO
   jc.can_get_source_debug_extension = 1;
   jc.can_access_local_variables = 1;
--- a/src/hotspot/share/prims/methodHandles.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/methodHandles.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
 #include "prims/methodHandles.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/fieldDescriptor.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.inline.hpp"
@@ -968,7 +969,6 @@
   bool search_superc = ((match_flags & SEARCH_SUPERCLASSES) != 0);
   bool search_intfc  = ((match_flags & SEARCH_INTERFACES)   != 0);
   bool local_only = !(search_superc | search_intfc);
-  bool classes_only = false;
 
   if (name != NULL) {
     if (name->utf8_length() == 0)  return 0; // a match is not possible
--- a/src/hotspot/share/prims/methodHandles.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/methodHandles.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -67,7 +67,6 @@
   static oop init_MemberName(Handle mname_h, Handle target_h, TRAPS); // compute vmtarget/vmindex from target
   static oop init_field_MemberName(Handle mname_h, fieldDescriptor& fd, bool is_setter = false);
   static oop init_method_MemberName(Handle mname_h, CallInfo& info);
-  static int method_ref_kind(Method* m, bool do_dispatch_if_possible = true);
   static int find_MemberNames(Klass* k, Symbol* name, Symbol* sig,
                               int mflags, Klass* caller,
                               int skip, objArrayHandle results, TRAPS);
@@ -148,8 +147,6 @@
 
   static Bytecodes::Code signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id);
 
-  static int get_named_constant(int which, Handle name_box, TRAPS);
-
 public:
   static Symbol* lookup_signature(oop type_str, bool polymorphic, TRAPS);  // use TempNewSymbol
   static Symbol* lookup_basic_type_signature(Symbol* sig, bool keep_last_arg, TRAPS);  // use TempNewSymbol
@@ -158,11 +155,6 @@
   }
   static bool is_basic_type_signature(Symbol* sig);
 
-  static Symbol* lookup_method_type(Symbol* msig, Handle mtype, TRAPS);
-
-  static void print_as_method_type_on(outputStream* st, Symbol* sig) {
-    print_as_basic_type_signature_on(st, sig, true, true);
-  }
   static void print_as_basic_type_signature_on(outputStream* st, Symbol* sig, bool keep_arrays = false, bool keep_basic_names = false);
 
   // decoding CONSTANT_MethodHandle constants
@@ -188,13 +180,6 @@
     assert(ref_kind_is_valid(ref_kind), "");
     return (ref_kind & 1) != 0;
   }
-  static bool ref_kind_is_static(int ref_kind) {
-    return !ref_kind_has_receiver(ref_kind) && (ref_kind != JVM_REF_newInvokeSpecial);
-  }
-  static bool ref_kind_does_dispatch(int ref_kind) {
-    return (ref_kind == JVM_REF_invokeVirtual ||
-            ref_kind == JVM_REF_invokeInterface);
-  }
 
   static int ref_kind_to_flags(int ref_kind);
 
--- a/src/hotspot/share/prims/nativeLookup.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/nativeLookup.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 #include "runtime/arguments.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "utilities/macros.hpp"
--- a/src/hotspot/share/prims/stackwalk.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/stackwalk.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -35,6 +35,7 @@
 #include "runtime/globals.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
+#include "runtime/thread.inline.hpp"
 #include "runtime/vframe.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
 
--- a/src/hotspot/share/prims/unsafe.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/unsafe.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -38,6 +38,7 @@
 #include "prims/unsafe.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/globals.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
 #include "runtime/orderAccess.hpp"
--- a/src/hotspot/share/prims/whitebox.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/prims/whitebox.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -59,6 +59,7 @@
 #include "runtime/fieldDescriptor.inline.hpp"
 #include "runtime/flags/jvmFlag.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/handshake.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
--- a/src/hotspot/share/runtime/arguments.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/arguments.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -328,10 +328,6 @@
   _agentList.add(agentLib);
 }
 
-void Arguments::add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib) {
-  _agentList.add(new AgentLibrary(name, options, absolute_path, os_lib));
-}
-
 // Return TRUE if option matches 'property', or 'property=', or 'property.'.
 static bool matches_property_suffix(const char* option, const char* property, size_t len) {
   return ((strncmp(option, property, len) == 0) &&
@@ -583,7 +579,7 @@
   { "TraceClassUnloading",       LogLevel::Info,  true,  LOG_TAGS(class, unload) },
   { "TraceExceptions",           LogLevel::Info,  true,  LOG_TAGS(exceptions) },
   { "TraceLoaderConstraints",    LogLevel::Info,  true,  LOG_TAGS(class, loader, constraints) },
-  { "TraceMonitorInflation",     LogLevel::Debug, true,  LOG_TAGS(monitorinflation) },
+  { "TraceMonitorInflation",     LogLevel::Trace, true,  LOG_TAGS(monitorinflation) },
   { "TraceSafepointCleanupTime", LogLevel::Info,  true,  LOG_TAGS(safepoint, cleanup) },
   { "TraceJVMTIObjectTagging",   LogLevel::Debug, true,  LOG_TAGS(jvmti, objecttagging) },
   { "TraceRedefineClasses",      LogLevel::Info,  false, LOG_TAGS(redefine, class) },
--- a/src/hotspot/share/runtime/arguments.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/arguments.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -346,7 +346,6 @@
 
   // Late-binding agents not started via arguments
   static void add_loaded_agent(AgentLibrary *agentLib);
-  static void add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib);
 
   // Operation modi
   static Mode _mode;
@@ -368,7 +367,6 @@
   static bool _UseOnStackReplacement;
   static bool _BackgroundCompilation;
   static bool _ClipInlining;
-  static bool _CIDynamicCompilePriority;
   static intx _Tier3InvokeNotifyFreqLog;
   static intx _Tier4InvocationThreshold;
 
--- a/src/hotspot/share/runtime/basicLock.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/basicLock.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, 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
@@ -74,7 +74,5 @@
     // store-before-CAS avoidance in fast_lock/compiler_lock_object
     // we can find any flavor mark in the displaced mark.
   }
-// [RGV] The next line appears to do nothing!
-  intptr_t dh = (intptr_t) displaced_header();
   dest->set_displaced_header(displaced_header());
 }
--- a/src/hotspot/share/runtime/deoptimization.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/deoptimization.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,7 @@
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/safepointVerifiers.hpp"
 #include "runtime/sharedRuntime.hpp"
@@ -1284,36 +1285,6 @@
 }
 
 
-void Deoptimization::revoke_biases_of_monitors(CodeBlob* cb) {
-  if (!UseBiasedLocking) {
-    return;
-  }
-
-  assert(SafepointSynchronize::is_at_safepoint(), "must only be called from safepoint");
-  GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
-  for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
-    if (jt->has_last_Java_frame()) {
-      StackFrameStream sfs(jt, true);
-      while (!sfs.is_done()) {
-        frame* cur = sfs.current();
-        if (cb->contains(cur->pc())) {
-          vframe* vf = vframe::new_vframe(cur, sfs.register_map(), jt);
-          compiledVFrame* cvf = compiledVFrame::cast(vf);
-          // Revoke monitors' biases in all scopes
-          while (!cvf->is_top()) {
-            collect_monitors(cvf, objects_to_revoke);
-            cvf = compiledVFrame::cast(cvf->sender());
-          }
-          collect_monitors(cvf, objects_to_revoke);
-        }
-        sfs.next();
-      }
-    }
-  }
-  BiasedLocking::revoke_at_safepoint(objects_to_revoke);
-}
-
-
 void Deoptimization::deoptimize_single_frame(JavaThread* thread, frame fr, Deoptimization::DeoptReason reason) {
   assert(fr.can_be_deoptimized(), "checking frame type");
 
@@ -2300,11 +2271,6 @@
   return _deoptimization_hist[Reason_none][0][0];
 }
 
-jint Deoptimization::deoptimization_count(DeoptReason reason) {
-  assert(reason >= 0 && reason < Reason_LIMIT, "oob");
-  return _deoptimization_hist[reason][0][0];
-}
-
 void Deoptimization::print_statistics() {
   juint total = total_deoptimization_count();
   juint account = total;
--- a/src/hotspot/share/runtime/deoptimization.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/deoptimization.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -154,9 +154,6 @@
   // Helper function to revoke biases of all monitors in frame if UseBiasedLocking
   // is enabled
   static void revoke_biases_of_monitors(JavaThread* thread, frame fr, RegisterMap* map);
-  // Helper function to revoke biases of all monitors in frames
-  // executing in a particular CodeBlob if UseBiasedLocking is enabled
-  static void revoke_biases_of_monitors(CodeBlob* cb);
 
 #if COMPILER2_OR_JVMCI
 JVMCI_ONLY(public:)
@@ -420,7 +417,6 @@
                                          int trap_request);
 
   static jint total_deoptimization_count();
-  static jint deoptimization_count(DeoptReason reason);
 
   // JVMTI PopFrame support
 
--- a/src/hotspot/share/runtime/frame.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/frame.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -368,29 +368,6 @@
   return result;
 }
 
-// Note: called by profiler - NOT for current thread
-frame frame::profile_find_Java_sender_frame(JavaThread *thread) {
-// If we don't recognize this frame, walk back up the stack until we do
-  RegisterMap map(thread, false);
-  frame first_java_frame = frame();
-
-  // Find the first Java frame on the stack starting with input frame
-  if (is_java_frame()) {
-    // top frame is compiled frame or deoptimized frame
-    first_java_frame = *this;
-  } else if (safe_for_sender(thread)) {
-    for (frame sender_frame = sender(&map);
-      sender_frame.safe_for_sender(thread) && !sender_frame.is_first_frame();
-      sender_frame = sender_frame.sender(&map)) {
-      if (sender_frame.is_java_frame()) {
-        first_java_frame = sender_frame;
-        break;
-      }
-    }
-  }
-  return first_java_frame;
-}
-
 // Interpreter frames
 
 
--- a/src/hotspot/share/runtime/frame.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/frame.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -148,9 +148,6 @@
   // returns the sending frame
   frame sender(RegisterMap* map) const;
 
-  // for Profiling - acting on another frame. walks sender frames
-  // if valid.
-  frame profile_find_Java_sender_frame(JavaThread *thread);
   bool safe_for_sender(JavaThread *thread);
 
   // returns the sender, but skips conversion frames
--- a/src/hotspot/share/runtime/handles.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/handles.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -31,6 +31,7 @@
 
 class InstanceKlass;
 class Klass;
+class Thread;
 
 //------------------------------------------------------------------------------------------------------------------------
 // In order to preserve oops during garbage collection, they should be
--- a/src/hotspot/share/runtime/handles.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/handles.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -26,7 +26,9 @@
 #define SHARE_RUNTIME_HANDLES_INLINE_HPP
 
 #include "runtime/handles.hpp"
-#include "runtime/thread.inline.hpp"
+#include "runtime/thread.hpp"
+#include "oops/metadata.hpp"
+#include "oops/oop.hpp"
 
 // these inline functions are in a separate file to break an include cycle
 // between Thread and Handle
--- a/src/hotspot/share/runtime/init.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/init.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -166,6 +166,13 @@
   static bool destructorsCalled = false;
   if (!destructorsCalled) {
     destructorsCalled = true;
+    if (log_is_enabled(Info, monitorinflation)) {
+      // The ObjectMonitor subsystem uses perf counters so
+      // do this before perfMemory_exit().
+      // ObjectSynchronizer::finish_deflate_idle_monitors()'s call
+      // to audit_and_print_stats() is done at the Debug level.
+      ObjectSynchronizer::audit_and_print_stats(true /* on_exit */);
+    }
     perfMemory_exit();
     if (log_is_enabled(Debug, safepoint, stats)) {
       // Print the collected safepoint statistics.
--- a/src/hotspot/share/runtime/java.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/java.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -58,6 +58,7 @@
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/flags/flagSetting.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/java.hpp"
--- a/src/hotspot/share/runtime/objectMonitor.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/objectMonitor.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1884,8 +1884,9 @@
 
 // One-shot global initialization for the sync subsystem.
 // We could also defer initialization and initialize on-demand
-// the first time we call inflate().  Initialization would
-// be protected - like so many things - by the MonitorCache_lock.
+// the first time we call ObjectSynchronizer::inflate().
+// Initialization would be protected - like so many things - by
+// the MonitorCache_lock.
 
 void ObjectMonitor::Initialize() {
   assert(!InitDone, "invariant");
--- a/src/hotspot/share/runtime/objectMonitor.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/objectMonitor.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -164,7 +164,7 @@
   volatile int _SpinDuration;
 
   volatile jint  _count;            // reference count to prevent reclamation/deflation
-                                    // at stop-the-world time.  See deflate_idle_monitors().
+                                    // at stop-the-world time. See ObjectSynchronizer::deflate_monitor().
                                     // _count is approximately |_WaitSet| + |_EntryList|
  protected:
   ObjectWaiter * volatile _WaitSet; // LL of threads wait()ing on the monitor
--- a/src/hotspot/share/runtime/objectMonitor.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/objectMonitor.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -58,18 +58,17 @@
 }
 
 inline void ObjectMonitor::clear() {
-  assert(_header, "Fatal logic error in ObjectMonitor header!");
+  assert(_header != NULL, "Fatal logic error in ObjectMonitor header!");
   assert(_count == 0, "Fatal logic error in ObjectMonitor count!");
   assert(_waiters == 0, "Fatal logic error in ObjectMonitor waiters!");
   assert(_recursions == 0, "Fatal logic error in ObjectMonitor recursions!");
   assert(_object != NULL, "Fatal logic error in ObjectMonitor object!");
-  assert(_owner == 0, "Fatal logic error in ObjectMonitor owner!");
+  assert(_owner == NULL, "Fatal logic error in ObjectMonitor owner!");
 
   _header = NULL;
   _object = NULL;
 }
 
-
 inline void* ObjectMonitor::object() const {
   return _object;
 }
@@ -95,7 +94,6 @@
   return true;
 }
 
-
 // return number of threads contending for this monitor
 inline jint ObjectMonitor::contentions() const {
   return _count;
@@ -109,5 +107,4 @@
   _recursions = 0;
 }
 
-
 #endif // SHARE_RUNTIME_OBJECTMONITOR_INLINE_HPP
--- a/src/hotspot/share/runtime/os.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/os.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -47,6 +47,7 @@
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
@@ -885,11 +886,15 @@
   address p = start;
   st->print(PTR_FORMAT ":   ", p2i(start));
   while (p < end) {
-    switch (unitsize) {
-      case 1: st->print("%02x", *(u1*)p); break;
-      case 2: st->print("%04x", *(u2*)p); break;
-      case 4: st->print("%08x", *(u4*)p); break;
-      case 8: st->print("%016" FORMAT64_MODIFIER "x", *(u8*)p); break;
+    if (is_readable_pointer(p)) {
+      switch (unitsize) {
+        case 1: st->print("%02x", *(u1*)p); break;
+        case 2: st->print("%04x", *(u2*)p); break;
+        case 4: st->print("%08x", *(u4*)p); break;
+        case 8: st->print("%016" FORMAT64_MODIFIER "x", *(u8*)p); break;
+      }
+    } else {
+      st->print("%*.*s", 2*unitsize, 2*unitsize, "????????????????");
     }
     p += unitsize;
     cols++;
@@ -904,6 +909,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	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/os.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -640,6 +640,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/reflection.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/reflection.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -49,6 +49,7 @@
 #include "runtime/reflection.hpp"
 #include "runtime/reflectionUtils.hpp"
 #include "runtime/signature.hpp"
+#include "runtime/thread.inline.hpp"
 #include "runtime/vframe.inline.hpp"
 
 static void trace_class_resolution(const Klass* to_class) {
--- a/src/hotspot/share/runtime/safepoint.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/safepoint.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/orderAccess.hpp"
--- a/src/hotspot/share/runtime/semaphore.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/semaphore.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -27,7 +27,7 @@
 
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/semaphore.hpp"
-#include "runtime/thread.inline.hpp"
+#include "runtime/thread.hpp"
 
 inline void Semaphore::wait_with_safepoint_check(JavaThread* thread) {
   // Prepare to block and allow safepoints while blocked
--- a/src/hotspot/share/runtime/serviceThread.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/serviceThread.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -27,6 +27,7 @@
 #include "classfile/stringTable.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.hpp"
--- a/src/hotspot/share/runtime/statSampler.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/statSampler.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, 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
@@ -356,14 +356,3 @@
   PerfDataManager::create_counter(SUN_OS, "hrt.ticks",
                                   PerfData::U_Ticks, psh, CHECK);
 }
-
-/*
- * the statSampler_exit() function is called from os_init.cpp on
- * exit of the vm.
- */
-void statSampler_exit() {
-
-  if (!UsePerfData) return;
-
-  StatSampler::destroy();
-}
--- a/src/hotspot/share/runtime/statSampler.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/statSampler.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -65,6 +65,4 @@
     static void destroy();
 };
 
-void statSampler_exit();
-
 #endif // SHARE_RUNTIME_STATSAMPLER_HPP
--- a/src/hotspot/share/runtime/stubRoutines.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/stubRoutines.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,6 @@
 
 jint    StubRoutines::_fpu_cntrl_wrd_std                        = 0;
 jint    StubRoutines::_fpu_cntrl_wrd_24                         = 0;
-jint    StubRoutines::_fpu_cntrl_wrd_64                         = 0;
 jint    StubRoutines::_fpu_cntrl_wrd_trunc                      = 0;
 jint    StubRoutines::_mxcsr_std                                = 0;
 jint    StubRoutines::_fpu_subnormal_bias1[3]                   = { 0, 0, 0 };
@@ -163,11 +162,6 @@
 address StubRoutines::_dlibm_tan_cot_huge = NULL;
 address StubRoutines::_dtan = NULL;
 
-double (* StubRoutines::_intrinsic_log10 )(double) = NULL;
-double (* StubRoutines::_intrinsic_sin   )(double) = NULL;
-double (* StubRoutines::_intrinsic_cos   )(double) = NULL;
-double (* StubRoutines::_intrinsic_tan   )(double) = NULL;
-
 address StubRoutines::_safefetch32_entry                 = NULL;
 address StubRoutines::_safefetch32_fault_pc              = NULL;
 address StubRoutines::_safefetch32_continuation_pc       = NULL;
--- a/src/hotspot/share/runtime/stubRoutines.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/stubRoutines.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -78,10 +78,6 @@
 class StubRoutines: AllStatic {
 
  public:
-  enum platform_independent_constants {
-    max_size_of_parameters = 256                           // max. parameter size supported by megamorphic lookups
-  };
-
   // Dependencies
   friend class StubGenerator;
 
@@ -114,7 +110,6 @@
 
   static jint    _fpu_cntrl_wrd_std;
   static jint    _fpu_cntrl_wrd_24;
-  static jint    _fpu_cntrl_wrd_64;
   static jint    _fpu_cntrl_wrd_trunc;
   static jint    _mxcsr_std;
   static jint    _fpu_subnormal_bias1[3];
@@ -207,18 +202,6 @@
   static address _dlibm_tan_cot_huge;
   static address _dtan;
 
-  // These are versions of the java.lang.Math methods which perform
-  // the same operations as the intrinsic version.  They are used for
-  // constant folding in the compiler to ensure equivalence.  If the
-  // intrinsic version returns the same result as the strict version
-  // then they can be set to the appropriate function from
-  // SharedRuntime.
-  static double (*_intrinsic_log10)(double);
-  static double (*_intrinsic_pow)(double, double);
-  static double (*_intrinsic_sin)(double);
-  static double (*_intrinsic_cos)(double);
-  static double (*_intrinsic_tan)(double);
-
   // Safefetch stubs.
   static address _safefetch32_entry;
   static address _safefetch32_fault_pc;
@@ -289,7 +272,6 @@
   static jint    fpu_cntrl_wrd_std()                       { return _fpu_cntrl_wrd_std;   }
   static address addr_fpu_cntrl_wrd_std()                  { return (address)&_fpu_cntrl_wrd_std;   }
   static address addr_fpu_cntrl_wrd_24()                   { return (address)&_fpu_cntrl_wrd_24;   }
-  static address addr_fpu_cntrl_wrd_64()                   { return (address)&_fpu_cntrl_wrd_64;   }
   static address addr_fpu_cntrl_wrd_trunc()                { return (address)&_fpu_cntrl_wrd_trunc; }
   static address addr_mxcsr_std()                          { return (address)&_mxcsr_std; }
   static address addr_fpu_subnormal_bias1()                { return (address)&_fpu_subnormal_bias1; }
@@ -386,27 +368,6 @@
 
   static address zero_aligned_words()  { return _zero_aligned_words; }
 
-  static double  intrinsic_log10(double d) {
-    assert(_intrinsic_log10 != NULL, "must be defined");
-    return _intrinsic_log10(d);
-  }
-  static double  intrinsic_pow(double d, double d2) {
-    assert(_intrinsic_pow != NULL, "must be defined");
-    return _intrinsic_pow(d, d2);
-  }
-  static double  intrinsic_sin(double d) {
-    assert(_intrinsic_sin != NULL, "must be defined");
-    return _intrinsic_sin(d);
-  }
-  static double  intrinsic_cos(double d) {
-    assert(_intrinsic_cos != NULL, "must be defined");
-    return _intrinsic_cos(d);
-  }
-  static double  intrinsic_tan(double d) {
-    assert(_intrinsic_tan != NULL, "must be defined");
-    return _intrinsic_tan(d);
-  }
-
   //
   // Safefetch stub support
   //
--- a/src/hotspot/share/runtime/synchronizer.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/synchronizer.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "logging/log.hpp"
+#include "logging/logStream.hpp"
 #include "jfr/jfrEvents.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/metaspaceShared.hpp"
@@ -326,9 +327,7 @@
   }
 
   // We have to take the slow-path of possible inflation and then exit.
-  ObjectSynchronizer::inflate(THREAD,
-                              object,
-                              inflate_cause_vm_internal)->exit(true, THREAD);
+  inflate(THREAD, object, inflate_cause_vm_internal)->exit(true, THREAD);
 }
 
 // -----------------------------------------------------------------------------
@@ -361,9 +360,7 @@
   // must be non-zero to avoid looking like a re-entrant lock,
   // and must not look locked either.
   lock->set_displaced_header(markOopDesc::unused_mark());
-  ObjectSynchronizer::inflate(THREAD,
-                              obj(),
-                              inflate_cause_monitor_enter)->enter(THREAD);
+  inflate(THREAD, obj(), inflate_cause_monitor_enter)->enter(THREAD);
 }
 
 // This routine is used to handle interpreter/compiler slow case
@@ -392,9 +389,7 @@
     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
   }
 
-  ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD,
-                                                       obj(),
-                                                       inflate_cause_vm_internal);
+  ObjectMonitor* monitor = inflate(THREAD, obj(), inflate_cause_vm_internal);
 
   return monitor->complete_exit(THREAD);
 }
@@ -406,9 +401,7 @@
     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
   }
 
-  ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD,
-                                                       obj(),
-                                                       inflate_cause_vm_internal);
+  ObjectMonitor* monitor = inflate(THREAD, obj(), inflate_cause_vm_internal);
 
   monitor->reenter(recursion, THREAD);
 }
@@ -422,7 +415,7 @@
     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
   }
   THREAD->set_current_pending_monitor_is_from_java(false);
-  ObjectSynchronizer::inflate(THREAD, obj(), inflate_cause_jni_enter)->enter(THREAD);
+  inflate(THREAD, obj(), inflate_cause_jni_enter)->enter(THREAD);
   THREAD->set_current_pending_monitor_is_from_java(true);
 }
 
@@ -435,9 +428,7 @@
   }
   assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
 
-  ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD,
-                                                       obj,
-                                                       inflate_cause_jni_exit);
+  ObjectMonitor* monitor = inflate(THREAD, obj, inflate_cause_jni_exit);
   // If this thread has locked the object, exit the monitor.  Note:  can't use
   // monitor->check(CHECK); must exit even if an exception is pending.
   if (monitor->check(THREAD)) {
@@ -477,9 +468,7 @@
   if (millis < 0) {
     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative");
   }
-  ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD,
-                                                       obj(),
-                                                       inflate_cause_wait);
+  ObjectMonitor* monitor = inflate(THREAD, obj(), inflate_cause_wait);
 
   DTRACE_MONITOR_WAIT_PROBE(monitor, obj(), THREAD, millis);
   monitor->wait(millis, true, THREAD);
@@ -499,9 +488,7 @@
   if (millis < 0) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative");
   }
-  ObjectSynchronizer::inflate(THREAD,
-                              obj(),
-                              inflate_cause_wait)->wait(millis, false, THREAD);
+  inflate(THREAD, obj(), inflate_cause_wait)->wait(millis, false, THREAD);
 }
 
 void ObjectSynchronizer::notify(Handle obj, TRAPS) {
@@ -514,9 +501,7 @@
   if (mark->has_locker() && THREAD->is_lock_owned((address)mark->locker())) {
     return;
   }
-  ObjectSynchronizer::inflate(THREAD,
-                              obj(),
-                              inflate_cause_notify)->notify(THREAD);
+  inflate(THREAD, obj(), inflate_cause_notify)->notify(THREAD);
 }
 
 // NOTE: see comment of notify()
@@ -530,9 +515,7 @@
   if (mark->has_locker() && THREAD->is_lock_owned((address)mark->locker())) {
     return;
   }
-  ObjectSynchronizer::inflate(THREAD,
-                              obj(),
-                              inflate_cause_notify)->notifyAll(THREAD);
+  inflate(THREAD, obj(), inflate_cause_notify)->notifyAll(THREAD);
 }
 
 // -----------------------------------------------------------------------------
@@ -736,7 +719,7 @@
 
   if (mark->is_neutral()) {
     hash = mark->hash();              // this is a normal header
-    if (hash) {                       // if it has hash, just return it
+    if (hash != 0) {                  // if it has hash, just return it
       return hash;
     }
     hash = get_next_hash(Self, obj);  // allocate a new hash code
@@ -752,17 +735,17 @@
   } else if (mark->has_monitor()) {
     monitor = mark->monitor();
     temp = monitor->header();
-    assert(temp->is_neutral(), "invariant");
+    assert(temp->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)temp));
     hash = temp->hash();
-    if (hash) {
+    if (hash != 0) {
       return hash;
     }
     // Skip to the following code to reduce code size
   } else if (Self->is_lock_owned((address)mark->locker())) {
     temp = mark->displaced_mark_helper(); // this is a lightweight monitor owned
-    assert(temp->is_neutral(), "invariant");
+    assert(temp->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)temp));
     hash = temp->hash();              // by current thread, check if the displaced
-    if (hash) {                       // header contains hash code
+    if (hash != 0) {                  // header contains hash code
       return hash;
     }
     // WARNING:
@@ -777,22 +760,22 @@
   }
 
   // Inflate the monitor to set hash code
-  monitor = ObjectSynchronizer::inflate(Self, obj, inflate_cause_hash_code);
+  monitor = inflate(Self, obj, inflate_cause_hash_code);
   // Load displaced header and check it has hash code
   mark = monitor->header();
-  assert(mark->is_neutral(), "invariant");
+  assert(mark->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)mark));
   hash = mark->hash();
   if (hash == 0) {
     hash = get_next_hash(Self, obj);
     temp = mark->copy_set_hash(hash); // merge hash code into header
-    assert(temp->is_neutral(), "invariant");
+    assert(temp->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)temp));
     test = Atomic::cmpxchg(temp, monitor->header_addr(), mark);
     if (test != mark) {
       // The only update to the header in the monitor (outside GC)
       // is install the hash code. If someone add new usage of
       // displaced header, please update this code
       hash = test->hash();
-      assert(test->is_neutral(), "invariant");
+      assert(test->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)test));
       assert(hash != 0, "Trivial unexpected object/monitor header usage.");
     }
   }
@@ -864,7 +847,7 @@
       owner_self : owner_other;
   }
 
-  // CASE: inflated. Mark (tagged pointer) points to an objectMonitor.
+  // CASE: inflated. Mark (tagged pointer) points to an ObjectMonitor.
   // The Object:ObjectMonitor relationship is stable as long as we're
   // not at a safepoint.
   if (mark->has_monitor()) {
@@ -901,7 +884,7 @@
   }
 
   // Contended case, header points to ObjectMonitor (tagged pointer)
-  if (mark->has_monitor()) {
+  else if (mark->has_monitor()) {
     ObjectMonitor* monitor = mark->monitor();
     assert(monitor != NULL, "monitor should be non-null");
     owner = (address) monitor->owner();
@@ -1076,7 +1059,7 @@
       // Reprovision the thread's omFreeList.
       // Use bulk transfers to reduce the allocation rate and heat
       // on various locks.
-      Thread::muxAcquire(&gListLock, "omAlloc");
+      Thread::muxAcquire(&gListLock, "omAlloc(1)");
       for (int i = Self->omFreeProvision; --i >= 0 && gFreeList != NULL;) {
         gMonitorFreeCount--;
         ObjectMonitor * take = gFreeList;
@@ -1150,7 +1133,7 @@
 
     // Acquire the gListLock to manipulate gBlockList and gFreeList.
     // An Oyama-Taura-Yonezawa scheme might be more efficient.
-    Thread::muxAcquire(&gListLock, "omAlloc [2]");
+    Thread::muxAcquire(&gListLock, "omAlloc(2)");
     gMonitorPopulation += _BLOCKSIZE-1;
     gMonitorFreeCount += _BLOCKSIZE-1;
 
@@ -1178,10 +1161,11 @@
 //
 // Key constraint: all ObjectMonitors on a thread's free list and the global
 // free list must have their object field set to null. This prevents the
-// scavenger -- deflate_idle_monitors -- from reclaiming them.
+// scavenger -- deflate_monitor_list() -- from reclaiming them.
 
 void ObjectSynchronizer::omRelease(Thread * Self, ObjectMonitor * m,
                                    bool fromPerThreadAlloc) {
+  guarantee(m->header() == NULL, "invariant");
   guarantee(m->object() == NULL, "invariant");
   guarantee(((m->is_busy()|m->_recursions) == 0), "freeing in-use monitor");
   // Remove from omInUseList
@@ -1223,16 +1207,15 @@
 //
 // We currently call omFlush() from Threads::remove() _before the thread
 // has been excised from the thread list and is no longer a mutator.
-// This means that omFlush() can not run concurrently with a safepoint and
-// interleave with the scavenge operator. In particular, this ensures that
-// the thread's monitors are scanned by a GC safepoint, either via
-// Thread::oops_do() (if safepoint happens before omFlush()) or via
+// This means that omFlush() cannot run concurrently with a safepoint and
+// interleave with the deflate_idle_monitors scavenge operator. In particular,
+// this ensures that the thread's monitors are scanned by a GC safepoint,
+// either via Thread::oops_do() (if safepoint happens before omFlush()) or via
 // ObjectSynchronizer::oops_do() (if it happens after omFlush() and the thread's
 // monitors have been transferred to the global in-use list).
 
 void ObjectSynchronizer::omFlush(Thread * Self) {
   ObjectMonitor * list = Self->omFreeList;  // Null-terminated SLL
-  Self->omFreeList = NULL;
   ObjectMonitor * tail = NULL;
   int tally = 0;
   if (list != NULL) {
@@ -1248,14 +1231,16 @@
       guarantee(!s->is_busy(), "invariant");
       s->set_owner(NULL);   // redundant but good hygiene
     }
-    guarantee(tail != NULL && list != NULL, "invariant");
+    guarantee(tail != NULL, "invariant");
+    assert(Self->omFreeCount == tally, "free-count off");
+    Self->omFreeList = NULL;
+    Self->omFreeCount = 0;
   }
 
   ObjectMonitor * inUseList = Self->omInUseList;
   ObjectMonitor * inUseTail = NULL;
   int inUseTally = 0;
   if (inUseList != NULL) {
-    Self->omInUseList = NULL;
     ObjectMonitor *cur_om;
     // The thread is going away, however the omInUseList inflated
     // monitors may still be in-use by other threads.
@@ -1265,9 +1250,10 @@
       inUseTail = cur_om;
       inUseTally++;
     }
+    guarantee(inUseTail != NULL, "invariant");
     assert(Self->omInUseCount == inUseTally, "in-use count off");
+    Self->omInUseList = NULL;
     Self->omInUseCount = 0;
-    guarantee(inUseTail != NULL && inUseList != NULL, "invariant");
   }
 
   Thread::muxAcquire(&gListLock, "omFlush");
@@ -1275,8 +1261,6 @@
     tail->FreeNext = gFreeList;
     gFreeList = list;
     gMonitorFreeCount += tally;
-    assert(Self->omFreeCount == tally, "free-count off");
-    Self->omFreeCount = 0;
   }
 
   if (inUseTail != NULL) {
@@ -1300,22 +1284,19 @@
 }
 
 // Fast path code shared by multiple functions
-ObjectMonitor* ObjectSynchronizer::inflate_helper(oop obj) {
+void ObjectSynchronizer::inflate_helper(oop obj) {
   markOop mark = obj->mark();
   if (mark->has_monitor()) {
     assert(ObjectSynchronizer::verify_objmon_isinpool(mark->monitor()), "monitor is invalid");
     assert(mark->monitor()->header()->is_neutral(), "monitor must record a good object header");
-    return mark->monitor();
+    return;
   }
-  return ObjectSynchronizer::inflate(Thread::current(),
-                                     obj,
-                                     inflate_cause_vm_internal);
+  inflate(Thread::current(), obj, inflate_cause_vm_internal);
 }
 
 ObjectMonitor* ObjectSynchronizer::inflate(Thread * Self,
-                                                     oop object,
-                                                     const InflateCause cause) {
-
+                                           oop object,
+                                           const InflateCause cause) {
   // Inflate mutates the heap ...
   // Relaxing assertion for bug 6320749.
   assert(Universe::verify_in_progress() ||
@@ -1337,7 +1318,8 @@
     // CASE: inflated
     if (mark->has_monitor()) {
       ObjectMonitor * inf = mark->monitor();
-      assert(inf->header()->is_neutral(), "invariant");
+      markOop dmw = inf->header();
+      assert(dmw->is_neutral(), "invariant: header=" INTPTR_FORMAT, p2i((address)dmw));
       assert(oopDesc::equals((oop) inf->object(), object), "invariant");
       assert(ObjectSynchronizer::verify_objmon_isinpool(inf), "monitor is invalid");
       return inf;
@@ -1373,6 +1355,8 @@
     // before or after the CAS(INFLATING) operation.
     // See the comments in omAlloc().
 
+    LogStreamHandle(Trace, monitorinflation) lsh;
+
     if (mark->has_locker()) {
       ObjectMonitor * m = omAlloc(Self);
       // Optimistically prepare the objectmonitor - anticipate successful CAS
@@ -1442,13 +1426,11 @@
       // Hopefully the performance counters are allocated on distinct cache lines
       // to avoid false sharing on MP systems ...
       OM_PERFDATA_OP(Inflations, inc());
-      if (log_is_enabled(Debug, monitorinflation)) {
-        if (object->is_instance()) {
-          ResourceMark rm;
-          log_debug(monitorinflation)("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
-                                      p2i(object), p2i(object->mark()),
-                                      object->klass()->external_name());
-        }
+      if (log_is_enabled(Trace, monitorinflation)) {
+        ResourceMark rm(Self);
+        lsh.print_cr("inflate(has_locker): object=" INTPTR_FORMAT ", mark="
+                     INTPTR_FORMAT ", type='%s'", p2i(object),
+                     p2i(object->mark()), object->klass()->external_name());
       }
       if (event.should_commit()) {
         post_monitor_inflate_event(&event, object, cause);
@@ -1478,8 +1460,8 @@
     m->_SpinDuration = ObjectMonitor::Knob_SpinLimit;       // consider: keep metastats by type/class
 
     if (object->cas_set_mark(markOopDesc::encode(m), mark) != mark) {
+      m->set_header(NULL);
       m->set_object(NULL);
-      m->set_owner(NULL);
       m->Recycle();
       omRelease(Self, m, true);
       m = NULL;
@@ -1492,13 +1474,11 @@
     // Hopefully the performance counters are allocated on distinct
     // cache lines to avoid false sharing on MP systems ...
     OM_PERFDATA_OP(Inflations, inc());
-    if (log_is_enabled(Debug, monitorinflation)) {
-      if (object->is_instance()) {
-        ResourceMark rm;
-        log_debug(monitorinflation)("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
-                                    p2i(object), p2i(object->mark()),
-                                    object->klass()->external_name());
-      }
+    if (log_is_enabled(Trace, monitorinflation)) {
+      ResourceMark rm(Self);
+      lsh.print_cr("inflate(neutral): object=" INTPTR_FORMAT ", mark="
+                   INTPTR_FORMAT ", type='%s'", p2i(object),
+                   p2i(object->mark()), object->klass()->external_name());
     }
     if (event.should_commit()) {
       post_monitor_inflate_event(&event, object, cause);
@@ -1546,14 +1526,12 @@
     // Deflate the monitor if it is no longer being used
     // It's idle - scavenge and return to the global free list
     // plain old deflation ...
-    if (log_is_enabled(Debug, monitorinflation)) {
-      if (obj->is_instance()) {
-        ResourceMark rm;
-        log_debug(monitorinflation)("Deflating object " INTPTR_FORMAT " , "
-                                    "mark " INTPTR_FORMAT " , type %s",
-                                    p2i(obj), p2i(obj->mark()),
-                                    obj->klass()->external_name());
-      }
+    if (log_is_enabled(Trace, monitorinflation)) {
+      ResourceMark rm;
+      log_trace(monitorinflation)("deflate_monitor: "
+                                  "object=" INTPTR_FORMAT ", mark=" INTPTR_FORMAT ", type='%s'",
+                                  p2i(obj), p2i(obj->mark()),
+                                  obj->klass()->external_name());
     }
 
     // Restore the header back to obj
@@ -1577,7 +1555,7 @@
 
 // Walk a given monitor list, and deflate idle monitors
 // The given list could be a per-thread list or a global list
-// Caller acquires gListLock.
+// Caller acquires gListLock as needed.
 //
 // In the case of parallel processing of thread local monitor lists,
 // work is done by Threads::parallel_threads_do() which ensures that
@@ -1619,10 +1597,11 @@
 }
 
 void ObjectSynchronizer::prepare_deflate_idle_monitors(DeflateMonitorCounters* counters) {
-  counters->nInuse = 0;            // currently associated with objects
-  counters->nInCirculation = 0;    // extant
-  counters->nScavenged = 0;        // reclaimed
-  counters->perThreadTimes = 0.0;  // per-thread scavenge times
+  counters->nInuse = 0;              // currently associated with objects
+  counters->nInCirculation = 0;      // extant
+  counters->nScavenged = 0;          // reclaimed (global and per-thread)
+  counters->perThreadScavenged = 0;  // per-thread scavenge total
+  counters->perThreadTimes = 0.0;    // per-thread scavenge times
 }
 
 void ObjectSynchronizer::deflate_idle_monitors(DeflateMonitorCounters* counters) {
@@ -1631,19 +1610,25 @@
 
   ObjectMonitor * freeHeadp = NULL;  // Local SLL of scavenged monitors
   ObjectMonitor * freeTailp = NULL;
+  elapsedTimer timer;
+
+  if (log_is_enabled(Info, monitorinflation)) {
+    timer.start();
+  }
 
   // Prevent omFlush from changing mids in Thread dtor's during deflation
   // And in case the vm thread is acquiring a lock during a safepoint
   // See e.g. 6320749
-  Thread::muxAcquire(&gListLock, "scavenge - return");
+  Thread::muxAcquire(&gListLock, "deflate_idle_monitors");
 
   // Note: the thread-local monitors lists get deflated in
   // a separate pass. See deflate_thread_local_monitors().
 
   // For moribund threads, scan gOmInUseList
+  int deflated_count = 0;
   if (gOmInUseList) {
     counters->nInCirculation += gOmInUseCount;
-    int deflated_count = deflate_monitor_list((ObjectMonitor **)&gOmInUseList, &freeHeadp, &freeTailp);
+    deflated_count = deflate_monitor_list((ObjectMonitor **)&gOmInUseList, &freeHeadp, &freeTailp);
     gOmInUseCount -= deflated_count;
     counters->nScavenged += deflated_count;
     counters->nInuse += gOmInUseCount;
@@ -1658,29 +1643,53 @@
     gFreeList = freeHeadp;
   }
   Thread::muxRelease(&gListLock);
+  timer.stop();
 
+  LogStreamHandle(Debug, monitorinflation) lsh_debug;
+  LogStreamHandle(Info, monitorinflation) lsh_info;
+  LogStream * ls = NULL;
+  if (log_is_enabled(Debug, monitorinflation)) {
+    ls = &lsh_debug;
+  } else if (deflated_count != 0 && log_is_enabled(Info, monitorinflation)) {
+    ls = &lsh_info;
+  }
+  if (ls != NULL) {
+    ls->print_cr("deflating global idle monitors, %3.7f secs, %d monitors", timer.seconds(), deflated_count);
+  }
 }
 
 void ObjectSynchronizer::finish_deflate_idle_monitors(DeflateMonitorCounters* counters) {
-  if (log_is_enabled(Info, safepoint, cleanup)) {
-    // Report the cumulative time for deflating each thread's idle
-    // monitors. Note: if the work is split among more than one
-    // worker thread, then the reported time will likely be more
-    // than a beginning to end measurement of the phase.
-    log_info(safepoint, cleanup)("deflating per-thread idle monitors, %3.7f secs", counters->perThreadTimes);
+  // Report the cumulative time for deflating each thread's idle
+  // monitors. Note: if the work is split among more than one
+  // worker thread, then the reported time will likely be more
+  // than a beginning to end measurement of the phase.
+  log_info(safepoint, cleanup)("deflating per-thread idle monitors, %3.7f secs, monitors=%d", counters->perThreadTimes, counters->perThreadScavenged);
+
+  LogStreamHandle(Debug, monitorinflation) lsh_debug;
+  LogStreamHandle(Info, monitorinflation) lsh_info;
+  LogStream * ls = NULL;
+  if (log_is_enabled(Debug, monitorinflation)) {
+    ls = &lsh_debug;
+  } else if (counters->perThreadScavenged != 0 && log_is_enabled(Info, monitorinflation)) {
+    ls = &lsh_info;
+  }
+  if (ls != NULL) {
+    ls->print_cr("deflating per-thread idle monitors, %3.7f secs, %d monitors", counters->perThreadTimes, counters->perThreadScavenged);
   }
 
   gMonitorFreeCount += counters->nScavenged;
 
-  // Consider: audit gFreeList to ensure that gMonitorFreeCount and list agree.
+  if (log_is_enabled(Debug, monitorinflation)) {
+    // exit_globals()'s call to audit_and_print_stats() is done
+    // at the Info level.
+    ObjectSynchronizer::audit_and_print_stats(false /* on_exit */);
+  }
 
   ForceMonitorScavenge = 0;    // Reset
 
   OM_PERFDATA_OP(Deflations, inc(counters->nScavenged));
   OM_PERFDATA_OP(MonExtant, set_value(counters->nInCirculation));
 
-  // TODO: Add objectMonitor leak detection.
-  // Audit/inventory the objectMonitors -- make sure they're all accounted for.
   GVars.stwRandom = os::random();
   GVars.stwCycle++;
 }
@@ -1692,7 +1701,8 @@
   ObjectMonitor * freeTailp = NULL;
   elapsedTimer timer;
 
-  if (log_is_enabled(Info, safepoint, cleanup)) {
+  if (log_is_enabled(Info, safepoint, cleanup) ||
+      log_is_enabled(Info, monitorinflation)) {
     timer.start();
   }
 
@@ -1700,13 +1710,14 @@
 
   timer.stop();
 
-  Thread::muxAcquire(&gListLock, "scavenge - return");
+  Thread::muxAcquire(&gListLock, "deflate_thread_local_monitors");
 
   // Adjust counters
   counters->nInCirculation += thread->omInUseCount;
   thread->omInUseCount -= deflated_count;
   counters->nScavenged += deflated_count;
   counters->nInuse += thread->omInUseCount;
+  counters->perThreadScavenged += deflated_count;
   // For now, we only care about cumulative per-thread deflation time.
   counters->perThreadTimes += timer.seconds();
 
@@ -1799,6 +1810,338 @@
   return (u_char*)&GVars.stwRandom;
 }
 
+void ObjectSynchronizer::audit_and_print_stats(bool on_exit) {
+  assert(on_exit || SafepointSynchronize::is_at_safepoint(), "invariant");
+
+  LogStreamHandle(Debug, monitorinflation) lsh_debug;
+  LogStreamHandle(Info, monitorinflation) lsh_info;
+  LogStreamHandle(Trace, monitorinflation) lsh_trace;
+  LogStream * ls = NULL;
+  if (log_is_enabled(Trace, monitorinflation)) {
+    ls = &lsh_trace;
+  } else if (log_is_enabled(Debug, monitorinflation)) {
+    ls = &lsh_debug;
+  } else if (log_is_enabled(Info, monitorinflation)) {
+    ls = &lsh_info;
+  }
+  assert(ls != NULL, "sanity check");
+
+  if (!on_exit) {
+    // Not at VM exit so grab the global list lock.
+    Thread::muxAcquire(&gListLock, "audit_and_print_stats");
+  }
+
+  // Log counts for the global and per-thread monitor lists:
+  int chkMonitorPopulation = log_monitor_list_counts(ls);
+  int error_cnt = 0;
+
+  ls->print_cr("Checking global lists:");
+
+  // Check gMonitorPopulation:
+  if (gMonitorPopulation == chkMonitorPopulation) {
+     ls->print_cr("gMonitorPopulation=%d equals chkMonitorPopulation=%d",
+                  gMonitorPopulation, chkMonitorPopulation);
+  } else {
+     ls->print_cr("ERROR: gMonitorPopulation=%d is not equal to "
+                  "chkMonitorPopulation=%d", gMonitorPopulation,
+                  chkMonitorPopulation);
+     error_cnt++;
+  }
+
+  // Check gOmInUseList and gOmInUseCount:
+  chk_global_in_use_list_and_count(ls, &error_cnt);
+
+  // Check gFreeList and gMonitorFreeCount:
+  chk_global_free_list_and_count(ls, &error_cnt);
+
+  if (!on_exit) {
+    Thread::muxRelease(&gListLock);
+  }
+
+  ls->print_cr("Checking per-thread lists:");
+
+  for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
+    // Check omInUseList and omInUseCount:
+    chk_per_thread_in_use_list_and_count(jt, ls, &error_cnt);
+
+    // Check omFreeList and omFreeCount:
+    chk_per_thread_free_list_and_count(jt, ls, &error_cnt);
+  }
+
+  if (error_cnt == 0) {
+    ls->print_cr("No errors found in monitor list checks.");
+  } else {
+    log_error(monitorinflation)("found monitor list errors: error_cnt=%d", error_cnt);
+  }
+
+  if ((on_exit && log_is_enabled(Info, monitorinflation)) ||
+      (!on_exit && log_is_enabled(Trace, monitorinflation))) {
+    // When exiting this log output is at the Info level. When called
+    // at a safepoint, this log output is at the Trace level since
+    // there can be a lot of it.
+    log_in_use_monitor_details(ls, on_exit);
+  }
+
+  ls->flush();
+
+  guarantee(error_cnt == 0, "ERROR: found monitor list errors: error_cnt=%d", error_cnt);
+}
+
+// Check a free monitor entry; log any errors.
+void ObjectSynchronizer::chk_free_entry(JavaThread * jt, ObjectMonitor * n,
+                                        outputStream * out, int *error_cnt_p) {
+  if (n->is_busy()) {
+    if (jt != NULL) {
+      out->print_cr("ERROR: jt=" INTPTR_FORMAT ", monitor=" INTPTR_FORMAT
+                    ": free per-thread monitor must not be busy.", p2i(jt),
+                    p2i(n));
+    } else {
+      out->print_cr("ERROR: monitor=" INTPTR_FORMAT ": free global monitor "
+                    "must not be busy.", p2i(n));
+    }
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+  if (n->header() != NULL) {
+    if (jt != NULL) {
+      out->print_cr("ERROR: jt=" INTPTR_FORMAT ", monitor=" INTPTR_FORMAT
+                    ": free per-thread monitor must have NULL _header "
+                    "field: _header=" INTPTR_FORMAT, p2i(jt), p2i(n),
+                    p2i(n->header()));
+    } else {
+      out->print_cr("ERROR: monitor=" INTPTR_FORMAT ": free global monitor "
+                    "must have NULL _header field: _header=" INTPTR_FORMAT,
+                    p2i(n), p2i(n->header()));
+    }
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+  if (n->object() != NULL) {
+    if (jt != NULL) {
+      out->print_cr("ERROR: jt=" INTPTR_FORMAT ", monitor=" INTPTR_FORMAT
+                    ": free per-thread monitor must have NULL _object "
+                    "field: _object=" INTPTR_FORMAT, p2i(jt), p2i(n),
+                    p2i(n->object()));
+    } else {
+      out->print_cr("ERROR: monitor=" INTPTR_FORMAT ": free global monitor "
+                    "must have NULL _object field: _object=" INTPTR_FORMAT,
+                    p2i(n), p2i(n->object()));
+    }
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+}
+
+// Check the global free list and count; log the results of the checks.
+void ObjectSynchronizer::chk_global_free_list_and_count(outputStream * out,
+                                                        int *error_cnt_p) {
+  int chkMonitorFreeCount = 0;
+  for (ObjectMonitor * n = gFreeList; n != NULL; n = n->FreeNext) {
+    chk_free_entry(NULL /* jt */, n, out, error_cnt_p);
+    chkMonitorFreeCount++;
+  }
+  if (gMonitorFreeCount == chkMonitorFreeCount) {
+    out->print_cr("gMonitorFreeCount=%d equals chkMonitorFreeCount=%d",
+                  gMonitorFreeCount, chkMonitorFreeCount);
+  } else {
+    out->print_cr("ERROR: gMonitorFreeCount=%d is not equal to "
+                  "chkMonitorFreeCount=%d", gMonitorFreeCount,
+                  chkMonitorFreeCount);
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+}
+
+// Check the global in-use list and count; log the results of the checks.
+void ObjectSynchronizer::chk_global_in_use_list_and_count(outputStream * out,
+                                                          int *error_cnt_p) {
+  int chkOmInUseCount = 0;
+  for (ObjectMonitor * n = gOmInUseList; n != NULL; n = n->FreeNext) {
+    chk_in_use_entry(NULL /* jt */, n, out, error_cnt_p);
+    chkOmInUseCount++;
+  }
+  if (gOmInUseCount == chkOmInUseCount) {
+    out->print_cr("gOmInUseCount=%d equals chkOmInUseCount=%d", gOmInUseCount,
+                  chkOmInUseCount);
+  } else {
+    out->print_cr("ERROR: gOmInUseCount=%d is not equal to chkOmInUseCount=%d",
+                  gOmInUseCount, chkOmInUseCount);
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+}
+
+// Check an in-use monitor entry; log any errors.
+void ObjectSynchronizer::chk_in_use_entry(JavaThread * jt, ObjectMonitor * n,
+                                          outputStream * out, int *error_cnt_p) {
+  if (n->header() == NULL) {
+    if (jt != NULL) {
+      out->print_cr("ERROR: jt=" INTPTR_FORMAT ", monitor=" INTPTR_FORMAT
+                    ": in-use per-thread monitor must have non-NULL _header "
+                    "field.", p2i(jt), p2i(n));
+    } else {
+      out->print_cr("ERROR: monitor=" INTPTR_FORMAT ": in-use global monitor "
+                    "must have non-NULL _header field.", p2i(n));
+    }
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+  if (n->object() == NULL) {
+    if (jt != NULL) {
+      out->print_cr("ERROR: jt=" INTPTR_FORMAT ", monitor=" INTPTR_FORMAT
+                    ": in-use per-thread monitor must have non-NULL _object "
+                    "field.", p2i(jt), p2i(n));
+    } else {
+      out->print_cr("ERROR: monitor=" INTPTR_FORMAT ": in-use global monitor "
+                    "must have non-NULL _object field.", p2i(n));
+    }
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+  const oop obj = (oop)n->object();
+  const markOop mark = obj->mark();
+  if (!mark->has_monitor()) {
+    if (jt != NULL) {
+      out->print_cr("ERROR: jt=" INTPTR_FORMAT ", monitor=" INTPTR_FORMAT
+                    ": in-use per-thread monitor's object does not think "
+                    "it has a monitor: obj=" INTPTR_FORMAT ", mark="
+                    INTPTR_FORMAT,  p2i(jt), p2i(n), p2i((address)obj),
+                    p2i((address)mark));
+    } else {
+      out->print_cr("ERROR: monitor=" INTPTR_FORMAT ": in-use global "
+                    "monitor's object does not think it has a monitor: obj="
+                    INTPTR_FORMAT ", mark=" INTPTR_FORMAT, p2i(n),
+                    p2i((address)obj), p2i((address)mark));
+    }
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+  ObjectMonitor * const obj_mon = mark->monitor();
+  if (n != obj_mon) {
+    if (jt != NULL) {
+      out->print_cr("ERROR: jt=" INTPTR_FORMAT ", monitor=" INTPTR_FORMAT
+                    ": in-use per-thread monitor's object does not refer "
+                    "to the same monitor: obj=" INTPTR_FORMAT ", mark="
+                    INTPTR_FORMAT ", obj_mon=" INTPTR_FORMAT, p2i(jt),
+                    p2i(n), p2i((address)obj), p2i((address)mark),
+                    p2i((address)obj_mon));
+    } else {
+      out->print_cr("ERROR: monitor=" INTPTR_FORMAT ": in-use global "
+                    "monitor's object does not refer to the same monitor: obj="
+                    INTPTR_FORMAT ", mark=" INTPTR_FORMAT ", obj_mon="
+                    INTPTR_FORMAT, p2i(n), p2i((address)obj),
+                    p2i((address)mark), p2i((address)obj_mon));
+    }
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+}
+
+// Check the thread's free list and count; log the results of the checks.
+void ObjectSynchronizer::chk_per_thread_free_list_and_count(JavaThread *jt,
+                                                            outputStream * out,
+                                                            int *error_cnt_p) {
+  int chkOmFreeCount = 0;
+  for (ObjectMonitor * n = jt->omFreeList; n != NULL; n = n->FreeNext) {
+    chk_free_entry(jt, n, out, error_cnt_p);
+    chkOmFreeCount++;
+  }
+  if (jt->omFreeCount == chkOmFreeCount) {
+    out->print_cr("jt=" INTPTR_FORMAT ": omFreeCount=%d equals "
+                  "chkOmFreeCount=%d", p2i(jt), jt->omFreeCount, chkOmFreeCount);
+  } else {
+    out->print_cr("ERROR: jt=" INTPTR_FORMAT ": omFreeCount=%d is not "
+                  "equal to chkOmFreeCount=%d", p2i(jt), jt->omFreeCount,
+                  chkOmFreeCount);
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+}
+
+// Check the thread's in-use list and count; log the results of the checks.
+void ObjectSynchronizer::chk_per_thread_in_use_list_and_count(JavaThread *jt,
+                                                              outputStream * out,
+                                                              int *error_cnt_p) {
+  int chkOmInUseCount = 0;
+  for (ObjectMonitor * n = jt->omInUseList; n != NULL; n = n->FreeNext) {
+    chk_in_use_entry(jt, n, out, error_cnt_p);
+    chkOmInUseCount++;
+  }
+  if (jt->omInUseCount == chkOmInUseCount) {
+    out->print_cr("jt=" INTPTR_FORMAT ": omInUseCount=%d equals "
+                  "chkOmInUseCount=%d", p2i(jt), jt->omInUseCount,
+                  chkOmInUseCount);
+  } else {
+    out->print_cr("ERROR: jt=" INTPTR_FORMAT ": omInUseCount=%d is not "
+                  "equal to chkOmInUseCount=%d", p2i(jt), jt->omInUseCount,
+                  chkOmInUseCount);
+    *error_cnt_p = *error_cnt_p + 1;
+  }
+}
+
+// Log details about ObjectMonitors on the in-use lists. The 'BHL'
+// flags indicate why the entry is in-use, 'object' and 'object type'
+// indicate the associated object and its type.
+void ObjectSynchronizer::log_in_use_monitor_details(outputStream * out,
+                                                    bool on_exit) {
+  if (!on_exit) {
+    // Not at VM exit so grab the global list lock.
+    Thread::muxAcquire(&gListLock, "log_in_use_monitor_details");
+  }
+
+  if (gOmInUseCount > 0) {
+    out->print_cr("In-use global monitor info:");
+    out->print_cr("(B -> is_busy, H -> has hashcode, L -> lock status)");
+    out->print_cr("%18s  %s  %18s  %18s",
+                  "monitor", "BHL", "object", "object type");
+    out->print_cr("==================  ===  ==================  ==================");
+    for (ObjectMonitor * n = gOmInUseList; n != NULL; n = n->FreeNext) {
+      const oop obj = (oop) n->object();
+      const markOop mark = n->header();
+      ResourceMark rm;
+      out->print_cr(INTPTR_FORMAT "  %d%d%d  " INTPTR_FORMAT "  %s", p2i(n),
+                    n->is_busy() != 0, mark->hash() != 0, n->owner() != NULL,
+                    p2i(obj), obj->klass()->external_name());
+    }
+  }
+
+  if (!on_exit) {
+    Thread::muxRelease(&gListLock);
+  }
+
+  out->print_cr("In-use per-thread monitor info:");
+  out->print_cr("(B -> is_busy, H -> has hashcode, L -> lock status)");
+  out->print_cr("%18s  %18s  %s  %18s  %18s",
+                "jt", "monitor", "BHL", "object", "object type");
+  out->print_cr("==================  ==================  ===  ==================  ==================");
+  for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
+    for (ObjectMonitor * n = jt->omInUseList; n != NULL; n = n->FreeNext) {
+      const oop obj = (oop) n->object();
+      const markOop mark = n->header();
+      ResourceMark rm;
+      out->print_cr(INTPTR_FORMAT "  " INTPTR_FORMAT "  %d%d%d  " INTPTR_FORMAT
+                    "  %s", p2i(jt), p2i(n), n->is_busy() != 0,
+                    mark->hash() != 0, n->owner() != NULL, p2i(obj),
+                    obj->klass()->external_name());
+    }
+  }
+
+  out->flush();
+}
+
+// Log counts for the global and per-thread monitor lists and return
+// the population count.
+int ObjectSynchronizer::log_monitor_list_counts(outputStream * out) {
+  int popCount = 0;
+  out->print_cr("%18s  %10s  %10s  %10s",
+                "Global Lists:", "InUse", "Free", "Total");
+  out->print_cr("==================  ==========  ==========  ==========");
+  out->print_cr("%18s  %10d  %10d  %10d", "",
+                gOmInUseCount, gMonitorFreeCount, gMonitorPopulation);
+  popCount += gOmInUseCount + gMonitorFreeCount;
+
+  out->print_cr("%18s  %10s  %10s  %10s",
+                "Per-Thread Lists:", "InUse", "Free", "Provision");
+  out->print_cr("==================  ==========  ==========  ==========");
+
+  for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
+    out->print_cr(INTPTR_FORMAT "  %10d  %10d  %10d", p2i(jt),
+                  jt->omInUseCount, jt->omFreeCount, jt->omFreeProvision);
+    popCount += jt->omInUseCount + jt->omFreeCount;
+  }
+  return popCount;
+}
+
 #ifndef PRODUCT
 
 // Check if monitor belongs to the monitor cache
--- a/src/hotspot/share/runtime/synchronizer.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/synchronizer.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -35,10 +35,11 @@
 class ThreadsList;
 
 struct DeflateMonitorCounters {
-  int nInuse;             // currently associated with objects
-  int nInCirculation;     // extant
-  int nScavenged;         // reclaimed
-  double perThreadTimes;  // per-thread scavenge times
+  int nInuse;              // currently associated with objects
+  int nInCirculation;      // extant
+  int nScavenged;          // reclaimed (global and per-thread)
+  int perThreadScavenged;  // per-thread scavenge total
+  double perThreadTimes;   // per-thread scavenge times
 };
 
 class ObjectSynchronizer : AllStatic {
@@ -114,7 +115,7 @@
   // Inflate light weight monitor to heavy weight monitor
   static ObjectMonitor* inflate(Thread * Self, oop obj, const InflateCause cause);
   // This version is only for internal use
-  static ObjectMonitor* inflate_helper(oop obj);
+  static void inflate_helper(oop obj);
   static const char* inflate_cause_name(const InflateCause cause);
 
   // Returns the identity hash value for an oop
@@ -153,6 +154,23 @@
   static void thread_local_used_oops_do(Thread* thread, OopClosure* f);
 
   // debugging
+  static void audit_and_print_stats(bool on_exit);
+  static void chk_free_entry(JavaThread * jt, ObjectMonitor * n,
+                             outputStream * out, int *error_cnt_p);
+  static void chk_global_free_list_and_count(outputStream * out,
+                                             int *error_cnt_p);
+  static void chk_global_in_use_list_and_count(outputStream * out,
+                                               int *error_cnt_p);
+  static void chk_in_use_entry(JavaThread * jt, ObjectMonitor * n,
+                               outputStream * out, int *error_cnt_p);
+  static void chk_per_thread_in_use_list_and_count(JavaThread *jt,
+                                                   outputStream * out,
+                                                   int *error_cnt_p);
+  static void chk_per_thread_free_list_and_count(JavaThread *jt,
+                                                 outputStream * out,
+                                                 int *error_cnt_p);
+  static void log_in_use_monitor_details(outputStream * out, bool on_exit);
+  static int  log_monitor_list_counts(outputStream * out);
   static int  verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
 
  private:
--- a/src/hotspot/share/runtime/thread.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/thread.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -69,6 +69,7 @@
 #include "runtime/flags/jvmFlagWriteableList.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/handshake.hpp"
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
--- a/src/hotspot/share/runtime/thread.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/thread.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -647,7 +647,7 @@
   // uses an atomic instruction to set the current threads parity to
   // "collection_parity", if it is not already.  Returns "true" iff the
   // calling thread does the update, this indicates that the calling thread
-  // has claimed the thread's stack as a root groop in the current
+  // has claimed the thread's stack as a root group in the current
   // collection.
   bool claim_oops_do(bool is_par, int collection_parity) {
     if (!is_par) {
@@ -1280,15 +1280,8 @@
   address last_Java_pc(void)                     { return _anchor.last_Java_pc(); }
 
   // Safepoint support
-#if !(defined(PPC64) || defined(AARCH64))
-  JavaThreadState thread_state() const           { return _thread_state; }
-  void set_thread_state(JavaThreadState s)       { _thread_state = s;    }
-#else
-  // Use membars when accessing volatile _thread_state. See
-  // Threads::create_vm() for size checks.
   inline JavaThreadState thread_state() const;
   inline void set_thread_state(JavaThreadState s);
-#endif
   inline ThreadSafepointState* safepoint_state() const;
   inline void set_safepoint_state(ThreadSafepointState* state);
   inline bool is_at_poll_safepoint();
@@ -2250,7 +2243,7 @@
   // The "thread claim parity" provides a way for threads to be claimed
   // by parallel worker tasks.
   //
-  // Each thread contains a a "parity" field. A task will claim the
+  // Each thread contains a "parity" field. A task will claim the
   // thread only if its parity field is the same as the global parity,
   // which is updated by calling change_thread_claim_parity().
   //
@@ -2259,7 +2252,7 @@
   // that should claim threads.
   //
   // New threads get their parity set to 0 and change_thread_claim_parity()
-  // never set the global parity to 0.
+  // never sets the global parity to 0.
   static int thread_claim_parity() { return _thread_claim_parity; }
   static void change_thread_claim_parity();
   static void assert_all_threads_claimed() NOT_DEBUG_RETURN;
--- a/src/hotspot/share/runtime/thread.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/thread.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -121,15 +121,25 @@
   set_has_async_exception();
 }
 
+inline JavaThreadState JavaThread::thread_state() const    {
 #if defined(PPC64) || defined (AARCH64)
-inline JavaThreadState JavaThread::thread_state() const    {
+  // Use membars when accessing volatile _thread_state. See
+  // Threads::create_vm() for size checks.
   return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
+#else
+  return _thread_state;
+#endif
 }
 
 inline void JavaThread::set_thread_state(JavaThreadState s) {
+#if defined(PPC64) || defined (AARCH64)
+  // Use membars when accessing volatile _thread_state. See
+  // Threads::create_vm() for size checks.
   OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
+#else
+  _thread_state = s;
+#endif
 }
-#endif
 
 ThreadSafepointState* JavaThread::safepoint_state() const  {
   return _safepoint_state;
--- a/src/hotspot/share/runtime/vframe.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/vframe.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
 #include "runtime/signature.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/synchronizer.hpp"
+#include "runtime/thread.inline.hpp"
 #include "runtime/vframe.inline.hpp"
 #include "runtime/vframeArray.hpp"
 #include "runtime/vframe_hp.hpp"
--- a/src/hotspot/share/runtime/vmOperations.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/vmOperations.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -68,7 +68,9 @@
   template(G1CollectForAllocation)                \
   template(G1CollectFull)                         \
   template(G1Concurrent)                          \
-  template(ZOperation)                            \
+  template(ZMarkStart)                            \
+  template(ZMarkEnd)                              \
+  template(ZRelocateStart)                        \
   template(HandshakeOneThread)                    \
   template(HandshakeAllThreads)                   \
   template(HandshakeFallback)                     \
@@ -119,7 +121,6 @@
   template(PrintCompileQueue)                     \
   template(PrintClassHierarchy)                   \
   template(ThreadSuspend)                         \
-  template(CTWThreshold)                          \
   template(ThreadsSuspendJVMTI)                   \
   template(ICBufferFull)                          \
   template(ScavengeMonitors)                      \
@@ -270,12 +271,6 @@
   VMOp_Type type() const { return VMOp_ThreadSuspend; }
 };
 
-// empty vm op, when forcing a safepoint due to ctw threshold is reached for the sweeper
-class VM_CTWThreshold: public VM_ForceSafepoint {
- public:
-  VMOp_Type type() const { return VMOp_CTWThreshold; }
-};
-
 // empty vm op, when forcing a safepoint to suspend threads from jvmti
 class VM_ThreadsSuspendJVMTI: public VM_ForceSafepoint {
  public:
--- a/src/hotspot/share/runtime/vmThread.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/runtime/vmThread.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/verifyOopClosure.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/os.hpp"
--- a/src/hotspot/share/services/lowMemoryDetector.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/services/lowMemoryDetector.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 #include "classfile/vmSymbols.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
--- a/src/hotspot/share/utilities/bitMap.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/utilities/bitMap.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -429,12 +429,6 @@
     return _map.size();
   }
 
-  // Returns number of full slots that have been allocated
-  idx_t size_in_slots() {
-    // Round down
-    return _map.size() / _bits_per_slot;
-  }
-
   bool is_valid_index(idx_t slot_index, idx_t bit_within_slot_index);
   bool at(idx_t slot_index, idx_t bit_within_slot_index) const;
   void set_bit(idx_t slot_index, idx_t bit_within_slot_index);
--- a/src/hotspot/share/utilities/concurrentHashTable.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/utilities/concurrentHashTable.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -403,10 +403,6 @@
   bool get(Thread* thread, LOOKUP_FUNC& lookup_f, FOUND_FUNC& foundf,
            bool* grow_hint = NULL);
 
-  // Return a copy of an item found with LOOKUP_FUNC.
-  template <typename LOOKUP_FUNC>
-  VALUE get_copy(Thread* thread, LOOKUP_FUNC& lookup_f, bool* grow_hint = NULL);
-
   // Returns true true if the item was inserted, duplicates are found with
   // LOOKUP_FUNC.
   template <typename LOOKUP_FUNC>
@@ -475,10 +471,6 @@
     static uintx get_hash(const VALUE& value, bool* dead) {
       return CONFIG::get_hash(value, dead);
     }
-    // On get_copy if no value is found then this value is returned.
-    static const VALUE& notfound() {
-      return CONFIG::notfound();
-    }
     // Default node allocation.
     static void* allocate_node(size_t size, const VALUE& value);
     // Default node reclamation.
--- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1066,16 +1066,6 @@
 }
 
 template <typename VALUE, typename CONFIG, MEMFLAGS F>
-template <typename LOOKUP_FUNC>
-inline VALUE ConcurrentHashTable<VALUE, CONFIG, F>::
-  get_copy(Thread* thread, LOOKUP_FUNC& lookup_f, bool* grow_hint)
-{
-  ScopedCS cs(thread, this);
-  VALUE* val = internal_get(thread, lookup_f, grow_hint);
-  return val != NULL ? *val : CONFIG::notfound();
-}
-
-template <typename VALUE, typename CONFIG, MEMFLAGS F>
 inline bool ConcurrentHashTable<VALUE, CONFIG, F>::
   unsafe_insert(const VALUE& value) {
   bool dead_hash = false;
--- a/src/hotspot/share/utilities/debug.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/utilities/debug.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -92,6 +92,21 @@
 #  endif
 #endif // PRODUCT
 
+#ifdef ASSERT
+// This is to test that error reporting works if we assert during dynamic
+// initialization of the hotspot. See JDK-8214975.
+struct Crasher {
+  Crasher() {
+    // Using getenv - no other mechanism would work yet.
+    const char* s = ::getenv("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION");
+    if (s != NULL && ::strcmp(s, "1") == 0) {
+      fatal("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION");
+    }
+  }
+};
+static Crasher g_crasher;
+#endif // ASSERT
+
 ATTRIBUTE_PRINTF(1, 2)
 void warning(const char* format, ...) {
   if (PrintWarnings) {
--- a/src/hotspot/share/utilities/resourceHash.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/utilities/resourceHash.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -27,11 +27,6 @@
 
 #include "memory/allocation.hpp"
 
-template<typename K> struct ResourceHashtableFns {
-    typedef unsigned (*hash_fn)(K const&);
-    typedef bool (*equals_fn)(K const&, K const&);
-};
-
 template<
     typename K, typename V,
     // xlC does not compile this:
@@ -160,10 +155,6 @@
       ++bucket;
     }
   }
-
-  static size_t node_size() {
-    return sizeof(Node);
-  }
 };
 
 
--- a/src/hotspot/share/utilities/vmError.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/utilities/vmError.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1189,16 +1189,6 @@
 
 volatile intptr_t VMError::first_error_tid = -1;
 
-// An error could happen before tty is initialized or after it has been
-// destroyed.
-// Please note: to prevent large stack allocations, the log- and
-// output-stream use a global scratch buffer for format printing.
-// (see VmError::report_and_die(). Access to those streams is synchronized
-// in  VmError::report_and_die() - there is only one reporting thread at
-// any given time.
-fdStream VMError::out(defaultStream::output_fd());
-fdStream VMError::log; // error log used by VMError::report_and_die()
-
 /** Expand a pattern into a buffer starting at pos and open a file using constructed path */
 static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) {
   int fd = -1;
@@ -1303,9 +1293,25 @@
                              Thread* thread, address pc, void* siginfo, void* context, const char* filename,
                              int lineno, size_t size)
 {
-  // Don't allocate large buffer on stack
+  // A single scratch buffer to be used from here on.
+  // Do not rely on it being preserved across function calls.
   static char buffer[O_BUFLEN];
+
+  // File descriptor to tty to print an error summary to.
+  // Hard wired to stdout; see JDK-8215004 (compatibility concerns).
+  static const int fd_out = 1; // stdout
+
+  // File descriptor to the error log file.
+  static int fd_log = -1;
+
+  // Use local fdStream objects only. Do not use global instances whose initialization
+  // relies on dynamic initialization (see JDK-8214975). Do not rely on these instances
+  // to carry over into recursions or invocations from other threads.
+  fdStream out(fd_out);
   out.set_scratch_buffer(buffer, sizeof(buffer));
+
+  // Depending on the re-entrance depth at this point, fd_log may be -1 or point to an open hs-err file.
+  fdStream log(fd_log);
   log.set_scratch_buffer(buffer, sizeof(buffer));
 
   // How many errors occurred in error handler when reporting first_error.
@@ -1451,15 +1457,15 @@
     // see if log file is already open
     if (!log.is_open()) {
       // open log file
-      int fd = prepare_log_file(ErrorFile, "hs_err_pid%p.log", buffer, sizeof(buffer));
-      if (fd != -1) {
+      fd_log = prepare_log_file(ErrorFile, "hs_err_pid%p.log", buffer, sizeof(buffer));
+      if (fd_log != -1) {
         out.print_raw("# An error report file with more information is saved as:\n# ");
         out.print_raw_cr(buffer);
 
-        log.set_fd(fd);
+        log.set_fd(fd_log);
       } else {
         out.print_raw_cr("# Can not save log file, dump to screen..");
-        log.set_fd(defaultStream::output_fd());
+        log.set_fd(fd_out);
       }
     }
 
@@ -1468,8 +1474,9 @@
     _current_step = 0;
     _current_step_info = "";
 
-    if (log.fd() != defaultStream::output_fd()) {
-      close(log.fd());
+    if (fd_log != -1) {
+      close(fd_log);
+      fd_log = -1;
     }
 
     log.set_fd(-1);
--- a/src/hotspot/share/utilities/vmError.hpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/hotspot/share/utilities/vmError.hpp	Mon Feb 04 11:01:04 2019 +0530
@@ -122,9 +122,6 @@
                              void* context, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(6, 7);
   static void report_and_die(const char* message, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(2, 3);
 
-  static fdStream out;
-  static fdStream log; // error log used by VMError::report_and_die()
-
   // Timeout handling.
   // Hook functions for platform dependend functionality:
   static void reporting_started();
--- a/src/java.base/share/classes/java/lang/Character.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/lang/Character.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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,35 +35,29 @@
 
 /**
  * The {@code Character} class wraps a value of the primitive
- * type {@code char} in an object. An object of type
+ * type {@code char} in an object. An object of class
  * {@code Character} contains a single field whose type is
  * {@code char}.
  * <p>
- * In addition, this class provides several methods for determining
- * a character's category (lowercase letter, digit, etc.) and for converting
- * characters from uppercase to lowercase and vice versa.
- * <p>
- * Character information is based on the Unicode Standard, version 11.0.0.
- * <p>
- * The methods and data of class {@code Character} are defined by
- * the information in the <i>UnicodeData</i> file that is part of the
- * Unicode Character Database maintained by the Unicode
- * Consortium. This file specifies various properties including name
- * and general category for every defined Unicode code point or
- * character range.
+ * In addition, this class provides a large number of static methods for
+ * determining a character's category (lowercase letter, digit, etc.)
+ * and for converting characters from uppercase to lowercase and vice
+ * versa.
+ *
+ * <h3><a id="conformance">Unicode Conformance</a></h3>
  * <p>
- * The file and its description are available from the Unicode Consortium at:
- * <ul>
- * <li><a href="http://www.unicode.org">http://www.unicode.org</a>
- * </ul>
+ * The fields and methods of class {@code Character} are defined in terms
+ * of character information from the Unicode Standard, specifically the
+ * <i>UnicodeData</i> file that is part of the Unicode Character Database.
+ * This file specifies properties including name and category for every
+ * assigned Unicode code point or character range. The file is available
+ * from the Unicode Consortium at
+ * <a href="http://www.unicode.org">http://www.unicode.org</a>.
  * <p>
- * The code point, U+32FF, is reserved by the Unicode Consortium
- * to represent the Japanese square character for the new era that begins
- * May 2019. Relevant methods in the Character class return the same
- * properties as for the existing Japanese era characters (e.g., U+337E for
- * "Meizi"). For the details of the code point, refer to
- * <a href="http://blog.unicode.org/2018/09/new-japanese-era.html">
- * http://blog.unicode.org/2018/09/new-japanese-era.html</a>.
+ * The Java SE 12 Platform uses character information from version 11.0
+ * of the Unicode Standard, plus the Japanese Era code point,
+ * {@code U+32FF}, from the first version of the Unicode Standard
+ * after 11.0 that assigns the code point.
  *
  * <h3><a id="unicode">Unicode Character Representations</a></h3>
  *
@@ -9495,7 +9489,7 @@
      * character in a Java identifier.
      * <p>
      * A character may start a Java identifier if and only if
-     * one of the following is true:
+     * one of the following conditions is true:
      * <ul>
      * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true}
      * <li> {@link #getType(char) getType(ch)} returns {@code LETTER_NUMBER}
@@ -9524,8 +9518,8 @@
      * Determines if the specified character may be part of a Java
      * identifier as other than the first character.
      * <p>
-     * A character may be part of a Java identifier if and only if any
-     * of the following are true:
+     * A character may be part of a Java identifier if and only if one
+     * of the following conditions is true:
      * <ul>
      * <li>  it is a letter
      * <li>  it is a currency symbol (such as {@code '$'})
@@ -9667,7 +9661,7 @@
      * identifier as other than the first character.
      * <p>
      * A character may be part of a Java identifier if any of the following
-     * are true:
+     * conditions are true:
      * <ul>
      * <li>  it is a letter
      * <li>  it is a currency symbol (such as {@code '$'})
@@ -9704,7 +9698,7 @@
      * identifier as other than the first character.
      * <p>
      * A character may be part of a Java identifier if any of the following
-     * are true:
+     * conditions are true:
      * <ul>
      * <li>  it is a letter
      * <li>  it is a currency symbol (such as {@code '$'})
@@ -9715,7 +9709,7 @@
      * <li>  it is a non-spacing mark
      * <li> {@link #isIdentifierIgnorable(int)
      * isIdentifierIgnorable(codePoint)} returns {@code true} for
-     * the character
+     * the code point
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
--- a/src/java.base/share/classes/java/lang/LiveStackFrame.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/lang/LiveStackFrame.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -166,7 +166,7 @@
      * @param options stack walk {@link StackWalker.Option options}
      *
      * @throws SecurityException if the security manager is present and
-     * it denies access to {@code RuntimePermission("liveStackFrames")}; or
+     * it denies access to {@code RuntimePermission("liveStackFrames")};
      * or if the given {@code options} contains
      * {@link StackWalker.Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE}
      * and it denies access to {@code RuntimePermission("getStackWalkerWithClassReference")}.
--- a/src/java.base/share/classes/java/lang/Object.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/lang/Object.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -430,7 +430,7 @@
      * }</pre>
      *
      * @param  timeoutMillis the maximum time to wait, in milliseconds
-     * @param  nanos   additional time, in nanoseconds, in the range range 0-999999 inclusive
+     * @param  nanos   additional time, in nanoseconds, in the range 0-999999 inclusive
      * @throws IllegalArgumentException if {@code timeoutMillis} is negative,
      *         or if the value of {@code nanos} is out of range
      * @throws IllegalMonitorStateException if the current thread is not
--- a/src/java.base/share/classes/java/lang/String.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/lang/String.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -2698,7 +2698,7 @@
      * <p>
      * Otherwise, returns a substring of this string beginning with the first
      * code point that is not a {@link Character#isWhitespace(int) white space}
-     * up to to and including the last code point of this string.
+     * up to and including the last code point of this string.
      * <p>
      * This method may be used to trim
      * {@link Character#isWhitespace(int) white space} from
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -1083,7 +1083,7 @@
       * else if (makeVarargs)
       *   return asVarargsCollector(type().lastParameterType());
       * else
-      *   return return asFixedArity();
+      *   return asFixedArity();
       * }</pre></blockquote>
       * @param makeVarargs true if the return method handle should have variable arity behavior
       * @return a method handle of the same type, with possibly adjusted variable arity behavior
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -434,7 +434,7 @@
      * completely in the linker method.
      * As a corner case, if N==255, no appendix is possible.
      * In this case, the method returned must be custom-generated to
-     * to perform any needed type checking.
+     * perform any needed type checking.
      * <p>
      * If the JVM does not reify a method at a call site, but instead
      * calls {@code linkMethod}, the corresponding call represented
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Mon Feb 04 11:01:04 2019 +0530
@@ -2160,7 +2160,7 @@
          * Construct a {@linkplain VarHandleDesc} given a kind, name, and declaring
          * class.
          *
-         * @param kind the kind of of the var handle
+         * @param kind the kind of the var handle
          * @param name the unqualified name of the field, for field var handles; otherwise ignored
          * @param declaringClass a {@link ClassDesc} describing the declaring class,
          *                       for field var handles
@@ -2217,7 +2217,7 @@
 
         /**
          * Returns a {@linkplain VarHandleDesc} corresponding to a {@link VarHandle}
-         * for for an array type.
+         * for an array type.
          *
          * @param arrayClass a {@link ClassDesc} describing the type of the array
          * @return the {@linkplain VarHandleDesc}
--- a/src/java.base/share/classes/java/lang/module/Resolver.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/lang/module/Resolver.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -659,7 +659,7 @@
      * Checks the readability graph to ensure that
      * <ol>
      *   <li><p> A module does not read two or more modules with the same name.
-     *   This includes the case where a module reads another another with the
+     *   This includes the case where a module reads another module with the
      *   same name as itself. </p></li>
      *   <li><p> Two or more modules in the configuration don't export the same
      *   package to a module that reads both. This includes the case where a
--- a/src/java.base/share/classes/java/security/cert/Extension.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/security/cert/Extension.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -41,7 +41,7 @@
  * <p>
  * Each extension contains an object identifier, a criticality setting
  * indicating whether it is a critical or a non-critical extension, and
- * and an ASN.1 DER-encoded value. Its ASN.1 definition is:
+ * an ASN.1 DER-encoded value. Its ASN.1 definition is:
  *
  * <pre>
  *
--- a/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Mon Feb 04 11:01:04 2019 +0530
@@ -88,15 +88,33 @@
 /**
  * An era in the Japanese Imperial calendar system.
  * <p>
- * This class defines the valid eras for the Japanese chronology.
- * Japan introduced the Gregorian calendar starting with Meiji 6.
- * Only Meiji and later eras are supported;
- * dates before Meiji 6, January 1 are not supported.
- * The number of the valid eras may increase, as new eras may be
- * defined by the Japanese government. Once an era is defined,
- * future versions of the platform may add a singleton instance
- * for it. The defined era is expected to have a consecutive integer
- * associated with it.
+ * The Japanese government defines the official name and start date of
+ * each era. Eras are consecutive and their date ranges do not overlap,
+ * so the end date of one era is always the day before the start date
+ * of the next era.
+ * <p>
+ * The Java SE Platform supports all eras defined by the Japanese government,
+ * beginning with the Meiji era. Each era is identified in the Platform by an
+ * integer value and a name. The {@link #of(int)} and {@link #valueOf(String)}
+ * methods may be used to obtain a singleton instance of {@code JapaneseEra}
+ * for each era. The {@link #values()} method returns the singleton instances
+ * of all supported eras.
+ * <p>
+ * For convenience, this class declares a number of public static final fields
+ * that refer to singleton instances returned by the {@link #values()} method.
+ *
+ * @apiNote
+ * The fields declared in this class may evolve over time, in line with the
+ * results of the {@link #values()} method. However, there is not necessarily
+ * a 1:1 correspondence between the fields and the singleton instances.
+ *
+ * @apiNote
+ * The Japanese government may announce a new era and define its start
+ * date but not its official name. In this scenario, the singleton instance
+ * that represents the new era may return a name that is not stable until
+ * the official name is defined. Developers should exercise caution when
+ * relying on the name returned by any singleton instance that does not
+ * correspond to a public static final field.
  *
  * @implSpec
  * This class is immutable and thread-safe.
@@ -199,14 +217,18 @@
     //-----------------------------------------------------------------------
     /**
      * Obtains an instance of {@code JapaneseEra} from an {@code int} value.
+     * <ul>
+     * <li>The value {@code 1} is associated with the 'Showa' era, because
+     * it contains 1970-01-01 (ISO calendar system).</li>
+     * <li>The values {@code -1} and {@code 0} are associated with two earlier
+     * eras, Meiji and Taisho, respectively.</li>
+     * <li>A value greater than {@code 1} is associated with a later era,
+     * beginning with Heisei ({@code 2}).</li>
+     * </ul>
      * <p>
-     * The {@link #SHOWA} era that contains 1970-01-01 (ISO calendar system) has the value 1.
-     * Later era is numbered 2 ({@link #HEISEI}). Earlier eras are numbered 0 ({@link #TAISHO}),
-     * -1 ({@link #MEIJI}), only Meiji and later eras are supported.
-     * <p>
-     * In addition to the known era singletons, values for additional
-     * eras may be defined. Those values are the {@link Era#getValue()}
-     * of corresponding eras from the {@link #values()} method.
+     * Every instance of {@code JapaneseEra} that is returned from the {@link #values()}
+     * method has an int value (available via {@link Era#getValue()} which is
+     * accepted by this method.
      *
      * @param japaneseEra  the era to represent
      * @return the {@code JapaneseEra} singleton, not null
--- a/src/java.base/share/classes/java/util/SimpleTimeZone.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/util/SimpleTimeZone.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -310,7 +310,7 @@
      *                        See the class description for the special cases of this parameter.
      * @param endDayOfWeek    The daylight saving time ending day-of-week.
      *                        See the class description for the special cases of this parameter.
-     * @param endTime         The daylight saving ending time in time time mode
+     * @param endTime         The daylight saving ending time in time mode
      *                        specified by <code>endTimeMode</code>.
      * @param endTimeMode     The mode of the end time specified by endTime
      * @param dstSavings      The amount of time in milliseconds saved during
--- a/src/java.base/share/classes/java/util/stream/WhileOps.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/java/util/stream/WhileOps.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -658,7 +658,7 @@
         // True if no splitting should be performed, if true then
         // this spliterator may be used for an underlying spliterator whose
         // covered elements have an encounter order
-        // See use in stream take/dropWhile default default methods
+        // See use in stream take/dropWhile default methods
         final boolean noSplitting;
         // True when operations are cancelled for all related spliterators
         // For taking, spliterators cannot split or traversed
--- a/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -57,7 +57,7 @@
      * {@code SubjectDomainCombiner}.
      *
      * @param subject the {@code Subject} to be associated with
-     *          with this {@code SubjectDomainCombiner}.
+     *          this {@code SubjectDomainCombiner}.
      */
     public SubjectDomainCombiner(Subject subject) {
         this.subject = subject;
--- a/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, 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
@@ -58,7 +58,7 @@
     public static final int YES_NO_OPTION               = 0;
 
     /**
-     * YES/NO/CANCEL confirmation confirmation option.
+     * YES/NO/CANCEL confirmation option.
      *
      * <p> An underlying security service specifies this as the
      * {@code optionType} to a {@code ConfirmationCallback}
@@ -68,7 +68,7 @@
     public static final int YES_NO_CANCEL_OPTION        = 1;
 
     /**
-     * OK/CANCEL confirmation confirmation option.
+     * OK/CANCEL confirmation option.
      *
      * <p> An underlying security service specifies this as the
      * {@code optionType} to a {@code ConfirmationCallback}
--- a/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@
 
     public static JavaUtilJarAccess javaUtilJarAccess() {
         if (javaUtilJarAccess == null) {
-            // Ensure JarFile is initialized; we know that that class
+            // Ensure JarFile is initialized; we know that this class
             // provides the shared secret
             unsafe.ensureClassInitialized(JarFile.class);
         }
--- a/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@
     private ServicesCatalog() { }
 
     /**
-     * Creates a ServicesCatalog that supports concurrent registration and
+     * Creates a ServicesCatalog that supports concurrent registration
      * and lookup
      */
     public static ServicesCatalog create() {
--- a/src/java.base/share/classes/jdk/internal/platform/Metrics.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/jdk/internal/platform/Metrics.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -278,7 +278,7 @@
      * operating system tries to satisfy a memory request for any
      * process in the current Isolation Group when no free memory is
      * readily available.  Use {@link #isCpuSetMemoryPressureEnabled()} to
-     * to determine if this support is enabled.
+     * determine if this support is enabled.
      *
      * @return Memory pressure or 0 if not enabled or metric is not
      *         available.
@@ -322,7 +322,7 @@
      * Returns the largest amount of physical memory, in bytes, that
      * have been allocated in the Isolation Group.
      *
-     * @return The largest amount of memory in bytes or or 0 if this
+     * @return The largest amount of memory in bytes or 0 if this
      *         metric is not available.
      *
      */
@@ -362,7 +362,7 @@
      * Returns the largest amount of kernel physical memory, in bytes, that
      * have been allocated in the Isolation Group.
      *
-     * @return The largest amount of memory in bytes or or 0 if this
+     * @return The largest amount of memory in bytes or 0 if this
      *         metric is not available.
      *
      */
@@ -402,7 +402,7 @@
      * Returns the largest amount of networking physical memory, in bytes,
      * that have been allocated in the Isolation Group.
      *
-     * @return The largest amount of memory in bytes or or 0 if this
+     * @return The largest amount of memory in bytes or 0 if this
      *         metric is not available.
      *
      */
@@ -442,7 +442,7 @@
      * Returns the largest amount of physical memory and swap space,
      * in bytes, that have been allocated in the Isolation Group.
      *
-     * @return The largest amount of memory in bytes or or 0 if this
+     * @return The largest amount of memory in bytes or 0 if this
      *         metric is not available.
      *
      */
--- a/src/java.base/share/classes/sun/net/www/http/HttpClient.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/sun/net/www/http/HttpClient.java	Mon Feb 04 11:01:04 2019 +0530
@@ -216,7 +216,7 @@
     }
 
     /* This package-only CTOR should only be used for FTP piggy-backed on HTTP
-     * HTTP URL's that use this won't take advantage of keep-alive.
+     * URL's that use this won't take advantage of keep-alive.
      * Additionally, this constructor may be used as a last resort when the
      * first HttpClient gotten through New() failed (probably b/c of a
      * Keep-Alive mismatch).
--- a/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -246,7 +246,7 @@
             try {
                 baos.writeTo(result.baos);
             } catch (IOException ex) {
-                throw new RuntimeException("unable to to clone hash state");
+                throw new RuntimeException("unable to clone hash state");
             }
             return result;
         }
--- a/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -145,7 +145,7 @@
             if (!chc.conContext.isNegotiated) {
                 if (chc.activeCipherSuites.contains(
                         CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) {
-                    // Using the the TLS_EMPTY_RENEGOTIATION_INFO_SCSV instead.
+                    // Using the TLS_EMPTY_RENEGOTIATION_INFO_SCSV instead.
                     return null;
                 }
 
--- a/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -266,7 +266,8 @@
                 // ignore: unknown or unsupported ciphersuite
             }
 
-            if (cipherSuite != null) {
+            if (cipherSuite != null &&
+                cipherSuite != CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV) {
                 return decompose(cipherSuite.keyExchange,
                         cipherSuite.bulkCipher,
                         cipherSuite.macAlg,
--- a/src/java.base/share/classes/sun/security/ssl/SSLTransport.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLTransport.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -71,7 +71,7 @@
      * destination application data buffers.
      *
      * For SSL/TLS connections, if no source data, the network data may be
-     * received from the underlying underlying SSL/TLS input stream.
+     * received from the underlying SSL/TLS input stream.
      *
      * @param context      the transportation context
      * @param srcs         an array of {@code ByteBuffers} containing the
--- a/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -331,7 +331,7 @@
         }
 
         /**
-         * Load the the KeyStore as described in the specified descriptor.
+         * Load the KeyStore as described in the specified descriptor.
          */
         private static KeyStore loadKeyStore(
                 TrustStoreDescriptor descriptor) throws Exception {
--- a/src/java.base/share/classes/sun/security/util/ConstraintsParameters.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/sun/security/util/ConstraintsParameters.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, 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
@@ -36,8 +36,8 @@
 /**
  * This class contains parameters for checking against constraints that extend
  * past the publicly available parameters in java.security.AlgorithmConstraints.
-
- * This is currently on passed between  between PKIX, AlgorithmChecker,
+ *
+ * This is currently passed between PKIX, AlgorithmChecker,
  * and DisabledAlgorithmConstraints.
  */
 public class ConstraintsParameters {
--- a/src/java.base/share/classes/sun/security/util/math/SmallValue.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.base/share/classes/sun/security/util/math/SmallValue.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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,7 +28,7 @@
 /**
  * A "small" value that can be used with the field arithmetic library. This
  * interface enables optimizations based on the fact that certain values are
- * known to be small, where the definition of small is specific to the the
+ * known to be small, where the definition of small is specific to the
  * arithmetic implementation.
  */
 
--- a/src/java.desktop/share/legal/mesa3d.md	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.desktop/share/legal/mesa3d.md	Mon Feb 04 11:01:04 2019 +0530
@@ -1,10 +1,10 @@
-## Mesa 3-D Graphics Library v4.1
+## Mesa 3-D Graphics Library v5.0
 
 ### Mesa License
 <pre>
 
 Mesa 3-D graphics library
-Version:  4.1
+Version:  5.0
 
 Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
 
--- a/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java	Mon Feb 04 11:01:04 2019 +0530
@@ -468,6 +468,7 @@
                     if (unfurledChoice.isMouseInListArea(e)) {
                         int newIdx = helper.getSelectedIndex();
                         if (newIdx >= 0) {
+                            int currentItem = ((Choice)target).getSelectedIndex();
                             // Update the selected item in the target now that
                             // the mouse selection is complete.
                             if (newIdx != dragStartIdx) {
@@ -484,7 +485,7 @@
                             * LeftMouseButton used */
                             if (e.getButton() == MouseEvent.BUTTON1 &&
                                 (!firstPress || wasDragged ) &&
-                                ((Choice)target).getSelectedIndex() != newIdx)
+                                (newIdx != currentItem))
                             {
                                 ((Choice)target).select(newIdx);
                                 postEvent(new ItemEvent((Choice)target,
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java	Sat Feb 02 10:00:05 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,391 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xpath.internal;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.transform.Source;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * This class bottlenecks all management of source trees.  The methods
- * in this class should allow easy garbage collection of source
- * trees (not yet!), and should centralize parsing for those source trees.
- *
- * @LastModified: Oct 2017
- */
-@SuppressWarnings("deprecation")
-public class SourceTreeManager
-{
-
-  /** List of SourceTree objects that this manager manages. */
-  private List<SourceTree> m_sourceTree = new ArrayList<>();
-
-  /**
-   * Reset the list of SourceTree objects that this manager manages.
-   *
-   */
-  public void reset()
-  {
-    m_sourceTree = new ArrayList<>();
-  }
-
-  /** The TrAX URI resolver used to obtain source trees. */
-  URIResolver m_uriResolver;
-
-  /**
-   * Set an object that will be used to resolve URIs used in
-   * document(), etc.
-   * @param resolver An object that implements the URIResolver interface,
-   * or null.
-   */
-  public void setURIResolver(URIResolver resolver)
-  {
-    m_uriResolver = resolver;
-  }
-
-  /**
-   * Get the object that will be used to resolve URIs used in
-   * document(), etc.
-   * @return An object that implements the URIResolver interface,
-   * or null.
-   */
-  public URIResolver getURIResolver()
-  {
-    return m_uriResolver;
-  }
-
-  /**
-   * Given a document, find the URL associated with that document.
-   * @param owner Document that was previously processed by this liaison.
-   *
-   * @return The base URI of the owner argument.
-   */
-  public String findURIFromDoc(int owner)
-  {
-    int n = m_sourceTree.size();
-
-    for (int i = 0; i < n; i++)
-    {
-      SourceTree sTree = m_sourceTree.get(i);
-
-      if (owner == sTree.m_root)
-        return sTree.m_url;
-    }
-
-    return null;
-  }
-
-  /**
-   * This will be called by the processor when it encounters
-   * an xsl:include, xsl:import, or document() function.
-   *
-   * @param base The base URI that should be used.
-   * @param urlString Value from an xsl:import or xsl:include's href attribute,
-   * or a URI specified in the document() function.
-   *
-   * @return a Source that can be used to process the resource.
-   *
-   * @throws IOException
-   * @throws TransformerException
-   */
-  public Source resolveURI(
-          String base, String urlString, SourceLocator locator)
-            throws TransformerException, IOException
-  {
-
-    Source source = null;
-
-    if (null != m_uriResolver)
-    {
-      source = m_uriResolver.resolve(urlString, base);
-    }
-
-    if (null == source)
-    {
-      String uri = SystemIDResolver.getAbsoluteURI(urlString, base);
-
-      source = new StreamSource(uri);
-    }
-
-    return source;
-  }
-
-  /** JJK: Support  <?xalan:doc_cache_off?> kluge in ElemForEach.
-   * TODO: This function is highly dangerous. Cache management must be improved.
-   *
-   * @param n The node to remove.
-   */
-  public void removeDocumentFromCache(int n)
-  {
-    if(DTM.NULL ==n)
-      return;
-    for(int i=m_sourceTree.size()-1;i>=0;--i)
-    {
-      SourceTree st= m_sourceTree.get(i);
-      if(st!=null && st.m_root==n)
-      {
-        m_sourceTree.remove(i);
-        return;
-      }
-    }
-  }
-
-
-
-  /**
-   * Put the source tree root node in the document cache.
-   * TODO: This function needs to be a LOT more sophisticated.
-   *
-   * @param n The node to cache.
-   * @param source The Source object to cache.
-   */
-  public void putDocumentInCache(int n, Source source)
-  {
-
-    int cachedNode = getNode(source);
-
-    if (DTM.NULL != cachedNode)
-    {
-      if (!(cachedNode == n))
-        throw new RuntimeException(
-          "Programmer's Error!  "
-          + "putDocumentInCache found reparse of doc: "
-          + source.getSystemId());
-      return;
-    }
-    if (null != source.getSystemId())
-    {
-      m_sourceTree.add(new SourceTree(n, source.getSystemId()));
-    }
-  }
-
-  /**
-   * Given a Source object, find the node associated with it.
-   *
-   * @param source The Source object to act as the key.
-   *
-   * @return The node that is associated with the Source, or null if not found.
-   */
-  public int getNode(Source source)
-  {
-
-//    if (source instanceof DOMSource)
-//      return ((DOMSource) source).getNode();
-
-    // TODO: Not sure if the BaseID is really the same thing as the ID.
-    String url = source.getSystemId();
-
-    if (null == url)
-      return DTM.NULL;
-
-    int n = m_sourceTree.size();
-
-    // System.out.println("getNode: "+n);
-    for (int i = 0; i < n; i++)
-    {
-      SourceTree sTree = m_sourceTree.get(i);
-
-      // System.out.println("getNode -         url: "+url);
-      // System.out.println("getNode - sTree.m_url: "+sTree.m_url);
-      if (url.equals(sTree.m_url))
-        return sTree.m_root;
-    }
-
-    // System.out.println("getNode - returning: "+node);
-    return DTM.NULL;
-  }
-
-  /**
-   * Get the source tree from the a base URL and a URL string.
-   *
-   * @param base The base URI to use if the urlString is relative.
-   * @param urlString An absolute or relative URL string.
-   * @param locator The location of the caller, for diagnostic purposes.
-   *
-   * @return should be a non-null reference to the node identified by the
-   * base and urlString.
-   *
-   * @throws TransformerException If the URL can not resolve to a node.
-   */
-  public int getSourceTree(
-          String base, String urlString, SourceLocator locator, XPathContext xctxt)
-            throws TransformerException
-  {
-
-    // System.out.println("getSourceTree");
-    try
-    {
-      Source source = this.resolveURI(base, urlString, locator);
-
-      // System.out.println("getSourceTree - base: "+base+", urlString: "+urlString+", source: "+source.getSystemId());
-      return getSourceTree(source, locator, xctxt);
-    }
-    catch (IOException ioe)
-    {
-      throw new TransformerException(ioe.getMessage(), locator, ioe);
-    }
-
-    /* catch (TransformerException te)
-     {
-       throw new TransformerException(te.getMessage(), locator, te);
-     }*/
-  }
-
-  /**
-   * Get the source tree from the input source.
-   *
-   * @param source The Source object that should identify the desired node.
-   * @param locator The location of the caller, for diagnostic purposes.
-   *
-   * @return non-null reference to a node.
-   *
-   * @throws TransformerException if the Source argument can't be resolved to
-   *         a node.
-   */
-  public int getSourceTree(Source source, SourceLocator locator, XPathContext xctxt)
-          throws TransformerException
-  {
-
-    int n = getNode(source);
-
-    if (DTM.NULL != n)
-      return n;
-
-    n = parseToNode(source, locator, xctxt);
-
-    if (DTM.NULL != n)
-      putDocumentInCache(n, source);
-
-    return n;
-  }
-
-  /**
-   * Try to create a DOM source tree from the input source.
-   *
-   * @param source The Source object that identifies the source node.
-   * @param locator The location of the caller, for diagnostic purposes.
-   *
-   * @return non-null reference to node identified by the source argument.
-   *
-   * @throws TransformerException if the source argument can not be resolved
-   *         to a source node.
-   */
-  public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt)
-          throws TransformerException
-  {
-
-    try
-    {
-      Object xowner = xctxt.getOwnerObject();
-      DTM dtm;
-      if(null != xowner && xowner instanceof com.sun.org.apache.xml.internal.dtm.DTMWSFilter)
-      {
-        dtm = xctxt.getDTM(source, false,
-                          (com.sun.org.apache.xml.internal.dtm.DTMWSFilter)xowner, false, true);
-      }
-      else
-      {
-        dtm = xctxt.getDTM(source, false, null, false, true);
-      }
-      return dtm.getDocument();
-    }
-    catch (Exception e)
-    {
-      //e.printStackTrace();
-      throw new TransformerException(e.getMessage(), locator, e);
-    }
-
-  }
-
-  /**
-   * This method returns the SAX2 parser to use with the InputSource
-   * obtained from this URI.
-   * It may return null if any SAX2-conformant XML parser can be used,
-   * or if getInputSource() will also return null. The parser must
-   * be free for use (i.e.
-   * not currently in use for another parse().
-   *
-   * @param inputSource The value returned from the URIResolver.
-   * @return a SAX2 XMLReader to use to resolve the inputSource argument.
-   * @param locator The location of the original caller, for diagnostic purposes.
-   *
-   * @throws TransformerException if the reader can not be created.
-   */
-  public static XMLReader getXMLReader(Source inputSource, SourceLocator locator)
-          throws TransformerException
-  {
-
-    try
-    {
-      XMLReader reader = (inputSource instanceof SAXSource)
-                         ? ((SAXSource) inputSource).getXMLReader() : null;
-
-      if (null == reader)
-      {
-        try {
-          javax.xml.parsers.SAXParserFactory factory=
-              javax.xml.parsers.SAXParserFactory.newInstance();
-          factory.setNamespaceAware( true );
-          javax.xml.parsers.SAXParser jaxpParser=
-              factory.newSAXParser();
-          reader=jaxpParser.getXMLReader();
-
-        } catch( javax.xml.parsers.ParserConfigurationException ex ) {
-          throw new org.xml.sax.SAXException( ex );
-        } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
-            throw new org.xml.sax.SAXException( ex1.toString() );
-        } catch( NoSuchMethodError ex2 ) {
-        }
-        catch (AbstractMethodError ame){}
-        if(null == reader)
-          reader = XMLReaderFactory.createXMLReader();
-      }
-
-      try
-      {
-        reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
-                          true);
-      }
-      catch (org.xml.sax.SAXException se)
-      {
-
-        // What can we do?
-        // TODO: User diagnostics.
-      }
-
-      return reader;
-    }
-    catch (org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se.getMessage(), locator, se);
-    }
-  }
-}
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -49,7 +49,6 @@
 import javax.xml.transform.ErrorListener;
 import javax.xml.transform.SourceLocator;
 import javax.xml.transform.URIResolver;
-import jdk.xml.internal.JdkXmlUtils;
 import org.xml.sax.XMLReader;
 
 /**
@@ -57,7 +56,7 @@
  *
  * <p>This class extends DTMManager but does not directly implement it.</p>
  * @xsl.usage advanced
- * @LastModified: Oct 2017
+ * @LastModified: Jan 2019
  */
 public class XPathContext extends DTMManager // implements ExpressionContext
 {
@@ -483,33 +482,6 @@
     m_variableStacks = varStack;
   }
 
-  // ================ SourceTreeManager ===================
-
-  /** The source tree manager, which associates Source objects to source
-   *  tree nodes. */
-  private SourceTreeManager m_sourceTreeManager = new SourceTreeManager();
-
-  /**
-   * Get the SourceTreeManager associated with this execution context.
-   *
-   * @return the SourceTreeManager associated with this execution context.
-   */
-  public final SourceTreeManager getSourceTreeManager()
-  {
-    return m_sourceTreeManager;
-  }
-
-  /**
-   * Set the SourceTreeManager associated with this execution context.
-   *
-   * @param mgr the SourceTreeManager to be associated with this
-   *        execution context.
-   */
-  public void setSourceTreeManager(SourceTreeManager mgr)
-  {
-    m_sourceTreeManager = mgr;
-  }
-
   // =================================================
 
   /** The ErrorListener where errors and warnings are to be reported.   */
--- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java	Mon Feb 04 11:01:04 2019 +0530
@@ -62,8 +62,6 @@
       if (DTM.NULL != whereNode)
       {
         fileLocation = dtm.getDocumentBaseURI();
-//        int owner = dtm.getDocument();
-//        fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner);
       }
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Mon Feb 04 11:01:04 2019 +0530
@@ -158,7 +158,7 @@
         }
     },
 
-    DOCLINT_FORMAT("--doclint-format", "opt.doclint.format", EXTENDED, BASIC, ONEOF, "html4", "html5"),
+    DOCLINT_FORMAT("--doclint-format", "opt.doclint.format", EXTENDED, BASIC, ONEOF, "html5"),
 
     // -nowarn is retained for command-line backward compatibility
     NOWARN("-nowarn", "opt.nowarn", STANDARD, BASIC) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -407,19 +407,16 @@
      *
      * @param mems list of program elements for which the use information will be added
      * @param heading the section heading
-     * @param tableSummary the summary for the use table
      * @param contentTree the content tree to which the use information will be added
      */
-    protected void addUseInfo(List<? extends Element> mems,
-            Content heading, String tableSummary, Content contentTree) {
+    protected void addUseInfo(List<? extends Element> mems, Content heading, Content contentTree) {
         if (mems == null || mems.isEmpty()) {
             return;
         }
         List<? extends Element> members = mems;
         boolean printedUseTableHeader = false;
         if (members.size() > 0) {
-            Table useTable = new Table(configuration.htmlVersion, HtmlStyle.useSummary)
-                    .setSummary(tableSummary)
+            Table useTable = new Table(HtmlStyle.useSummary)
                     .setCaption(heading)
                     .setRowScopeColumn(1)
                     .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -131,13 +131,13 @@
     protected void buildModuleIndexFile(String title, boolean includeScript) throws DocFileIOException {
         String windowOverview = resources.getText(title);
         Content body = getBody(includeScript, getWindowTitle(windowOverview));
-        Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new);
+        Content header = HtmlTree.HEADER();
         addNavigationBarHeader(header);
-        Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new);
+        Content main = HtmlTree.MAIN();
         addOverviewHeader(main);
         addIndex(header, main);
         addOverview(main);
-        Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new);
+        Content footer = HtmlTree.FOOTER();
         addNavigationBarFooter(footer);
         body.addContent(header);
         body.addContent(main);
@@ -160,13 +160,13 @@
             boolean includeScript, ModuleElement mdle) throws DocFileIOException {
         String windowOverview = resources.getText(title);
         Content body = getBody(includeScript, getWindowTitle(windowOverview));
-        Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new);
+        Content header = HtmlTree.HEADER();
         addNavigationBarHeader(header);
-        Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new);
+        Content main = HtmlTree.MAIN();
         addOverviewHeader(main);
         addModulePackagesIndex(header, main, mdle);
         addOverview(main);
-        Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new);
+        Content footer = HtmlTree.FOOTER();
         addNavigationBarFooter(footer);
         body.addContent(header);
         body.addContent(main);
@@ -221,7 +221,7 @@
      */
     protected void addIndexContents(Collection<ModuleElement> modules, String text,
             String tableSummary, Content header, Content main) {
-        HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV));
+        HtmlTree htmlTree = HtmlTree.NAV();
         htmlTree.setStyle(HtmlStyle.indexNav);
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         addAllClassesLink(ul);
@@ -243,7 +243,7 @@
      */
     protected void addModulePackagesIndexContents(String text,
             String tableSummary, Content header, Content main, ModuleElement mdle) {
-        HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV));
+        HtmlTree htmlTree = HtmlTree.NAV();
         htmlTree.setStyle(HtmlStyle.indexNav);
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         addAllClassesLink(ul);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -116,13 +116,13 @@
     protected void buildPackageIndexFile(String title, boolean includeScript) throws DocFileIOException {
         String windowOverview = resources.getText(title);
         Content body = getBody(includeScript, getWindowTitle(windowOverview));
-        Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new);
+        Content header = HtmlTree.HEADER();
         addNavigationBarHeader(header);
-        Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new);
+        Content main = HtmlTree.MAIN();
         addOverviewHeader(main);
         addIndex(header, main);
         addOverview(main);
-        Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new);
+        Content footer = HtmlTree.FOOTER();
         addNavigationBarFooter(footer);
         body.addContent(header);
         body.addContent(main);
@@ -157,7 +157,7 @@
      */
     protected void addIndexContents(Content header, Content main) {
         if (!packages.isEmpty()) {
-            HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV));
+            HtmlTree htmlTree = HtmlTree.NAV();
             htmlTree.setStyle(HtmlStyle.indexNav);
             HtmlTree ul = new HtmlTree(HtmlTag.UL);
             addAllClassesLink(ul);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -119,18 +119,10 @@
             Content headingContent = contents.getContent(heading);
             Content sectionHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
                     headingContent);
-            HtmlTree htmlTree;
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                htmlTree = HtmlTree.SECTION(sectionHeading);
-            } else {
-                div.addContent(sectionHeading);
-                htmlTree = div;
-            }
+            HtmlTree htmlTree = HtmlTree.SECTION(sectionHeading);
             addLevelInfo(!utils.isInterface(firstTypeElement) ? firstTypeElement : null,
                     sset, isEnums, htmlTree);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                div.addContent(htmlTree);
-            }
+            div.addContent(htmlTree);
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -112,7 +112,7 @@
     protected void buildAllClassesFile(boolean wantFrames) throws DocFileIOException {
         String label = resources.getText("doclet.All_Classes");
         Content body = getBody(false, getWindowTitle(label));
-        Content htmlTree = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new);
+        Content htmlTree = HtmlTree.MAIN();
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
                 HtmlStyle.bar, contents.allClassesLabel);
         htmlTree.addContent(heading);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -103,32 +103,20 @@
     protected void buildAllClassesFile() throws DocFileIOException {
         String label = resources.getText("doclet.All_Classes");
         HtmlTree bodyTree = getBody(true, getWindowTitle(label));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
-        addTop(htmlTree);
+        HtmlTree header = HtmlTree.HEADER();
+        addTop(header);
         navBar.setUserHeader(getUserHeaderFooter(true));
-        htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        header.addContent(navBar.getContent(true));
+        bodyTree.addContent(header);
         Content allClassesContent = new ContentBuilder();
         addContents(allClassesContent);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(allClassesContent);
-            bodyTree.addContent(mainTree);
-        } else {
-            bodyTree.addContent(allClassesContent);
-        }
-        Content tree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : bodyTree;
+        mainTree.addContent(allClassesContent);
+        bodyTree.addContent(mainTree);
+        Content footer = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
-        tree.addContent(navBar.getContent(false));
-        addBottom(tree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            bodyTree.addContent(tree);
-        }
+        footer.addContent(navBar.getContent(false));
+        addBottom(footer);
+        bodyTree.addContent(footer);
         printHtmlDocument(null, true, bodyTree);
     }
 
@@ -138,8 +126,7 @@
      * @param content HtmlTree content to which the links will be added
      */
     protected void addContents(Content content) {
-        Table table = new Table(configuration.htmlVersion, HtmlStyle.typeSummary)
-                .setSummary(resources.classTableSummary)
+        Table table = new Table(HtmlStyle.typeSummary)
                 .setHeader(new TableHeader(contents.classLabel, contents.descriptionLabel))
                 .setRowScopeColumn(1)
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast)
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -85,15 +85,11 @@
     protected void buildAllPackagesFile() throws DocFileIOException {
         String label = resources.getText("doclet.All_Packages");
         HtmlTree bodyTree = getBody(true, getWindowTitle(label));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
-        addTop(htmlTree);
+        HtmlTree header = HtmlTree.HEADER();
+        addTop(header);
         navBar.setUserHeader(getUserHeaderFooter(true));
-        htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        header.addContent(navBar.getContent(true));
+        bodyTree.addContent(header);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.setStyle(HtmlStyle.allPackagesContainer);
         addPackages(div);
@@ -101,23 +97,14 @@
         Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
                 HtmlStyle.title, titleContent);
         Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(headerDiv);
-            mainTree.addContent(div);
-            bodyTree.addContent(mainTree);
-        } else {
-            bodyTree.addContent(headerDiv);
-            bodyTree.addContent(div);
-        }
-        Content tree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : bodyTree;
+        mainTree.addContent(headerDiv);
+        mainTree.addContent(div);
+        bodyTree.addContent(mainTree);
+        Content footer = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
-        tree.addContent(navBar.getContent(false));
-        addBottom(tree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            bodyTree.addContent(tree);
-        }
+        footer.addContent(navBar.getContent(false));
+        addBottom(footer);
+        bodyTree.addContent(footer);
         printHtmlDocument(null, true, bodyTree);
     }
 
@@ -127,8 +114,7 @@
      * @param content HtmlTree content to which the links will be added
      */
     protected void addPackages(Content content) {
-        Table table = new Table(configuration.htmlVersion, HtmlStyle.packagesSummary)
-                .setSummary(resources.packageTableSummary)
+        Table table = new Table(HtmlStyle.packagesSummary)
                 .setCaption(getTableCaption(new StringContent(resources.packageSummary)))
                 .setHeader(new TableHeader(contents.packageLabel, contents.descriptionLabel))
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -173,11 +173,7 @@
      * {@inheritDoc}
      */
     public Content getAnnotationDetails(Content annotationDetailsTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
-            return htmlTree;
-        }
-        return getMemberTree(annotationDetailsTree);
+        return HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
     }
 
     /**
@@ -208,16 +204,12 @@
 
     @Override
     protected Table createSummaryTable() {
-        String summary = resources.getText("doclet.Member_Table_Summary",
-            resources.getText("doclet.Field_Summary"),
-            resources.getText("doclet.fields"));
         Content caption = contents.getContent("doclet.Fields");
 
         TableHeader header = new TableHeader(contents.modifierAndTypeLabel, contents.fields,
             contents.descriptionLabel);
 
-        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
-                .setSummary(summary)
+        return new Table(HtmlStyle.memberSummary)
                 .setCaption(caption)
                 .setHeader(header)
                 .setRowScopeColumn(1)
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -121,16 +121,6 @@
      * {@inheritDoc}
      */
     @Override
-    protected String getTableSummary() {
-        return resources.getText("doclet.Member_Table_Summary",
-                resources.getText("doclet.Annotation_Type_Optional_Member_Summary"),
-                resources.getText("doclet.annotation_type_optional_members"));
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
     protected Content getCaption() {
         return contents.getContent("doclet.Annotation_Type_Optional_Members");
     }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -178,11 +178,7 @@
      * {@inheritDoc}
      */
     public Content getAnnotationDetails(Content annotationDetailsTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
-            return htmlTree;
-        }
-        return getMemberTree(annotationDetailsTree);
+        return HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
     }
 
     /**
@@ -203,18 +199,6 @@
     }
 
     /**
-     * Get the summary for the member summary table.
-     *
-     * @return a string for the table summary
-     */
-    // Overridden by AnnotationTypeOptionalMemberWriterImpl
-    protected String getTableSummary() {
-        return resources.getText("doclet.Member_Table_Summary",
-                resources.getText("doclet.Annotation_Type_Required_Member_Summary"),
-                resources.getText("doclet.annotation_type_required_members"));
-    }
-
-    /**
      * Get the caption for the summary table.
      * @return the caption
      */
@@ -237,8 +221,7 @@
      */
     @Override
     protected Table createSummaryTable() {
-        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
-                .setSummary(getTableSummary())
+        return new Table(HtmlStyle.memberSummary)
                 .setCaption(getCaption())
                 .setHeader(getSummaryTableHeader(typeElement))
                 .setRowScopeColumn(1)
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -86,9 +86,7 @@
     @Override
     public Content getHeader(String header) {
         HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getSimpleName(annotationType)));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(annotationType),
                 contents.moduleLabel);
@@ -96,9 +94,7 @@
         navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this));
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.setStyle(HtmlStyle.header);
@@ -126,11 +122,7 @@
                 HtmlStyle.title, headerContent);
         heading.addContent(getTypeParameterLinks(linkInfo));
         div.addContent(heading);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-        } else {
-            bodyTree.addContent(div);
-        }
+        mainTree.addContent(div);
         return bodyTree;
     }
 
@@ -148,15 +140,11 @@
     @Override
     public void addFooter(Content contentTree) {
         contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
-        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : contentTree;
+        Content htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            contentTree.addContent(htmlTree);
-        }
+        contentTree.addContent(htmlTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -99,14 +99,6 @@
     final ConstructorWriterImpl constrSubWriter;
     final FieldWriterImpl fieldSubWriter;
     final NestedClassWriterImpl classSubWriter;
-    // Summary for various use tables.
-    final String classUseTableSummary;
-    final String subclassUseTableSummary;
-    final String subinterfaceUseTableSummary;
-    final String fieldUseTableSummary;
-    final String methodUseTableSummary;
-    final String constructorUseTableSummary;
-    final String packageUseTableSummary;
     private final Navigation navBar;
 
     /**
@@ -164,22 +156,6 @@
         constrSubWriter = new ConstructorWriterImpl(this);
         fieldSubWriter = new FieldWriterImpl(this);
         classSubWriter = new NestedClassWriterImpl(this);
-
-        String useTableSummary = resources.getText("doclet.Use_Table_Summary");
-        classUseTableSummary = MessageFormat.format(useTableSummary,
-                resources.getText("doclet.classes"));
-        subclassUseTableSummary = MessageFormat.format(useTableSummary,
-                resources.getText("doclet.subclasses"));
-        subinterfaceUseTableSummary = MessageFormat.format(useTableSummary,
-                resources.getText("doclet.subinterfaces"));
-        fieldUseTableSummary = MessageFormat.format(useTableSummary,
-                resources.getText("doclet.fields"));
-        methodUseTableSummary = MessageFormat.format(useTableSummary,
-                resources.getText("doclet.methods"));
-        constructorUseTableSummary = MessageFormat.format(useTableSummary,
-                resources.getText("doclet.constructors"));
-        packageUseTableSummary = MessageFormat.format(useTableSummary,
-                resources.getText("doclet.packages"));
         this.navBar = new Navigation(typeElement, configuration, fixedNavDiv, PageMode.USE, path);
     }
 
@@ -258,21 +234,13 @@
             div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0",
                     utils.getFullyQualifiedName(typeElement)));
         }
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-            body.addContent(mainTree);
-        } else {
-            body.addContent(div);
-        }
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : body;
+        mainTree.addContent(div);
+        body.addContent(mainTree);
+        HtmlTree footer = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
-        htmlTree.addContent(navBar.getContent(false));
-        addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            body.addContent(htmlTree);
-        }
+        footer.addContent(navBar.getContent(false));
+        addBottom(footer);
+        body.addContent(footer);
         printHtmlDocument(null, true, body);
     }
 
@@ -302,8 +270,7 @@
                 "doclet.ClassUse_Packages.that.use.0",
                 getLink(new LinkInfoImpl(configuration,
                         LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))));
-        Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary)
-                .setSummary(packageUseTableSummary)
+        Table table = new Table(HtmlStyle.useSummary)
                 .setCaption(caption)
                 .setHeader(getPackageTableHeader())
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
@@ -330,8 +297,7 @@
                 getLink(new LinkInfoImpl(configuration,
                         LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))));
 
-        Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary)
-                .setSummary(packageUseTableSummary)
+        Table table = new Table(HtmlStyle.useSummary)
                 .setCaption(caption)
                 .setHeader(getPackageTableHeader())
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
@@ -354,9 +320,7 @@
         ul.setStyle(HtmlStyle.blockList);
         for (PackageElement pkg : pkgSet) {
             Content markerAnchor = links.createAnchor(getPackageAnchorName(pkg));
-            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION(markerAnchor)
-                    : HtmlTree.LI(HtmlStyle.blockList, markerAnchor);
+            HtmlTree htmlTree = HtmlTree.SECTION(markerAnchor);
             Content link = contents.getContent("doclet.ClassUse_Uses.of.0.in.1",
                     getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
                             typeElement)),
@@ -364,11 +328,7 @@
             Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
             htmlTree.addContent(heading);
             addClassUse(pkg, htmlTree);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-            } else {
-                ul.addContent(htmlTree);
-            }
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
         Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
         contentTree.addContent(li);
@@ -400,67 +360,67 @@
         Content pkgLink = getPackageLink(pkg, utils.getPackageName(pkg));
         classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg),
                 contents.getContent("doclet.ClassUse_Annotation", classLink,
-                pkgLink), classUseTableSummary, contentTree);
+                pkgLink), contentTree);
         classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg),
                 contents.getContent("doclet.ClassUse_TypeParameter", classLink,
-                pkgLink), classUseTableSummary, contentTree);
+                pkgLink), contentTree);
         classSubWriter.addUseInfo(pkgToSubclass.get(pkg),
                 contents.getContent("doclet.ClassUse_Subclass", classLink,
-                pkgLink), subclassUseTableSummary, contentTree);
+                pkgLink), contentTree);
         classSubWriter.addUseInfo(pkgToSubinterface.get(pkg),
                 contents.getContent("doclet.ClassUse_Subinterface", classLink,
-                pkgLink), subinterfaceUseTableSummary, contentTree);
+                pkgLink), contentTree);
         classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg),
                 contents.getContent("doclet.ClassUse_ImplementingClass", classLink,
-                pkgLink), classUseTableSummary, contentTree);
+                pkgLink), contentTree);
         fieldSubWriter.addUseInfo(pkgToField.get(pkg),
                 contents.getContent("doclet.ClassUse_Field", classLink,
-                pkgLink), fieldUseTableSummary, contentTree);
+                pkgLink), contentTree);
         fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg),
                 contents.getContent("doclet.ClassUse_FieldAnnotations", classLink,
-                pkgLink), fieldUseTableSummary, contentTree);
+                pkgLink), contentTree);
         fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg),
                 contents.getContent("doclet.ClassUse_FieldTypeParameter", classLink,
-                pkgLink), fieldUseTableSummary, contentTree);
+                pkgLink), contentTree);
         methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg),
                 contents.getContent("doclet.ClassUse_MethodAnnotations", classLink,
-                pkgLink), methodUseTableSummary, contentTree);
+                pkgLink), contentTree);
         methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg),
                 contents.getContent("doclet.ClassUse_MethodParameterAnnotations", classLink,
-                pkgLink), methodUseTableSummary, contentTree);
+                pkgLink), contentTree);
         methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg),
                 contents.getContent("doclet.ClassUse_MethodTypeParameter", classLink,
-                pkgLink), methodUseTableSummary, contentTree);
+                pkgLink), contentTree);
         methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg),
                 contents.getContent("doclet.ClassUse_MethodReturn", classLink,
-                pkgLink), methodUseTableSummary, contentTree);
+                pkgLink), contentTree);
         methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg),
                 contents.getContent("doclet.ClassUse_MethodReturnTypeParameter", classLink,
-                pkgLink), methodUseTableSummary, contentTree);
+                pkgLink), contentTree);
         methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg),
                 contents.getContent("doclet.ClassUse_MethodArgs", classLink,
-                pkgLink), methodUseTableSummary, contentTree);
+                pkgLink), contentTree);
         methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg),
                 contents.getContent("doclet.ClassUse_MethodArgsTypeParameters", classLink,
-                pkgLink), methodUseTableSummary, contentTree);
+                pkgLink), contentTree);
         methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg),
                 contents.getContent("doclet.ClassUse_MethodThrows", classLink,
-                pkgLink), methodUseTableSummary, contentTree);
+                pkgLink), contentTree);
         constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg),
                 contents.getContent("doclet.ClassUse_ConstructorAnnotations", classLink,
-                pkgLink), constructorUseTableSummary, contentTree);
+                pkgLink), contentTree);
         constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg),
                 contents.getContent("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
-                pkgLink), constructorUseTableSummary, contentTree);
+                pkgLink), contentTree);
         constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg),
                 contents.getContent("doclet.ClassUse_ConstructorArgs", classLink,
-                pkgLink), constructorUseTableSummary, contentTree);
+                pkgLink), contentTree);
         constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg),
                 contents.getContent("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
-                pkgLink), constructorUseTableSummary, contentTree);
+                pkgLink), contentTree);
         constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg),
                 contents.getContent("doclet.ClassUse_ConstructorThrows", classLink,
-                pkgLink), constructorUseTableSummary, contentTree);
+                pkgLink), contentTree);
     }
 
     /**
@@ -476,9 +436,7 @@
         String title = resources.getText("doclet.Window_ClassUse_Header",
                 cltype, clname);
         HtmlTree bodyTree = getBody(true, getWindowTitle(title));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         Content mdleLinkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement),
                 contents.moduleLabel);
@@ -489,9 +447,7 @@
         navBar.setNavLinkClass(classLinkContent);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         ContentBuilder headContent = new ContentBuilder();
         headContent.addContent(contents.getContent("doclet.ClassUse_Title", cltype));
         headContent.addContent(new HtmlTree(HtmlTag.BR));
@@ -499,11 +455,7 @@
         Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
                 true, HtmlStyle.title, headContent);
         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-        } else {
-            bodyTree.addContent(div);
-        }
+        mainTree.addContent(div);
         return bodyTree;
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -107,9 +107,7 @@
     @Override
     public Content getHeader(String header) {
         HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getSimpleName(typeElement)));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement),
                 contents.moduleLabel);
@@ -117,9 +115,7 @@
         navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this));
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.setStyle(HtmlStyle.header);
@@ -151,11 +147,7 @@
                 HtmlStyle.title, headerContent);
         heading.addContent(getTypeParameterLinks(linkInfo));
         div.addContent(heading);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-        } else {
-            bodyTree.addContent(div);
-        }
+        mainTree.addContent(div);
         return bodyTree;
     }
 
@@ -173,15 +165,11 @@
     @Override
     public void addFooter(Content contentTree) {
         contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
-        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : contentTree;
+        Content htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            contentTree.addContent(htmlTree);
-        }
+        contentTree.addContent(htmlTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -73,8 +73,6 @@
      */
     private TypeElement currentTypeElement;
 
-    private final String constantsTableSummary;
-
     private final TableHeader constantsTableHeader;
 
     /**
@@ -97,8 +95,6 @@
     public ConstantsSummaryWriterImpl(HtmlConfiguration configuration) {
         super(configuration, DocPaths.CONSTANT_VALUES);
         this.configuration = configuration;
-        constantsTableSummary = resources.getText("doclet.Constants_Table_Summary",
-                resources.getText("doclet.Constants_Summary"));
         constantsTableHeader = new TableHeader(
                 contents.modifierAndTypeLabel, contents.constantFieldLabel, contents.valueLabel);
         this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.CONSTANTVALUES, path);
@@ -111,15 +107,11 @@
     public Content getHeader() {
         String label = resources.getText("doclet.Constants_Summary");
         HtmlTree bodyTree = getBody(true, getWindowTitle(label));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         return bodyTree;
     }
 
@@ -166,16 +158,10 @@
         Content headingContent = contents.contentsHeading;
         Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
                 headingContent);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree section = HtmlTree.SECTION(heading);
-            section.addContent(contentListTree);
-            div.addContent(section);
-            mainTree.addContent(div);
-        } else {
-            div.addContent(heading);
-            div.addContent(contentListTree);
-            contentTree.addContent(div);
-        }
+        HtmlTree section = HtmlTree.SECTION(heading);
+        section.addContent(contentListTree);
+        div.addContent(section);
+        mainTree.addContent(div);
     }
 
     /**
@@ -194,7 +180,7 @@
     @Override
     public void addPackageName(PackageElement pkg, Content summariesTree, boolean first) {
         Content pkgNameContent;
-        if (!first && configuration.allowTag(HtmlTag.SECTION)) {
+        if (!first) {
             summariesTree.addContent(summaryTree);
         }
         if (pkg.isUnnamed()) {
@@ -209,11 +195,7 @@
         Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
                 pkgNameContent);
         heading.addContent(headingContent);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            summaryTree = HtmlTree.SECTION(heading);
-        } else {
-            summariesTree.addContent(heading);
-        }
+        summaryTree = HtmlTree.SECTION(heading);
     }
 
     /**
@@ -231,11 +213,7 @@
      */
     @Override
     public void addClassConstant(Content summariesTree, Content classConstantTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            summaryTree.addContent(classConstantTree);
-        } else {
-            summariesTree.addContent(classConstantTree);
-        }
+        summaryTree.addContent(classConstantTree);
     }
 
     /**
@@ -260,8 +238,7 @@
         }
         caption.addContent(classlink);
 
-        Table table = new Table(configuration.htmlVersion, HtmlStyle.constantsSummary)
-                .setSummary(constantsTableSummary)
+        Table table = new Table(HtmlStyle.constantsSummary)
                 .setCaption(caption)
                 .setHeader(constantsTableHeader)
                 .setRowScopeColumn(1)
@@ -327,15 +304,11 @@
      */
     @Override
     public void addConstantSummaries(Content contentTree, Content summariesTree) {
-        if (configuration.allowTag(HtmlTag.SECTION) && summaryTree != null) {
+        if (summaryTree != null) {
             summariesTree.addContent(summaryTree);
         }
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(summariesTree);
-            contentTree.addContent(mainTree);
-        } else {
-            contentTree.addContent(summariesTree);
-        }
+        mainTree.addContent(summariesTree);
+        contentTree.addContent(mainTree);
     }
 
     /**
@@ -343,15 +316,11 @@
      */
     @Override
     public void addFooter(Content contentTree) {
-        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : contentTree;
+        Content htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            contentTree.addContent(htmlTree);
-        }
+        contentTree.addContent(htmlTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -196,11 +196,7 @@
      */
     @Override
     public Content getConstructorDetails(Content constructorDetailsTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(constructorDetailsTree));
-            return htmlTree;
-        }
-        return getMemberTree(constructorDetailsTree);
+        return HtmlTree.SECTION(getMemberTree(constructorDetailsTree));
     }
 
     /**
@@ -259,12 +255,7 @@
             rowScopeColumn = 0;
         }
 
-        String summary =  resources.getText("doclet.Member_Table_Summary",
-                resources.getText("doclet.Constructor_Summary"),
-                resources.getText("doclet.constructors"));
-
-        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
-                .setSummary(summary)
+        return new Table(HtmlStyle.memberSummary)
                 .setCaption(contents.constructors)
                 .setHeader(getSummaryTableHeader(typeElement))
                 .setRowScopeColumn(rowScopeColumn)
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -284,9 +284,7 @@
     protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi)
             throws DocFileIOException {
         HtmlTree body = getHeader();
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
-                ? HtmlTree.MAIN()
-                : body;
+        HtmlTree htmlTree = HtmlTree.MAIN();
         htmlTree.addContent(getContentsList(deprapi));
         String memberTableSummary;
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
@@ -303,21 +301,13 @@
                             getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
             }
         }
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            htmlTree.addContent(div);
-            body.addContent(htmlTree);
-        } else {
-            body.addContent(div);
-        }
-        htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : body;
+        htmlTree.addContent(div);
+        body.addContent(htmlTree);
+        htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            body.addContent(htmlTree);
-        }
+        body.addContent(htmlTree);
         printHtmlDocument(null, true, body);
     }
 
@@ -380,15 +370,11 @@
     public HtmlTree getHeader() {
         String title = resources.getText("doclet.Window_Deprecated_List");
         HtmlTree bodyTree = getBody(true, getWindowTitle(title));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         return bodyTree;
     }
 
@@ -405,8 +391,7 @@
             String tableSummary, TableHeader tableHeader, Content contentTree) {
         if (deprList.size() > 0) {
             Content caption = contents.getContent(headingKey);
-            Table table = new Table(configuration.htmlVersion, HtmlStyle.deprecatedSummary)
-                    .setSummary(tableSummary)
+            Table table = new Table(HtmlStyle.deprecatedSummary)
                     .setCaption(caption)
                     .setHeader(tableHeader)
                     .setColumnStyles(HtmlStyle.colDeprecatedItemName, HtmlStyle.colLast);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -181,25 +181,19 @@
         Content pkgLinkContent = docletWriter.getPackageLink(pkg, docletWriter.contents.packageLabel);
         navBar.setNavLinkPackage(pkgLinkContent);
         navBar.setUserHeader(docletWriter.getUserHeaderFooter(true));
-        Content header = docletWriter.createTagIfAllowed(
-                jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag.HEADER, HtmlTree::HEADER,
-                ContentBuilder::new);
+        Content header = HtmlTree.HEADER();
         header.addContent(navBar.getContent(true));
         htmlContent.addContent(header);
 
         List<? extends DocTree> fullBody = utils.getFullBody(dfElement);
         Content bodyContent = docletWriter.commentTagsToContent(null, dfElement, fullBody, false);
         docletWriter.addTagsInfo(dfElement, bodyContent);
-        Content main = docletWriter.createTagIfAllowed(
-                jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag.MAIN, HtmlTree::MAIN,
-                ContentBuilder::new);
+        Content main = HtmlTree.MAIN();
         main.addContent(bodyContent);
         htmlContent.addContent(main);
 
         navBar.setUserFooter(docletWriter.getUserHeaderFooter(false));
-        Content footer = docletWriter.createTagIfAllowed(
-                jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag.FOOTER, HtmlTree::FOOTER,
-                ContentBuilder::new);
+        Content footer = HtmlTree.FOOTER();
         footer.addContent(navBar.getContent(false));
         docletWriter.addBottom(footer);
         htmlContent.addContent(footer);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -165,11 +165,7 @@
      */
     @Override
     public Content getEnumConstantsDetails(Content enumConstantsDetailsTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(enumConstantsDetailsTree));
-            return htmlTree;
-        }
-        return getMemberTree(enumConstantsDetailsTree);
+        return HtmlTree.SECTION(getMemberTree(enumConstantsDetailsTree));
     }
 
     /**
@@ -204,12 +200,7 @@
      */
     @Override
     protected Table createSummaryTable() {
-        String summary = resources.getText("doclet.Member_Table_Summary",
-            resources.getText("doclet.Enum_Constant_Summary"),
-            resources.getText("doclet.enum_constants"));
-
-        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
-                .setSummary(summary)
+        return new Table(HtmlStyle.memberSummary)
                 .setCaption(contents.getContent("doclet.Enum_Constants"))
                 .setHeader(getSummaryTableHeader(typeElement))
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -169,11 +169,7 @@
      */
     @Override
     public Content getFieldDetails(Content fieldDetailsTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(fieldDetailsTree));
-            return htmlTree;
-        }
-        return getMemberTree(fieldDetailsTree);
+        return HtmlTree.SECTION(getMemberTree(fieldDetailsTree));
     }
 
     /**
@@ -206,15 +202,10 @@
 
     @Override
     protected Table createSummaryTable() {
-        String summary =  resources.getText("doclet.Member_Table_Summary",
-                resources.getText("doclet.Field_Summary"),
-                resources.getText("doclet.fields"));
-
         List<HtmlStyle> bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colSecond,
                 HtmlStyle.colLast);
 
-        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
-                .setSummary(summary)
+        return new Table(HtmlStyle.memberSummary)
                 .setCaption(contents.fields)
                 .setHeader(getSummaryTableHeader(typeElement))
                 .setRowScopeColumn(1)
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -106,12 +106,8 @@
         body.addContent(script.asContent());
         Content noScript = HtmlTree.NOSCRIPT(contents.noScriptMessage);
         body.addContent(noScript);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            HtmlTree main = HtmlTree.MAIN(frame);
-            body.addContent(main);
-        } else {
-            body.addContent(frame);
-        }
+        HtmlTree main = HtmlTree.MAIN(frame);
+        body.addContent(main);
         if (configuration.windowtitle.length() > 0) {
             printFramesDocument(configuration.windowtitle, body);
         } else {
@@ -128,9 +124,8 @@
      * @throws DocFileIOException if there is an error writing the frames document
      */
     private void printFramesDocument(String title, HtmlTree body) throws DocFileIOException {
-        DocType htmlDocType = DocType.forVersion(configuration.htmlVersion);
         Content htmlComment = contents.newPage;
-        Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion)
+        Head head = new Head(path, configuration.docletVersion)
                 .setTimestamp(!configuration.notimestamp)
                 .setTitle(title)
                 .setCharset(configuration.charset)
@@ -139,7 +134,7 @@
                 .addScript(getFramesScript());
 
         Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body);
-        HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree);
+        HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
         htmlDocument.write(DocFile.createFileForOutput(configuration, path));
    }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -89,25 +89,17 @@
     protected void generateHelpFile() throws DocFileIOException {
         String title = resources.getText("doclet.Window_Help_title");
         HtmlTree body = getBody(true, getWindowTitle(title));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : body;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            body.addContent(htmlTree);
-        }
+        body.addContent(htmlTree);
         addHelpFileContents(body);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            htmlTree = HtmlTree.FOOTER();
-        }
+        htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            body.addContent(htmlTree);
-        }
+        body.addContent(htmlTree);
         printHtmlDocument(null, true, body);
     }
 
@@ -127,11 +119,7 @@
         Content intro = HtmlTree.DIV(HtmlStyle.subTitle,
                 contents.getContent("doclet.help.intro"));
         div.addContent(intro);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-        } else {
-            contentTree.addContent(div);
-        }
+        mainTree.addContent(div);
         HtmlTree htmlTree;
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         ul.setStyle(HtmlStyle.blockList);
@@ -140,9 +128,7 @@
         if (configuration.createoverview) {
             Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 contents.overviewLabel);
-            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION(overviewHeading)
-                    : HtmlTree.LI(HtmlStyle.blockList, overviewHeading);
+            htmlTree = HtmlTree.SECTION(overviewHeading);
             String overviewKey = configuration.showModules
                     ? "doclet.help.overview.modules.body"
                     : "doclet.help.overview.packages.body";
@@ -152,20 +138,14 @@
             Content overviewBody = contents.getContent(overviewKey, overviewLink);
             Content overviewPara = HtmlTree.P(overviewBody);
             htmlTree.addContent(overviewPara);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-            } else {
-                ul.addContent(htmlTree);
-            }
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
 
         // Module
         if (configuration.showModules) {
             Content moduleHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     contents.moduleLabel);
-            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION(moduleHead)
-                    : HtmlTree.LI(HtmlStyle.blockList, moduleHead);
+            htmlTree = HtmlTree.SECTION(moduleHead);
             Content moduleIntro = contents.getContent("doclet.help.module.intro");
             Content modulePara = HtmlTree.P(moduleIntro);
             htmlTree.addContent(modulePara);
@@ -174,20 +154,13 @@
             ulModule.addContent(HtmlTree.LI(contents.modulesLabel));
             ulModule.addContent(HtmlTree.LI(contents.servicesLabel));
             htmlTree.addContent(ulModule);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-            } else {
-                ul.addContent(htmlTree);
-            }
-
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
 
         // Package
         Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 contents.packageLabel);
-        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.SECTION(packageHead)
-                : HtmlTree.LI(HtmlStyle.blockList, packageHead);
+        htmlTree = HtmlTree.SECTION(packageHead);
         Content packageIntro = contents.getContent("doclet.help.package.intro");
         Content packagePara = HtmlTree.P(packageIntro);
         htmlTree.addContent(packagePara);
@@ -199,18 +172,12 @@
         ulPackage.addContent(HtmlTree.LI(contents.errors));
         ulPackage.addContent(HtmlTree.LI(contents.annotationTypes));
         htmlTree.addContent(ulPackage);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-        } else {
-            ul.addContent(htmlTree);
-        }
+        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
 
         // Class/interface
         Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 contents.getContent("doclet.help.class_interface.head"));
-        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.SECTION(classHead)
-                : HtmlTree.LI(HtmlStyle.blockList, classHead);
+        htmlTree = HtmlTree.SECTION(classHead);
         Content classIntro = contents.getContent("doclet.help.class_interface.intro");
         Content classPara = HtmlTree.P(classIntro);
         htmlTree.addContent(classPara);
@@ -240,18 +207,12 @@
         Content classSummary = contents.getContent("doclet.help.class_interface.summary");
         Content para = HtmlTree.P(classSummary);
         htmlTree.addContent(para);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-        } else {
-            ul.addContent(htmlTree);
-        }
+        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
 
         // Annotation Types
         Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 contents.annotationType);
-        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.SECTION(aHead)
-                : HtmlTree.LI(HtmlStyle.blockList, aHead);
+        htmlTree = HtmlTree.SECTION(aHead);
         Content aIntro = contents.getContent("doclet.help.annotation_type.intro");
         Content aPara = HtmlTree.P(aIntro);
         htmlTree.addContent(aPara);
@@ -262,17 +223,11 @@
         aul.addContent(HtmlTree.LI(contents.annotateTypeOptionalMemberSummaryLabel));
         aul.addContent(HtmlTree.LI(contents.annotationTypeMemberDetail));
         htmlTree.addContent(aul);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-        } else {
-            ul.addContent(htmlTree);
-        }
+        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
 
         // Enums
         Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.enum_);
-        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.SECTION(enumHead)
-                : HtmlTree.LI(HtmlStyle.blockList, enumHead);
+        htmlTree = HtmlTree.SECTION(enumHead);
         Content eIntro = contents.getContent("doclet.help.enum.intro");
         Content enumPara = HtmlTree.P(eIntro);
         htmlTree.addContent(enumPara);
@@ -282,36 +237,24 @@
         eul.addContent(HtmlTree.LI(contents.enumConstantSummary));
         eul.addContent(HtmlTree.LI(contents.enumConstantDetailLabel));
         htmlTree.addContent(eul);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-        } else {
-            ul.addContent(htmlTree);
-        }
+        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
 
         // Class Use
         if (configuration.classuse) {
             Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     contents.getContent("doclet.help.use.head"));
-            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION(useHead)
-                    : HtmlTree.LI(HtmlStyle.blockList, useHead);
+            htmlTree = HtmlTree.SECTION(useHead);
             Content useBody = contents.getContent("doclet.help.use.body");
             Content usePara = HtmlTree.P(useBody);
             htmlTree.addContent(usePara);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-            } else {
-                ul.addContent(htmlTree);
-            }
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
 
         // Tree
         if (configuration.createtree) {
             Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     contents.getContent("doclet.help.tree.head"));
-            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION(treeHead)
-                    : HtmlTree.LI(HtmlStyle.blockList, treeHead);
+            htmlTree = HtmlTree.SECTION(treeHead);
             Content treeIntro = contents.getContent("doclet.help.tree.intro",
                     links.createLink(DocPaths.OVERVIEW_TREE,
                     resources.getText("doclet.Class_Hierarchy")),
@@ -322,30 +265,20 @@
             tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.overview")));
             tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.package")));
             htmlTree.addContent(tul);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-            } else {
-                ul.addContent(htmlTree);
-            }
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
 
         // Deprecated
         if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) {
             Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     contents.deprecatedAPI);
-            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION(dHead)
-                    : HtmlTree.LI(HtmlStyle.blockList, dHead);
+            htmlTree = HtmlTree.SECTION(dHead);
             Content deprBody = contents.getContent("doclet.help.deprecated.body",
                     links.createLink(DocPaths.DEPRECATED_LIST,
                     resources.getText("doclet.Deprecated_API")));
             Content dPara = HtmlTree.P(deprBody);
             htmlTree.addContent(dPara);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-            } else {
-                ul.addContent(htmlTree);
-            }
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
 
         // Index
@@ -360,94 +293,60 @@
             }
             Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     contents.getContent("doclet.help.index.head"));
-            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION(indexHead)
-                    : HtmlTree.LI(HtmlStyle.blockList, indexHead);
+            htmlTree = HtmlTree.SECTION(indexHead);
             Content indexBody = contents.getContent("doclet.help.index.body", indexlink);
             Content indexPara = HtmlTree.P(indexBody);
             htmlTree.addContent(indexPara);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-            } else {
-                ul.addContent(htmlTree);
-            }
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
 
         // Frames
         if (configuration.frames) {
             Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     contents.getContent("doclet.help.frames.head"));
-            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION(frameHead)
-                    : HtmlTree.LI(HtmlStyle.blockList, frameHead);
+            htmlTree = HtmlTree.SECTION(frameHead);
             Content framesBody = contents.getContent("doclet.help.frames.body");
             Content framePara = HtmlTree.P(framesBody);
             htmlTree.addContent(framePara);
 
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-            } else {
-                ul.addContent(htmlTree);
-            }
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
 
         // Serialized Form
         Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 contents.serializedForm);
-        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.SECTION(sHead)
-                : HtmlTree.LI(HtmlStyle.blockList, sHead);
+        htmlTree = HtmlTree.SECTION(sHead);
         Content serialBody = contents.getContent("doclet.help.serial_form.body");
         Content serialPara = HtmlTree.P(serialBody);
         htmlTree.addContent(serialPara);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-        } else {
-            ul.addContent(htmlTree);
-        }
+        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
 
         // Constant Field Values
         Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 contents.constantsSummaryTitle);
-        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.SECTION(constHead)
-                : HtmlTree.LI(HtmlStyle.blockList, constHead);
+        htmlTree = HtmlTree.SECTION(constHead);
         Content constantsBody = contents.getContent("doclet.help.constants.body",
                 links.createLink(DocPaths.CONSTANT_VALUES,
                 resources.getText("doclet.Constants_Summary")));
         Content constPara = HtmlTree.P(constantsBody);
         htmlTree.addContent(constPara);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-        } else {
-            ul.addContent(htmlTree);
-        }
+        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
 
         // Search
         Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 contents.getContent("doclet.help.search.head"));
-        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.SECTION(searchHead)
-                : HtmlTree.LI(HtmlStyle.blockList, searchHead);
+        htmlTree = HtmlTree.SECTION(searchHead);
         Content searchBody = contents.getContent("doclet.help.search.body");
         Content searchPara = HtmlTree.P(searchBody);
         htmlTree.addContent(searchPara);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
-        } else {
-            ul.addContent(htmlTree);
-        }
+        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
 
         Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
         divContent.addContent(new HtmlTree(HtmlTag.HR));
         Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase,
                 contents.getContent("doclet.help.footnote"));
         divContent.addContent(footnote);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(divContent);
-            contentTree.addContent(mainTree);
-        } else {
-            contentTree.addContent(divContent);
-        }
+        mainTree.addContent(divContent);
+        contentTree.addContent(mainTree);
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java	Mon Feb 04 11:01:04 2019 +0530
@@ -203,12 +203,6 @@
     public boolean frames = false;
 
     /**
-     * This is the HTML version of the generated pages.
-     * The default value is determined later.
-     */
-    public HtmlVersion htmlVersion = null;
-
-    /**
      * Collected set of doclint options
      */
     public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>();
@@ -303,10 +297,6 @@
             return false;
         }
 
-        if (htmlVersion == null) {
-            htmlVersion = HtmlVersion.HTML5;
-        }
-
         // check if helpfile exists
         if (!helpfile.isEmpty()) {
             DocFile help = DocFile.createFileForInput(this, helpfile);
@@ -365,25 +355,11 @@
         setCreateOverview();
         setTopFile(docEnv);
         workArounds.initDocLint(doclintOpts.values(), tagletManager.getAllTagletNames(),
-                Utils.toLowerCase(htmlVersion.name()));
+                Utils.toLowerCase(HtmlVersion.HTML5.name()));
         return true;
     }
 
     /**
-     * Return true if the generated output is HTML5.
-     */
-    public boolean isOutputHtml5() {
-        return htmlVersion == HtmlVersion.HTML5;
-    }
-
-    /**
-     * Return true if the tag is allowed for this specific version of HTML.
-     */
-    public boolean allowTag(HtmlTag htmlTag) {
-        return htmlTag.allowTag(this.htmlVersion);
-    }
-
-    /**
      * Decide the page which will appear first in the right-hand frame. It will
      * be "overview-summary.html" if "-overview" option is used or no
      * "-overview" but the number of packages is more than one. It will be
@@ -588,18 +564,9 @@
                     return true;
                 }
             },
-            new Option(resources, "-html4") {
-                @Override
-                public boolean process(String opt,  List<String> args) {
-                    reporter.print(WARNING, resources.getText("doclet.HTML_4_specified", helpfile));
-                    htmlVersion = HtmlVersion.HTML4;
-                    return true;
-                }
-            },
             new Option(resources, "-html5") {
                 @Override
                 public boolean process(String opt,  List<String> args) {
-                    htmlVersion = HtmlVersion.HTML5;
                     return true;
                 }
             },
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -196,7 +196,7 @@
         this.contents = configuration.contents;
         this.messages = configuration.messages;
         this.resources = configuration.resources;
-        this.links = new Links(path, configuration.htmlVersion);
+        this.links = new Links(path);
         this.utils = configuration.utils;
         this.path = path;
         this.pathToRoot = path.parent().invert();
@@ -445,9 +445,8 @@
      */
     public void printHtmlDocument(List<String> metakeywords, boolean includeScript, Content extraContent,
                                   Content body) throws DocFileIOException {
-        DocType htmlDocType = DocType.forVersion(configuration.htmlVersion);
         Content htmlComment = contents.newPage;
-        Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion)
+        Head head = new Head(path, configuration.docletVersion)
                 .setTimestamp(!configuration.notimestamp)
                 .setTitle(winTitle)
                 .setCharset(configuration.charset)
@@ -458,7 +457,7 @@
                 .addContent(extraContent);
 
         Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body);
-        HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree);
+        HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
         htmlDocument.write(DocFile.createFileForOutput(configuration, path));
     }
 
@@ -1004,8 +1003,7 @@
     }
 
     public String anchorName(Element member) {
-        if (member.getKind() == ElementKind.CONSTRUCTOR
-                && configuration.isOutputHtml5()) {
+        if (member.getKind() == ElementKind.CONSTRUCTOR) {
             return "<init>";
         } else {
             return utils.getSimpleName(member);
@@ -2160,20 +2158,4 @@
     Script getMainBodyScript() {
         return mainBodyScript;
     }
-
-    /**
-     * Creates the HTML tag if the tag is supported by this specific HTML version
-     * otherwise return the Content instance provided by Supplier ifNotSupported.
-     * @param tag the HTML tag
-     * @param ifSupported create this instance if HTML tag is supported
-     * @param ifNotSupported create this instance if HTML tag is not supported
-     * @return
-     */
-    protected Content createTagIfAllowed(HtmlTag tag, Supplier<Content> ifSupported, Supplier<Content> ifNotSupported) {
-        if (configuration.allowTag(tag)) {
-            return ifSupported.get();
-        } else {
-            return ifNotSupported.get();
-        }
-    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -76,9 +76,8 @@
      * @throws DocFileIOException if there is a problem generating the file
      */
     private void generateIndexFile() throws DocFileIOException {
-        DocType htmlDocType = DocType.forVersion(configuration.htmlVersion);
         Content htmlComment = contents.newPage;
-        Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion)
+        Head head = new Head(path, configuration.docletVersion)
                 .setTimestamp(true)
                 .setStylesheets(configuration.getMainStylesheet(), Collections.emptyList()) // avoid reference to default stylesheet
                 .addDefaultScript(false);
@@ -98,9 +97,7 @@
         HtmlTree metaRefresh = new HtmlTree(HtmlTag.META)
                 .addAttr(HtmlAttr.HTTP_EQUIV, "Refresh")
                 .addAttr(HtmlAttr.CONTENT, "0;" + targetPath);
-        head.addContent(
-                script.asContent(),
-                configuration.isOutputHtml5() ? HtmlTree.NOSCRIPT(metaRefresh) : metaRefresh);
+        head.addContent(script.asContent(), HtmlTree.NOSCRIPT(metaRefresh));
 
         ContentBuilder bodyContent = new ContentBuilder();
         bodyContent.addContent(HtmlTree.NOSCRIPT(
@@ -109,15 +106,11 @@
         bodyContent.addContent(HtmlTree.P(HtmlTree.A(targetPath, new StringContent(targetPath))));
 
         Content body = new HtmlTree(HtmlTag.BODY);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            HtmlTree main = HtmlTree.MAIN(bodyContent);
-            body.addContent(main);
-        } else {
-            body.addContent(bodyContent);
-        }
+        HtmlTree main = HtmlTree.MAIN(bodyContent);
+        body.addContent(main);
 
         Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body);
-        HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree);
+        HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
         htmlDocument.write(DocFile.createFileForOutput(configuration, path));
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -212,11 +212,7 @@
      */
     @Override
     public Content getMethodDetails(Content methodDetailsTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(methodDetailsTree));
-            return htmlTree;
-        }
-        return getMemberTree(methodDetailsTree);
+        return HtmlTree.SECTION(getMemberTree(methodDetailsTree));
     }
 
     /**
@@ -249,12 +245,7 @@
 
     @Override
     protected Table createSummaryTable() {
-        String summary =  resources.getText("doclet.Member_Table_Summary",
-                resources.getText("doclet.Method_Summary"),
-                resources.getText("doclet.methods"));
-
-        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
-                .setSummary(summary)
+        return new Table(HtmlStyle.memberSummary)
                 .setHeader(getSummaryTableHeader(typeElement))
                 .setRowScopeColumn(1)
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast)
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -98,9 +98,7 @@
         String mdlName = moduleElement.getQualifiedName().toString();
         Content mdlLabel = new StringContent(mdlName);
         HtmlTree body = mdlgen.getBody(false, mdlgen.getWindowTitle(mdlName));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
-                ? HtmlTree.MAIN()
-                : body;
+        HtmlTree htmlTree = HtmlTree.MAIN();
         DocPath moduleSummary = configuration.useModuleDirectories
                 ? DocPaths.DOT_DOT.resolve(configuration.docPaths.moduleSummary(moduleElement))
                 : configuration.docPaths.moduleSummary(moduleElement);
@@ -111,9 +109,7 @@
         div.setStyle(HtmlStyle.indexContainer);
         mdlgen.addClassListing(div);
         htmlTree.addContent(div);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            body.addContent(htmlTree);
-        }
+        body.addContent(htmlTree);
         mdlgen.printHtmlDocument(
                 configuration.metakeywords.getMetaKeywordsForModule(moduleElement), false, body);
     }
@@ -163,9 +159,7 @@
         SortedSet<TypeElement> tset = utils.filterOutPrivateClasses(list, configuration.javafx);
         if (!tset.isEmpty()) {
             boolean printedHeader = false;
-            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION()
-                    : contentTree;
+            HtmlTree htmlTree = HtmlTree.SECTION();
             HtmlTree ul = new HtmlTree(HtmlTag.UL);
             ul.setTitle(labelContent);
             for (TypeElement typeElement : tset) {
@@ -191,9 +185,7 @@
                 ul.addContent(li);
             }
             htmlTree.addContent(ul);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                contentTree.addContent(htmlTree);
-            }
+            contentTree.addContent(htmlTree);
         }
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -95,7 +95,7 @@
      * @param main the document tree to which the modules list will be added
      */
     protected void addIndexContents(Content header, Content main) {
-        HtmlTree htmltree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV));
+        HtmlTree htmltree = HtmlTree.NAV();
         htmltree.setStyle(HtmlStyle.indexNav);
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         addAllClassesLink(ul);
@@ -121,8 +121,7 @@
             String tableSummary = resources.getText("doclet.Member_Table_Summary",
                     resources.getText("doclet.Module_Summary"), resources.getText("doclet.modules"));
             TableHeader header = new TableHeader(contents.moduleLabel, contents.descriptionLabel);
-            Table table =  new Table(configuration.htmlVersion, HtmlStyle.overviewSummary)
-                    .setSummary(tableSummary)
+            Table table =  new Table(HtmlStyle.overviewSummary)
                     .setHeader(header)
                     .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast)
                     .setDefaultTab(resources.getText("doclet.All_Modules"))
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -113,9 +113,7 @@
                 getTargetModuleLink("classFrame", moduleNameContent, mdle));
         heading.addContent(Contents.SPACE);
         heading.addContent(contents.packagesLabel);
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
-                ? HtmlTree.MAIN(HtmlStyle.indexContainer, heading)
-                : HtmlTree.DIV(HtmlStyle.indexContainer, heading);
+        HtmlTree htmlTree = HtmlTree.MAIN(HtmlStyle.indexContainer, heading);
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         ul.setTitle(contents.packagesLabel);
         Set<PackageElement> modulePackages = configuration.modulePackages.get(mdle);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -196,9 +196,7 @@
     @Override
     public Content getModuleHeader(String heading) {
         HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString()));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment);
         navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules));
@@ -207,9 +205,7 @@
         navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees));
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.setStyle(HtmlStyle.header);
         Content annotationContent = new HtmlTree(HtmlTag.P);
@@ -223,11 +219,7 @@
         Content moduleHead = new RawHtml(heading);
         tHeading.addContent(moduleHead);
         div.addContent(tHeading);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-        } else {
-            bodyTree.addContent(div);
-        }
+        mainTree.addContent(div);
         return bodyTree;
     }
 
@@ -476,15 +468,13 @@
      * Get a table, with two columns.
      *
      * @param caption the table caption
-     * @param tableSummary the summary for the table
      * @param tableStyle the table style
      * @param tableHeader the table header
      * @return a content object
      */
-    private Table getTable2(Content caption, String tableSummary, HtmlStyle tableStyle,
+    private Table getTable2(Content caption, HtmlStyle tableStyle,
             TableHeader tableHeader) {
-        return new Table(configuration.htmlVersion, tableStyle)
-                .setSummary(tableSummary)
+        return new Table(tableStyle)
                 .setCaption(caption)
                 .setHeader(tableHeader)
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
@@ -501,8 +491,7 @@
      */
     private Table getTable3(Content caption, String tableSummary, HtmlStyle tableStyle,
             TableHeader tableHeader) {
-        return new Table(configuration.htmlVersion, tableStyle)
-                .setSummary(tableSummary)
+        return new Table(tableStyle)
                 .setCaption(caption)
                 .setHeader(tableHeader)
                 .setRowScopeColumn(1)
@@ -575,32 +564,21 @@
             addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
                     contents.navPackages, li);
             if (display(packages)) {
-                String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        resources.getText("doclet.Packages_Summary"),
-                        resources.getText("doclet.packages"));
-                addPackageSummary(tableSummary, li);
+                addPackageSummary(li);
             }
             TableHeader indirectPackagesHeader =
                     new TableHeader(contents.fromLabel, contents.packagesLabel);
             if (display(indirectPackages)) {
                 String aepText = resources.getText("doclet.Indirect_Exports_Summary");
-                String aepTableSummary = resources.getText("doclet.Indirect_Packages_Table_Summary",
-                        aepText,
-                        resources.getText("doclet.modules"),
-                        resources.getText("doclet.packages"));
-                Table aepTable = getTable2(new StringContent(aepText), aepTableSummary,
+                Table aepTable = getTable2(new StringContent(aepText),
                         HtmlStyle.packagesSummary, indirectPackagesHeader);
                 addIndirectPackages(aepTable, indirectPackages);
                 li.addContent(aepTable.toContent());
             }
             if (display(indirectOpenPackages)) {
                 String aopText = resources.getText("doclet.Indirect_Opens_Summary");
-                String aopTableSummary = resources.getText("doclet.Indirect_Packages_Table_Summary",
-                        aopText,
-                        resources.getText("doclet.modules"),
-                        resources.getText("doclet.packages"));
-                Table aopTable = getTable2(new StringContent(aopText), aopTableSummary,
-                        HtmlStyle.packagesSummary, indirectPackagesHeader);
+                Table aopTable = getTable2(new StringContent(aopText), HtmlStyle.packagesSummary,
+                        indirectPackagesHeader);
                 addIndirectPackages(aopTable, indirectOpenPackages);
                 li.addContent(aopTable.toContent());
             }
@@ -612,12 +590,10 @@
     /**
      * Add the package summary for the module.
      *
-     * @param tableSummary
      * @param li
      */
-    public void addPackageSummary(String tableSummary, HtmlTree li) {
-        Table table = new Table(configuration.htmlVersion, HtmlStyle.packagesSummary)
-                .setSummary(tableSummary)
+    public void addPackageSummary(HtmlTree li) {
+        Table table = new Table(HtmlStyle.packagesSummary)
                 .setDefaultTab(resources.getText("doclet.All_Packages"))
                 .addTab(resources.getText("doclet.Exported_Packages_Summary"), this::isExported)
                 .addTab(resources.getText("doclet.Opened_Packages_Summary"), this::isOpened)
@@ -770,10 +746,7 @@
                     new TableHeader(contents.typeLabel, contents.descriptionLabel);
             if (haveProvides) {
                 String label = resources.getText("doclet.Provides_Summary");
-                String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        label,
-                        resources.getText("doclet.types"));
-                Table table = getTable2(new StringContent(label), tableSummary, HtmlStyle.providesSummary,
+                Table table = getTable2(new StringContent(label), HtmlStyle.providesSummary,
                         usesProvidesTableHeader);
                 addProvidesList(table);
                 if (!table.isEmpty()) {
@@ -782,10 +755,7 @@
             }
             if (haveUses){
                 String label = resources.getText("doclet.Uses_Summary");
-                String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        label,
-                        resources.getText("doclet.types"));
-                Table table = getTable2(new StringContent(label), tableSummary, HtmlStyle.usesSummary,
+                Table table = getTable2(new StringContent(label), HtmlStyle.usesSummary,
                         usesProvidesTableHeader);
                 addUsesList(table);
                 if (!table.isEmpty()) {
@@ -897,14 +867,12 @@
     @Override
     public void addModuleDescription(Content moduleContentTree) {
         if (!utils.getFullBody(mdle).isEmpty()) {
-            Content tree = configuration.allowTag(HtmlTag.SECTION) ? HtmlTree.SECTION() : moduleContentTree;
+            Content tree = HtmlTree.SECTION();
             addDeprecationInfo(tree);
             tree.addContent(HtmlConstants.START_OF_MODULE_DESCRIPTION);
             tree.addContent(links.createAnchor(SectionName.MODULE_DESCRIPTION));
             addInlineComment(mdle, tree);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                moduleContentTree.addContent(tree);
-            }
+            moduleContentTree.addContent(tree);
         }
     }
 
@@ -913,13 +881,9 @@
      */
     @Override
     public void addModuleTags(Content moduleContentTree) {
-        Content tree = (configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.SECTION()
-                : moduleContentTree;
+        Content tree = HtmlTree.SECTION();
         addTagsInfo(mdle, tree);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            moduleContentTree.addContent(tree);
-        }
+        moduleContentTree.addContent(tree);
     }
 
     /**
@@ -927,12 +891,8 @@
      */
     @Override
     public void addModuleContent(Content contentTree, Content moduleContentTree) {
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(moduleContentTree);
-            contentTree.addContent(mainTree);
-        } else {
-            contentTree.addContent(moduleContentTree);
-        }
+        mainTree.addContent(moduleContentTree);
+        contentTree.addContent(mainTree);
     }
 
     /**
@@ -940,15 +900,11 @@
      */
     @Override
     public void addModuleFooter(Content contentTree) {
-        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : contentTree;
+        Content htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            contentTree.addContent(htmlTree);
-        }
+        contentTree.addContent(htmlTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -109,15 +109,10 @@
 
     @Override
     protected Table createSummaryTable() {
-        String summary =  resources.getText("doclet.Member_Table_Summary",
-                resources.getText("doclet.Nested_Class_Summary"),
-                resources.getText("doclet.nested_classes"));
-
         List<HtmlStyle> bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colSecond,
                 HtmlStyle.colLast);
 
-        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
-                .setSummary(summary)
+        return new Table(HtmlStyle.memberSummary)
                 .setCaption(contents.getContent("doclet.Nested_Classes"))
                 .setHeader(getSummaryTableHeader(typeElement))
                 .setRowScopeColumn(1)
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -101,9 +101,7 @@
         String pkgName = configuration.utils.getPackageName(packageElement);
         HtmlTree body = packgen.getBody(false, packgen.getWindowTitle(pkgName));
         Content pkgNameContent = new StringContent(pkgName);
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
-                ? HtmlTree.MAIN()
-                : body;
+        HtmlTree htmlTree = HtmlTree.MAIN();
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
                 packgen.getTargetPackageLink(packageElement, "classFrame", pkgNameContent));
         htmlTree.addContent(heading);
@@ -111,9 +109,7 @@
         div.setStyle(HtmlStyle.indexContainer);
         packgen.addClassListing(div);
         htmlTree.addContent(div);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            body.addContent(htmlTree);
-        }
+        body.addContent(htmlTree);
         packgen.printHtmlDocument(
                 configuration.metakeywords.getMetaKeywords(packageElement), false, body);
     }
@@ -168,9 +164,7 @@
         SortedSet<TypeElement> tset = utils.filterOutPrivateClasses(list, configuration.javafx);
         if(!tset.isEmpty()) {
             boolean printedHeader = false;
-            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                    ? HtmlTree.SECTION()
-                    : contentTree;
+            HtmlTree htmlTree = HtmlTree.SECTION();
             HtmlTree ul = new HtmlTree(HtmlTag.UL);
             ul.setTitle(labelContent);
             for (TypeElement typeElement : tset) {
@@ -195,9 +189,7 @@
                 ul.addContent(li);
             }
             htmlTree.addContent(ul);
-            if (configuration.allowTag(HtmlTag.SECTION)) {
-                contentTree.addContent(htmlTree);
-            }
+            contentTree.addContent(htmlTree);
         }
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -102,10 +102,7 @@
                 = configuration.group.groupPackages(packages);
 
         if (!groupPackageMap.keySet().isEmpty()) {
-            String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                    resources.getText("doclet.Package_Summary"), resources.getText("doclet.packages"));
-            Table table =  new Table(configuration.htmlVersion, HtmlStyle.overviewSummary)
-                    .setSummary(tableSummary)
+            Table table =  new Table(HtmlStyle.overviewSummary)
                     .setHeader(getPackageTableHeader())
                     .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast)
                     .setDefaultTab(resources.getText("doclet.All_Packages"))
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -98,9 +98,7 @@
      */
     protected void generatePackageTreeFile() throws DocFileIOException {
         HtmlTree body = getPackageTreeHeader();
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
-                ? HtmlTree.MAIN()
-                : body;
+        HtmlTree mainTree = HtmlTree.MAIN();
         Content headContent = contents.getContent("doclet.Hierarchy_For_Package",
                 utils.getPackageName(packageElement));
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
@@ -109,26 +107,20 @@
         if (configuration.packages.size() > 1) {
             addLinkToMainTree(div);
         }
-        htmlTree.addContent(div);
+        mainTree.addContent(div);
         HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
         divTree.setStyle(HtmlStyle.contentContainer);
         addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree);
         addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree);
         addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
         addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true);
-        htmlTree.addContent(divTree);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            body.addContent(htmlTree);
-        }
-        HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : body;
+        mainTree.addContent(divTree);
+        body.addContent(mainTree);
+        HtmlTree footer = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
-        tree.addContent(navBar.getContent(false));
-        addBottom(tree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            body.addContent(tree);
-        }
+        footer.addContent(navBar.getContent(false));
+        addBottom(footer);
+        body.addContent(footer);
         printHtmlDocument(null, true, body);
     }
 
@@ -141,18 +133,14 @@
         String packageName = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement);
         String title = packageName + " " + resources.getText("doclet.Window_Class_Hierarchy");
         HtmlTree bodyTree = getBody(true, getWindowTitle(title));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
                 contents.moduleLabel);
         navBar.setNavLinkModule(linkContent);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         return bodyTree;
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -134,21 +134,13 @@
         } else {
             addPackageUse(div);
         }
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-            body.addContent(mainTree);
-        } else {
-            body.addContent(div);
-        }
-        HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : body;
+        mainTree.addContent(div);
+        body.addContent(mainTree);
+        HtmlTree footer = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
-        tree.addContent(navBar.getContent(false));
-        addBottom(tree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            body.addContent(tree);
-        }
+        footer.addContent(navBar.getContent(false));
+        addBottom(footer);
+        body.addContent(footer);
         printHtmlDocument(null, true, body);
     }
 
@@ -176,8 +168,7 @@
         Content caption = contents.getContent(
                 "doclet.ClassUse_Packages.that.use.0",
                 getPackageLink(packageElement, utils.getPackageName(packageElement)));
-        Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary)
-                .setSummary(packageUseTableSummary)
+        Table table = new Table(HtmlStyle.useSummary)
                 .setCaption(caption)
                 .setHeader(getPackageTableHeader())
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
@@ -216,8 +207,7 @@
                     "doclet.ClassUse_Classes.in.0.used.by.1",
                     getPackageLink(packageElement, utils.getPackageName(packageElement)),
                     getPackageLink(usingPackage, utils.getPackageName(usingPackage)));
-            Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary)
-                    .setSummary(tableSummary)
+            Table table = new Table(HtmlStyle.useSummary)
                     .setCaption(caption)
                     .setHeader(classTableHeader)
                     .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
@@ -247,18 +237,14 @@
         String name = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement);
         String title = resources.getText("doclet.Window_ClassUse_Header", packageText, name);
         HtmlTree bodyTree = getBody(true, getWindowTitle(title));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
                 contents.moduleLabel);
         navBar.setNavLinkModule(linkContent);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         ContentBuilder headContent = new ContentBuilder();
         headContent.addContent(contents.getContent("doclet.ClassUse_Title", packageText));
         headContent.addContent(new HtmlTree(HtmlTag.BR));
@@ -266,11 +252,7 @@
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
                 HtmlStyle.title, headContent);
         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-        } else {
-            bodyTree.addContent(div);
-        }
+        mainTree.addContent(div);
         return bodyTree;
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -107,18 +107,14 @@
     @Override
     public Content getPackageHeader(String heading) {
         HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageElement)));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
                 contents.moduleLabel);
         navBar.setNavLinkModule(linkContent);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.setStyle(HtmlStyle.header);
         if (configuration.showModules) {
@@ -139,11 +135,7 @@
         Content packageHead = new StringContent(heading);
         tHeading.addContent(packageHead);
         div.addContent(tHeading);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-        } else {
-            bodyTree.addContent(div);
-        }
+        mainTree.addContent(div);
         return bodyTree;
     }
 
@@ -196,8 +188,7 @@
     @Override
     public void addInterfaceSummary(SortedSet<TypeElement> interfaces, Content summaryContentTree) {
         TableHeader tableHeader= new TableHeader(contents.interfaceLabel, contents.descriptionLabel);
-        addClassesSummary(interfaces, resources.interfaceSummary, resources.interfaceTableSummary,
-                tableHeader, summaryContentTree);
+        addClassesSummary(interfaces, resources.interfaceSummary, tableHeader, summaryContentTree);
     }
 
     /**
@@ -206,8 +197,7 @@
     @Override
     public void addClassSummary(SortedSet<TypeElement> classes, Content summaryContentTree) {
         TableHeader tableHeader= new TableHeader(contents.classLabel, contents.descriptionLabel);
-        addClassesSummary(classes, resources.classSummary, resources.classTableSummary,
-                tableHeader, summaryContentTree);
+        addClassesSummary(classes, resources.classSummary, tableHeader, summaryContentTree);
     }
 
     /**
@@ -216,8 +206,7 @@
     @Override
     public void addEnumSummary(SortedSet<TypeElement> enums, Content summaryContentTree) {
         TableHeader tableHeader= new TableHeader(contents.enum_, contents.descriptionLabel);
-        addClassesSummary(enums, resources.enumSummary, resources.enumTableSummary,
-                tableHeader, summaryContentTree);
+        addClassesSummary(enums, resources.enumSummary, tableHeader, summaryContentTree);
     }
 
     /**
@@ -226,8 +215,7 @@
     @Override
     public void addExceptionSummary(SortedSet<TypeElement> exceptions, Content summaryContentTree) {
         TableHeader tableHeader= new TableHeader(contents.exception, contents.descriptionLabel);
-        addClassesSummary(exceptions, resources.exceptionSummary, resources.exceptionTableSummary,
-                tableHeader, summaryContentTree);
+        addClassesSummary(exceptions, resources.exceptionSummary, tableHeader, summaryContentTree);
     }
 
     /**
@@ -236,8 +224,7 @@
     @Override
     public void addErrorSummary(SortedSet<TypeElement> errors, Content summaryContentTree) {
         TableHeader tableHeader= new TableHeader(contents.error, contents.descriptionLabel);
-        addClassesSummary(errors, resources.errorSummary, resources.errorTableSummary,
-                tableHeader, summaryContentTree);
+        addClassesSummary(errors, resources.errorSummary, tableHeader, summaryContentTree);
     }
 
     /**
@@ -246,15 +233,13 @@
     @Override
     public void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes, Content summaryContentTree) {
         TableHeader tableHeader= new TableHeader(contents.annotationType, contents.descriptionLabel);
-        addClassesSummary(annoTypes, resources.annotationTypeSummary, resources.annotationTypeTableSummary,
-                tableHeader, summaryContentTree);
+        addClassesSummary(annoTypes, resources.annotationTypeSummary, tableHeader, summaryContentTree);
     }
 
     public void addClassesSummary(SortedSet<TypeElement> classes, String label,
-            String tableSummary, TableHeader tableHeader, Content summaryContentTree) {
+            TableHeader tableHeader, Content summaryContentTree) {
         if(!classes.isEmpty()) {
-            Table table = new Table(configuration.htmlVersion, HtmlStyle.typeSummary)
-                    .setSummary(tableSummary)
+            Table table = new Table(HtmlStyle.typeSummary)
                     .setCaption(getTableCaption(new StringContent(label)))
                     .setHeader(tableHeader)
                     .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
@@ -288,7 +273,7 @@
     @Override
     public void addPackageDescription(Content packageContentTree) {
         if (!utils.getBody(packageElement).isEmpty()) {
-            Content tree = configuration.allowTag(HtmlTag.SECTION) ? sectionTree : packageContentTree;
+            Content tree = sectionTree;
             tree.addContent(links.createAnchor(SectionName.PACKAGE_DESCRIPTION));
             addDeprecationInfo(tree);
             addInlineComment(packageElement, tree);
@@ -300,13 +285,9 @@
      */
     @Override
     public void addPackageTags(Content packageContentTree) {
-        Content htmlTree = (configuration.allowTag(HtmlTag.SECTION))
-                ? sectionTree
-                : packageContentTree;
+        Content htmlTree = sectionTree;
         addTagsInfo(packageElement, htmlTree);
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            packageContentTree.addContent(sectionTree);
-        }
+        packageContentTree.addContent(sectionTree);
     }
 
     /**
@@ -314,12 +295,8 @@
      */
     @Override
     public void addPackageContent(Content contentTree, Content packageContentTree) {
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(packageContentTree);
-            contentTree.addContent(mainTree);
-        } else {
-            contentTree.addContent(packageContentTree);
-        }
+        mainTree.addContent(packageContentTree);
+        contentTree.addContent(mainTree);
     }
 
     /**
@@ -327,15 +304,11 @@
      */
     @Override
     public void addPackageFooter(Content contentTree) {
-        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : contentTree;
+        Content htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            contentTree.addContent(htmlTree);
-        }
+        contentTree.addContent(htmlTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -183,11 +183,7 @@
      */
     @Override
     public Content getPropertyDetails(Content propertyDetailsTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(propertyDetailsTree));
-            return htmlTree;
-        }
-        return getMemberTree(propertyDetailsTree);
+        return HtmlTree.SECTION(getMemberTree(propertyDetailsTree));
     }
 
     /**
@@ -223,12 +219,7 @@
      */
     @Override
     protected Table createSummaryTable() {
-        String summary = resources.getText("doclet.Member_Table_Summary",
-            resources.getText("doclet.Property_Summary"),
-            resources.getText("doclet.properties"));
-
-        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
-                .setSummary(summary)
+        return new Table(HtmlStyle.memberSummary)
                 .setCaption(contents.properties)
                 .setHeader(getSummaryTableHeader(typeElement))
                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast)
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java	Mon Feb 04 11:01:04 2019 +0530
@@ -80,24 +80,16 @@
      */
     public Content getHeader(String header) {
         HtmlTree bodyTree = getBody(true, getWindowTitle(header));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         Content h1Content = new StringContent(header);
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
                 HtmlStyle.title, h1Content);
         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(div);
-        } else {
-            bodyTree.addContent(div);
-        }
+        mainTree.addContent(div);
         return bodyTree;
     }
 
@@ -118,14 +110,7 @@
      * @return the package serialized form header tree
      */
     public Content getPackageSerializedHeader() {
-        HtmlTree htmlTree;
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            htmlTree = HtmlTree.SECTION();
-        } else {
-            htmlTree = new HtmlTree(HtmlTag.LI);
-            htmlTree.setStyle(HtmlStyle.blockList);
-        }
-        return htmlTree;
+        return HtmlTree.SECTION();
     }
 
     /**
@@ -240,12 +225,8 @@
     public Content getSerializedContent(Content serializedTreeContent) {
         HtmlTree divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer,
                 serializedTreeContent);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(divContent);
-            return mainTree;
-        } else {
-            return divContent;
-        }
+        mainTree.addContent(divContent);
+        return mainTree;
     }
 
     /**
@@ -253,9 +234,7 @@
      */
     public void addPackageSerializedTree(Content serializedSummariesTree,
             Content packageSerializedTree) {
-        serializedSummariesTree.addContent((configuration.allowTag(HtmlTag.SECTION))
-                ? HtmlTree.LI(HtmlStyle.blockList, packageSerializedTree)
-                : packageSerializedTree);
+        serializedSummariesTree.addContent(HtmlTree.LI(HtmlStyle.blockList, packageSerializedTree));
     }
 
     /**
@@ -264,15 +243,11 @@
      * @param serializedTree the serialized tree to be added
      */
     public void addFooter(Content serializedTree) {
-        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
-                ? HtmlTree.FOOTER()
-                : serializedTree;
+        Content htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            serializedTree.addContent(htmlTree);
-        }
+        serializedTree.addContent(htmlTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -93,15 +93,11 @@
     protected void generateIndexFile() throws DocFileIOException {
         String title = resources.getText("doclet.Window_Single_Index");
         HtmlTree body = getBody(true, getWindowTitle(title));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : body;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            body.addContent(htmlTree);
-        }
+        body.addContent(htmlTree);
         HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
         divTree.setStyle(HtmlStyle.contentContainer);
         elements = new TreeSet<>(indexbuilder.getIndexMap().keySet());
@@ -118,18 +114,12 @@
             }
         }
         addLinksForIndexes(divTree);
-        body.addContent((configuration.allowTag(HtmlTag.MAIN))
-                ? HtmlTree.MAIN(divTree)
-                : divTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            htmlTree = HtmlTree.FOOTER();
-        }
+        body.addContent(HtmlTree.MAIN(divTree));
+        htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            body.addContent(htmlTree);
-        }
+        body.addContent(htmlTree);
         createSearchIndexFiles();
         printHtmlDocument(null, true, body);
     }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -195,7 +195,7 @@
             }
             addBlankLines(pre);
             Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
-            body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(div) : div);
+            body.addContent(HtmlTree.MAIN(div));
             writeToFile(body, outputdir.resolve(configuration.docPaths.forClass(te)));
         } catch (IOException e) {
             String message = resources.getText("doclet.exception.read.file", fo.getName());
@@ -210,8 +210,7 @@
      * @param path the path for the file.
      */
     private void writeToFile(Content body, DocPath path) throws DocFileIOException {
-        DocType htmlDocType = DocType.forVersion(configuration.htmlVersion);
-        Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion)
+        Head head = new Head(path, configuration.docletVersion)
 //                .setTimestamp(!configuration.notimestamp) // temporary: compatibility!
                 .setTitle(resources.getText("doclet.Window_Source_title"))
 //                .setCharset(configuration.charset) // temporary: compatibility!
@@ -219,7 +218,7 @@
                 .setStylesheets(configuration.getMainStylesheet(), configuration.getAdditionalStylesheets());
         Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
                 head.toContent(), body);
-        HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlTree);
+        HtmlDocument htmlDocument = new HtmlDocument(htmlTree);
         messages.notice("doclet.Generating_0", path.getPath());
         htmlDocument.write(DocFile.createFileForOutput(configuration, path));
     }
@@ -294,7 +293,7 @@
      */
     private void addLine(Content pre, String line, int currentLineNo) {
         if (line != null) {
-            Content anchor = HtmlTree.A(configuration.htmlVersion,
+            Content anchor = HtmlTree.A_ID(
                     "line." + Integer.toString(currentLineNo),
                     new StringContent(utils.replaceTabs(line)));
             pre.addContent(anchor);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -121,15 +121,11 @@
         String title = resources.getText("doclet.Window_Split_Index",
                 unicode.toString());
         HtmlTree body = getBody(true, getWindowTitle(title));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : body;
-        addTop(htmlTree);
+        HtmlTree header = HtmlTree.HEADER();
+        addTop(header);
         navBar.setUserHeader(getUserHeaderFooter(true));
-        htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            body.addContent(htmlTree);
-        }
+        header.addContent(navBar.getContent(true));
+        body.addContent(header);
         HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
         divTree.setStyle(HtmlStyle.contentContainer);
         addLinksForIndexes(divTree);
@@ -142,16 +138,12 @@
                     configuration.tagSearchIndexMap.get(unicode), divTree);
         }
         addLinksForIndexes(divTree);
-        body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(divTree) : divTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            htmlTree = HtmlTree.FOOTER();
-        }
+        body.addContent(HtmlTree.MAIN(divTree));
+        HtmlTree footer = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
-        htmlTree.addContent(navBar.getContent(false));
-        addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            body.addContent(htmlTree);
-        }
+        footer.addContent(navBar.getContent(false));
+        addBottom(footer);
+        body.addContent(footer);
         printHtmlDocument(null, true, body);
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -195,12 +195,8 @@
      * @param classContentTree class content tree which will be added to the content tree
      */
     public void addClassContentTree(Content contentTree, Content classContentTree) {
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            mainTree.addContent(classContentTree);
-            contentTree.addContent(mainTree);
-        } else {
-            contentTree.addContent(classContentTree);
-        }
+        mainTree.addContent(classContentTree);
+        contentTree.addContent(mainTree);
     }
 
     /**
@@ -231,12 +227,8 @@
      * @param memberTree the content tree representing the member
      */
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        if (configuration.allowTag(HtmlTag.SECTION)) {
-            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree));
-            memberSummaryTree.addContent(htmlTree);
-        } else {
-            memberSummaryTree.addContent(getMemberTree(memberTree));
-        }
+        HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree));
+        memberSummaryTree.addContent(htmlTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java	Mon Feb 04 11:01:04 2019 +0530
@@ -112,9 +112,7 @@
                 HtmlStyle.title, headContent);
         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
         addPackageTreeLinks(div);
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
-                ? HtmlTree.MAIN()
-                : body;
+        HtmlTree htmlTree = HtmlTree.MAIN();
         htmlTree.addContent(div);
         HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
         divTree.setStyle(HtmlStyle.contentContainer);
@@ -123,20 +121,12 @@
         addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
         addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true);
         htmlTree.addContent(divTree);
-        if (configuration.allowTag(HtmlTag.MAIN)) {
-            body.addContent(htmlTree);
-        }
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            htmlTree = HtmlTree.FOOTER();
-        } else {
-            htmlTree = body;
-        }
+        body.addContent(htmlTree);
+        htmlTree = HtmlTree.FOOTER();
         navBar.setUserFooter(getUserHeaderFooter(false));
         htmlTree.addContent(navBar.getContent(false));
         addBottom(htmlTree);
-        if (configuration.allowTag(HtmlTag.FOOTER)) {
-            body.addContent(htmlTree);
-        }
+        body.addContent(htmlTree);
         printHtmlDocument(null, true, body);
     }
 
@@ -187,15 +177,11 @@
     protected HtmlTree getTreeHeader() {
         String title = resources.getText("doclet.Window_Class_Hierarchy");
         HtmlTree bodyTree = getBody(true, getWindowTitle(title));
-        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
-                ? HtmlTree.HEADER()
-                : bodyTree;
+        HtmlTree htmlTree = HtmlTree.HEADER();
         addTop(htmlTree);
         navBar.setUserHeader(getUserHeaderFooter(true));
         htmlTree.addContent(navBar.getContent(true));
-        if (configuration.allowTag(HtmlTag.HEADER)) {
-            bodyTree.addContent(htmlTree);
-        }
+        bodyTree.addContent(htmlTree);
         return bodyTree;
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/DocType.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/DocType.java	Mon Feb 04 11:01:04 2019 +0530
@@ -45,12 +45,4 @@
     DocType(String text) {
         this.text = text;
     }
-
-    public static DocType forVersion(HtmlVersion v) {
-        switch (v) {
-            case HTML4: return HTML4_TRANSITIONAL;
-            case HTML5: return HTML5;
-            default: throw new IllegalArgumentException();
-        }
-    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java	Mon Feb 04 11:01:04 2019 +0530
@@ -51,7 +51,6 @@
  *  deletion without notice.</b>
  */
 public class Head {
-    private final HtmlVersion htmlVersion;
     private final String docletVersion;
     private final DocPath pathToRoot;
     private String title;
@@ -77,11 +76,9 @@
      * recording the time the file was created.
      * The doclet version should also be provided for recording in the file.
      * @param path the path for the file that will include this HEAD element
-     * @param htmlVersion the HTML version
      * @param docletVersion a string identifying the doclet version
      */
-    public Head(DocPath path, HtmlVersion htmlVersion, String docletVersion) {
-        this.htmlVersion = htmlVersion;
+    public Head(DocPath path, String docletVersion) {
         this.docletVersion = docletVersion;
         pathToRoot = path.parent().invert();
         keywords = new ArrayList<>();
@@ -245,9 +242,7 @@
 
         if (showTimestamp) {
             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            tree.addContent(HtmlTree.META(
-                    (htmlVersion == HtmlVersion.HTML5) ? "dc.created" : "date",
-                    dateFormat.format(now)));
+            tree.addContent(HtmlTree.META("dc.created", dateFormat.format(now)));
         }
 
         for (String k : keywords) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java	Mon Feb 04 11:01:04 2019 +0530
@@ -46,29 +46,25 @@
  * @author Bhavesh Patel
  */
 public class HtmlDocument {
-    private final DocType docType;
+    private final DocType docType = DocType.HTML5;
     private final List<Content> docContent;
 
     /**
      * Constructor to construct an HTML document.
      *
-     * @param docType document type for the HTML document
      * @param docComment comment for the document
      * @param htmlTree HTML tree of the document
      */
-    public HtmlDocument(DocType docType, Content docComment, Content htmlTree) {
-        this.docType = docType;
+    public HtmlDocument(Content docComment, Content htmlTree) {
         docContent = Arrays.asList(docComment, htmlTree);
     }
 
     /**
      * Constructor to construct an HTML document.
      *
-     * @param docType document type for the HTML document
      * @param htmlTree HTML tree of the document
      */
-    public HtmlDocument(DocType docType, Content htmlTree) {
-        this.docType = docType;
+    public HtmlDocument(Content htmlTree) {
         docContent = Collections.singletonList(htmlTree);
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java	Mon Feb 04 11:01:04 2019 +0530
@@ -299,24 +299,6 @@
     }
 
     /**
-     * Generates an HTML anchor tag with an id or a name attribute and content.
-     *
-     * @param htmlVersion the version of the generated HTML
-     * @param attr name or id attribute for the anchor tag
-     * @param body content for the anchor tag
-     * @return an HtmlTree object
-     */
-    public static HtmlTree A(HtmlVersion htmlVersion, String attr, Content body) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.A);
-        htmltree.addAttr((htmlVersion == HtmlVersion.HTML4)
-                ? HtmlAttr.NAME
-                : HtmlAttr.ID,
-                nullCheck(attr));
-        htmltree.addContent(nullCheck(body));
-        return htmltree;
-    }
-
-    /**
      * Generates an HTML anchor tag with id attribute and a body.
      *
      * @param id id for the anchor tag
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Mon Feb 04 11:01:04 2019 +0530
@@ -47,7 +47,6 @@
 public class Links {
 
     private final DocPath file;
-    private final HtmlVersion version;
 
     /**
      * Creates a {@code Links} object for a specific file, to be written in a specific HTML version.
@@ -56,11 +55,9 @@
      * to use an {@code id} or {@code name} attribute when creating anchors.
      *
      * @param file the file
-     * @param version the HTML version
      */
-    public Links(DocPath file, HtmlVersion version) {
+    public Links(DocPath file) {
         this.file = file;
-        this.version = version;
     }
 
     /**
@@ -107,7 +104,7 @@
      * @return a content tree for the marker anchor
      */
     public Content createAnchor(String name, Content content) {
-        return HtmlTree.A(version, name, (content == null ? EMPTY_COMMENT : content));
+        return HtmlTree.A_ID(name, (content == null ? EMPTY_COMMENT : content));
     }
 
     private static final Content EMPTY_COMMENT = new Comment(" ");
@@ -319,59 +316,7 @@
      * @return a valid HTML name
      */
     public String getName(String name) {
-        /* The HTML 4 spec at http://www.w3.org/TR/html4/types.html#h-6.2 mentions
-         * that the name/id should begin with a letter followed by other valid characters.
-         * The HTML 5 spec (draft) is more permissive on names/ids where the only restriction
-         * is that it should be at least one character long and should not contain spaces.
-         * The spec draft is @ http://www.w3.org/html/wg/drafts/html/master/dom.html#the-id-attribute.
-         *
-         * For HTML 4, we need to check for non-characters at the beginning of the name and
-         * substitute it accordingly, "_" and "$" can appear at the beginning of a member name.
-         * The method substitutes "$" with "Z:Z:D" and will prefix "_" with "Z:Z".
-         */
-
-        if (version == HtmlVersion.HTML5) {
-            return name.replaceAll(" +", "");
-        }
-
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < name.length(); i++) {
-            char ch = name.charAt(i);
-            switch (ch) {
-                case '(':
-                case ')':
-                case '<':
-                case '>':
-                case ',':
-                    sb.append('-');
-                    break;
-                case ' ':
-                case '[':
-                    break;
-                case ']':
-                    sb.append(":A");
-                    break;
-                // Any appearance of $ needs to be substituted with ":D" and not with hyphen
-                // since a field name "P$$ and a method P(), both valid member names, can end
-                // up as "P--". A member name beginning with $ needs to be substituted with
-                // "Z:Z:D".
-                case '$':
-                    if (i == 0)
-                        sb.append("Z:Z");
-                    sb.append(":D");
-                    break;
-                // A member name beginning with _ needs to be prefixed with "Z:Z" since valid anchor
-                // names can only begin with a letter.
-                case '_':
-                    if (i == 0)
-                        sb.append("Z:Z");
-                    sb.append(ch);
-                    break;
-                default:
-                    sb.append(ch);
-            }
-        }
-        return sb.toString();
+        return name.replaceAll(" +", "");
     }
 
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java	Mon Feb 04 11:01:04 2019 +0530
@@ -145,7 +145,7 @@
         this.documentedPage = page;
         this.path = path;
         this.pathToRoot = path.parent().invert();
-        this.links = new Links(path, configuration.htmlVersion);
+        this.links = new Links(path);
         this.topBottomNavContents = new HashMap<>();
         this.rowListTitle = configuration.getResources().getText("doclet.Navigation");
         this.searchLabel = contents.getContent("doclet.search");
@@ -976,9 +976,7 @@
         Content contentTree = new ContentBuilder();
         if (!configuration.nonavbar) {
             Deque<Content> queue;
-            Content tree = (configuration.htmlVersion == HtmlVersion.HTML5)
-                    ? HtmlTree.NAV()
-                    : contentTree;
+            Content tree = HtmlTree.NAV();
             HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
             if (top) {
                 queue = topBottomNavContents.get(Position.TOP);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java	Mon Feb 04 11:01:04 2019 +0530
@@ -61,9 +61,7 @@
  *  deletion without notice.</b>
  */
 public class Table {
-    private final HtmlVersion version;
     private final HtmlStyle tableStyle;
-    private String summary;
     private Content caption;
     private Map<String, Predicate<Element>> tabMap;
     private String defaultTab;
@@ -84,32 +82,15 @@
     /**
      * Creates a builder for an HTML table.
      *
-     * @param version   the version of HTML, used to determine is a {@code summary}
-     *                  attribute is needed
      * @param style     the style class for the {@code <table>} tag
      */
-    public Table(HtmlVersion version, HtmlStyle style) {
-        this.version = version;
+    public Table(HtmlStyle style) {
         this.tableStyle = style;
         bodyRows = new ArrayList<>();
         bodyRowMasks = new ArrayList<>();
     }
 
     /**
-     * Sets the summary for the table.
-     * This is ignored if the HTML version for the table is not {@link HtmlVersion#HTML4}.
-     *
-     * @param summary the summary
-     * @return this object
-     */
-    public Table setSummary(String summary) {
-        if (version == HtmlVersion.HTML4) {
-            this.summary = summary;
-        }
-        return this;
-    }
-
-    /**
      * Sets the caption for the table.
      * This is ignored if the table is configured to provide tabs to select
      * different subsets of rows within the table.
@@ -418,9 +399,6 @@
         HtmlTree mainDiv = new HtmlTree(HtmlTag.DIV);
         mainDiv.setStyle(tableStyle);
         HtmlTree table = new HtmlTree(HtmlTag.TABLE);
-        if (summary != null) {
-            table.addAttr(HtmlAttr.SUMMARY, summary);
-        }
         if (tabMap == null || tabs.size() == 1) {
             if (tabMap == null) {
                 table.addContent(caption);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Mon Feb 04 11:01:04 2019 +0530
@@ -279,11 +279,8 @@
 doclet.usage.header.description=\
     Include header text for each page
 
-doclet.usage.html4.description=\
-    Generate HTML 4.01 output
-
 doclet.usage.html5.description=\
-    Generate HTML 5 output
+    Generate HTML 5 output. This option is no longer required.
 
 doclet.usage.footer.parameters=\
     <html-code>
@@ -449,13 +446,6 @@
     of the given package. Prefix the package specifier with - to\n\
     disable checks for the specified packages.
 
-# L10N: do not localize the option names -html4 and -html5
-doclet.HTML_4_specified=\
-    You have specified the HTML version as HTML 4.01 by using the -html4 option.\n\
-    The default is currently HTML5 and the support for HTML 4.01 will be removed\n\
-    in a future release. To suppress this warning, please ensure that any HTML constructs\n\
-    in your comments are valid in HTML5, and remove the -html4 option.
-
 # L10N: do not localize the option names --frames
 doclet.Frames_specified=\
     You have specified to generate frames, by using the --frames option.\n\
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java	Mon Feb 04 11:01:04 2019 +0530
@@ -40,22 +40,15 @@
  */
 public class Resources {
     public final String annotationTypeSummary;
-    public final String annotationTypeTableSummary;
     public final String classSummary;
-    public final String classTableSummary;
     private final BaseConfiguration configuration;
     private final String commonBundleName;
     private final String docletBundleName;
     public final String enumSummary;
-    public final String enumTableSummary;
     public final String errorSummary;
-    public final String errorTableSummary;
     public final String exceptionSummary;
-    public final String exceptionTableSummary;
     public final String interfaceSummary;
-    public final String interfaceTableSummary;
     public final String packageSummary;
-    public final String packageTableSummary;
 
     protected ResourceBundle commonBundle;
     protected ResourceBundle docletBundle;
@@ -77,26 +70,12 @@
         this.commonBundleName = commonBundleName;
         this.docletBundleName = docletBundleName;
         this.annotationTypeSummary = getText("doclet.Annotation_Types_Summary");
-        this.annotationTypeTableSummary = getText("doclet.Member_Table_Summary",
-                this.annotationTypeSummary, getText("doclet.annotationtypes"));
         this.classSummary = getText("doclet.Class_Summary");
-        this.classTableSummary = getText("doclet.Member_Table_Summary",
-                this.classSummary, getText("doclet.classes"));
         this.enumSummary = getText("doclet.Enum_Summary");
-        this.enumTableSummary = getText("doclet.Member_Table_Summary",
-                this.enumSummary, getText("doclet.enums"));
         this.errorSummary = getText("doclet.Error_Summary");
-        this.errorTableSummary = getText("doclet.Member_Table_Summary",
-                this.errorSummary, getText("doclet.errors"));
         this.exceptionSummary = getText("doclet.Exception_Summary");
-        this.exceptionTableSummary = getText("doclet.Member_Table_Summary",
-                this.exceptionSummary, getText("doclet.exceptions"));
         this.interfaceSummary = getText("doclet.Interface_Summary");
-        this.interfaceTableSummary = getText("doclet.Member_Table_Summary",
-                this.interfaceSummary, getText("doclet.interfaces"));
         this.packageSummary = getText("doclet.Package_Summary");
-        this.packageTableSummary = getText("doclet.Member_Table_Summary",
-                this.packageSummary, getText("doclet.packages"));
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties	Mon Feb 04 11:01:04 2019 +0530
@@ -94,7 +94,6 @@
 doclet.Opened_Packages_Summary=Opens
 doclet.Concealed_Packages_Summary=Concealed
 doclet.From=From
-doclet.Packages_Summary=Packages
 doclet.Uses_Summary=Uses
 doclet.Provides_Summary=Provides
 doclet.Module_Summary=Module Summary
@@ -120,7 +119,6 @@
 doclet.Classes=Classes
 doclet.packages=packages
 doclet.modules=modules
-doclet.types=types
 doclet.All_Classes=All Classes
 doclet.All_Superinterfaces=All Superinterfaces:
 doclet.All_Implemented_Interfaces=All Implemented Interfaces:
@@ -179,12 +177,9 @@
 doclet.dest_dir_create=Creating destination directory: "{0}"
 doclet.in={0} in {1}
 doclet.Use_Table_Summary=Use table, listing {0}, and an explanation
-doclet.Constants_Table_Summary={0} table, listing constant fields, and values
 doclet.Member_Table_Summary={0} table, listing {1}, and an explanation
-doclet.Indirect_Packages_Table_Summary={0} table, listing {1}, and {2}
 doclet.fields=fields
 doclet.Fields=Fields
-doclet.properties=properties
 doclet.Properties=Properties
 doclet.constructors=constructors
 doclet.Constructors=Constructors
@@ -197,16 +192,11 @@
 doclet.Concrete_Methods=Concrete Methods
 doclet.Default_Methods=Default Methods
 doclet.Deprecated_Methods=Deprecated Methods
-doclet.annotation_type_optional_members=optional elements
 doclet.Annotation_Type_Optional_Members=Optional Elements
-doclet.annotation_type_required_members=required elements
 doclet.Annotation_Type_Required_Members=Required Elements
 doclet.enum_constants=enum constants
 doclet.Enum_Constants=Enum Constants
-doclet.nested_classes=nested classes
 doclet.Nested_Classes=Nested Classes
-doclet.subclasses=subclasses
-doclet.subinterfaces=subinterfaces
 doclet.Modifier=Modifier
 doclet.Type=Type
 doclet.Modifier_and_Type=Modifier and Type
--- a/src/jdk.javadoc/share/legal/jquery.md	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.javadoc/share/legal/jquery.md	Mon Feb 04 11:01:04 2019 +0530
@@ -3,8 +3,7 @@
 ### jQuery License
 ```
 jQuery v 3.3.1
-Copyright 2005, 2018 jQuery Foundation, Inc. and other contributors
-http://jquery.com/
+Copyright JS Foundation and other contributors, https://js.foundation/
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
--- a/src/jdk.jdwp.agent/share/native/libjdwp/eventHelper.c	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.jdwp.agent/share/native/libjdwp/eventHelper.c	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -752,6 +752,7 @@
     holdEvents = JNI_FALSE;
     debugMonitorNotifyAll(commandQueueLock);
     debugMonitorExit(commandQueueLock);
+    unblockCommandLoop();
 }
 
 /*
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Mon Feb 04 11:01:04 2019 +0530
@@ -24,11 +24,8 @@
  */
 package jdk.tools.jlink.internal;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.lang.module.Configuration;
-import java.lang.module.ModuleFinder;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -48,17 +45,16 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import jdk.tools.jlink.internal.plugins.ExcludeJmodSectionPlugin;
-import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.plugin.Plugin.Category;
 import jdk.tools.jlink.builder.DefaultImageBuilder;
 import jdk.tools.jlink.builder.ImageBuilder;
-import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.internal.Jlink.PluginsConfiguration;
+import jdk.tools.jlink.internal.plugins.DefaultCompressPlugin;
+import jdk.tools.jlink.internal.plugins.ExcludeJmodSectionPlugin;
 import jdk.tools.jlink.internal.plugins.PluginsResourceBundle;
-import jdk.tools.jlink.internal.plugins.DefaultCompressPlugin;
 import jdk.tools.jlink.internal.plugins.StripDebugPlugin;
-import jdk.internal.module.ModulePath;
+import jdk.tools.jlink.plugin.Plugin;
+import jdk.tools.jlink.plugin.Plugin.Category;
+import jdk.tools.jlink.plugin.PluginException;
 
 /**
  *
@@ -240,17 +236,7 @@
         private final List<PluginOption> pluginsOptions = new ArrayList<>();
         private final List<PluginOption> mainOptions = new ArrayList<>();
 
-        private PluginsHelper(String pp) throws BadArgs {
-
-            if (pp != null) {
-                String[] dirs = pp.split(File.pathSeparator);
-                List<Path> paths = new ArrayList<>(dirs.length);
-                for (String dir : dirs) {
-                    paths.add(Paths.get(dir));
-                }
-
-                pluginsLayer = createPluginsLayer(paths);
-            }
+        private PluginsHelper() throws BadArgs {
 
             plugins = PluginRepository.getPlugins(pluginsLayer);
 
@@ -544,7 +530,7 @@
             // Must extract it prior to do any option analysis.
             // Required to interpret custom plugin options.
             // Unit tests can call Task multiple time in same JVM.
-            pluginOptions = new PluginsHelper(null);
+            pluginOptions = new PluginsHelper();
 
             // process options
             for (int i = 0; i < args.length; i++) {
@@ -741,24 +727,6 @@
         return System.getProperty("java.version");
     }
 
-    static ModuleLayer createPluginsLayer(List<Path> paths) {
-
-        Path[] dirs = paths.toArray(new Path[0]);
-        ModuleFinder finder = ModulePath.of(Runtime.version(), true, dirs);
-        Configuration bootConfiguration = ModuleLayer.boot().configuration();
-        try {
-            Configuration cf = bootConfiguration
-                .resolveAndBind(ModuleFinder.of(),
-                                finder,
-                                Collections.emptySet());
-            ClassLoader scl = ClassLoader.getSystemClassLoader();
-            return ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
-        } catch (Exception ex) {
-            // Malformed plugin modules (e.g.: same package in multiple modules).
-            throw new PluginException("Invalid modules in the plugins path: " + ex);
-        }
-    }
-
     // Display all plugins
     private static boolean showsPlugin(Plugin plugin) {
         return (!Utils.isDisabled(plugin) && plugin.getOption() != null);
--- a/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/ja.xml	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/ja.xml	Mon Feb 04 11:01:04 2019 +0530
@@ -3633,6 +3633,7 @@
 						<era type="233">大正</era>
 						<era type="234">昭和</era>
 						<era type="235">平成</era>
+						<era type="236">元号</era> <!-- NewEra -->
 					</eraAbbr>
 					<eraNarrow>
 						<era type="0">大化</era>
@@ -3871,6 +3872,7 @@
 						<era type="233">T</era>
 						<era type="234">S</era>
 						<era type="235">H</era>
+						<era type="236">N</era> <!-- NewEra -->
 					</eraNarrow>
 				</eras>
 				<dateFormats>
--- a/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/root.xml	Sat Feb 02 10:00:05 2019 -0800
+++ b/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/main/root.xml	Mon Feb 04 11:01:04 2019 +0530
@@ -2030,6 +2030,7 @@
 						<era type="233">Taishō</era>
 						<era type="234">Shōwa</era>
 						<era type="235">Heisei</era>
+						<era type="236">NewEra</era> <!-- NewEra -->
 					</eraAbbr>
 					<eraNarrow>
 						<era type="0">Taika (645–650)</era>
@@ -2268,6 +2269,7 @@
 						<era type="233">T</era>
 						<era type="234">S</era>
 						<era type="235">H</era>
+						<era type="236">N</era> <!-- NewEra -->
 					</eraNarrow>
 				</eras>
 				<dateFormats>
--- a/test/hotspot/gtest/runtime/test_os.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/gtest/runtime/test_os.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -153,6 +153,30 @@
 }
 #endif
 
+TEST(os, test_print_hex_dump) {
+  ResourceMark rm;
+  stringStream ss;
+  outputStream* out = &ss;
+//  outputStream* out = tty; // enable for printout
+
+  // Test dumping unreadable memory does not fail
+  os::print_hex_dump(out, (address)0, (address)100, 1);
+  os::print_hex_dump(out, (address)0, (address)100, 2);
+  os::print_hex_dump(out, (address)0, (address)100, 4);
+  os::print_hex_dump(out, (address)0, (address)100, 8);
+
+  // Test dumping readable memory does not fail
+  char arr[100];
+  for (int c = 0; c < 100; c++) {
+    arr[c] = c;
+  }
+  address addr = (address)&arr;
+  os::print_hex_dump(out, addr, addr + 100, 1);
+  os::print_hex_dump(out, addr, addr + 100, 2);
+  os::print_hex_dump(out, addr, addr + 100, 4);
+  os::print_hex_dump(out, addr, addr + 100, 8);
+}
+
 //////////////////////////////////////////////////////////////////////////////
 // Test os::vsnprintf and friends.
 
--- a/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -46,10 +46,6 @@
   static uintx get_hash(const uintptr_t& value, bool* dead_hash) {
     return (uintx)value;
   }
-  static const uintptr_t& notfound() {
-    static uintptr_t notfound = 0;
-    return notfound;
-  }
   static void* allocate_node(size_t size, const uintptr_t& value) {
     return ::malloc(size);
   }
@@ -69,18 +65,6 @@
   }
 };
 
-static void cht_insert(Thread* thr) {
-  uintptr_t val = 0x2;
-  SimpleTestLookup stl(val);
-  SimpleTestTable* cht = new SimpleTestTable();
-  EXPECT_TRUE(cht->insert(thr, stl, val)) << "Insert unique value failed.";
-  EXPECT_EQ(cht->get_copy(thr, stl), val) << "Getting an existing value failed.";
-  EXPECT_TRUE(cht->remove(thr, stl)) << "Removing an existing value failed.";
-  EXPECT_FALSE(cht->remove(thr, stl)) << "Removing an already removed item succeeded.";
-  EXPECT_NE(cht->get_copy(thr, stl), val) << "Getting a removed value succeeded.";
-  delete cht;
-}
-
 struct ValueGet {
   uintptr_t _return;
   ValueGet() : _return(0) {}
@@ -93,22 +77,35 @@
   }
 };
 
-static void cht_get_helper(Thread* thr, SimpleTestTable* cht, uintptr_t val) {
-  {
-    SimpleTestLookup stl(val);
-    ValueGet vg;
-    EXPECT_EQ(cht->get(thr, stl, vg), true) << "Getting an old value failed.";
-    EXPECT_EQ(val, vg.get_value()) << "Getting an old value failed.";
-  }
+static uintptr_t cht_get_copy(SimpleTestTable* cht, Thread* thr, SimpleTestLookup stl) {
+  ValueGet vg;
+  cht->get(thr, stl, vg);
+  return vg.get_value();
+}
+
+static void cht_find(Thread* thr, SimpleTestTable* cht, uintptr_t val) {
+  SimpleTestLookup stl(val);
+  ValueGet vg;
+  EXPECT_EQ(cht->get(thr, stl, vg), true) << "Getting an old value failed.";
+  EXPECT_EQ(val, vg.get_value()) << "Getting an old value failed.";
 }
 
-static void cht_insert_helper(Thread* thr, SimpleTestTable* cht, uintptr_t val) {
-  {
-    SimpleTestLookup stl(val);
-    EXPECT_EQ(cht->insert(thr, stl, val), true) << "Inserting an unique value failed.";
-  }
+static void cht_insert_and_find(Thread* thr, SimpleTestTable* cht, uintptr_t val) {
+  SimpleTestLookup stl(val);
+  EXPECT_EQ(cht->insert(thr, stl, val), true) << "Inserting an unique value failed.";
+  cht_find(thr, cht, val);
+}
 
-  cht_get_helper(thr, cht, val);
+static void cht_insert(Thread* thr) {
+  uintptr_t val = 0x2;
+  SimpleTestLookup stl(val);
+  SimpleTestTable* cht = new SimpleTestTable();
+  EXPECT_TRUE(cht->insert(thr, stl, val)) << "Insert unique value failed.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl), val) << "Getting an existing value failed.";
+  EXPECT_TRUE(cht->remove(thr, stl)) << "Removing an existing value failed.";
+  EXPECT_FALSE(cht->remove(thr, stl)) << "Removing an already removed item succeeded.";
+  EXPECT_NE(cht_get_copy(cht, thr, stl), val) << "Getting a removed value succeeded.";
+  delete cht;
 }
 
 static void cht_get_insert(Thread* thr) {
@@ -118,15 +115,15 @@
 
   {
     SCOPED_TRACE("First");
-    cht_insert_helper(thr, cht, val);
+    cht_insert_and_find(thr, cht, val);
   }
-  EXPECT_EQ(cht->get_copy(thr, stl), val) << "Get an old value failed";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl), val) << "Get an old value failed";
   EXPECT_TRUE(cht->remove(thr, stl)) << "Removing existing value failed.";
-  EXPECT_NE(cht->get_copy(thr, stl), val) << "Got an already removed item.";
+  EXPECT_NE(cht_get_copy(cht, thr, stl), val) << "Got an already removed item.";
 
   {
     SCOPED_TRACE("Second");
-    cht_insert_helper(thr, cht, val);
+    cht_insert_and_find(thr, cht, val);
   }
 
   delete cht;
@@ -145,10 +142,10 @@
                                                      bool verify_expect_get, bool verify_expect_inserted) {
   SimpleTestLookup stl(val);
   if (verify_expect_inserted) {
-    cht_insert_helper(thr, cht, val);
+    cht_insert_and_find(thr, cht, val);
   }
   if (verify_expect_get) {
-    cht_get_helper(thr, cht, val);
+    cht_find(thr, cht, val);
   }
 }
 
@@ -169,17 +166,17 @@
   cht_getinsert_bulkdelete_insert_verified(thr, cht, val2, false, true); // val2 should be inserted
   cht_getinsert_bulkdelete_insert_verified(thr, cht, val3, true, false); // val3 should be present
 
-  EXPECT_EQ(cht->get_copy(thr, stl1), val1) << "Get did not find value.";
-  EXPECT_EQ(cht->get_copy(thr, stl2), val2) << "Get did not find value.";
-  EXPECT_EQ(cht->get_copy(thr, stl3), val3) << "Get did not find value.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl1), val1) << "Get did not find value.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl2), val2) << "Get did not find value.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl3), val3) << "Get did not find value.";
 
   // Removes all odd values.
   cht->bulk_delete(thr, getinsert_bulkdelete_eval, getinsert_bulkdelete_del);
 
-  EXPECT_EQ(cht->get_copy(thr, stl1), (uintptr_t)0) << "Odd value should not exist.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl1), (uintptr_t)0) << "Odd value should not exist.";
   EXPECT_FALSE(cht->remove(thr, stl1)) << "Odd value should not exist.";
-  EXPECT_EQ(cht->get_copy(thr, stl2), val2) << "Even value should not have been removed.";
-  EXPECT_EQ(cht->get_copy(thr, stl3), (uintptr_t)0) << "Add value should not exists.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl2), val2) << "Even value should not have been removed.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl3), (uintptr_t)0) << "Add value should not exists.";
   EXPECT_FALSE(cht->remove(thr, stl3)) << "Odd value should not exists.";
 
   delete cht;
@@ -202,9 +199,9 @@
   cht_getinsert_bulkdelete_insert_verified(thr, cht, val2, false, true); // val2 should be inserted
   cht_getinsert_bulkdelete_insert_verified(thr, cht, val3, true, false); // val3 should be present
 
-  EXPECT_EQ(cht->get_copy(thr, stl1), val1) << "Get did not find value.";
-  EXPECT_EQ(cht->get_copy(thr, stl2), val2) << "Get did not find value.";
-  EXPECT_EQ(cht->get_copy(thr, stl3), val3) << "Get did not find value.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl1), val1) << "Get did not find value.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl2), val2) << "Get did not find value.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl3), val3) << "Get did not find value.";
 
   // Removes all odd values.
   SimpleTestTable::BulkDeleteTask bdt(cht);
@@ -216,10 +213,10 @@
     bdt.done(thr);
   }
 
-  EXPECT_EQ(cht->get_copy(thr, stl1), (uintptr_t)0) << "Odd value should not exist.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl1), (uintptr_t)0) << "Odd value should not exist.";
   EXPECT_FALSE(cht->remove(thr, stl1)) << "Odd value should not exist.";
-  EXPECT_EQ(cht->get_copy(thr, stl2), val2) << "Even value should not have been removed.";
-  EXPECT_EQ(cht->get_copy(thr, stl3), (uintptr_t)0) << "Add value should not exists.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl2), val2) << "Even value should not have been removed.";
+  EXPECT_EQ(cht_get_copy(cht, thr, stl3), (uintptr_t)0) << "Add value should not exists.";
   EXPECT_FALSE(cht->remove(thr, stl3)) << "Odd value should not exists.";
 
   delete cht;
@@ -236,7 +233,7 @@
   }
   // We do remove here to make sure the value-handle 'unlocked' the table when leaving the scope.
   EXPECT_TRUE(cht->remove(thr, stl)) << "Removing a pre-existing value failed.";
-  EXPECT_FALSE(cht->get_copy(thr, stl) == val) << "Got a removed value.";
+  EXPECT_FALSE(cht_get_copy(cht, thr, stl) == val) << "Got a removed value.";
   delete cht;
 }
 
@@ -259,7 +256,7 @@
   EXPECT_TRUE(cht->insert(thr, stl, val)) << "Insert unique value failed.";
   EXPECT_EQ(cht->try_scan(thr, scan), true) << "Scanning an non-growing/shrinking table should work.";
   EXPECT_TRUE(cht->remove(thr, stl)) << "Removing a pre-existing value failed.";
-  EXPECT_FALSE(cht->get_copy(thr, stl) == val) << "Got a removed value.";
+  EXPECT_FALSE(cht_get_copy(cht, thr, stl) == val) << "Got a removed value.";
   delete cht;
 }
 
@@ -292,9 +289,9 @@
   ChtCountScan scan_new;
   EXPECT_TRUE(to_cht->try_scan(thr, scan_new)) << "Scanning table should work.";
   EXPECT_EQ(scan_new._count, (size_t)3) << "All items should be moved";
-  EXPECT_TRUE(to_cht->get_copy(thr, stl1) == val1) << "Getting an inserted value should work.";
-  EXPECT_TRUE(to_cht->get_copy(thr, stl2) == val2) << "Getting an inserted value should work.";
-  EXPECT_TRUE(to_cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(to_cht, thr, stl1) == val1) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(to_cht, thr, stl2) == val2) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(to_cht, thr, stl3) == val3) << "Getting an inserted value should work.";
 }
 
 static void cht_grow(Thread* thr) {
@@ -308,31 +305,31 @@
   EXPECT_TRUE(cht->insert(thr, stl2, val2)) << "Insert unique value failed.";
   EXPECT_TRUE(cht->insert(thr, stl3, val3)) << "Insert unique value failed.";
   EXPECT_FALSE(cht->insert(thr, stl3, val3)) << "Insert duplicate value should have failed.";
-  EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an inserted value should work.";
-  EXPECT_TRUE(cht->get_copy(thr, stl2) == val2) << "Getting an inserted value should work.";
-  EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl2) == val2) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an inserted value should work.";
 
   EXPECT_TRUE(cht->remove(thr, stl2)) << "Removing an inserted value should work.";
 
-  EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an inserted value should work.";
-  EXPECT_FALSE(cht->get_copy(thr, stl2) == val2) << "Getting a removed value should have failed.";
-  EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an inserted value should work.";
+  EXPECT_FALSE(cht_get_copy(cht, thr, stl2) == val2) << "Getting a removed value should have failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an inserted value should work.";
 
 
   EXPECT_TRUE(cht->grow(thr)) << "Growing uncontended should not fail.";
 
-  EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an item after grow failed.";
-  EXPECT_FALSE(cht->get_copy(thr, stl2) == val2) << "Getting a removed value after grow should have failed.";
-  EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an item after grow failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an item after grow failed.";
+  EXPECT_FALSE(cht_get_copy(cht, thr, stl2) == val2) << "Getting a removed value after grow should have failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an item after grow failed.";
 
   EXPECT_TRUE(cht->insert(thr, stl2, val2)) << "Insert unique value failed.";
   EXPECT_TRUE(cht->remove(thr, stl3)) << "Removing an inserted value should work.";
 
   EXPECT_TRUE(cht->shrink(thr)) << "Shrinking uncontended should not fail.";
 
-  EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an item after shrink failed.";
-  EXPECT_TRUE(cht->get_copy(thr, stl2) == val2) << "Getting an item after shrink failed.";
-  EXPECT_FALSE(cht->get_copy(thr, stl3) == val3) << "Getting a removed value after shrink should have failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an item after shrink failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl2) == val2) << "Getting an item after shrink failed.";
+  EXPECT_FALSE(cht_get_copy(cht, thr, stl3) == val3) << "Getting a removed value after shrink should have failed.";
 
   delete cht;
 }
@@ -348,33 +345,33 @@
   EXPECT_TRUE(cht->insert(thr, stl2, val2)) << "Insert unique value failed.";
   EXPECT_TRUE(cht->insert(thr, stl3, val3)) << "Insert unique value failed.";
   EXPECT_FALSE(cht->insert(thr, stl3, val3)) << "Insert duplicate value should have failed.";
-  EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an inserted value should work.";
-  EXPECT_TRUE(cht->get_copy(thr, stl2) == val2) << "Getting an inserted value should work.";
-  EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl2) == val2) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an inserted value should work.";
 
   EXPECT_TRUE(cht->remove(thr, stl2)) << "Removing an inserted value should work.";
 
-  EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an inserted value should work.";
-  EXPECT_FALSE(cht->get_copy(thr, stl2) == val2) << "Getting a removed value should have failed.";
-  EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an inserted value should work.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an inserted value should work.";
+  EXPECT_FALSE(cht_get_copy(cht, thr, stl2) == val2) << "Getting a removed value should have failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an inserted value should work.";
 
   SimpleTestTable::GrowTask gt(cht);
   EXPECT_TRUE(gt.prepare(thr)) << "Growing uncontended should not fail.";
   while(gt.do_task(thr)) { /* grow */  }
   gt.done(thr);
 
-  EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an item after grow failed.";
-  EXPECT_FALSE(cht->get_copy(thr, stl2) == val2) << "Getting a removed value after grow should have failed.";
-  EXPECT_TRUE(cht->get_copy(thr, stl3) == val3) << "Getting an item after grow failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an item after grow failed.";
+  EXPECT_FALSE(cht_get_copy(cht, thr, stl2) == val2) << "Getting a removed value after grow should have failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl3) == val3) << "Getting an item after grow failed.";
 
   EXPECT_TRUE(cht->insert(thr, stl2, val2)) << "Insert unique value failed.";
   EXPECT_TRUE(cht->remove(thr, stl3)) << "Removing an inserted value should work.";
 
   EXPECT_TRUE(cht->shrink(thr)) << "Shrinking uncontended should not fail.";
 
-  EXPECT_TRUE(cht->get_copy(thr, stl) == val) << "Getting an item after shrink failed.";
-  EXPECT_TRUE(cht->get_copy(thr, stl2) == val2) << "Getting an item after shrink failed.";
-  EXPECT_FALSE(cht->get_copy(thr, stl3) == val3) << "Getting a removed value after shrink should have failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl) == val) << "Getting an item after shrink failed.";
+  EXPECT_TRUE(cht_get_copy(cht, thr, stl2) == val2) << "Getting an item after shrink failed.";
+  EXPECT_FALSE(cht_get_copy(cht, thr, stl3) == val3) << "Getting a removed value after shrink should have failed.";
 
   delete cht;
 }
@@ -427,10 +424,6 @@
   static uintx get_hash(const uintptr_t& value, bool* dead_hash) {
     return (uintx)(value + 18446744073709551557ul) * 18446744073709551557ul;
   }
-  static const uintptr_t& notfound() {
-    static uintptr_t notfound = 0;
-    return notfound;
-  }
 };
 
 struct TestLookup {
@@ -444,6 +437,12 @@
   }
 };
 
+static uintptr_t cht_get_copy(TestTable* cht, Thread* thr, TestLookup tl) {
+  ValueGet vg;
+  cht->get(thr, tl, vg);
+  return vg.get_value();
+}
+
 class CHTTestThread : public JavaTestThread {
   public:
   uintptr_t _start;
@@ -530,7 +529,7 @@
     }
     for (uintptr_t v = _start; v <= _stop; v++) {
       TestLookup tl(v);
-      EXPECT_TRUE(_cht->get_copy(this, tl) == v) << "Getting an previously inserted value unsafe failed.";
+      EXPECT_TRUE(cht_get_copy(_cht, this, tl) == v) << "Getting an previously inserted value unsafe failed.";
     }
     for (uintptr_t v = _start; v <= _stop; v++) {
       TestLookup tl(v);
@@ -538,7 +537,7 @@
     }
     for (uintptr_t v = _start; v <= _stop; v++) {
       TestLookup tl(v);
-      EXPECT_TRUE(_cht->get_copy(this, tl) == TestInterface::notfound()) << "Got a removed value.";
+      EXPECT_TRUE(cht_get_copy(_cht, this, tl) == 0) << "Got a removed value.";
     }
     return true;
   }
@@ -577,7 +576,7 @@
   bool test_loop() {
     for (uintptr_t v = 0x500; v < 0x5FF; v++ ) {
       TestLookup tl(v);
-      EXPECT_TRUE(_cht->get_copy(this, tl) == v) << "Getting an previously inserted value unsafe failed.";;
+      EXPECT_TRUE(cht_get_copy(_cht, this, tl) == v) << "Getting an previously inserted value unsafe failed.";;
     }
     return true;
   }
@@ -656,7 +655,7 @@
       uintptr_t tv;
       if (v & 0x1) {
         TestLookup tl(v);
-        tv = _cht->get_copy(this, tl);
+        tv = cht_get_copy(_cht, this, tl);
       } else {
         TestLookup tl(v);
         TestGetHandle value_handle(this, _cht);
@@ -712,7 +711,7 @@
     }
     for (uintptr_t v = _start; v <= _stop; v++) {
       TestLookup tl(v);
-      EXPECT_TRUE(_cht->get_copy(this, tl) == v) <<  "Getting an previously inserted value unsafe failed.";
+      EXPECT_TRUE(cht_get_copy(_cht, this, tl) == v) <<  "Getting an previously inserted value unsafe failed.";
     }
     for (uintptr_t v = _start; v <= _stop; v++) {
       TestLookup tl(v);
@@ -723,7 +722,7 @@
     }
     for (uintptr_t v = _start; v <= _stop; v++) {
       TestLookup tl(v);
-      EXPECT_FALSE(_cht->get_copy(this, tl) == v)  << "Getting a removed value should have failed.";
+      EXPECT_FALSE(cht_get_copy(_cht, this, tl) == v)  << "Getting a removed value should have failed.";
     }
     if (!_shrink && _cht->get_size_log2(this) == END_SIZE) {
       _shrink = true;
@@ -794,7 +793,7 @@
   bool test_loop() {
     for (uintptr_t v = _start; v <= (_start + _range); v++ ) {
       TestLookup tl(v);
-      EXPECT_TRUE(_cht->get_copy(this, tl) == v) <<  "Getting an previously inserted value unsafe failed.";
+      EXPECT_TRUE(cht_get_copy(_cht, this, tl) == v) <<  "Getting an previously inserted value unsafe failed.";
     }
     return true;
   }
@@ -930,9 +929,9 @@
     for (uintptr_t v = _start; v <= (_start + _range); v++ ) {
       TestLookup tl(v);
       if (v & 0xF) {
-        _cht->get_copy(this, tl);
+        cht_get_copy(_cht, this, tl);
       } else {
-        EXPECT_EQ(_cht->get_copy(this, tl), v) << "Item ending with 0xX0 should never be removed.";
+        EXPECT_EQ(cht_get_copy(_cht, this, tl), v) << "Item ending with 0xX0 should never be removed.";
       }
     }
     return true;
@@ -1009,7 +1008,7 @@
 
     for (uintptr_t v = 1; v < 99999; v++ ) {
       TestLookup tl(v);
-      cht->get_copy(this, tl);
+      cht_get_copy(cht, this, tl);
     }
 
     for (int i = 0; i < 4; i++) {
--- a/test/hotspot/jtreg/ProblemList-Xcomp.txt	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/ProblemList-Xcomp.txt	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -27,4 +27,4 @@
 #
 #############################################################################
 
-vmTestbase/vm/mlvm/meth/stress/jni/nativeAndMH/Test.java 8208235 solaris-all
+vmTestbase/vm/mlvm/meth/stress/jni/nativeAndMH/Test.java 8058176 solaris-all
--- a/test/hotspot/jtreg/ProblemList-graal.txt	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/ProblemList-graal.txt	Mon Feb 04 11:01:04 2019 +0530
@@ -60,6 +60,8 @@
 gc/g1/plab/TestPLABPromotion.java                               8191048   generic-all
 gc/g1/plab/TestPLABResize.java                                  8191048   generic-all
 
+gc/stress/TestStressG1Humongous.java                            8218176   generic-all
+
 compiler/compilercontrol/directives/LogTest.java                8181753   generic-all
 
 gc/parallel/TestPrintGCDetailsVerbose.java                      8196611   macosx-all
@@ -109,8 +111,6 @@
 vmTestbase/vm/mlvm/anonloader/stress/oome/metaspace/Test.java    8186299   generic-all
 
 # jvmti tests
-vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretbase/TestDescription.java       8195635   generic-all
-
 vmTestbase/nsk/jvmti/PopFrame/popframe009/TestDescription.java                     8195639   generic-all
 
 vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java     8195674   generic-all
@@ -127,6 +127,61 @@
 
 serviceability/jvmti/FieldAccessWatch/FieldAccessWatch.java                        8202482   generic-all
 
+# tests require pop_frame and force_early_return capabilities
+vmTestbase/nsk/jdb/pop/pop001/pop001.java                                                         8195635 generic-all
+vmTestbase/nsk/jdb/pop_exception/pop_exception001/pop_exception001.java                           8195635 generic-all
+vmTestbase/nsk/jdb/reenter/reenter001/reenter001.java                                             8195635 generic-all
+vmTestbase/nsk/jdi/BScenarios/hotswap/tc01x002/TestDescription.java                               8195635 generic-all
+vmTestbase/nsk/jdi/BScenarios/hotswap/tc02x001/TestDescription.java                               8195635 generic-all
+vmTestbase/nsk/jdi/BScenarios/hotswap/tc02x002/TestDescription.java                               8195635 generic-all
+vmTestbase/nsk/jdi/BScenarios/hotswap/tc04x001/TestDescription.java                               8195635 generic-all
+vmTestbase/nsk/jdi/BScenarios/hotswap/tc04x002/TestDescription.java                               8195635 generic-all
+vmTestbase/nsk/jdi/BScenarios/hotswap/tc06x001/TestDescription.java                               8195635 generic-all
+vmTestbase/nsk/jdi/BScenarios/hotswap/tc08x001/TestDescription.java                               8195635 generic-all
+vmTestbase/nsk/jdi/BScenarios/hotswap/tc10x002/TestDescription.java                               8195635 generic-all
+vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue003/returnValue003.java                 8195635 generic-all
+vmTestbase/nsk/jdi/Scenarios/invokeMethod/popframes001/TestDescription.jav                        8195635 generic-all
+vmTestbase/nsk/jdi/Scenarios/invokeMethod/popframes001/TestDescription.java                       8195635 generic-all
+vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes001/TestDescription.java                    8195635 generic-all
+vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses002/TestDescription.java         8195635 generic-all
+vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn001/TestDescription.java                         8195635 generic-all
+vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn002/TestDescription.java                         8195635 generic-all
+vmTestbase/nsk/jdi/stress/serial/mixed002/TestDescription.java                                    8195635 generic-all
+vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java 8195635 generic-all
+vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java                    8195635 generic-all
+vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn002/TestDescription.java                    8195635 generic-all
+vmTestbase/nsk/jvmti/PopFrame/popframe001/TestDescription.java                                    8195635 generic-all
+vmTestbase/nsk/jvmti/PopFrame/popframe003/TestDescription.java                                    8195635 generic-all
+vmTestbase/nsk/jvmti/PopFrame/popframe005/TestDescription.java                                    8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t007/TestDescription.java                      8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java                      8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t001/TestDescription.java                       8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t001/TestDescription.java                       8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/TestDescription.java                       8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t002/hs202t002.java                             8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t001/hs203t001.java                             8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t002/hs203t002.java                             8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.java                             8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t004/hs203t004.java                             8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t001/hs204t001.java                             8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t003/hs204t003.java                             8195635 generic-all
+vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t004/hs204t004.java                             8195635 generic-all
+vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretbase/TestDescription.java                      8195635 generic-all
+vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretfp/TestDescription.java                        8195635 generic-all
+vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretint/TestDescription.java                       8195635 generic-all
+vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretlong/TestDescription.java                      8195635 generic-all
+vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretobj/TestDescription.java                       8195635 generic-all
+vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretstr/TestDescription.java                       8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manyDiff_a/TestDescription.java                   8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manySame_a/TestDescription.java                   8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2none_b/TestDescription.java                       8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2same_a/TestDescription.java                       8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2same_b/TestDescription.java                       8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_none2indy_a/TestDescription.java                       8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_none2indy_b/TestDescription.java                       8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/redefineClassInTarget/TestDescription.java                     8195635 generic-all
+vmTestbase/vm/mlvm/indy/func/jvmti/stepBreakPopReturn/INDIFY_Test.java                            8195635 generic-all
+
 compiler/stable/TestStableBoolean.java                           8204347   generic-all
 compiler/stable/TestStableByte.java                              8204347   generic-all
 compiler/stable/TestStableChar.java                              8204347   generic-all
--- a/test/hotspot/jtreg/ProblemList.txt	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/ProblemList.txt	Mon Feb 04 11:01:04 2019 +0530
@@ -57,9 +57,9 @@
 
 compiler/runtime/Test8168712.java 8211769,8211771 generic-ppc64,generic-ppc64le,linux-s390x
 
-applications/ctw/modules/java_desktop.java 8217851 windows-all
-applications/ctw/modules/java_desktop_2.java 8217851 windows-all
-applications/ctw/modules/jdk_jconsole.java 8217851 windows-all
+applications/ctw/modules/java_desktop.java   8189604 windows-all
+applications/ctw/modules/java_desktop_2.java 8189604 windows-all
+applications/ctw/modules/jdk_jconsole.java   8189604 windows-all
 
 #############################################################################
 
@@ -67,12 +67,12 @@
 
 gc/epsilon/TestMemoryMXBeans.java 8206434 generic-all
 gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java 8156755 generic-all
-gc/survivorAlignment/TestPromotionToSurvivor.java 8129886 generic-all
+gc/survivorAlignment/TestPromotionToSurvivor.java 8218049 generic-all
+gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java 8218049 generic-all
 gc/g1/logging/TestG1LoggingFailure.java 8169634 generic-all
 gc/g1/humongousObjects/TestHeapCounters.java 8178918 generic-all
 gc/stress/gclocker/TestGCLockerWithParallel.java 8180622 generic-all
 gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all
-gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java 8177765 generic-all
 gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all
 gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8193639 solaris-all
 
@@ -171,7 +171,7 @@
 vmTestbase/metaspace/gc/firstGC_default/TestDescription.java 8208250 generic-all
 
 vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003/TestDescription.java 6606767 generic-all
-vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted004/TestDescription.java 7013634,6606767 generic-all
+vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted004/TestDescription.java 6606767 generic-all
 vmTestbase/nsk/jvmti/scenarios/extension/EX03/ex03t001/TestDescription.java 8173658 generic-all
 vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 generic-all
 
@@ -181,14 +181,14 @@
 vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java 8208259 generic-all
 
 vmTestbase/vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/TestDescription.java 8013267 generic-all
-vmTestbase/vm/mlvm/meth/func/java/throwException/Test.java 8208255 generic-all
-vmTestbase/vm/mlvm/meth/func/jdi/breakpointOtherStratum/Test.java 8208257,8208255 generic-all
-vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java 8208255 generic-all
-vmTestbase/vm/mlvm/meth/stress/compiler/i2c_c2i/Test.java 8208255 generic-all
-vmTestbase/vm/mlvm/meth/stress/compiler/sequences/Test.java 8208255 generic-all
-vmTestbase/vm/mlvm/meth/stress/gc/callSequencesDuringGC/Test.java 8208255 generic-all
-vmTestbase/vm/mlvm/meth/stress/java/sequences/Test.java 8208255 generic-all
-vmTestbase/vm/mlvm/meth/stress/jdi/breakpointInCompiledCode/Test.java 8208255 generic-all
+vmTestbase/vm/mlvm/meth/func/java/throwException/Test.java 8058176 generic-all
+vmTestbase/vm/mlvm/meth/func/jdi/breakpointOtherStratum/Test.java 8208257,8058176 generic-all
+vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java 8058176 generic-all
+vmTestbase/vm/mlvm/meth/stress/compiler/i2c_c2i/Test.java 8058176 generic-all
+vmTestbase/vm/mlvm/meth/stress/compiler/sequences/Test.java 8058176 generic-all
+vmTestbase/vm/mlvm/meth/stress/gc/callSequencesDuringGC/Test.java 8058176 generic-all
+vmTestbase/vm/mlvm/meth/stress/java/sequences/Test.java 8058176 generic-all
+vmTestbase/vm/mlvm/meth/stress/jdi/breakpointInCompiledCode/Test.java 8058176 generic-all
 vmTestbase/vm/mlvm/mixed/stress/java/findDeadlock/TestDescription.java 8208278 generic-all
 vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2none_a/TestDescription.java 8013267 generic-all
 vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manyDiff_b/TestDescription.java 8013267 generic-all
--- a/test/hotspot/jtreg/TEST.ROOT	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/TEST.ROOT	Mon Feb 04 11:01:04 2019 +0530
@@ -66,7 +66,8 @@
     vm.graal.enabled \
     vm.compiler1.enabled \
     vm.compiler2.enabled \
-    docker.support
+    docker.support \
+    test.vm.gc.nvdimm
 
 # Minimum jtreg version
 requiredVersion=4.2 b13
--- a/test/hotspot/jtreg/TEST.groups	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/TEST.groups	Mon Feb 04 11:01:04 2019 +0530
@@ -59,7 +59,8 @@
  -:hotspot_compiler \
  -:hotspot_gc \
  -:hotspot_runtime \
- -:hotspot_serviceability
+ -:hotspot_serviceability \
+ -gc/nvdimm
 
 hotspot_native_sanity = \
   native_sanity
@@ -197,7 +198,7 @@
 gc_epsilon = \
   gc/epsilon/ \
   gc/CriticalNativeArgs.java \
-  gc/stress/CriticalNativeStress.java 
+  gc/stress/CriticalNativeStress.java
 
 tier1_gc_gcold = \
   gc/stress/gcold/TestGCOldWithG1.java \
@@ -210,7 +211,7 @@
   gc/stress/gcbasher/TestGCBasherWithCMS.java \
   gc/stress/gcbasher/TestGCBasherWithSerial.java \
   gc/stress/gcbasher/TestGCBasherWithParallel.java
-  
+
 tier1_gc_shenandoah = \
   gc/shenandoah/options/ \
   gc/shenandoah/compiler/ \
--- a/test/hotspot/jtreg/compiler/aot/AotCompiler.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/compiler/aot/AotCompiler.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -117,6 +117,8 @@
         // Execute with asserts
         args.add("-J-ea");
         args.add("-J-esa");
+        // we don't want to run jaotc w/ Xcomp even if it's in extraopts
+        args.add("-J-Xmixed");
         return launchJaotc(args, extraopts);
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/cha/StrengthReduceInterfaceCall.java	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,970 @@
+/*
+ * 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
+ * @requires !vm.graal.enabled
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.misc
+ *          java.base/jdk.internal.vm.annotation
+ * @library /test/lib /
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+PrintCompilation -XX:+PrintInlining -XX:+TraceDependencies -verbose:class -XX:CompileCommand=quiet
+ *                   -XX:CompileCommand=compileonly,*::test -XX:CompileCommand=compileonly,*::m -XX:CompileCommand=dontinline,*::test
+ *                   -Xbatch -XX:+WhiteBoxAPI -Xmixed
+ *                   -XX:-TieredCompilation
+ *                      compiler.cha.StrengthReduceInterfaceCall
+ *
+ * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+PrintCompilation -XX:+PrintInlining -XX:+TraceDependencies -verbose:class -XX:CompileCommand=quiet
+ *                   -XX:CompileCommand=compileonly,*::test -XX:CompileCommand=compileonly,*::m -XX:CompileCommand=dontinline,*::test
+ *                   -Xbatch -XX:+WhiteBoxAPI -Xmixed
+ *                   -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ *                      compiler.cha.StrengthReduceInterfaceCall
+ */
+package compiler.cha;
+
+import jdk.internal.misc.Unsafe;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.vm.annotation.DontInline;
+import sun.hotspot.WhiteBox;
+
+import java.io.IOException;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.concurrent.Callable;
+
+import static jdk.test.lib.Asserts.*;
+import static jdk.internal.org.objectweb.asm.ClassWriter.*;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+
+public class StrengthReduceInterfaceCall {
+    public static void main(String[] args) {
+        run(ObjectToString.class);
+        run(ObjectHashCode.class);
+        run(TwoLevelHierarchyLinear.class);
+        run(ThreeLevelHierarchyLinear.class);
+        run(ThreeLevelHierarchyAbstractVsDefault.class);
+        run(ThreeLevelDefaultHierarchy.class);
+        run(ThreeLevelDefaultHierarchy1.class);
+    }
+
+    public static class ObjectToString extends ATest<ObjectToString.I> {
+        public ObjectToString() { super(I.class, C.class); }
+
+        interface J           { String toString(); }
+        interface I extends J {}
+
+        static class C implements I {}
+
+        interface K1 extends I {}
+        interface K2 extends I { String toString(); } // K2.tS() ABSTRACT
+        // interface K3 extends I { default String toString() { return "K3"; } // K2.tS() DEFAULT
+
+        static class D implements I { public String toString() { return "D"; }}
+
+        static class DJ1 implements J {}
+        static class DJ2 implements J { public String toString() { return "DJ2"; }}
+
+        @Override
+        public Object test(I i) { return ObjectToStringHelper.test(i); /* invokeinterface I.toString() */ }
+
+        @TestCase
+        public void testMono() {
+            // 0. Trigger compilation of a monomorphic call site
+            compile(monomophic()); // C1 <: C <: intf I <: intf J <: Object.toString()
+            assertCompiled();
+
+            // Dependency: none
+
+            call(new C() { public String toString() { return "Cn"; }}); // Cn.tS <: C.tS <: intf I
+            assertCompiled();
+        }
+
+        @TestCase
+        public void testBi() {
+            // 0. Trigger compilation of a bimorphic call site
+            compile(bimorphic()); // C1 <: C <: intf I <: intf J <: Object.toString()
+            assertCompiled();
+
+            // Dependency: none
+
+            call(new C() { public String toString() { return "Cn"; }}); // Cn.tS <: C.tS <: intf I
+            assertCompiled();
+        }
+
+        @TestCase
+        public void testMega() {
+            // 0. Trigger compilation of a megamorphic call site
+            compile(megamorphic()); // C1,C2,C3 <: C <: intf I <: intf J <: Object.toString()
+            assertCompiled();
+
+            // Dependency: none
+            // compiler.cha.StrengthReduceInterfaceCall$ObjectToString::test (5 bytes)
+            //     @ 1   compiler.cha.StrengthReduceInterfaceCall$ObjectToStringHelper::test (7 bytes)   inline (hot)
+            //       @ 1   java.lang.Object::toString (36 bytes)   virtual call
+
+            // No dependency - no invalidation
+            repeat(100, () -> call(new C(){})); // Cn <: C <: intf I
+            assertCompiled();
+
+            initialize(K1.class,   // intf  K1             <: intf I <: intf J
+                       K2.class,   // intf  K2.tS ABSTRACT <: intf I <: intf J
+                       DJ1.class,  //      DJ1                       <: intf J
+                       DJ2.class); //      DJ2.tS                    <: intf J
+            assertCompiled();
+
+            initialize(D.class); // D.tS <: intf I <: intf J
+            assertCompiled();
+
+            call(new C() { public String toString() { return "Cn"; }}); // Cn.tS <: C.tS <: intf I
+            assertCompiled();
+        }
+
+        @Override
+        public void checkInvalidReceiver() {
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I o = (I) unsafeCastMH(I.class).invokeExact(new Object()); // unrelated
+                test(o);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J() {}); // super interface
+                test(j);
+            });
+            assertCompiled();
+        }
+    }
+
+    public static class ObjectHashCode extends ATest<ObjectHashCode.I> {
+        public ObjectHashCode() { super(I.class, C.class); }
+
+        interface J {}
+        interface I extends J {}
+
+        static class C implements I {}
+
+        interface K1 extends I {}
+        interface K2 extends I { int hashCode(); } // K2.hC() ABSTRACT
+        // interface K3 extends I { default int hashCode() { return CORRECT; } // K2.hC() DEFAULT
+
+        static class D implements I { public int hashCode() { return super.hashCode(); }}
+
+        static class DJ1 implements J {}
+        static class DJ2 implements J { public int hashCode() { return super.hashCode(); }}
+
+        @Override
+        public Object test(I i) {
+            return ObjectHashCodeHelper.test(i); /* invokeinterface I.hashCode() */
+        }
+
+        @TestCase
+        public void testMono() {
+            // 0. Trigger compilation of a monomorphic call site
+            compile(monomophic()); // C1 <: C <: intf I <: intf J <: Object.hashCode()
+            assertCompiled();
+
+            // Dependency: none
+
+            call(new C() { public int hashCode() { return super.hashCode(); }}); // Cn.hC <: C.hC <: intf I
+            assertCompiled();
+        }
+
+        @TestCase
+        public void testBi() {
+            // 0. Trigger compilation of a bimorphic call site
+            compile(bimorphic()); // C1 <: C <: intf I <: intf J <: Object.toString()
+            assertCompiled();
+
+            // Dependency: none
+
+            call(new C() { public int hashCode() { return super.hashCode(); }}); // Cn.hC <: C.hC <: intf I
+            assertCompiled();
+        }
+
+        @TestCase
+        public void testMega() {
+            // 0. Trigger compilation of a megamorphic call site
+            compile(megamorphic()); // C1,C2,C3 <: C <: intf I <: intf J <: Object.hashCode()
+            assertCompiled();
+
+            // Dependency: none
+
+            // No dependency - no invalidation
+            repeat(100, () -> call(new C(){})); // Cn <: C <: intf I
+            assertCompiled();
+
+            initialize(K1.class,   // intf  K1             <: intf I <: intf J
+                       K2.class,   // intf  K2.hC ABSTRACT <: intf I <: intf J
+                       DJ1.class,  //      DJ1                       <: intf J
+                       DJ2.class); //      DJ2.hC                    <: intf J
+            assertCompiled();
+
+            initialize(D.class); // D.hC <: intf I <: intf J
+            assertCompiled();
+
+            call(new C() { public int hashCode() { return super.hashCode(); }}); // Cn.hC <: C.hC <: intf I
+            assertCompiled();
+        }
+
+        @Override
+        public void checkInvalidReceiver() {
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I o = (I) unsafeCastMH(I.class).invokeExact(new Object()); // unrelated
+                test(o);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J() {}); // super interface
+                test(j);
+            });
+            assertCompiled();
+        }
+    }
+
+    public static class TwoLevelHierarchyLinear extends ATest<TwoLevelHierarchyLinear.I> {
+        public TwoLevelHierarchyLinear() { super(I.class, C.class); }
+
+        interface J { default Object m() { return WRONG; } }
+
+        interface I extends J { Object m(); }
+        static class C implements I { public Object m() { return CORRECT; }}
+
+        interface K1 extends I {}
+        interface K2 extends I { Object m(); }
+        interface K3 extends I { default Object m() { return WRONG; }}
+
+        static class D implements I { public Object m() { return WRONG;   }}
+
+        static class DJ1 implements J {}
+        static class DJ2 implements J { public Object m() { return WRONG; }}
+
+        @DontInline
+        public Object test(I i) {
+            return i.m();
+        }
+
+        @TestCase
+        public void testMega1() {
+            // 0. Trigger compilation of a megamorphic call site
+            compile(megamorphic()); // C1,C2,C3 <: C.m <: intf I.m ABSTRACT <: intf J.m ABSTRACT
+            assertCompiled();
+
+            // Dependency: type = unique_concrete_method, context = I, method = C.m
+
+            checkInvalidReceiver(); // ensure proper type check is preserved
+
+            // 1. No deoptimization/invalidation on not-yet-seen receiver
+            repeat(100, () -> call(new C(){})); // Cn <: C.m <: intf I.m ABSTRACT <: intf J.m DEFAULT
+            assertCompiled();
+
+            // 2. No dependency invalidation on class loading of unrelated classes: different context
+            initialize(K1.class,   // intf  K1            <: intf I.m ABSTRACT <: intf J.m DEFAULT
+                       K2.class,   // intf  K2.m ABSTRACT <: intf I.m ABSTRACT <: intf J.m DEFAULT
+                       DJ1.class,  //      DJ1                                 <: intf J.m DEFAULT
+                       DJ2.class); //      DJ2.m                               <: intf J.m DEFAULT
+            assertCompiled();
+
+            // 3. Dependency invalidation on D <: I
+            initialize(D.class); // D.m <: intf I.m ABSTRACT <: intf J.m DEFAULT
+            assertNotCompiled();
+
+            // 4. Recompilation: no inlining, no dependencies
+            compile(megamorphic());
+            call(new C() { public Object m() { return CORRECT; }}); // Cn.m <: C.m <: intf I.m ABSTRACT <: intf J.m DEFAULT
+            assertCompiled();
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+        }
+
+        @TestCase
+        public void testMega2() {
+            // 0. Trigger compilation of a megamorphic call site
+            compile(megamorphic()); // C1,C2,C3 <: C.m <: intf I.m ABSTRACT <: intf J.m DEFAULT
+            assertCompiled();
+
+            // Dependency: type = unique_concrete_method, context = I, method = C.m
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+
+            // 1. Dependency invalidation
+            initialize(K3.class); // intf K3.m DEFAULT <: intf I.m ABSTRACT <: intf J.m DEFAULT
+            assertNotCompiled();
+
+            // 2. Recompilation: still inlines
+            // FIXME: no default method support in CHA yet
+            compile(megamorphic());
+            call(new K3() { public Object m() { return CORRECT; }}); // K3n.m <: intf K3.m DEFAULT <: intf I.m ABSTRACT <: intf J.m ABSTRACT
+            assertNotCompiled();
+
+            // 3. Recompilation: no inlining, no dependencies
+            compile(megamorphic());
+            call(new K3() { public Object m() { return CORRECT; }}); // Kn.m <: intf K3.m DEFAULT  <: intf I.m ABSTRACT <: intf J.m DEFAULT
+            assertCompiled();
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+        }
+
+        @Override
+        public void checkInvalidReceiver() {
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I o = (I) unsafeCastMH(I.class).invokeExact(new Object()); // unrelated
+                test(o);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J() {}); // super interface
+                test(j);
+            });
+            assertCompiled();
+        }
+    }
+
+    public static class ThreeLevelHierarchyLinear extends ATest<ThreeLevelHierarchyLinear.I> {
+        public ThreeLevelHierarchyLinear() { super(I.class, C.class); }
+
+        interface J           { Object m(); }
+        interface I extends J {}
+
+        interface K1 extends I {}
+        interface K2 extends I { Object m(); }
+        interface K3 extends I { default Object m() { return WRONG; }}
+
+        static class C  implements I { public Object m() { return CORRECT; }}
+
+        static class DI implements I { public Object m() { return WRONG;   }}
+        static class DJ implements J { public Object m() { return WRONG;   }}
+
+        @DontInline
+        public Object test(I i) {
+            return i.m(); // I <: J.m ABSTRACT
+        }
+
+        @TestCase
+        public void testMega1() {
+            // 0. Trigger compilation of a megamorphic call site
+            compile(megamorphic()); // C1,C2,C3 <: C.m <: intf I <: intf J.m ABSTRACT
+            assertCompiled();
+
+            // Dependency: type = unique_concrete_method, context = I, method = C.m
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+
+            // 1. No deoptimization/invalidation on not-yet-seen receiver
+            repeat(100, () -> call(new C(){})); // Cn <: C.m <: intf I
+            assertCompiled(); // No deopt on not-yet-seen receiver
+
+            // 2. No dependency invalidation: different context
+            initialize(DJ.class,  //      DJ.m                    <: intf J.m ABSTRACT
+                       K1.class,  // intf K1            <: intf I <: intf J.m ABSTRACT
+                       K2.class); // intf K2.m ABSTRACT <: intf I <: intf J.m ABSTRACT
+            assertCompiled();
+
+            // 3. Dependency invalidation: DI.m <: I
+            initialize(DI.class); //      DI.m          <: intf I <: intf J.m ABSTRACT
+            assertNotCompiled();
+
+            // 4. Recompilation w/o a dependency
+            compile(megamorphic());
+            call(new C() { public Object m() { return CORRECT; }}); // Cn.m <: C.m <: intf I <: intf J.m ABSTRACT
+            assertCompiled(); // no dependency
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+        }
+
+        @TestCase
+        public void testMega2() {
+            compile(megamorphic()); // C1,C2,C3 <: C.m <: intf I <: intf J.m ABSTRACT
+            assertCompiled();
+
+            // Dependency: type = unique_concrete_method, context = I, method = C.m
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+
+            // Dependency invalidation
+            initialize(K3.class); // intf K3.m DEFAULT <: intf I;
+            assertNotCompiled(); // FIXME: default methods in sub-interfaces shouldn't be taken into account by CHA
+
+            // Recompilation with a dependency
+            compile(megamorphic());
+            assertCompiled();
+
+            // Dependency: type = unique_concrete_method, context = I, method = C.m
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+
+            call(new K3() { public Object m() { return CORRECT; }}); // Kn.m <: K3.m DEFAULT <: intf I <: intf J.m ABSTRACT
+            assertNotCompiled();
+
+            // Recompilation w/o a dependency
+            compile(megamorphic());
+            // Dependency: none
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+            call(new C() { public Object m() { return CORRECT; }}); // Cn.m <: C.m <: intf I <: intf J.m ABSTRACT
+            assertCompiled();
+        }
+
+        @Override
+        public void checkInvalidReceiver() {
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I o = (I) unsafeCastMH(I.class).invokeExact(new Object()); // unrelated
+                test(o);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J() { public Object m() { return WRONG; }}); // super interface
+                test(j);
+            });
+            assertCompiled();
+        }
+    }
+
+    public static class ThreeLevelHierarchyAbstractVsDefault extends ATest<ThreeLevelHierarchyAbstractVsDefault.I> {
+        public ThreeLevelHierarchyAbstractVsDefault() { super(I.class, C.class); }
+
+        interface J1                { default Object m() { return WRONG; } } // intf J1.m DEFAULT
+        interface J2 extends J1     { Object m(); }                          // intf J2.m ABSTRACT <: intf J1
+        interface I  extends J1, J2 {}                                       // intf  I.m OVERPASS <: intf J1,J2
+
+        static class C  implements I { public Object m() { return CORRECT; }}
+
+        @DontInline
+        public Object test(I i) {
+            return i.m(); // intf I.m OVERPASS
+        }
+
+        static class DI implements I { public Object m() { return WRONG;   }}
+
+        static class DJ11 implements J1 {}
+        static class DJ12 implements J1 { public Object m() { return WRONG; }}
+
+        static class DJ2 implements J2 { public Object m() { return WRONG;   }}
+
+        interface K11 extends J1 {}
+        interface K12 extends J1 { Object m(); }
+        interface K13 extends J1 { default Object m() { return WRONG; }}
+        interface K21 extends J2 {}
+        interface K22 extends J2 { Object m(); }
+        interface K23 extends J2 { default Object m() { return WRONG; }}
+
+
+        public void testMega1() {
+            // 0. Trigger compilation of megamorphic call site
+            compile(megamorphic()); // C1,C2,C3 <: C.m <: intf I.m OVERPASS <: intf J2.m ABSTRACT <: intf J1.m DEFAULT
+            assertCompiled();
+
+            // Dependency: type = unique_concrete_method, context = I, method = C.m
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+
+            // 1. No deopt/invalidation on not-yet-seen receiver
+            repeat(100, () -> call(new C(){})); // Cn <: C.m <: intf I.m OVERPASS <: intf J2.m ABSTRACT <: intf J1.m DEFAULT
+            assertCompiled();
+
+            // 2. No dependency invalidation: different context
+            initialize(K11.class, K12.class, K13.class,
+                       K21.class, K22.class, K23.class);
+
+            // 3. Dependency invalidation: Cn.m <: C <: I
+            call(new C() { public Object m() { return CORRECT; }}); // Cn.m <: C.m <: intf I.m OVERPASS <: intf J2.m ABSTRACT <: intf J1.m DEFAULT
+            assertNotCompiled();
+
+            // 4. Recompilation w/o a dependency
+            compile(megamorphic());
+            call(new C() { public Object m() { return CORRECT; }});
+            assertCompiled(); // no inlining
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+        }
+
+        public void testMega2() {
+            // 0. Trigger compilation of a megamorphic call site
+            compile(megamorphic());
+            assertCompiled();
+
+            // Dependency: type = unique_concrete_method, context = I, method = C.m
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+
+            // 1. No dependency invalidation: different context
+            initialize(DJ11.class,
+                       DJ12.class,
+                       DJ2.class);
+            assertCompiled();
+
+            // 2. Dependency invalidation: DI.m <: I
+            initialize(DI.class);
+            assertNotCompiled();
+
+            // 3. Recompilation w/o a dependency
+            compile(megamorphic());
+            call(new C() { public Object m() { return CORRECT; }});
+            assertCompiled(); // no inlining
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+        }
+
+        @Override
+        public void checkInvalidReceiver() {
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I o = (I) unsafeCastMH(I.class).invokeExact(new Object()); // unrelated
+                test(o);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J1() {}); // super interface
+                test(j);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J2() { public Object m() { return WRONG; }}); // super interface
+                test(j);
+            });
+            assertCompiled();
+        }
+    }
+
+    public static class ThreeLevelDefaultHierarchy extends ATest<ThreeLevelDefaultHierarchy.I> {
+        public ThreeLevelDefaultHierarchy() { super(I.class, C.class); }
+
+        interface J           { default Object m() { return WRONG; }}
+        interface I extends J {}
+
+        static class C  implements I { public Object m() { return CORRECT; }}
+
+        interface K1 extends I {}
+        interface K2 extends I { Object m(); }
+        interface K3 extends I { default Object m() { return WRONG; }}
+
+        static class DI implements I { public Object m() { return WRONG; }}
+        static class DJ implements J { public Object m() { return WRONG; }}
+
+        @DontInline
+        public Object test(I i) {
+            return i.m(); // no inlining since J.m is a default method
+        }
+
+        @TestCase
+        public void testMega() {
+            // 0. Trigger compilation of a megamorphic call site
+            compile(megamorphic()); // C1,C2,C3 <: C.m <: intf I <: intf J.m ABSTRACT
+            assertCompiled();
+
+            // Dependency: none
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+
+            // 1. No deoptimization/invalidation on not-yet-seen receiver
+            repeat(100, () -> call(new C() {}));
+            assertCompiled();
+
+            // 2. No dependency and no inlining
+            initialize(DJ.class,  //      DJ.m                    <: intf J.m ABSTRACT
+                       DI.class,  //      DI.m          <: intf I <: intf J.m ABSTRACT
+                       K1.class,  // intf K1            <: intf I <: intf J.m ABSTRACT
+                       K2.class); // intf K2.m ABSTRACT <: intf I <: intf J.m ABSTRACT
+            assertCompiled();
+        }
+
+        @Override
+        public void checkInvalidReceiver() {
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I o = (I) unsafeCastMH(I.class).invokeExact(new Object()); // unrelated
+                test(o);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J() {}); // super interface
+                test(j);
+            });
+            assertCompiled();
+        }
+    }
+
+    public static class ThreeLevelDefaultHierarchy1 extends ATest<ThreeLevelDefaultHierarchy1.I> {
+        public ThreeLevelDefaultHierarchy1() { super(I.class, C.class); }
+
+        interface J1                { Object m();}
+        interface J2 extends J1     { default Object m() { return WRONG; }  }
+        interface I  extends J1, J2 {}
+
+        static class C  implements I { public Object m() { return CORRECT; }}
+
+        interface K1 extends I {}
+        interface K2 extends I { Object m(); }
+        interface K3 extends I { default Object m() { return WRONG; }}
+
+        static class DI implements I { public Object m() { return WRONG; }}
+        static class DJ1 implements J1 { public Object m() { return WRONG; }}
+        static class DJ2 implements J2 { public Object m() { return WRONG; }}
+
+        @DontInline
+        public Object test(I i) {
+            return i.m(); // no inlining since J.m is a default method
+        }
+
+        @TestCase
+        public void testMega() {
+            // 0. Trigger compilation of a megamorphic call site
+            compile(megamorphic());
+            assertCompiled();
+
+            // Dependency: none
+
+            checkInvalidReceiver(); // ensure proper type check on receiver is preserved
+
+            // 1. No deoptimization/invalidation on not-yet-seen receiver
+            repeat(100, () -> call(new C() {}));
+            assertCompiled();
+
+            // 2. No dependency, no inlining
+            // CHA doesn't support default methods yet.
+            initialize(DJ1.class,
+                       DJ2.class,
+                       DI.class,
+                       K1.class,
+                       K2.class,
+                       K3.class);
+            assertCompiled();
+        }
+
+        @Override
+        public void checkInvalidReceiver() {
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I o = (I) unsafeCastMH(I.class).invokeExact(new Object()); // unrelated
+                test(o);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J1() { public Object m() { return WRONG; } }); // super interface
+                test(j);
+            });
+            assertCompiled();
+
+            shouldThrow(IncompatibleClassChangeError.class, () -> {
+                I j = (I) unsafeCastMH(I.class).invokeExact((Object)new J2() {}); // super interface
+                test(j);
+            });
+            assertCompiled();
+        }
+    }
+
+    /* =========================================================== */
+
+    interface Action {
+        int run();
+    }
+
+    public static final Unsafe U = Unsafe.getUnsafe();
+
+    interface Test<T> {
+        boolean isCompiled();
+        void assertNotCompiled();
+        void assertCompiled();
+
+        void call(T o);
+        T receiver(int id);
+
+        default Runnable monomophic() {
+            return () -> {
+                call(receiver(0)); // 100%
+            };
+        }
+
+        default Runnable bimorphic() {
+            return () -> {
+                call(receiver(0)); // 50%
+                call(receiver(1)); // 50%
+            };
+        }
+
+        default Runnable polymorphic() {
+            return () -> {
+                for (int i = 0; i < 23; i++) {
+                    call(receiver(0)); // 92%
+                }
+                call(receiver(1)); // 4%
+                call(receiver(2)); // 4%
+            };
+        }
+
+        default Runnable megamorphic() {
+            return () -> {
+                call(receiver(0)); // 33%
+                call(receiver(1)); // 33%
+                call(receiver(2)); // 33%
+            };
+        }
+
+        default void compile(Runnable r) {
+            assertNotCompiled();
+            while(!isCompiled()) {
+                r.run();
+            }
+            assertCompiled();
+        }
+
+        default void initialize(Class<?>... cs) {
+            for (Class<?> c : cs) {
+                U.ensureClassInitialized(c);
+            }
+        }
+
+        default void repeat(int cnt, Runnable r) {
+            for (int i = 0; i < cnt; i++) {
+                r.run();
+            }
+        }
+    }
+
+    public static abstract class ATest<T> implements Test<T> {
+        public static final WhiteBox WB = WhiteBox.getWhiteBox();
+
+        public static final Object CORRECT = new Object();
+        public static final Object WRONG   = new Object();
+
+        final Method TEST;
+        private final Class<T> declared;
+        private final Class<?> receiver;
+
+        private final HashMap<Integer, T> receivers = new HashMap<>();
+
+        public ATest(Class<T> declared, Class<?> receiver) {
+            this.declared = declared;
+            this.receiver = receiver;
+            TEST = compute(() -> this.getClass().getDeclaredMethod("test", declared));
+        }
+
+        @DontInline
+        public abstract Object test(T i);
+
+        public abstract void checkInvalidReceiver();
+
+        public T receiver(int id) {
+            return receivers.computeIfAbsent(id, (i -> {
+                try {
+                    MyClassLoader cl = (MyClassLoader) receiver.getClassLoader();
+                    Class<?> sub = cl.subclass(receiver, i);
+                    return (T)sub.getDeclaredConstructor().newInstance();
+                } catch (Exception e) {
+                    throw new Error(e);
+                }
+            }));
+        }
+
+        @Override
+        public boolean isCompiled()     { return WB.isMethodCompiled(TEST); }
+
+        @Override
+        public void assertNotCompiled() { assertFalse(isCompiled()); }
+
+        @Override
+        public void assertCompiled()    { assertTrue(isCompiled()); }
+
+        @Override
+        public void call(T i) {
+            assertTrue(test(i) != WRONG);
+        }
+    }
+
+    @Retention(value = RetentionPolicy.RUNTIME)
+    public @interface TestCase {}
+
+    static void run(Class<?> test) {
+        try {
+            for (Method m : test.getDeclaredMethods()) {
+                if (m.isAnnotationPresent(TestCase.class)) {
+                    System.out.println(m.toString());
+                    ClassLoader cl = new MyClassLoader(test);
+                    Class<?> c = cl.loadClass(test.getName());
+                    c.getMethod(m.getName()).invoke(c.getDeclaredConstructor().newInstance());
+                }
+            }
+        } catch (Exception e) {
+            throw new Error(e);
+        }
+    }
+
+    static class ObjectToStringHelper {
+        static Object test(Object o) {
+            throw new Error("not used");
+        }
+    }
+    static class ObjectHashCodeHelper {
+        static int test(Object o) {
+        throw new Error("not used");
+    }
+    }
+
+    static final class MyClassLoader extends ClassLoader {
+        private final Class<?> test;
+
+        MyClassLoader(Class<?> test) {
+            this.test = test;
+        }
+
+        static String intl(String s) {
+            return s.replace('.', '/');
+        }
+
+        Class<?> subclass(Class<?> c, int id) {
+            String name = c.getName() + id;
+            Class<?> sub = findLoadedClass(name);
+            if (sub == null) {
+                ClassWriter cw = new ClassWriter(COMPUTE_MAXS | COMPUTE_FRAMES);
+                cw.visit(52, ACC_PUBLIC | ACC_SUPER, intl(name), null, intl(c.getName()), null);
+
+                { // Default constructor: <init>()V
+                    MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+                    mv.visitCode();
+                    mv.visitVarInsn(ALOAD, 0);
+                    mv.visitMethodInsn(INVOKESPECIAL, intl(c.getName()), "<init>", "()V", false);
+                    mv.visitInsn(RETURN);
+                    mv.visitMaxs(0, 0);
+                    mv.visitEnd();
+                }
+
+                byte[] classFile = cw.toByteArray();
+                return defineClass(name, classFile, 0, classFile.length);
+            }
+            return sub;
+        }
+
+        protected Class<?> loadClass(String name, boolean resolve)
+                throws ClassNotFoundException
+        {
+            // First, check if the class has already been loaded
+            Class<?> c = findLoadedClass(name);
+            if (c == null) {
+                try {
+                    c = getParent().loadClass(name);
+                    if (name.endsWith("ObjectToStringHelper")) {
+                        ClassWriter cw = new ClassWriter(COMPUTE_MAXS | COMPUTE_FRAMES);
+                        cw.visit(52, ACC_PUBLIC | ACC_SUPER, intl(name), null, "java/lang/Object", null);
+
+                        {
+                            MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "test", "(Ljava/lang/Object;)Ljava/lang/Object;", null, null);
+                            mv.visitCode();
+                            mv.visitVarInsn(ALOAD, 0);
+                            mv.visitMethodInsn(INVOKEINTERFACE, intl(test.getName()) + "$I", "toString", "()Ljava/lang/String;", true);
+                            mv.visitInsn(ARETURN);
+                            mv.visitMaxs(0, 0);
+                            mv.visitEnd();
+                        }
+
+                        byte[] classFile = cw.toByteArray();
+                        return defineClass(name, classFile, 0, classFile.length);
+                    } else if (name.endsWith("ObjectHashCodeHelper")) {
+                        ClassWriter cw = new ClassWriter(COMPUTE_MAXS | COMPUTE_FRAMES);
+                        cw.visit(52, ACC_PUBLIC | ACC_SUPER, intl(name), null, "java/lang/Object", null);
+
+                        {
+                            MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "test", "(Ljava/lang/Object;)I", null, null);
+                            mv.visitCode();
+                            mv.visitVarInsn(ALOAD, 0);
+                            mv.visitMethodInsn(INVOKEINTERFACE, intl(test.getName()) + "$I", "hashCode", "()I", true);
+                            mv.visitInsn(IRETURN);
+                            mv.visitMaxs(0, 0);
+                            mv.visitEnd();
+                        }
+
+                        byte[] classFile = cw.toByteArray();
+                        return defineClass(name, classFile, 0, classFile.length);
+                    } else if (c == test || name.startsWith(test.getName())) {
+                        try {
+                            String path = name.replace('.', '/') + ".class";
+                            byte[] classFile = getParent().getResourceAsStream(path).readAllBytes();
+                            return defineClass(name, classFile, 0, classFile.length);
+                        } catch (IOException e) {
+                            throw new Error(e);
+                        }
+                    }
+                } catch (ClassNotFoundException e) {
+                    // ClassNotFoundException thrown if class not found
+                    // from the non-null parent class loader
+                }
+
+                if (c == null) {
+                    // If still not found, then invoke findClass in order
+                    // to find the class.
+                    c = findClass(name);
+                }
+            }
+            if (resolve) {
+                resolveClass(c);
+            }
+            return c;
+        }
+    }
+
+    public interface RunnableWithException {
+        void run() throws Throwable;
+    }
+
+    public static void shouldThrow(Class<? extends Throwable> expectedException, RunnableWithException r) {
+        try {
+            r.run();
+            throw new AssertionError("Exception not thrown: " + expectedException.getName());
+        } catch(Throwable e) {
+            if (expectedException == e.getClass()) {
+                // success: proper exception is thrown
+            } else {
+                throw new Error(expectedException.getName() + " is expected", e);
+            }
+        }
+    }
+
+    public static MethodHandle unsafeCastMH(Class<?> cls) {
+        try {
+            MethodHandle mh = MethodHandles.identity(Object.class);
+            return MethodHandles.explicitCastArguments(mh, mh.type().changeReturnType(cls));
+        } catch (Throwable e) {
+            throw new Error(e);
+        }
+    }
+
+    static <T> T compute(Callable<T> c) {
+        try {
+            return c.call();
+        } catch (Exception e) {
+            throw new Error(e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,136 @@
+/*
+ * 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 8209951
+ * @summary SIGBUS in com.sun.crypto.provider.CipherBlockChaining
+ * @run main/othervm/timeout=300 -Xbatch
+ *      compiler.codegen.aes.TestCipherBlockChainingEncrypt
+ */
+
+package compiler.codegen.aes;
+
+import java.io.PrintStream;
+import java.security.*;
+import java.util.Random;
+import java.lang.reflect.Method;
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.PBEKeySpec;
+
+public class TestCipherBlockChainingEncrypt {
+    private static String algorithm = "PBEWithHmacSHA1AndAES_256";
+    private static final String PBEPASS = "Hush, it's supposed to be a secret!";
+
+    private static final int INPUT_LENGTH = 800;
+    private static final int[] OFFSETS = {0};
+    private static final int NUM_PAD_BYTES = 8;
+    private static final int PBKDF2_ADD_PAD_BYTES = 8;
+
+    private static SecretKey key;
+    private static Cipher ci;
+
+    public static void main(String[] args) throws Exception {
+     for(int i=0; i<5_000; i++) {
+        if (!(new TestCipherBlockChainingEncrypt().test(args))) {
+            throw new RuntimeException("TestCipherBlockChainingEncrypt test failed");
+       }
+     }
+   }
+
+    public boolean test(String[] args) throws Exception {
+        boolean result = true;
+
+        Provider p = Security.getProvider("SunJCE");
+        ci = Cipher.getInstance(algorithm, p);
+        key = SecretKeyFactory.getInstance(algorithm, p).generateSecret(
+                        new PBEKeySpec(PBEPASS.toCharArray()));
+
+        // generate input data
+        byte[] inputText = new byte[INPUT_LENGTH + NUM_PAD_BYTES
+                + PBKDF2_ADD_PAD_BYTES];
+        new Random().nextBytes(inputText);
+
+        try {
+            // Encrypt
+            execute(Cipher.ENCRYPT_MODE,
+                    inputText,
+                    0,
+                    INPUT_LENGTH);
+
+            // PBKDF2 required 16 byte padding
+            int padLength = NUM_PAD_BYTES + PBKDF2_ADD_PAD_BYTES;
+
+            // Decrypt
+            // Note: inputText is implicitly padded by the above encrypt
+            // operation so decrypt operation can safely proceed
+            execute(Cipher.DECRYPT_MODE,
+                    inputText,
+                    0,
+                    INPUT_LENGTH + padLength);
+
+        } catch (Exception ex) {
+            ex.printStackTrace(System.out);
+            result = false;
+        }
+        return result;
+    }
+
+    private void execute(int edMode, byte[] inputText, int offset, int len) {
+        try {
+            // init Cipher
+            if (Cipher.ENCRYPT_MODE == edMode) {
+                ci.init(Cipher.ENCRYPT_MODE, this.key);
+            } else {
+                ci.init(Cipher.DECRYPT_MODE, this.key, ci.getParameters());
+            }
+
+            // First, generate the cipherText at an allocated buffer
+            byte[] outputText = ci.doFinal(inputText, offset, len);
+
+            // Second, generate cipherText again at the same buffer of plainText
+            int myoff = offset / 2;
+            int off = ci.update(inputText, offset, len, inputText, myoff);
+            ci.doFinal(inputText, myoff + off);
+
+            // Compare to see whether the two results are the same or not
+            boolean e = equalsBlock(inputText, myoff, outputText, 0,
+                    outputText.length);
+        } catch (Exception ex) {
+                System.out.println("Got unexpected exception for " + algorithm);
+                ex.printStackTrace(System.out);
+        }
+    }
+
+    private boolean equalsBlock(byte[] b1, int off1,
+            byte[] b2, int off2, int len) {
+        for (int i = off1, j = off2, k = 0; k < len; i++, j++, k++) {
+            if (b1[i] != b2[j]) {
+                return false;
+            }
+        }
+        return true;
+    }
+}
--- a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java	Mon Feb 04 11:01:04 2019 +0530
@@ -108,7 +108,6 @@
         new LogMessageWithLevel("Skipped Cards", Level.DEBUG),
         // Ext Root Scan
         new LogMessageWithLevel("Thread Roots", Level.TRACE),
-        new LogMessageWithLevel("StringTable Roots", Level.TRACE),
         new LogMessageWithLevel("Universe Roots", Level.TRACE),
         new LogMessageWithLevel("JNI Handles Roots", Level.TRACE),
         new LogMessageWithLevel("ObjectSynchronizer Roots", Level.TRACE),
@@ -126,7 +125,9 @@
         new LogMessageWithLevel("Redirtied Cards", Level.TRACE),
         // Misc Top-level
         new LogMessageWithLevel("Code Roots Purge", Level.DEBUG),
-        new LogMessageWithLevel("String Dedup Fixup", Level.DEBUG),
+        new LogMessageWithLevel("String Deduplication", Level.DEBUG),
+        new LogMessageWithLevel("Queue Fixup", Level.DEBUG),
+        new LogMessageWithLevel("Table Fixup", Level.DEBUG),
         new LogMessageWithLevel("Expand Heap After Collection", Level.DEBUG),
         // Free CSet
         new LogMessageWithLevel("Free Collection Set", Level.DEBUG),
@@ -145,6 +146,9 @@
         new LogMessageWithLevel("Reference Processing", Level.DEBUG),
         // VM internal reference processing
         new LogMessageWithLevel("Weak Processing", Level.DEBUG),
+        new LogMessageWithLevel("JNI weak processing", Level.DEBUG),
+        new LogMessageWithLevel("StringTable weak processing", Level.DEBUG),
+        new LogMessageWithLevel("VM weak processing", Level.DEBUG),
 
         new LogMessageWithLevelC2OrJVMCIOnly("DerivedPointerTable Update", Level.DEBUG),
         new LogMessageWithLevel("Start New Collection Set", Level.DEBUG),
--- a/test/hotspot/jtreg/gc/g1/TestStringTableStats.java	Sat Feb 02 10:00:05 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package gc.g1;
-
-/*
- * @test TestStringTableStats
- * @bug 8027476 8027455
- * @summary Ensure that the G1TraceStringTableScrubbing prints the expected message.
- * @key gc
- * @requires vm.gc.G1
- * @library /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- * @run main gc.g1.TestStringTableStats
- */
-
-import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.process.ProcessTools;
-
-public class TestStringTableStats {
-  public static void main(String[] args) throws Exception {
-
-    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-                                                              "-XX:+UnlockExperimentalVMOptions",
-                                                              "-Xlog:gc+stringtable=trace",
-                                                              SystemGCTest.class.getName());
-
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
-
-    System.out.println("Output:\n" + output.getOutput());
-
-    output.shouldMatch("GC\\(\\d+\\) Cleaned string table");
-    output.shouldHaveExitValue(0);
-  }
-
-  static class SystemGCTest {
-    public static void main(String [] args) {
-      System.out.println("Calling System.gc()");
-      System.gc();
-    }
-  }
-}
--- a/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAt.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAt.java	Mon Feb 04 11:01:04 2019 +0530
@@ -27,6 +27,7 @@
  * @key gc
  * @summary Test to check allocation of Java Heap with AllocateOldGenAt option
  * @requires vm.gc=="null" & os.family != "aix"
+ * @requires test.vm.gc.nvdimm
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  * @run main gc.nvdimm.TestAllocateOldGenAt
--- a/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtError.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtError.java	Mon Feb 04 11:01:04 2019 +0530
@@ -27,6 +27,7 @@
  * @key gc
  * @summary Test to check correct handling of non-existent directory passed to AllocateOldGenAt option
  * @requires vm.gc=="null" & os.family != "aix"
+ * @requires test.vm.gc.nvdimm
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  * @run main gc.nvdimm.TestAllocateOldGenAtError
--- a/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtMultiple.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtMultiple.java	Mon Feb 04 11:01:04 2019 +0530
@@ -27,6 +27,7 @@
  * @key gc
  * @summary Test to check allocation of Java Heap with AllocateOldGenAt option. Has multiple sub-tests to cover different code paths.
  * @requires vm.gc=="null" & os.family != "aix"
+ * @requires test.vm.gc.nvdimm
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  * @requires vm.bits == "64"
--- a/test/hotspot/jtreg/gc/nvdimm/TestHumongousObjectsOnNvdimm.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/gc/nvdimm/TestHumongousObjectsOnNvdimm.java	Mon Feb 04 11:01:04 2019 +0530
@@ -28,6 +28,7 @@
  * @summary Check that humongous objects reside in nv-dimm
  * @library /test/lib /
  * @requires vm.gc=="null" & os.family != "aix"
+ * @requires test.vm.gc.nvdimm
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run main gc.nvdimm.TestHumongousObjectsOnNvdimm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
--- a/test/hotspot/jtreg/gc/nvdimm/TestOldObjectsOnNvdimm.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/gc/nvdimm/TestOldObjectsOnNvdimm.java	Mon Feb 04 11:01:04 2019 +0530
@@ -27,6 +27,7 @@
  * @test TestOldObjectsOnNvdimm
  * @summary Check that objects in old generation reside in dram.
  * @requires vm.gc=="null" & os.family != "aix"
+ * @requires test.vm.gc.nvdimm
  * @library /test/lib
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
--- a/test/hotspot/jtreg/gc/nvdimm/TestYoungObjectsOnDram.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/gc/nvdimm/TestYoungObjectsOnDram.java	Mon Feb 04 11:01:04 2019 +0530
@@ -27,6 +27,7 @@
  * @test TestYoungObjectsOnDram
  * @summary Check that objects in young generation reside in dram.
  * @requires vm.gc=="null" & os.family != "aix"
+ * @requires test.vm.gc.nvdimm
  * @library /test/lib
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, SAP. All rights reserved.
+ * 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 8214975
+ * @summary No hs-err file if fatal error is raised during dynamic initialization.
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ * @requires (vm.debug == true)
+ * @requires os.family == "linux"
+ */
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.util.regex.Pattern;
+import java.util.Map;
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+
+public class VeryEarlyAssertTest {
+
+  public static void main(String[] args) throws Exception {
+
+
+    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+            "-Xmx64M",
+            "-XX:-CreateCoredumpOnCrash",
+            "-version");
+    Map<String, String> env = pb.environment();
+    env.put("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION", "1");
+
+    OutputAnalyzer output_detail = new OutputAnalyzer(pb.start());
+
+    // we should have crashed with an assert with a specific message:
+    output_detail.shouldMatch("# A fatal error has been detected by the Java Runtime Environment:.*");
+    output_detail.shouldMatch("#.*HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION.*");
+
+    // extract hs-err file
+    String hs_err_file = output_detail.firstMatch("# *(\\S*hs_err_pid\\d+\\.log)", 1);
+    if (hs_err_file == null) {
+      throw new RuntimeException("Did not find hs-err file in output.\n");
+    }
+
+    // scan hs-err file: File should contain the same assertion message. Other than that,
+    // do not expect too much: file will be littered with secondary errors. The test
+    // should test that we get a hs-err file at all.
+    File f = new File(hs_err_file);
+    if (!f.exists()) {
+      throw new RuntimeException("hs-err file missing at "
+              + f.getAbsolutePath() + ".\n");
+    }
+
+    System.out.println("Found hs_err file. Scanning...");
+
+    FileInputStream fis = new FileInputStream(f);
+    BufferedReader br = new BufferedReader(new InputStreamReader(fis));
+    String line = null;
+
+    Pattern[] pattern = new Pattern[]{
+            Pattern.compile(".*HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION.*")
+    };
+    int currentPattern = 0;
+
+    String lastLine = null;
+    while ((line = br.readLine()) != null) {
+      if (currentPattern < pattern.length) {
+        if (pattern[currentPattern].matcher(line).matches()) {
+          System.out.println("Found: " + line + ".");
+          currentPattern++;
+        }
+      }
+      lastLine = line;
+    }
+    br.close();
+
+    if (currentPattern < pattern.length) {
+      throw new RuntimeException("hs-err file incomplete (first missing pattern: " + currentPattern + ")");
+    }
+
+    if (!lastLine.equals("END.")) {
+      throw new RuntimeException("hs-err file incomplete (missing END marker.)");
+    } else {
+      System.out.println("End marker found.");
+    }
+
+    System.out.println("OK.");
+
+  }
+
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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 {
+    public static void main(String args[]) throws Throwable {
+        // 1. Test escape analysis of a method that contains
+        //    a ldc instruction of a condy whose return type is an array of boolean
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+             "-XX:CompileCommand=dontinline,runtime.condy.TestEscapeThroughInvokeWithCondy::create",
+             "runtime.condy.TestEscapeThroughInvokeWithCondy");
+        OutputAnalyzer oa = new OutputAnalyzer(pb.start());
+        oa.shouldContain("Test has successfully analyzed ldc bytecode within method create");
+        oa.shouldHaveExitValue(0);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeThroughInvokeWithCondy$A.jasm	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ *
+ */
+
+package runtime/condy;
+
+super class TestEscapeThroughInvokeWithCondy$A
+        version 55:0
+{
+
+private Field saved:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;";
+
+public Method "<init>":"(Ljava/lang/Integer;)V"
+	stack 1 locals 2
+{
+		aload_0;
+		invokespecial	Method java/lang/Object."<init>":"()V";
+		return;
+}
+
+public Method saveInto:"(Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;Ljava/lang/Integer;)V"
+	stack 2 locals 3
+{
+		aload_1;
+		aload_0;
+		putfield	Field saved:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;";
+		return;
+}
+
+public Method check:"(Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;)V"
+	stack 3 locals 2
+{
+		aload_0;
+		getfield	Field saved:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;";
+		aload_1;
+		if_acmpeq	L18;
+		new	class java/lang/RuntimeException;
+		dup;
+		ldc	String "TEST FAILED: Objects not equal.";
+		invokespecial	Method java/lang/RuntimeException."<init>":"(Ljava/lang/String;)V";
+		athrow;
+	L18:	stack_frame_type same;
+		return;
+}
+
+NestHost TestEscapeThroughInvokeWithCondy;
+static InnerClass A=class TestEscapeThroughInvokeWithCondy$A of class TestEscapeThroughInvokeWithCondy;
+
+} // end Class TestEscapeThroughInvokeWithCondy$A
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeThroughInvokeWithCondy.jasm	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,141 @@
+/*
+ * 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.
+ *
+ */
+
+// The below .jasm code implements the same java code as test
+// compiler/escapeAnalysis/TestEscapeThrowInvoke.java with the addition
+// of an ldc bytecode of a dynamic constant whose return type is an array of boolean.
+// The method bsmArray is the bootstrap method for the dynamic constant.
+// The ldc has been added to the method create.
+
+package runtime/condy;
+
+super public class TestEscapeThroughInvokeWithCondy
+        version 55:0
+{
+
+private Field a:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;";
+
+public Method "<init>":"()V"
+	stack 1 locals 1
+{
+		aload_0;
+		invokespecial	Method java/lang/Object."<init>":"()V";
+		return;
+}
+
+public static Method main:"([Ljava/lang/String;)V"
+	stack 4 locals 3
+{
+		new	class TestEscapeThroughInvokeWithCondy;
+		dup;
+		invokespecial	Method "<init>":"()V";
+		astore_1;
+		aload_1;
+		new	class TestEscapeThroughInvokeWithCondy$A;
+		dup;
+		bipush	42;
+		invokestatic	Method java/lang/Integer.valueOf:"(I)Ljava/lang/Integer;";
+		invokespecial	Method TestEscapeThroughInvokeWithCondy$A."<init>":"(Ljava/lang/Integer;)V";
+		putfield	Field a:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;";
+		iconst_0;
+		istore_2;
+	L26:	stack_frame_type append;
+		locals_map class TestEscapeThroughInvokeWithCondy, int;
+		iload_2;
+		ldc	int 100000;
+		if_icmpge	L42;
+		aload_1;
+		invokevirtual	Method run:"()V";
+		iinc	2, 1;
+		goto	L26;
+	L42:	stack_frame_type chop1;
+                getstatic       Field java/lang/System.out:"Ljava/io/PrintStream;";
+                ldc     String "Test has successfully analyzed ldc bytecode within method create";
+                invokevirtual   Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
+		return;
+}
+public static Method bsmArray:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;)[Z"
+        stack 5 locals 6
+{
+        iconst_2;
+        newarray boolean;
+        astore_3;
+        aload_3;
+        iconst_0;
+        iconst_1;
+        bastore;
+        aload_3;
+        iconst_1;
+        iconst_1;
+        bastore;
+        aload_3;
+        areturn;
+}
+
+private Method run:"()V"
+	stack 2 locals 2
+{
+		new	class java/lang/Object;
+		dup;
+		invokespecial	Method java/lang/Object."<init>":"()V";
+		pop;
+		aload_0;
+		bipush	42;
+		invokestatic	Method java/lang/Integer.valueOf:"(I)Ljava/lang/Integer;";
+		invokevirtual	Method create:"(Ljava/lang/Integer;)Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;";
+		astore_1;
+		aload_0;
+		getfield	Field a:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;";
+		aload_1;
+		invokevirtual	Method TestEscapeThroughInvokeWithCondy$A.check:"(Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;)V";
+		return;
+}
+
+private Method create:"(Ljava/lang/Integer;)Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;"
+	stack 5 locals 4
+{
+                ldc     Dynamic REF_invokeStatic:TestEscapeThroughInvokeWithCondy.bsmArray:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;)[Z":name:"[Z";
+                astore_2;
+                aload_2;
+                iconst_1;
+                iconst_1;
+                bastore;
+		new	class TestEscapeThroughInvokeWithCondy$A;
+		dup;
+		aload_1;
+		invokespecial	Method TestEscapeThroughInvokeWithCondy$A."<init>":"(Ljava/lang/Integer;)V";
+		astore_3;
+		aload_3;
+		aload_0;
+		getfield	Field a:"Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;";
+		aload_1;
+		invokevirtual	Method TestEscapeThroughInvokeWithCondy$A.saveInto:"(Lruntime/condy/TestEscapeThroughInvokeWithCondy$A;Ljava/lang/Integer;)V";
+		aload_3;
+		areturn;
+}
+
+NestMembers TestEscapeThroughInvokeWithCondy$A;
+static InnerClass A=class TestEscapeThroughInvokeWithCondy$A of class TestEscapeThroughInvokeWithCondy;
+
+} // end Class TestEscapeThroughInvokeWithCondy
--- a/test/hotspot/jtreg/runtime/exceptionMsgs/ArrayIndexOutOfBoundsException/ArrayIndexOutOfBoundsExceptionTest.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/runtime/exceptionMsgs/ArrayIndexOutOfBoundsException/ArrayIndexOutOfBoundsExceptionTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018 SAP SE. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 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
@@ -51,6 +51,10 @@
  */
 public class ArrayIndexOutOfBoundsExceptionTest {
 
+    static {
+        System.loadLibrary("ArrayIndexOutOfBoundsExceptionTest");
+    }
+
     // Some fields used in the test.
     static int[] staticArray = new int[0];
     static long[][] staticLongArray = new long[0][0];
@@ -88,6 +92,26 @@
         }
     }
 
+    static native void  doNativeArrayStore(Object[] dst, Object element, int index);
+    static native Object doNativeArrayLoad(Object[] src, int index);
+
+    static native void doNativeBooleanArrayRegionLoad (boolean[] source, int start, int len);
+    static native void doNativeBooleanArrayRegionStore(boolean[] source, int start, int len);
+    static native void doNativeByteArrayRegionLoad    (byte[] source,    int start, int len);
+    static native void doNativeByteArrayRegionStore   (byte[] source,    int start, int len);
+    static native void doNativeShortArrayRegionLoad   (short[] source,   int start, int len);
+    static native void doNativeShortArrayRegionStore  (short[] source,   int start, int len);
+    static native void doNativeCharArrayRegionLoad    (char[] source,    int start, int len);
+    static native void doNativeCharArrayRegionStore   (char[] source,    int start, int len);
+    static native void doNativeIntArrayRegionLoad     (int[] source,     int start, int len);
+    static native void doNativeIntArrayRegionStore    (int[] source,     int start, int len);
+    static native void doNativeLongArrayRegionLoad    (long[] source,    int start, int len);
+    static native void doNativeLongArrayRegionStore   (long[] source,    int start, int len);
+    static native void doNativeFloatArrayRegionLoad   (float[] source,   int start, int len);
+    static native void doNativeFloatArrayRegionStore  (float[] source,   int start, int len);
+    static native void doNativeDoubleArrayRegionLoad  (double[] source,  int start, int len);
+    static native void doNativeDoubleArrayRegionStore (double[] source,  int start, int len);
+
     /**
      *
      */
@@ -439,5 +463,463 @@
             assertEquals(e.getMessage(),
                 "arraycopy: last destination index 7 out of bounds for float[5]");
         }
+
+
+        // Test native array access.
+
+
+        try {
+            System.out.println(doNativeArrayLoad(oa2, 77));
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Index 77 out of bounds for length 5");
+        }
+        try {
+            System.out.println(doNativeArrayLoad(oa1, -1));
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Index -1 out of bounds for length 10");
+        }
+
+        try {
+            doNativeArrayStore(oa1, "Some String", Integer.MIN_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Index -2147483648 out of bounds for length 10");
+        }
+        try {
+            doNativeArrayStore(oa1, "Some String", 13);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Index 13 out of bounds for length 10");
+        }
+
+        // Boolean
+
+        // Native array region loads.
+        // Boolean, len negative.
+        try {
+            doNativeBooleanArrayRegionLoad(za2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Boolean, index negative.
+        try {
+            doNativeBooleanArrayRegionLoad(za2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Boolean, index+len too big.
+        try {
+            doNativeBooleanArrayRegionLoad(za2, 3, Integer.MAX_VALUE-1);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483649 out of bounds for length 10");
+        }
+        // Native array region stores
+        // Boolean, len negative.
+        try {
+            doNativeBooleanArrayRegionStore(za2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Boolean, index negative.
+        try {
+            doNativeBooleanArrayRegionStore(za2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Boolean, index+len too big.
+        try {
+            doNativeBooleanArrayRegionStore(za2, 3, Integer.MAX_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483650 out of bounds for length 10");
+        }
+
+        // Byte
+
+        // Native array region loads.
+        // Byte, len negative.
+        try {
+            doNativeByteArrayRegionLoad(ba1, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Byte, index negative.
+        try {
+            doNativeByteArrayRegionLoad(ba1, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 0");
+        }
+        // Byte, index+len too big.
+        try {
+            doNativeByteArrayRegionLoad(ba2, 3, Integer.MAX_VALUE-1);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483649 out of bounds for length 10");
+        }
+        // Native array region stores
+        // Byte, len negative.
+        try {
+            doNativeByteArrayRegionStore(ba2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Byte, index negative.
+        try {
+            doNativeByteArrayRegionStore(ba2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Byte, index+len too big.
+        try {
+            doNativeByteArrayRegionStore(ba2, 3, Integer.MAX_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483650 out of bounds for length 10");
+        }
+
+        // Short
+
+        // Native array region loads.
+        // Short, len negative.
+        try {
+            doNativeShortArrayRegionLoad(sa2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Short, index negative.
+        try {
+            doNativeShortArrayRegionLoad(sa2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Short, index+len too big.
+        try {
+            doNativeShortArrayRegionLoad(sa2, 3, Integer.MAX_VALUE-1);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483649 out of bounds for length 10");
+        }
+        // Native array region stores
+        // Short, len negative.
+        try {
+            doNativeShortArrayRegionStore(sa2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Short, index negative.
+        try {
+            doNativeShortArrayRegionStore(sa2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Short, index+len too big.
+        try {
+            doNativeShortArrayRegionStore(sa2, 3, Integer.MAX_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483650 out of bounds for length 10");
+        }
+
+        // Char
+
+        // Native array region loads.
+        // Char, len negative.
+        try {
+            doNativeCharArrayRegionLoad(ca2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Char, index negative.
+        try {
+            doNativeCharArrayRegionLoad(ca2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Char, index+len too big.
+        try {
+            doNativeCharArrayRegionLoad(ca2, 3, Integer.MAX_VALUE-1);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483649 out of bounds for length 10");
+        }
+        // Native array region stores
+        // Char, len negative.
+        try {
+            doNativeCharArrayRegionStore(ca2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Char, index negative.
+        try {
+            doNativeCharArrayRegionStore(ca2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Char, index+len too big.
+        try {
+            doNativeCharArrayRegionStore(ca2, 3, Integer.MAX_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483650 out of bounds for length 10");
+        }
+
+        // Int
+
+        // Native array region loads.
+        // Int, len negative.
+        try {
+            doNativeIntArrayRegionLoad(ia2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Int, index negative.
+        try {
+            doNativeIntArrayRegionLoad(ia2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Int, index+len too big.
+        try {
+            doNativeIntArrayRegionLoad(ia2, 3, Integer.MAX_VALUE-1);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483649 out of bounds for length 10");
+        }
+        // Native array region stores
+        // Int, len negative.
+        try {
+            doNativeIntArrayRegionStore(ia2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Int, index negative.
+        try {
+            doNativeIntArrayRegionStore(ia2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Int, index+len too big.
+        try {
+            doNativeIntArrayRegionStore(ia2, 3, Integer.MAX_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483650 out of bounds for length 10");
+        }
+
+        // Long
+
+        // Native array region loads.
+        // Long, len negative.
+        try {
+            doNativeLongArrayRegionLoad(la2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Long, index negative.
+        try {
+            doNativeLongArrayRegionLoad(la2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Long, index+len too big.
+        try {
+            doNativeLongArrayRegionLoad(la2, 3, Integer.MAX_VALUE-1);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483649 out of bounds for length 10");
+        }
+        // Native array region stores
+        // Long, len negative.
+        try {
+            doNativeLongArrayRegionStore(la2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Long, index negative.
+        try {
+            doNativeLongArrayRegionStore(la2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Long, index+len too big.
+        try {
+            doNativeLongArrayRegionStore(la2, 3, Integer.MAX_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483650 out of bounds for length 10");
+        }
+
+        // Float
+
+        // Native array region loads.
+        // Float, len negative.
+        try {
+            doNativeFloatArrayRegionLoad(fa2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Float, index negative.
+        try {
+            doNativeFloatArrayRegionLoad(fa2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Float, index+len too big.
+        try {
+            doNativeFloatArrayRegionLoad(fa2, 3, Integer.MAX_VALUE-1);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483649 out of bounds for length 10");
+        }
+        // Native array region stores
+        // Float, len negative.
+        try {
+            doNativeFloatArrayRegionStore(fa2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Float, index negative.
+        try {
+            doNativeFloatArrayRegionStore(fa2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Float, index+len too big.
+        try {
+            doNativeFloatArrayRegionStore(fa2, 3, Integer.MAX_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483650 out of bounds for length 10");
+        }
+
+        // Double
+
+        // Native array region loads.
+        // Double, len negative.
+        try {
+            doNativeDoubleArrayRegionLoad(da2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Double, index negative.
+        try {
+            doNativeDoubleArrayRegionLoad(da2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Double, index+len too big.
+        try {
+            doNativeDoubleArrayRegionLoad(da2, 3, Integer.MAX_VALUE-1);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483649 out of bounds for length 10");
+        }
+        // Native array region stores
+        // Double, len negative.
+        try {
+            doNativeDoubleArrayRegionStore(da2, 3, -77);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Length -77 is negative");
+        }
+        // Double, index negative.
+        try {
+            doNativeDoubleArrayRegionStore(da2, -3, 3);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region -3..0 out of bounds for length 10");
+        }
+        // Double, index+len too big.
+        try {
+            doNativeDoubleArrayRegionStore(da2, 3, Integer.MAX_VALUE);
+            fail();
+        } catch (ArrayIndexOutOfBoundsException e) {
+            assertEquals(e.getMessage(),
+                "Array region 3..2147483650 out of bounds for length 10");
+        }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/exceptionMsgs/ArrayIndexOutOfBoundsException/libArrayIndexOutOfBoundsExceptionTest.c	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+#include <jni.h>
+
+JNIEXPORT void JNICALL
+  Java_ArrayIndexOutOfBoundsExceptionTest_doNativeArrayStore(JNIEnv *env, jclass klass,
+                                                             jobjectArray array, jobject element, jint index) {
+  (*env)->SetObjectArrayElement(env, array, index, element);
+}
+
+JNIEXPORT jobject JNICALL
+  Java_ArrayIndexOutOfBoundsExceptionTest_doNativeArrayLoad(JNIEnv *env, jclass klass,
+                                                            jobjectArray array, jint index) {
+  return (*env)->GetObjectArrayElement(env, array, index);
+}
+
+
+#define REGIONACCESS(ElementType,NameType) \
+JNIEXPORT void JNICALL \
+  Java_ArrayIndexOutOfBoundsExceptionTest_doNative##NameType##ArrayRegionLoad(JNIEnv *env, jclass klass, \
+                                                                     ElementType##Array array, jint start, jint len) { \
+  ElementType clone[100]; \
+  (*env)->Get##NameType##ArrayRegion(env, array, start, len, clone); \
+} \
+JNIEXPORT void JNICALL \
+  Java_ArrayIndexOutOfBoundsExceptionTest_doNative##NameType##ArrayRegionStore(JNIEnv *env, jclass klass, \
+                                                                      ElementType##Array array, jint start, jint len) { \
+  ElementType content[100]; \
+  (*env)->Set##NameType##ArrayRegion(env, array, start, len, content); \
+}
+
+REGIONACCESS(jboolean, Boolean)
+REGIONACCESS(jbyte,    Byte)
+REGIONACCESS(jshort,   Short)
+REGIONACCESS(jchar,    Char)
+REGIONACCESS(jint,     Int)
+REGIONACCESS(jlong,    Long)
+REGIONACCESS(jfloat,   Float)
+REGIONACCESS(jdouble,  Double)
--- a/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8133885
- * @summary monitorinflation=debug should have logging from each of the statements in the code
+ * @summary monitorinflation=trace should have logging from each of the statements in the code
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
@@ -37,8 +37,8 @@
 public class MonitorInflationTest {
     static void analyzeOutputOn(ProcessBuilder pb) throws Exception {
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Inflating object");
-        output.shouldContain("type MonitorInflationTest$Waiter");
+        output.shouldContain("inflate(has_locker):");
+        output.shouldContain("type='MonitorInflationTest$Waiter'");
         output.shouldContain("I've been waiting.");
         output.shouldHaveExitValue(0);
     }
@@ -50,7 +50,7 @@
     }
 
     public static void main(String[] args) throws Exception {
-        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=debug",
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=trace",
                                                                   InnerClass.class.getName());
         analyzeOutputOn(pb);
 
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbAttach.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbAttach.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 import java.util.Map;
 
 import jdk.test.lib.apps.LingeredApp;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -68,6 +69,8 @@
                     "longConstant markOopDesc::locked_value"));
 
             test.run(-1, cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbField.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbField.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.Map;
 import jdk.test.lib.apps.LingeredApp;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -63,6 +64,8 @@
                 "field nmethod _entry_bci int",
                 "field Universe _collectedHeap CollectedHeap"));
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java	Mon Feb 04 11:01:04 2019 +0530
@@ -27,6 +27,8 @@
 import java.util.ArrayList;
 
 import jdk.test.lib.apps.LingeredApp;
+import jtreg.SkippedException;
+
 /**
  * @test
  * @bug 8193124
@@ -91,6 +93,8 @@
 
                 test.run(theApp.getPid(), cmds, expStrMap, null);
             }
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java	Mon Feb 04 11:01:04 2019 +0530
@@ -29,6 +29,7 @@
 import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.Platform;
 import jdk.test.lib.Utils;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -82,6 +83,8 @@
                     "MaxJavaStackTraceDepth = 1024"));
 
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java	Mon Feb 04 11:01:04 2019 +0530
@@ -57,13 +57,6 @@
 
             String jstackOutput = test.run(theApp.getPid(), cmds, null, null);
 
-            if (jstackOutput == null) {
-                // Output could be null due to attach permission issues
-                // and if we are skipping this.
-                LingeredApp.stopApp(theApp);
-                throw new SkippedException("attach permission issues");
-            }
-
             Map<String, String> tokensMap = new HashMap<>();
             tokensMap.put("(a java.lang.Class for LingeredAppWithLock)",
                           "instance of Oop for java/lang/Class");
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbJdis.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbJdis.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,11 +57,6 @@
             // the 'jstack -v' command
             cmds = new ArrayList<String>();
 
-            // Output could be null if the test was skipped due to
-            // attach permission issues.
-            if (output == null) {
-                throw new SkippedException("attach permission issues");
-            }
             String cmdStr = null;
             String[] parts = output.split("LingeredApp.main");
             String[] tokens = parts[1].split(" ");
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 
 import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.Utils;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -68,6 +69,8 @@
                     "ParselTongue"));
 
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java	Mon Feb 04 11:01:04 2019 +0530
@@ -27,6 +27,7 @@
 
 import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.Platform;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -64,6 +65,8 @@
                     "LingeredApp.main"));
 
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR (with -Xcomp=" + withXcomp + ") " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java	Mon Feb 04 11:01:04 2019 +0530
@@ -33,6 +33,7 @@
 import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.SA.SATestUtils;
+import jtreg.SkippedException;
 
 
 /**
@@ -177,22 +178,18 @@
                       List<String> commands,
                       Map<String, List<String>> expectedStrMap,
                       Map<String, List<String>> unExpectedStrMap)
-        throws IOException, InterruptedException {
+        throws Exception {
 
         if (!Platform.shouldSAAttach()) {
-            if (Platform.isOSX()) {
-                if (!SATestUtils.canAddPrivileges()) {
-                   // Skip the test if we don't have enough permissions to attach
-                   // and cannot add privileges.
-                   System.out.println("SA attach not expected to work - test skipped.");
-                   return null;
-               } else {
-                   needPrivileges = true;
-               }
-            } else {
-                System.out.println("SA attach not expected to work. Insufficient privileges.");
-                throw new Error("Cannot attach.");
+            if (Platform.isOSX() && SATestUtils.canAddPrivileges()) {
+                needPrivileges = true;
             }
+            else {
+               // Skip the test if we don't have enough permissions to attach
+               // and cannot add privileges.
+               throw new SkippedException(
+                   "SA attach not expected to work. Insufficient privileges.");
+           }
         }
 
         attach(lingeredAppPid);
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbLongConstant.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbLongConstant.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,9 +75,6 @@
 
             String longConstantOutput = test.run(theApp.getPid(), cmds, expStrMap, unExpStrMap);
 
-            if (longConstantOutput == null) {
-                throw new SkippedException("attach permission issues");
-            }
             checkForTruncation(longConstantOutput);
         } catch (SkippedException e) {
             throw e;
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.Platform;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -57,6 +58,8 @@
                     "jimage", "zip", "verify"));
 
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.Map;
 import jdk.test.lib.apps.LingeredApp;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -68,6 +69,8 @@
             unExpStrMap.put("printall", List.of(
                 "cannot be cast to"));
             test.run(theApp.getPid(), cmds, expStrMap, unExpStrMap);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAs.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAs.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,11 +55,6 @@
 
             String jstackOutput = test.run(theApp.getPid(), cmds, null, null);
 
-            if (jstackOutput == null) {
-                LingeredApp.stopApp(theApp);
-                throw new SkippedException("attach permission issues");
-            }
-
             String[] snippets = jstackOutput.split("LingeredApp.main");
             String addressString = null;
 
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.Platform;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -83,6 +84,8 @@
                     "bool JvmtiExport::_can_post_on_exceptions"));
 
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.Platform;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -58,6 +59,8 @@
                     "Reference Handler", "Finalizer", "main"));
 
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -70,11 +70,6 @@
             unExpStrMap.put("g1regiondetails", List.of("Unknown Region Type"));
             String regionDetailsOutput = test.run(theApp.getPid(), cmds,
                                                   expStrMap, unExpStrMap);
-            if (regionDetailsOutput == null) {
-                LingeredApp.stopApp(theApp);
-                throw new SkippedException("attach permission issues");
-            }
-
             // Test the output of 'scanoops' -- get the start and end addresses
             // from the StartsHumongous region. Ensure that it contains an
             // array of Strings.
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,11 +58,6 @@
 
             String universeOutput = test.run(theApp.getPid(), cmds, null, null);
 
-            if (universeOutput == null) {
-                LingeredApp.stopApp(theApp);
-                throw new SkippedException("attach permission issues");
-            }
-
             cmds = new ArrayList<String>();
             Map<String, List<String>> expStrMap = new HashMap<>();
             Map<String, List<String>> unExpStrMap = new HashMap<>();
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbSource.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbSource.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 import java.util.Map;
 
 import jdk.test.lib.apps.LingeredApp;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -74,6 +75,8 @@
 
             test.run(theApp.getPid(), cmds, expStrMap, unExpStrMap);
             Files.delete(file);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbThread.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbThread.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.Map;
 import jdk.test.lib.apps.LingeredApp;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -76,14 +77,6 @@
                 expStrMap,
                 unExpStrMap);
 
-            if (consolidatedOutput == null) {
-                // Output could be null due to attach permission issues.
-                System.out.println(
-                    "Output is empty. Probably due to attach permission issues.");
-                LingeredApp.stopApp(theApp);
-                return;
-            }
-
             // Test the thread <id> command now. Obtain <id> from the
             // output of the previous 'threads' command. The word before
             // the token 'Finalizer' should denote the thread id of the
@@ -109,6 +102,8 @@
                 "Last_Java_SP"));
             cmds = List.of(cmd);
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbVmStructsDump.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbVmStructsDump.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.Map;
 import jdk.test.lib.apps.LingeredApp;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -63,6 +64,8 @@
                 "type Universe null",
                 "type ConstantPoolCache MetaspaceObj"));
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.Platform;
+import jtreg.SkippedException;
 
 /**
  * @test
@@ -63,6 +64,8 @@
                     "public static void main"));
 
             test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (SkippedException se) {
+            throw se;
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
--- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java	Mon Feb 04 11:01:04 2019 +0530
@@ -263,6 +263,8 @@
                 "-XX:-UseCounterDecay",
                 "-XX:-ShowMessageBoxOnError",
                 "-XX:+UnlockDiagnosticVMOptions",
+                // redirect VM output to cerr so it won't collide w/ ctw output
+                "-XX:+DisplayVMOutputToStderr",
                 // define phase start
                 "-DCompileTheWorldStartAt=" + classStart,
                 "-DCompileTheWorldStopAt=" + classStop,
--- a/test/hotspot/jtreg/vmTestbase/metaspace/shrink_grow/ShrinkGrowTest/ShrinkGrowTest.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/metaspace/shrink_grow/ShrinkGrowTest/ShrinkGrowTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 /*
  * @test
  *
+ * @bug 8217432
  * @summary converted from VM Testbase metaspace/shrink_grow/ShrinkGrowTest.
  *
  * @requires vm.opt.final.ClassUnloading
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/bi02t001.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/bi02t001.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -69,8 +69,7 @@
             }
 
             if (!NSK_JNI_VERIFY(jni_env, (*new_class_data = (unsigned char*)
-                    jni_env->GetByteArrayElements(classBytes, NULL))
-                        != NULL)) {
+                    jni_env->GetByteArrayElements(classBytes, NULL)) != NULL)) {
                 nsk_jvmti_setFailStatus();
                 return;
             }
@@ -97,8 +96,7 @@
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            jni->GetStaticObjectField(debugeeClass, field))
-                != NULL))
+            jni->GetStaticObjectField(debugeeClass, field)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/bi02t002.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/bi02t002.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,8 +63,7 @@
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            jni->GetStaticObjectField(debugeeClass, field))
-                != NULL))
+            jni->GetStaticObjectField(debugeeClass, field)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
@@ -91,8 +90,7 @@
         return NSK_TRUE;
 
     if (!NSK_JNI_VERIFY(jni, (class_def.class_bytes = (unsigned char*)
-            jni->GetByteArrayElements(classBytes, NULL))
-                != NULL))
+            jni->GetByteArrayElements(classBytes, NULL)) != NULL))
         return NSK_TRUE;
 
     class_def.klass = testedClass;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/bi03t001.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/bi03t001.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -69,8 +69,7 @@
             }
 
             if (!NSK_JNI_VERIFY(jni_env, (*new_class_data = (unsigned char*)
-                    jni_env->GetByteArrayElements(classBytes, NULL))
-                        != NULL)) {
+                    jni_env->GetByteArrayElements(classBytes, NULL)) != NULL)) {
                 nsk_jvmti_setFailStatus();
                 return;
             }
@@ -97,8 +96,7 @@
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            jni->GetStaticObjectField(debugeeClass, field))
-                != NULL))
+            jni->GetStaticObjectField(debugeeClass, field)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/bi03t002.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/bi03t002.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,8 +63,7 @@
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            jni->GetStaticObjectField(debugeeClass, field))
-                != NULL))
+            jni->GetStaticObjectField(debugeeClass, field)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
@@ -91,8 +90,7 @@
         return NSK_TRUE;
 
     if (!NSK_JNI_VERIFY(jni, (class_def.class_bytes = (unsigned char*)
-            jni->GetByteArrayElements(classBytes, NULL))
-                != NULL))
+            jni->GetByteArrayElements(classBytes, NULL)) != NULL))
         return NSK_TRUE;
 
     class_def.klass = testedClass;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t001/hs201t001.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t001/hs201t001.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -190,9 +190,7 @@
         return;
     }
 
-    if (strcmp(className, EXPECTED_CLASS_SIGN)
-                        == 0) {
-
+    if (strcmp(className, EXPECTED_CLASS_SIGN) == 0) {
         NSK_DISPLAY1("\n\n>>>> Class loaded: %s", className);
         NSK_DISPLAY0(", activating breakpoint\n");
         setBreakPoint(jvmti_env, jni_env, klass);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/hs201t002.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/hs201t002.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -190,9 +190,7 @@
         return;
     }
 
-    if (strcmp(className, EXPECTED_CLASS_SIGN)
-                        == 0) {
-
+    if (strcmp(className, EXPECTED_CLASS_SIGN) == 0) {
         NSK_DISPLAY1("\n\n>>>> Class loaded: %s", className);
         NSK_DISPLAY0(", activating breakpoint\n");
         setBreakPoint(jvmti_env, jni_env, klass);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t001/hs202t001.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t001/hs202t001.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -116,8 +116,7 @@
         jlocation location) {
     jvmtiError err;
     err = JVMTI_ERROR_NONE;
-    if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP, NULL)
-            == NSK_TRUE) {
+    if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP, NULL) == NSK_TRUE) {
         nsk_printf(" Enabled.. notification event ..");
     }
     err= jvmti->SetEventNotificationMode(JVMTI_DISABLE,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -155,10 +155,8 @@
             nsk_printf("#error Agent :: while setting event callbacks.\n");
             return JNI_ERR;
         }
-        if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL)
-                    == NSK_TRUE) &&
-                (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL)
-                  == NSK_TRUE)) {
+        if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) &&
+                (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL) == NSK_TRUE)) {
             nsk_printf(" Agent :: Notifications are enabled.\n");
         } else {
             nsk_printf("#error Agent :: Eanableing Notifications.\n");
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/followref003.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/followref003.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -533,7 +533,7 @@
     for (idx = 1; idx <= curr_local_idx; idx++) {
         loc = &locDesc[idx];
         if (loc->frame_id == frame_id &&
-            loc->slot     == slot) {
+            loc->slot == slot) {
             if (first_followref) {
                 /* Do this check on the first FollowReferences call only */
                 FrameDesc *fr = &frameDesc[frame_id];
--- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -486,20 +486,15 @@
         jstring stateName;
         jint state;
 
-        if (!NSK_VERIFY(
-             env->GetJavaVM(&vm) == 0)) {
+        if (!NSK_VERIFY(env->GetJavaVM(&vm) == 0)) {
             return NULL;
         }
 
-        if (!NSK_VERIFY(
-             vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1)
-                    == JNI_OK)) {
+        if (!NSK_VERIFY(vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1) == JNI_OK)) {
             return NULL;
         }
 
-        if (!NSK_VERIFY(
-             jvmti->GetThreadState((jthread)thread, &state)
-             == JVMTI_ERROR_NONE)) {
+        if (!NSK_VERIFY(jvmti->GetThreadState((jthread)thread, &state) == JVMTI_ERROR_NONE)) {
             return NULL;
         }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/aod/jvmti_aod.cpp	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/aod/jvmti_aod.cpp	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -166,7 +166,7 @@
         return NULL;
     }
     if (!NSK_JNI_VERIFY(jni,
-            (threadConstructor = jni->GetMethodID(klass, "<init>", "()V"))  != NULL)) {
+            (threadConstructor = jni->GetMethodID(klass, "<init>", "()V")) != NULL)) {
         NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
         return NULL;
     }
@@ -199,7 +199,7 @@
         return NULL;
     }
     if (!NSK_JNI_VERIFY(jni,
-            (threadConstructor = jni->GetMethodID(klass, "<init>", "(Ljava/lang/String;)V"))  != NULL)) {
+            (threadConstructor = jni->GetMethodID(klass, "<init>", "(Ljava/lang/String;)V")) != NULL)) {
         NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
         return NULL;
     }
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java	Mon Feb 04 11:01:04 2019 +0530
@@ -397,7 +397,7 @@
         // TODO: exclude GC time, compilation time (optionally) from measurements
 
         print("Comparing invocation time orders");
-        verifyTimeOrder(results[REFLECTION_CALL],         results[INVOKE_EXACT]);
+        verifyTimeOrder(results[INDY],                    results[REFLECTION_CALL]);
         verifyTimeOrder(results[INVOKE_EXACT],            results[DIRECT_CALL]);
         verifyTimeOrder(results[INVOKE],                  results[DIRECT_CALL]);
         verifyTimeOrder(results[INVOKE_EXACT],            results[INDY]);
--- a/test/jdk/ProblemList-Xcomp.txt	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/ProblemList-Xcomp.txt	Mon Feb 04 11:01:04 2019 +0530
@@ -29,3 +29,4 @@
 
 java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all
 java/util/concurrent/CountDownLatch/Basic.java 8195057 generic-all
+java/util/stream/test/org/openjdk/tests/java/util/stream/StreamLinkTest.java 8216317 solaris-all
--- a/test/jdk/ProblemList-graal.txt	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/ProblemList-graal.txt	Mon Feb 04 11:01:04 2019 +0530
@@ -69,6 +69,29 @@
 java/lang/Runtime/exec/LotsOfOutput.java                                8196611   generic-all
 java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java   8196611   generic-all
 
+# tests require pop_frame and force_early_return capabilities
+com/sun/jdi/RedefineTTYLineNumber.java                                  8195635   generic-all
+com/sun/jdi/RedefineG.java                                              8195635   generic-all
+com/sun/jdi/RedefineCrossStart.java                                     8195635   generic-all
+com/sun/jdi/PopSynchronousTest.java                                     8195635   generic-all
+com/sun/jdi/RedefineTTYLineNumber.java                                  8195635   generic-all
+com/sun/jdi/RedefineG.java                                              8195635   generic-all
+com/sun/jdi/RedefineCrossStart.java                                     8195635   generic-all
+com/sun/jdi/PopSynchronousTest.java                                     8195635   generic-all
+com/sun/jdi/PopAsynchronousTest.java                                    8195635   generic-all
+com/sun/jdi/PopAndStepTest.java                                         8195635   generic-all
+com/sun/jdi/PopAsynchronousTest.java                                    8195635   generic-all
+com/sun/jdi/PopAndStepTest.java                                         8195635   generic-all
+com/sun/jdi/EarlyReturnTest.java                                        8195635   generic-all
+com/sun/jdi/RedefineTTYLineNumber.java                                  8195635   generic-all
+com/sun/jdi/RedefineG.java                                              8195635   generic-all
+com/sun/jdi/RedefineCrossStart.java                                     8195635   generic-all
+com/sun/jdi/PopSynchronousTest.java                                     8195635   generic-all
+com/sun/jdi/PopAsynchronousTest.java                                    8195635   generic-all
+com/sun/jdi/PopAndStepTest.java                                         8195635   generic-all
+com/sun/jdi/EarlyReturnTest.java                                        8195635   generic-all
+com/sun/jdi/EarlyReturnTest.java                                        8195635   generic-all
+
 # Next JFR tests fail with Graal. Assuming 8193210.
 jdk/jfr/event/compiler/TestCodeSweeper.java              8193210   generic-all
 jdk/jfr/event/compiler/TestCompilerInlining.java         8193210   generic-all
--- a/test/jdk/ProblemList.txt	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/ProblemList.txt	Mon Feb 04 11:01:04 2019 +0530
@@ -252,7 +252,6 @@
 java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,linux-all
 java/awt/Component/CreateImage/CreateImage.java 8198334  windows-all
 java/awt/Component/GetScreenLocTest/GetScreenLocTest.java 4753654 generic-all
-java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html 8192929 windows-all,linux-all
 java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html 8017454 macosx-all
 java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java 8000171 windows-all
 java/awt/Frame/MiscUndecorated/RepaintTest.java 8079267 windows-all,linux-all
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/JdbStepTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,96 @@
+/*
+ * 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 8163127
+ * @summary Debugger classExclusionFilter does not work correctly with method references
+ *
+ * @library /test/lib
+ * @compile -g JdbStepTest.java
+ * @run main/othervm JdbStepTest
+ */
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jdk.test.lib.process.OutputAnalyzer;
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+class JdbStepTestTarg {
+
+    public static void actualMethod(long[] input, long min, long max) {
+        Map<Long, List<Long>> lookup = new HashMap<>();  //@2 breakpoint, just a marker,
+                                                         // not a real breakpoint
+        long range = max - min + 1;
+        for (long number : input) {
+            lookup.compute(number / range, (key, list) -> list != null ? list :
+                    new ArrayList<>()).add(number);
+        }
+    }
+
+    interface Func {
+        void call(long[] input, long min, long max);
+    }
+
+    public static void main(String args[]) {
+        Func methodRef = JdbStepTestTarg::actualMethod;
+        methodRef.call(new long[]{1, 2, 3, 4, 5, 6}, 1, 6);  //@1 breakpoint
+    }
+
+}
+
+public class JdbStepTest extends JdbTest {
+    public static void main(String argv[]) {
+        new JdbStepTest().run();
+    }
+
+    private JdbStepTest() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = JdbStepTestTarg.class.getName();
+    private static final String PATTERN_TEMPLATE = "^Step completed: \"thread=main\", " +
+            "JdbStepTestTarg\\.actualMethod\\(\\), line=%LINE_NUMBER.*\\R" +
+            "%LINE_NUMBER\\s+Map<Long, List<Long>> lookup = new HashMap<>\\(\\);.*\\R";
+
+    @Override
+    protected void runCases() {
+
+        setBreakpoints(jdb, DEBUGGEE_CLASS, System.getProperty("test.src") +
+                "/JdbStepTest.java", 1);
+
+        int expectedLineToStopAfterStep = parseBreakpoints(getTestSourcePath("JdbStepTest.java"),
+                2).get(0);
+
+        jdb.command(JdbCommand.run());
+        jdb.command(JdbCommand.step());
+
+        String pattern = PATTERN_TEMPLATE.replaceAll("%LINE_NUMBER",
+                String.valueOf(expectedLineToStopAfterStep));
+        new OutputAnalyzer(jdb.getJdbOutput()).shouldMatch(pattern);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,180 @@
+/*
+ * 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 8215921
+  @summary Test that selecting a different item does send an ItemEvent
+  @key headful
+  @run main SelectNewItemTest
+*/
+
+import java.awt.Choice;
+import java.awt.Robot;
+import java.awt.Frame;
+import java.awt.BorderLayout;
+import java.awt.AWTException;
+import java.awt.Point;
+import java.awt.Dimension;
+import java.awt.event.InputEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.WindowListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.WindowEvent;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+public class SelectNewItemTest implements ItemListener, WindowListener {
+    //Declare things used in the test, like buttons and labels here
+    private Frame frame;
+    private Choice theChoice;
+    private Robot robot;
+
+    private CountDownLatch latch = new CountDownLatch(1);
+    private volatile boolean passed = false;
+
+    private void init()
+    {
+        try {
+            robot = new Robot();
+            robot.setAutoDelay(500);
+        } catch (AWTException e) {
+            throw new RuntimeException("Unable to create Robot. Test fails.");
+        }
+
+        frame = new Frame("SelectNewItemTest");
+        frame.setLayout(new BorderLayout());
+        theChoice = new Choice();
+        for (int i = 0; i < 10; i++) {
+            theChoice.add(new String("Choice Item " + i));
+        }
+        theChoice.addItemListener(this);
+        frame.add(theChoice);
+        frame.addWindowListener(this);
+
+        frame.setLocation(1,20);
+        frame.setSize(200, 50);
+        robot.mouseMove(10, 30);
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+    public static void main(String... args) {
+        SelectNewItemTest test = new SelectNewItemTest();
+        test.init();
+        try {
+            test.latch.await(12000, TimeUnit.MILLISECONDS);
+        } catch (InterruptedException e) {}
+        test.robot.waitForIdle();
+
+        try {
+            if (!test.passed) {
+                throw new RuntimeException("TEST FAILED.");
+            }
+        } finally {
+            test.frame.dispose();
+        }
+    }
+
+    private void run() {
+        try {
+            Thread.sleep(1000);
+
+            Point loc = theChoice.getLocationOnScreen();
+            int selectedIndex = theChoice.getSelectedIndex();
+            Dimension size = theChoice.getSize();
+
+            robot.mouseMove(loc.x + size.width - 10, loc.y + size.height / 2);
+
+            robot.setAutoDelay(250);
+            robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+
+            robot.delay(1000);
+
+            //make sure that the mouse moves to a different item, so that
+            //itemStateChanged is called.
+            robot.mouseMove(loc.x + size.width / 2, loc.y + 3 * size.height);
+            robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+            robot.waitForIdle();
+
+            if (selectedIndex == theChoice.getSelectedIndex())
+                throw new RuntimeException("Test case failed - expected to select" +
+                " a different item than " + selectedIndex);
+
+            selectedIndex = theChoice.getSelectedIndex();
+            //now click on the same item and make sure that item event is
+            //not generated.
+            robot.delay(1000);
+            robot.mouseMove(loc.x + size.width - 10, loc.y + size.height / 2);
+
+            robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+            //Make sure that the popup menu scrolls back to show the index from
+            //beginning, so that the second mouse click happens on the previously
+            //selected item.
+            //For example, on windows, it automatically scrolls the list to show
+            //the currently selected item just below the choice, which can
+            //throw off the test.
+            if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+                robot.mouseWheel(-100);
+            }
+            robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+
+            robot.delay(1000);
+            robot.mouseMove(loc.x + size.width / 2, loc.y + 3 * size.height);
+            robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+            robot.waitForIdle();
+
+            if (selectedIndex != theChoice.getSelectedIndex())
+                throw new RuntimeException("Test failed. Expected to select the same item " +
+                "located at: " + selectedIndex + " but got an item selected at: " + theChoice.getSelectedIndex());
+        } catch(InterruptedException e) {
+            throw new RuntimeException(e.getCause());
+        } finally {
+            latch.countDown();
+        }
+    }
+
+    @Override public void itemStateChanged(ItemEvent e) {
+        if (!passed) {
+            System.out.println("ItemEvent received.  Test passes");
+            passed = true;
+        } else {
+            System.out.println("ItemEvent received for second click. Test fails");
+            passed = false;
+        }
+    }
+
+    @Override public void windowOpened(WindowEvent e) {
+        System.out.println("windowActivated()");
+        (new Thread(this::run)).start();
+    }
+
+    @Override public void windowActivated(WindowEvent e) {}
+    @Override public void windowDeactivated(WindowEvent e) {}
+    @Override public void windowClosed(WindowEvent e) {}
+    @Override public void windowClosing(WindowEvent e) {}
+    @Override public void windowIconified(WindowEvent e) {}
+    @Override public void windowDeiconified(WindowEvent e) {}
+}
--- a/test/jdk/java/beans/PropertyEditor/Test6397609.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/java/beans/PropertyEditor/Test6397609.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -32,31 +32,38 @@
  */
 
 import java.beans.PropertyEditorManager;
+import java.lang.ref.WeakReference;
 
 public class Test6397609 {
     public static void main(String[] args) throws Exception {
-        MemoryClassLoader loader = new MemoryClassLoader();
-        PropertyEditorManager.registerEditor(
-                Object.class,
-                loader.compile("Editor",
-                               "public class Editor extends java.beans.PropertyEditorSupport {}"));
+        Class<?> targetClass = Object.class;
+        Class<?> editorClass = new MemoryClassLoader().compile("Editor",
+                "public class Editor extends java.beans.PropertyEditorSupport {}");
+        PropertyEditorManager.registerEditor(targetClass, editorClass);
 
-        if (!isEditorExist(Object.class)) {
+        // trigger a gc
+        Object object = new Object();
+        var r = new WeakReference<Object>(object);
+        object = null;
+        while (r.get() != null) {
+            System.gc();
+            Thread.sleep(100);
+        }
+
+        if (PropertyEditorManager.findEditor(targetClass) == null) {
             throw new Error("the editor is lost");
         }
-        loader = null; // clean the reference
-        if (isEditorExist(Object.class)) {
+
+        // allow, and wait for, Editor class to be unloaded
+        var ref = new WeakReference<Class<?>>(editorClass);
+        editorClass = null;
+        while (ref.get() != null) {
+            System.gc();
+            Thread.sleep(100);
+        }
+
+        if (PropertyEditorManager.findEditor(targetClass) != null) {
             throw new Error("unexpected editor is found");
         }
     }
-
-    private static boolean isEditorExist(Class type) {
-        for (int i = 0; i < 10; i++) {
-            System.gc(); // clean all weak references
-            if (null == PropertyEditorManager.findEditor(type)) {
-                return false;
-            }
-        }
-        return true;
-    }
 }
--- a/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  */
 
 import java.io.PrintStream;
+import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.Array;
@@ -37,6 +38,7 @@
 import java.security.Policy;
 import java.security.ProtectionDomain;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.List;
 import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
@@ -156,7 +158,7 @@
                     .collect(Collectors.toSet());
             set.stream().forEach(t -> LogStream.err.println("Found: " + t));
             if (set.size() > 1) {
-                throw new RuntimeException("Too many bootsrap threads found");
+                throw new RuntimeException("Too many bootstrap threads found");
             }
             Optional<Thread> t = set.stream().findFirst();
             if (t.isPresent()) {
@@ -292,46 +294,73 @@
         // of the executor.
         SimplePolicy.allowAll.set(Boolean.TRUE);
         try {
-            Stream<Thread> stream = Thread.getAllStackTraces().keySet().stream();
-            stream.filter((t) -> t.getName().startsWith("BootstrapMessageLoggerTask-"))
-                    .forEach(t -> LogStream.err.println(t));
+            // Though unlikely, it is not impossible that the bootstrap logger
+            // executor may have released its first thread and spawned a new one.
+            // If that happened then the executor itself might have been GC'ed
+            // as well and a new one might have been created.
+            // The code below will lookup the executor threads again and
+            // join them.
+            // Only one may be active at a given time, but that might not
+            // be the one referenced by threadRef.
+            // We're just making sure all of them have stopped running
+            // before verifying that the executor is eventually GC'ed.
+            final WeakReference<Thread> previous = threadRef;
+            Stream<WeakReference<Thread>> stream = Thread.getAllStackTraces().keySet().stream()
+               .filter((t) -> t.getName().startsWith("BootstrapMessageLoggerTask-"))
+               .filter((t) -> previous == null ? true : t != previous.get())
+               .map((t) -> new WeakReference<>(t, queue));
+            List<WeakReference<Thread>> threads = stream.collect(Collectors.toList());
+            if (previous != null) threads.add(previous);
+            threads.forEach(t -> LogStream.err.println(t.get()));
             stream = null;
-            if (threadRef != null && test == TestCase.SECURE_AND_WAIT) {
-                Thread t = threadRef.get();
-                if (t != null) {
-                    if (!(Boolean)isAlive.invoke(null)) {
-                        throw new RuntimeException("Executor already terminated");
+
+            if (test == TestCase.SECURE_AND_WAIT) {
+                // First wait for all executor threads to terminate
+                for (var ref : threads) {
+                    Thread t = ref.get();
+                    if (t != null) {
+                        if (!(Boolean)isAlive.invoke(null) && t.isAlive()) {
+                            throw new RuntimeException("Executor already terminated");
+                        } else {
+                            LogStream.err.println("Executor still alive as expected: " + t.getName());
+                        }
+                        LogStream.err.println("Waiting for " + t.getName() + " to terminate (join)");
+                        t.join(60_000);
+                        t = null;
                     } else {
-                        LogStream.err.println("Executor still alive as expected.");
+                        LogStream.err.println("WeakReference<Thread> is already cleared.");
+                        long count = Thread.getAllStackTraces().keySet().stream()
+                            .filter((tr) -> tr.getName().startsWith("BootstrapMessageLoggerTask-"))
+                            .count();
+                        if (count != 0) {
+                            LogStream.err.println("There are " + count + " threads still lingering.");
+                        }
                     }
-                    LogStream.err.println("Waiting for " + t.getName() + " to terminate (join)");
-                    t.join(60_000);
-                    t = null;
                 }
-                LogStream.err.println("Calling System.gc()");
-                System.gc();
-                LogStream.err.println("Waiting for BootstrapMessageLoggerTask to be gc'ed");
-                while (queue.remove(1000) == null) {
+                // Then wait until all the executor threads are GC'ed
+                while (!threads.isEmpty()) {
                     LogStream.err.println("Calling System.gc()");
                     System.gc();
-                }
+                    LogStream.err.println("Waiting for BootstrapMessageLoggerTask to be gc'ed");
+                    Reference<?> tref;
+                    while ((tref = queue.remove(1000)) == null) {
+                        LogStream.err.println("Calling System.gc()");
+                        System.gc();
+                    }
 
-                // Call the reference here to make sure threadRef will not be
-                // eagerly garbage collected before the thread it references.
-                // otherwise, it might not be enqueued, resulting in the
-                // queue.remove() call above to always return null....
-                if (threadRef.get() != null) {
-                    throw new RuntimeException("Reference should have been cleared");
+                    threads.remove(tref);
+                    LogStream.err.println("BootstrapMessageLoggerTask has been gc'ed: "
+                                          + threads.size() + " remaining...");
                 }
-
-                LogStream.err.println("BootstrapMessageLoggerTask has been gc'ed");
-                // Wait for the executor to be gc'ed...
+                // Then wait for the executor to be gc'ed...
+                LogStream.err.println("Waiting for the executor to be gc'ed: Calling System.gc()");
+                System.gc();
                 for (int i=0; i<10; i++) {
-                    LogStream.err.println("Calling System.gc()");
-                    System.gc();
                     if (!(Boolean)isAlive.invoke(null)) break;
                     // It would be unexpected that we reach here...
                     Thread.sleep(1000);
+                    LogStream.err.println("Calling System.gc()");
+                    System.gc();
                 }
 
                 if ((Boolean)isAlive.invoke(null)) {
--- a/test/jdk/java/net/httpclient/ProxyServer.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/java/net/httpclient/ProxyServer.java	Mon Feb 04 11:01:04 2019 +0530
@@ -25,6 +25,7 @@
 import java.io.*;
 import java.util.*;
 import java.security.*;
+import java.util.concurrent.CopyOnWriteArrayList;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.Arrays.asList;
 import static java.util.stream.Collectors.toList;
@@ -90,12 +91,13 @@
         this.credentials = credentials;
         setName("ProxyListener");
         setDaemon(true);
-        connections = new LinkedList<>();
+        connections = new CopyOnWriteArrayList<Connection>();
         start();
     }
 
     public ProxyServer(String s) {
         credentials = null;
+        connections = new CopyOnWriteArrayList<Connection>();
     }
 
     /**
@@ -110,15 +112,16 @@
      * currently open
      */
     public void close() throws IOException {
-        if (debug) System.out.println("Proxy: closing");
+        if (debug) System.out.println("Proxy: closing server");
         done = true;
         listener.close();
         for (Connection c : connections) {
             c.close();
+            c.awaitCompletion();
         }
     }
 
-    List<Connection> connections;
+    final CopyOnWriteArrayList<Connection> connections;
 
     volatile boolean done;
 
@@ -137,17 +140,20 @@
     }
 
     public void execute() {
+        int id = 0;
         try {
-            while(!done) {
+            while (!done) {
                 Socket s = listener.accept();
+                id++;
+                Connection c = new Connection(s, id);
                 if (debug)
-                    System.out.println("Client: " + s);
-                Connection c = new Connection(s);
+                    System.out.println("Proxy: accepted new connection: " + s);
                 connections.add(c);
+                c.init();
             }
         } catch(Throwable e) {
             if (debug && !done) {
-                System.out.println("Fatal error: Listener: " + e);
+                System.out.println("Proxy: Fatal error, listener got " + e);
                 e.printStackTrace();
             }
         }
@@ -158,21 +164,20 @@
      */
     class Connection {
 
+        private final int id;
         Socket clientSocket, serverSocket;
         Thread out, in;
         volatile InputStream clientIn, serverIn;
         volatile OutputStream clientOut, serverOut;
 
-        boolean forwarding = false;
-
         final static int CR = 13;
         final static int LF = 10;
 
-        Connection(Socket s) throws IOException {
+        Connection(Socket s, int id) throws IOException {
+            this.id = id;
             this.clientSocket= s;
             this.clientIn = new BufferedInputStream(s.getInputStream());
             this.clientOut = s.getOutputStream();
-            init();
         }
 
         byte[] readHeaders(InputStream is) throws IOException {
@@ -218,9 +223,21 @@
         private volatile boolean closing;
         public synchronized void close() throws IOException {
             closing = true;
-            if (debug) System.out.println("Closing connection (proxy)");
-            if (serverSocket != null) serverSocket.close();
-            if (clientSocket != null) clientSocket.close();
+            if (debug)
+                System.out.println("Proxy: closing connection {" + this + "}");
+            if (serverSocket != null)
+                serverSocket.close();
+            if (clientSocket != null)
+                clientSocket.close();
+        }
+
+        public void awaitCompletion() {
+            try {
+                if (in != null)
+                    in.join();
+                if (out!= null)
+                    out.join();
+            } catch (InterruptedException e) { }
         }
 
         int findCRLF(byte[] b) {
@@ -274,6 +291,9 @@
                 while (true) {
                     buf = readHeaders(clientIn);
                     if (findCRLF(buf) == -1) {
+                        if (debug)
+                            System.out.println("Proxy: no CRLF closing, buf contains:["
+                                    + new String(buf, UTF_8) + "]" );
                         close();
                         return;
                     }
@@ -302,7 +322,8 @@
                 }
             } catch (Throwable e) {
                 if (debug) {
-                    System.out.println (e);
+                    System.out.println("Proxy: " + e);
+                    e.printStackTrace();
                 }
                 try {close(); } catch (IOException e1) {}
             }
@@ -352,7 +373,8 @@
             } else {
                 port = Integer.parseInt(hostport[1]);
             }
-            if (debug) System.out.printf("Server: (%s/%d)\n", hostport[0], port);
+            if (debug)
+                System.out.printf("Proxy: connecting to (%s/%d)\n", hostport[0], port);
             serverSocket = new Socket(hostport[0], port);
             serverOut = serverSocket.getOutputStream();
 
@@ -372,8 +394,9 @@
                     serverSocket.close();
                     clientSocket.close();
                 } catch (IOException e) {
-                    if (debug) {
-                        System.out.println (e);
+                    if (!closing && debug) {
+                        System.out.println("Proxy: " + e);
+                        e.printStackTrace();
                     }
                 }
             });
@@ -388,8 +411,8 @@
                     serverSocket.close();
                     clientSocket.close();
                 } catch (IOException e) {
-                    if (debug) {
-                        System.out.println(e);
+                    if (!closing && debug) {
+                        System.out.println("Proxy: " + e);
                         e.printStackTrace();
                     }
                 }
@@ -409,6 +432,11 @@
             clientOut.write("HTTP/1.1 200 OK\r\n\r\n".getBytes());
             proxyCommon();
         }
+
+        @Override
+        public String toString() {
+            return "Proxy connection " + id + ", client sock:" + clientSocket;
+        }
     }
 
     public static void main(String[] args) throws Exception {
--- a/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -35,6 +35,9 @@
 import java.net.http.HttpClient;
 import java.net.http.HttpRequest;
 import java.net.http.HttpResponse;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
 import jdk.test.lib.net.SimpleSSLContext;
 
 /**
@@ -60,6 +63,7 @@
     volatile String clientURL;
     volatile int port;
     final ServerSocket ss;
+    final List<Socket> acceptedList = new CopyOnWriteArrayList<>();
 
     UnknownBodyLengthTest(boolean useSSL) throws Exception {
         ctx = new SimpleSSLContext().get();
@@ -94,9 +98,16 @@
         fillBuf(BUF);
         try {
             while (!stopped) {
-                try (Socket s = ss.accept()) {
+                try {
+                    Socket s = ss.accept();
+                    acceptedList.add(s);
                     s.setTcpNoDelay(true);
-                    s.setSoLinger(true, 1);
+                    // if we use linger=1 we still see some
+                    // intermittent failures caused by IOException
+                    // "Connection reset by peer".
+                    // The client side is expecting EOF, but gets reset instead.
+                    // 30 is a 'magic' value that may need to be adjusted again.
+                    s.setSoLinger(true, 30);
                     System.out.println("Accepted: " + s.getRemoteSocketAddress());
                     System.out.println("Accepted: " + s);
                     OutputStream os = s.getOutputStream();
@@ -121,11 +132,13 @@
                         os.write(chdr.getBytes());
                     os.write("\r\n".getBytes());
                     os.write(BUF);
-                    if (is.available() > 0)
+                    if (is.available() > 0) {
+                        System.out.println("Draining input: " + s);
                         is.read(buf);
+                    }
                     os.flush();
-                    os.close();
                     s.shutdownOutput();
+                    System.out.println("Closed output: " + s);
                 } catch(Exception e) {
                     if (!stopped) {
                         System.out.println("Unexpected server exception: " + e);
@@ -136,7 +149,7 @@
         } catch(final Throwable t) {
             if (!stopped) t.printStackTrace();
         } finally {
-            try {stopped = true; ss.close(); } catch (Exception e) {}
+            stop();
         }
     }
 
@@ -182,5 +195,8 @@
     public void stop() {
         stopped = true;
         try { ss.close(); } catch (Throwable t) { }
+        for (Socket s : acceptedList) {
+            try { s.close(); } catch (Throwable t) { }
+        }
     }
 }
--- a/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/java/net/httpclient/websocket/WebSocketProxyTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -52,6 +52,7 @@
 import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import static java.net.http.HttpClient.newBuilder;
@@ -306,4 +307,9 @@
             }
         }
     }
+
+    @BeforeMethod
+    public void breakBetweenTests() {
+        System.out.println("\n-------\n");
+    }
 }
--- a/test/jdk/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java	Mon Feb 04 11:01:04 2019 +0530
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4404702
+ * @bug 4404702 8216528
  * @summary When the RMI runtime (lazily) spawns system threads that could
  * outlive the application context in which they were (happened to be)
  * created, such threads should not inherit (thread local) data specific to
@@ -106,7 +106,10 @@
              * context class loader-- by giving it a chance to pass away.
              */
             Thread.sleep(2000);
-            System.gc();
+            while (loaderRef.get() != null) {
+                System.gc();
+                Thread.sleep(100);
+            }
 
             System.err.println(
                 "waiting to be notified of loader being weakly reachable...");
--- a/test/jdk/java/util/Calendar/JapaneseEraNameTest.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/java/util/Calendar/JapaneseEraNameTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8202088 8207152
+ * @bug 8202088 8207152 8217609
  * @summary Test the localized Japanese new era name (May 1st. 2019-)
  *      is retrieved no matter CLDR provider contains the name or not.
  * @modules jdk.localedata
@@ -53,8 +53,8 @@
             // type,    locale,  name
             { LONG,     JAPAN,   "\u5143\u53f7" }, // NewEra
             { LONG,     US,      "NewEra" },
-            { SHORT,    JAPAN,   "N" },
-            { SHORT,    US,      "N" },
+            { SHORT,    JAPAN,   "\u5143\u53f7" },
+            { SHORT,    US,      "NewEra" },
         };
     }
 
--- a/test/jdk/java/util/prefs/ExportSubtree.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/java/util/prefs/ExportSubtree.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, 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
@@ -21,76 +21,74 @@
  * questions.
  */
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.prefs.Preferences;
 
-/* @test
- * @bug 6203576 4700020 7197662
+/**
+ * @test
+ * @bug 6203576 4700020 7197662 8217777
  * @summary checks if the output of exportSubtree() is identical to
  *          the output from previous release.
  * @run main/othervm -Djava.util.prefs.userRoot=. ExportSubtree
  */
-
-import java.io.*;
-import java.util.prefs.*;
+public class ExportSubtree {
+    private static final String LS = System.getProperty("line.separator");
 
-public class ExportSubtree {
-   public static void main(String[] args) throws Exception {
-      try
-      {
-          //File f = new File(System.getProperty("test.src", "."), "TestPrefs.xml");
-          ByteArrayInputStream bais = new ByteArrayInputStream(importPrefs.getBytes("utf-8"));
-          Preferences.importPreferences(bais);
-          ByteArrayOutputStream baos = new ByteArrayOutputStream();
-          Preferences.userRoot().node("testExportSubtree").exportSubtree(baos);
-          Preferences.userRoot().node("testExportSubtree").removeNode();
-          if (!expectedResult.equals(baos.toString())) {
-              //System.out.print(baos.toString());
-              //System.out.print(expectedResult);
-              throw new IOException("exportSubtree does not output expected result");
-          }
-      }
-      catch( Exception e ) {
-         e.printStackTrace();
-      }
-   }
+    private static final String IMPORT_PREFS =
+        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+        "<!DOCTYPE preferences SYSTEM \"http://java.sun.com/dtd/preferences.dtd\">" +
+        "<preferences EXTERNAL_XML_VERSION=\"1.0\">" +
+        "  <root type=\"user\">" +
+        "    <map>" +
+        "      <entry key=\"key1\" value=\"value1\"/>" +
+        "    </map>" +
+        "    <node name=\"testExportSubtree\">" +
+        "      <map>" +
+        "        <entry key=\"key2\" value=\"value2\"/>" +
+        "      </map>" +
+        "      <node name=\"test\">" +
+        "        <map>" +
+        "          <entry key=\"key3\" value=\"value3\"/>" +
+        "        </map>" +
+        "      </node>" +
+        "    </node>" +
+        "  </root>" +
+        "</preferences>";
 
-   static String ls = System.getProperty("line.separator");
-   static String importPrefs =
-       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-        + "<!DOCTYPE preferences SYSTEM \"http://java.sun.com/dtd/preferences.dtd\">"
-        + "<preferences EXTERNAL_XML_VERSION=\"1.0\">"
-        + "  <root type=\"user\">"
-        + "    <map>"
-        + "      <entry key=\"key1\" value=\"value1\"/>"
-        + "    </map>"
-        + "    <node name=\"testExportSubtree\">"
-        + "      <map>"
-        + "        <entry key=\"key2\" value=\"value2\"/>"
-        + "      </map>"
-        + "      <node name=\"test\">"
-        + "        <map>"
-        + "          <entry key=\"key3\" value=\"value3\"/>"
-        + "        </map>"
-        + "      </node>"
-        + "    </node>"
-        + "  </root>"
-        + "</preferences>";
+    private static final String EXPECTED_RESULT =
+        "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + LS +
+        "<!DOCTYPE preferences SYSTEM \"http://java.sun.com/dtd/preferences.dtd\">" + LS +
+        "<preferences EXTERNAL_XML_VERSION=\"1.0\">" + LS +
+        "  <root type=\"user\">" + LS +
+        "    <map/>" + LS +
+        "    <node name=\"testExportSubtree\">" + LS +
+        "      <map>" + LS +
+        "        <entry key=\"key2\" value=\"value2\"/>" + LS +
+        "      </map>" + LS +
+        "      <node name=\"test\">" + LS +
+        "        <map>" + LS +
+        "          <entry key=\"key3\" value=\"value3\"/>" + LS +
+        "        </map>" + LS +
+        "      </node>" + LS +
+        "    </node>" + LS +
+        "  </root>" + LS +
+        "</preferences>" + LS;
 
-   static String expectedResult =
-       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-        + ls    +  "<!DOCTYPE preferences SYSTEM \"http://java.sun.com/dtd/preferences.dtd\">"
-        + ls    +  "<preferences EXTERNAL_XML_VERSION=\"1.0\">"
-        + ls    +  "  <root type=\"user\">"
-        + ls    +  "    <map/>"
-        + ls    +  "    <node name=\"testExportSubtree\">"
-        + ls    +  "      <map>"
-        + ls    +  "        <entry key=\"key2\" value=\"value2\"/>"
-        + ls    +  "      </map>"
-        + ls    +  "      <node name=\"test\">"
-        + ls    +  "        <map>"
-        + ls    +  "          <entry key=\"key3\" value=\"value3\"/>"
-        + ls    +  "        </map>"
-        + ls    +  "      </node>"
-        + ls    +  "    </node>"
-        + ls    +  "  </root>"
-        + ls    +  "</preferences>"     + ls;
+    public static void main(String[] args) throws Exception {
+        ByteArrayInputStream bais = new ByteArrayInputStream(IMPORT_PREFS.getBytes("utf-8"));
+        Preferences.importPreferences(bais);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        Preferences.userRoot().node("testExportSubtree").exportSubtree(baos);
+        Preferences.userRoot().node("testExportSubtree").removeNode();
+        if (!EXPECTED_RESULT.equals(baos.toString())) {
+            String errMsg = "Preferences::exportSubtree did not yield the expected result.";
+            System.out.println(errMsg + LS +
+                               "Actual:" + LS +
+                               baos + LS +
+                               "Expected:" + LS +
+                               EXPECTED_RESULT);
+            throw new RuntimeException(errMsg);
+        }
+    }
 }
--- a/test/jdk/javax/net/ssl/sanity/ciphersuites/CheckCipherSuites.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/javax/net/ssl/sanity/ciphersuites/CheckCipherSuites.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -23,221 +23,180 @@
 
 /*
  * @test
- * @bug 4750141 4895631
+ * @bug 4750141 4895631 8217579
  * @summary Check enabled and supported ciphersuites are correct
- * @ignore JSSE supported cipher suites are changed with CR 6916074,
- *     need to update this test case in JDK 7 soon
+ * @run main CheckCipherSuites default
+ * @run main/othervm CheckCipherSuites limited
  */
 
 import java.util.*;
-
+import java.security.Security;
 import javax.net.ssl.*;
 
-import javax.crypto.Cipher;
-import javax.crypto.spec.*;
-
 public class CheckCipherSuites {
 
+    // List of enabled cipher suites when the "crypto.policy" security
+    // property is set to "unlimited" (the default value).
     private final static String[] ENABLED_DEFAULT = {
-        "SSL_RSA_WITH_RC4_128_MD5",
-        "SSL_RSA_WITH_RC4_128_SHA",
+        "TLS_AES_128_GCM_SHA256",
+        "TLS_AES_256_GCM_SHA384",
+        "TLS_CHACHA20_POLY1305_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
+        "TLS_RSA_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
+        "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",
+        "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
+        "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
+        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
+        "TLS_RSA_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
+        "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
+        "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
         "TLS_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
         "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
         "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
-        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
-        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
         "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
         "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
-        "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
-        "SSL_RSA_WITH_DES_CBC_SHA",
-        "SSL_DHE_RSA_WITH_DES_CBC_SHA",
-        "SSL_DHE_DSS_WITH_DES_CBC_SHA",
-        "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
-        "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
-        "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
-        "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
-        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
-
+        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV"
     };
 
-    private final static String[] ENABLED_UNLIMITED = {
-        "SSL_RSA_WITH_RC4_128_MD5",
-        "SSL_RSA_WITH_RC4_128_SHA",
-        "TLS_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_RSA_WITH_AES_256_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
-        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
-        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+    // List of enabled cipher suites when the "crypto.policy" security
+    // property is set to "limited".
+    private final static String[] ENABLED_LIMITED = {
+        "TLS_AES_128_GCM_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
         "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
         "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
-        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
-        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
-        "TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
-        "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
-        "SSL_RSA_WITH_DES_CBC_SHA",
-        "SSL_DHE_RSA_WITH_DES_CBC_SHA",
-        "SSL_DHE_DSS_WITH_DES_CBC_SHA",
-        "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
-        "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
-        "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
-        "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
-        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
-
-    };
-
-    // supported ciphersuites using default JCE policy jurisdiction files
-    // AES/256 unavailable
-    private final static String[] SUPPORTED_DEFAULT = {
-        "SSL_RSA_WITH_RC4_128_MD5",
-        "SSL_RSA_WITH_RC4_128_SHA",
         "TLS_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
         "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
         "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
-        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
-        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
         "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
         "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
-        "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
-        "SSL_RSA_WITH_DES_CBC_SHA",
-        "SSL_DHE_RSA_WITH_DES_CBC_SHA",
-        "SSL_DHE_DSS_WITH_DES_CBC_SHA",
-        "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
-        "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
-        "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
-        "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
-        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
-
-        "SSL_RSA_WITH_NULL_MD5",
-        "SSL_RSA_WITH_NULL_SHA",
-        "TLS_ECDH_ECDSA_WITH_NULL_SHA",
-        "TLS_ECDH_RSA_WITH_NULL_SHA",
-        "TLS_ECDHE_ECDSA_WITH_NULL_SHA",
-        "TLS_ECDHE_RSA_WITH_NULL_SHA",
-        "SSL_DH_anon_WITH_RC4_128_MD5",
-        "TLS_DH_anon_WITH_AES_128_CBC_SHA",
-        "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DH_anon_WITH_DES_CBC_SHA",
-        "TLS_ECDH_anon_WITH_RC4_128_SHA",
-        "TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
-        "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
-        "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
-        "TLS_ECDH_anon_WITH_NULL_SHA",
-        "TLS_KRB5_WITH_RC4_128_SHA",
-        "TLS_KRB5_WITH_RC4_128_MD5",
-        "TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
-        "TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
-        "TLS_KRB5_WITH_DES_CBC_SHA",
-        "TLS_KRB5_WITH_DES_CBC_MD5",
-        "TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
-        "TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
-        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
-        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
-
+        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV"
     };
 
-    // supported ciphersuites using unlimited JCE policy jurisdiction files
-    // AES/256 available
-    private final static String[] SUPPORTED_UNLIMITED = {
-        "SSL_RSA_WITH_RC4_128_MD5",
-        "SSL_RSA_WITH_RC4_128_SHA",
-        "TLS_RSA_WITH_AES_128_CBC_SHA",
+    // List of supported cipher suites when the "crypto.policy" security
+    // property is set to "unlimited" (the default value).
+    private final static String[] SUPPORTED_DEFAULT = {
+        "TLS_AES_128_GCM_SHA256",
+        "TLS_AES_256_GCM_SHA384",
+        "TLS_CHACHA20_POLY1305_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
+        "TLS_RSA_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
+        "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",
+        "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
+        "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384",
+        "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
+        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
+        "TLS_RSA_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
+        "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
+        "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
         "TLS_RSA_WITH_AES_256_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
-        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
         "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
-        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
         "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
-        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
-        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
-        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
         "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
-        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
         "TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
-        "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
-        "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
-        "SSL_RSA_WITH_DES_CBC_SHA",
-        "SSL_DHE_RSA_WITH_DES_CBC_SHA",
-        "SSL_DHE_DSS_WITH_DES_CBC_SHA",
-        "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
-        "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
-        "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
-        "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
-        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
+        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV"
+    };
 
-        "SSL_RSA_WITH_NULL_MD5",
-        "SSL_RSA_WITH_NULL_SHA",
-        "TLS_ECDH_ECDSA_WITH_NULL_SHA",
-        "TLS_ECDH_RSA_WITH_NULL_SHA",
-        "TLS_ECDHE_ECDSA_WITH_NULL_SHA",
-        "TLS_ECDHE_RSA_WITH_NULL_SHA",
-        "SSL_DH_anon_WITH_RC4_128_MD5",
-        "TLS_DH_anon_WITH_AES_128_CBC_SHA",
-        "TLS_DH_anon_WITH_AES_256_CBC_SHA",
-        "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DH_anon_WITH_DES_CBC_SHA",
-        "TLS_ECDH_anon_WITH_RC4_128_SHA",
-        "TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
-        "TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
-        "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
-        "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
-        "TLS_ECDH_anon_WITH_NULL_SHA",
-        "TLS_KRB5_WITH_RC4_128_SHA",
-        "TLS_KRB5_WITH_RC4_128_MD5",
-        "TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
-        "TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
-        "TLS_KRB5_WITH_DES_CBC_SHA",
-        "TLS_KRB5_WITH_DES_CBC_MD5",
-        "TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
-        "TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
-        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
-        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
-
+    // List of supported cipher suites when the "crypto.policy" security
+    // property is set to "limited".
+    private final static String[] SUPPORTED_LIMITED = {
+        "TLS_AES_128_GCM_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
+        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV"
     };
 
     private static void showSuites(String[] suites) {
@@ -252,19 +211,21 @@
     public static void main(String[] args) throws Exception {
         long start = System.currentTimeMillis();
 
+        if (args.length != 1) {
+            throw new Exception("One arg required");
+        }
+
         String[] ENABLED;
         String[] SUPPORTED;
-        try {
-            Cipher c = Cipher.getInstance("AES/CBC/NoPadding");
-            SecretKeySpec key = new SecretKeySpec(new byte[32], "AES");
-            c.init(Cipher.ENCRYPT_MODE, key);
-            System.out.println("AES/256 is available");
-            ENABLED = ENABLED_UNLIMITED;
-            SUPPORTED = SUPPORTED_UNLIMITED;
-        } catch (Exception e) {
-            System.out.println("AES/256 is NOT available (" + e + ")");
+        if (args[0].equals("default")) {
             ENABLED = ENABLED_DEFAULT;
             SUPPORTED = SUPPORTED_DEFAULT;
+        } else if (args[0].equals("limited")) {
+            Security.setProperty("crypto.policy", "limited");
+            ENABLED = ENABLED_LIMITED;
+            SUPPORTED = SUPPORTED_LIMITED;
+        } else {
+            throw new Exception("Illegal argument");
         }
 
         SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
--- a/test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -90,7 +90,6 @@
         Set<String> allPhases = of(
             "ExtRootScan",
             "ThreadRoots",
-            "StringTableRoots",
             "UniverseRoots",
             "JNIRoots",
             "ObjectSynchronizerRoots",
--- a/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java	Mon Feb 04 11:01:04 2019 +0530
@@ -61,10 +61,9 @@
              new TestVMCrash(),
              new TestUnhandledException(),
              new TestRuntimeHalt(),
-             // exclude until JDK-8217744 is fixed
-             // new TestSig("TERM"),
-             // new TestSig("HUP"),
-             // new TestSig("INT")
+             new TestSig("TERM"),
+             new TestSig("HUP"),
+             new TestSig("INT")
     };
 
     public static void main(String[] args) throws Throwable {
@@ -87,7 +86,8 @@
                                 String.valueOf(subTestIndex));
         OutputAnalyzer output = ProcessTools.executeProcess(pb);
         System.out.println(output.getOutput());
-        System.out.println("Exit code: " + output.getExitValue());
+        int exitCode = output.getExitValue();
+        System.out.println("Exit code: " + exitCode);
 
         String recordingName = output.firstMatch("emergency jfr file: (.*.jfr)", 1);
         if (recordingName == null) {
@@ -102,7 +102,7 @@
 
         Asserts.assertEquals(filteredEvents.size(), 1);
         RecordedEvent event = filteredEvents.get(0);
-        subTests[subTestIndex].verifyEvents(event);
+        subTests[subTestIndex].verifyEvents(event, exitCode);
     }
 
     @SuppressWarnings("unused")
@@ -119,7 +119,7 @@
             return true;
         }
         void runTest();
-        void verifyEvents(RecordedEvent event);
+        void verifyEvents(RecordedEvent event, int exitCode);
     }
 
     // Basic stack trace validation, checking that the runTest method is part of the stack
@@ -139,7 +139,7 @@
         }
 
         @Override
-        public void verifyEvents(RecordedEvent event) {
+        public void verifyEvents(RecordedEvent event, int exitCode) {
             Events.assertField(event, "reason").equal("No remaining non-daemon Java threads");
         }
     }
@@ -152,7 +152,7 @@
         }
 
         @Override
-        public void verifyEvents(RecordedEvent event) {
+        public void verifyEvents(RecordedEvent event, int exitCode) {
             Events.assertField(event, "reason").equal("Shutdown requested from Java");
             validateStackTrace(event.getStackTrace());
         }
@@ -167,7 +167,7 @@
         }
 
         @Override
-        public void verifyEvents(RecordedEvent event) {
+        public void verifyEvents(RecordedEvent event, int exitCode) {
             Events.assertField(event, "reason").equal("VM Error");
             validateStackTrace(event.getStackTrace());
         }
@@ -180,7 +180,7 @@
         }
 
         @Override
-        public void verifyEvents(RecordedEvent event) {
+        public void verifyEvents(RecordedEvent event, int exitCode) {
             Events.assertField(event, "reason").equal("No remaining non-daemon Java threads");
         }
     }
@@ -193,7 +193,7 @@
         }
 
         @Override
-        public void verifyEvents(RecordedEvent event) {
+        public void verifyEvents(RecordedEvent event, int exitCode) {
             Events.assertField(event, "reason").equal("Shutdown requested from Java");
             validateStackTrace(event.getStackTrace());
         }
@@ -229,11 +229,15 @@
             } catch (IOException e) {
                 e.printStackTrace();
             }
-            Asserts.fail("Process survived the SIG" + signalName + " signal!");
+            System.out.println("Process survived the SIG" + signalName + " signal!");
         }
 
         @Override
-        public void verifyEvents(RecordedEvent event) {
+        public void verifyEvents(RecordedEvent event, int exitCode) {
+            if (exitCode == 0) {
+                System.out.println("Process exited normally with exit code 0, skipping the verification");
+                return;
+            }
             Events.assertField(event, "reason").equal("Shutdown requested from Java");
             Events.assertEventThread(event);
             Asserts.assertEquals(event.getThread().getJavaName(), "SIG" + signalName + " handler");
--- a/test/jdk/sun/net/www/protocol/http/ProtocolRedirect.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jdk/sun/net/www/protocol/http/ProtocolRedirect.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -31,24 +31,30 @@
 
 public class ProtocolRedirect {
     public static void main(String [] args) throws Exception {
-        int localPort;
-        new Thread(new Redirect()).start();
-        while ((localPort = Redirect.listenPort) == -1) {
-            Thread.sleep(1000);
-        }
+        try (Redirect server = new Redirect(new ServerSocket())) {
+            ServerSocket ss = server.ssock;
+            ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
+            new Thread(server).start();
 
-        String page = "http://localhost:"+localPort+"/";
-        URL url = new URL(page);
-        HttpURLConnection conn = (HttpURLConnection)url.openConnection();
-        conn.connect();
-        if (conn.getResponseCode() != 302) {
-            throw new RuntimeException("Test failed. Should get RespCode: 302. Got:"+conn.getResponseCode());
+            URL url = new URL("http", ss.getInetAddress().getHostAddress(), ss.getLocalPort(), "/");
+            String page = url.toString();
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            conn.connect();
+            if (conn.getResponseCode() != 302) {
+                System.err.println("Bad response code received from: " + page);
+                throw new RuntimeException("Test failed. Should get RespCode: 302. Got:" + conn.getResponseCode());
+            }
+            System.out.println("Received expected response code from: " + page);
         }
     }
 }
 
-class Redirect implements Runnable {
-    public static int listenPort = -1; // port to listen for connections on
+class Redirect implements Runnable, Closeable {
+    final ServerSocket ssock;
+    volatile boolean stopped;
+    Redirect(ServerSocket ss) {
+        ssock = ss;
+    }
 
     // Send a header redirect to the peer telling it to go to the
     // https server on the host it sent the connection request to.
@@ -61,18 +67,31 @@
         out.write(reply.toString().getBytes());
     }
 
-    Socket sock;
+    volatile Socket sock;
     public void run() {
         try {
-            ServerSocket ssock = new ServerSocket();
-            ssock.bind(null);
-            listenPort = ssock.getLocalPort();
-            sock = ssock.accept();
-            sock.setTcpNoDelay(true);
+            Socket s = sock = ssock.accept();
+            s.setTcpNoDelay(true);
             sendReply();
-            sock.shutdownOutput();
-        } catch(IOException io) {
-            throw new RuntimeException(io.getCause());
+            s.shutdownOutput();
+        } catch(Throwable t) {
+            if (!stopped) {
+                t.printStackTrace();
+                throw new RuntimeException(String.valueOf(t), t);
+            }
+        }
+    }
+
+    public void close() {
+        Socket s = sock;
+        boolean done = stopped;
+        if (done) return;
+        stopped = true;
+        try {
+            if (s != null) s.close();
+        } catch (Throwable x) {
+        } finally {
+            try { ssock.close(); } catch (Throwable x) {}
         }
     }
 
--- a/test/jtreg-ext/requires/VMProps.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/jtreg-ext/requires/VMProps.java	Mon Feb 04 11:01:04 2019 +0530
@@ -97,6 +97,7 @@
         map.put("vm.compiler2.enabled", isCompiler2Enabled());
         map.put("docker.support", dockerSupport());
         map.put("release.implementor", implementor());
+        map.put("test.vm.gc.nvdimm", isNvdimmTestEnabled());
         vmGC(map); // vm.gc.X = true/false
         vmOptFinalFlags(map);
 
@@ -469,6 +470,15 @@
         return null;
     }
 
+    private String isNvdimmTestEnabled() {
+        String isEnbled = System.getenv("TEST_VM_GC_NVDIMM");
+        if (isEnbled != null && isEnbled.toLowerCase().equals("true")) {
+            return "true";
+        }
+        return "false";
+    }
+
+
 
     /**
      * Dumps the map to the file if the file name is given as the property.
--- a/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,22 +63,4 @@
                 + "<!--   -->\n"
                 + "</a>");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "p1", "p2");
-        checkExit(Exit.OK);
-
-        // Testing only for the presence of <a name>
-        checkOutput("p1/C1.html", true,
-                "<a name=\"skip.navbar.top\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<a name=\"skip.navbar.bottom\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -55,17 +55,6 @@
         checkSummary(false);
     }
 
-    @Test
-    public void testAccessSummary_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "--frames",
-                "-sourcepath", testSrc,
-                "p1", "p2");
-        checkExit(Exit.OK);
-        checkSummary(true);
-    }
-
     void checkSummary(boolean found) {
         checkOutput("overview-summary.html", found,
                  "summary=\"Package Summary table, listing packages, and an explanation\"");
--- a/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -78,36 +78,6 @@
         checkMeta("dc.created", false);
     }
 
-    @Test
-    public void testStandard_html4() {
-        javadoc("-d", "out-1-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-keywords",
-                "--frames",
-                "-doctitle", "Sample Packages",
-                "p1", "p2");
-
-        checkExit(Exit.OK);
-
-        checkMeta("date", true);
-    }
-
-    @Test
-    public void testNoTimestamp_html4() {
-        javadoc("-d", "out-2-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-notimestamp",
-                "--frames",
-                "-doctitle", "Sample Packages",
-                "p1", "p2");
-        checkExit(Exit.OK);
-
-        // No keywords when -keywords is not used.
-        checkMeta("date", false);
-    }
-
     void checkMeta(String metaNameDate, boolean found) {
         checkOutput("p1/C1.html", found,
                 "<meta name=\"keywords\" content=\"p1.C1 class\">",
--- a/test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -67,24 +67,6 @@
         checkValidHTML(HTML5);
     }
 
-    @Test
-    public void test_html4() {
-        // Test for all cases except the split index page
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-doctitle", "Document Title",
-                "-windowtitle", "Window Title",
-                "-use",
-                "--frames",
-                "-overview", testSrc("overview.html"),
-                "-sourcepath", testSrc,
-                "p1", "p2");
-        checkExit(Exit.OK);
-        String HTML4 = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
-
-        checkValidHTML(HTML4);
-}
-
     void checkValidHTML(String doctype) {
         // Test the proper DOCTYPE element are present:
         checkOutput("index.html", true, doctype);
--- a/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,127 +52,6 @@
     }
 
     @Test
-    public void testHtml4(Path ignore) {
-        setAutomaticCheckLinks(false); // @ignore JDK-8202622
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-source", "8", //so that '_' can be used as an identifier
-                "-use",
-                "pkg1");
-        setAutomaticCheckLinks(true); // @ignore JDK-8202622
-        checkExit(Exit.OK);
-
-        // Test some section markers and links to these markers
-        checkOutput("pkg1/RegClass.html", true,
-                "<a name=\"skip.navbar.top\">",
-                "<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">",
-                "<a name=\"nested.class.summary\">",
-                "<a href=\"#nested.class.summary\">",
-                "<a name=\"method.summary\">",
-                "<a href=\"#method.summary\">",
-                "<a name=\"field.detail\">",
-                "<a href=\"#field.detail\">",
-                "<a name=\"constructor.detail\">",
-                "<a href=\"#constructor.detail\">");
-
-        // Test some members and link to these members
-        checkOutput("pkg1/RegClass.html", true,
-                //The marker for this appears in the serialized-form.html which we will
-                //test below
-                "<a href=\"../serialized-form.html#pkg1.RegClass\">");
-
-        // Test some fields
-        checkOutput("pkg1/RegClass.html", true,
-                "<a name=\"Z:Z_\">",
-                "<a href=\"#Z:Z_\">",
-                "<a name=\"Z:Z_:D\">",
-                "<a href=\"#Z:Z_:D\">",
-                "<a name=\"Z:Z:D_\">",
-                "<a href=\"#Z:Z:D_\">",
-                "<a name=\"Z:Z:Dfield\">",
-                "<a href=\"#Z:Z:Dfield\">",
-                "<a name=\"fieldInCla:D:D\">",
-                "<a href=\"#fieldInCla:D:D\">",
-                "<a name=\"S_:D:D:D:D:DINT\">",
-                "<a href=\"#S_:D:D:D:D:DINT\">",
-                "<a name=\"method:D:D\">",
-                "<a href=\"#method:D:D\">");
-
-        checkOutput("pkg1/DeprMemClass.html", true,
-                "<a name=\"Z:Z_field_In_Class\">",
-                "<a href=\"#Z:Z_field_In_Class\">");
-
-        // Test constructor
-        checkOutput("pkg1/RegClass.html", true,
-                "<a name=\"RegClass-java.lang.String-int-\">",
-                "<a href=\"#RegClass-java.lang.String-int-\">");
-
-        // Test some methods
-        checkOutput("pkg1/RegClass.html", true,
-                "<a name=\"Z:Z_methodInClass-java.lang.String-\">",
-                "<a href=\"#Z:Z_methodInClass-java.lang.String-\">",
-                "<a name=\"method--\">",
-                "<a href=\"#method--\">",
-                "<a name=\"foo-java.util.Map-\">",
-                "<a href=\"#foo-java.util.Map-\">",
-                "<a name=\"methodInCla:Ds-java.lang.String:A-\">",
-                "<a href=\"#methodInCla:Ds-java.lang.String:A-\">",
-                "<a name=\"Z:Z_methodInClas:D-java.lang.String-int-\">",
-                "<a href=\"#Z:Z_methodInClas:D-java.lang.String-int-\">",
-                "<a name=\"methodD-pkg1.RegClass.:DA-\">",
-                "<a href=\"#methodD-pkg1.RegClass.:DA-\">",
-                "<a name=\"methodD-pkg1.RegClass.D:A-\">",
-                "<a href=\"#methodD-pkg1.RegClass.D:A-\">");
-
-        checkOutput("pkg1/DeprMemClass.html", true,
-                "<a name=\"Z:Z:Dmethod_In_Class--\">",
-                "<a href=\"#Z:Z:Dmethod_In_Class--\">");
-
-        // Test enum
-        checkOutput("pkg1/RegClass.Te$t_Enum.html", true,
-                "<a name=\"Z:Z:DFLD2\">",
-                "<a href=\"#Z:Z:DFLD2\">");
-
-        // Test nested class
-        checkOutput("pkg1/RegClass._NestedClas$.html", true,
-                "<a name=\"Z:Z_NestedClas:D--\">",
-                "<a href=\"#Z:Z_NestedClas:D--\">");
-
-        // Test class use page
-        checkOutput("pkg1/class-use/DeprMemClass.html", true,
-                "<a href=\"../RegClass.html#d____mc\">");
-
-        // Test deprecated list page
-        checkOutput("deprecated-list.html", true,
-                "<a href=\"pkg1/DeprMemClass.html#Z:Z_field_In_Class\">",
-                "<a href=\"pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">");
-
-        // Test constant values page
-        checkOutput("constant-values.html", true,
-                "<a href=\"pkg1/RegClass.html#S_:D:D:D:D:DINT\">");
-
-        // Test serialized form page
-        checkOutput("serialized-form.html", true,
-                //This is the marker for the link that appears in the pkg1.RegClass.html page
-                "<a name=\"pkg1.RegClass\">");
-
-        // Test member name index page
-        checkOutput("index-all.html", true,
-                "<a name=\"I:Z:Z:D\">",
-                "<a href=\"#I:Z:Z:D\">$",
-                "<a href=\"#I:Z:Z_\">_");
-
-        // The marker name conversion should only affect HTML anchors. It should not
-        // affect the labels.
-        checkOutput("pkg1/RegClass.html", false,
-                " Z:Z_",
-                " Z:Z:Dfield",
-                " Z:Z_field_In_Class",
-                " S_:D:D:D:D:DINT");
-    }
-
-    @Test
     public void testHtml5(Path ignore) {
         javadoc("-d", "out-html5",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -52,16 +52,4 @@
         checkOutput("pkg/AnnotationOptional.html", true,
             "<a id=\"annotation.type.element.detail\">");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/AnnotationOptional.html", true,
-            "<a name=\"annotation.type.element.detail\">");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -117,16 +117,4 @@
                 "public @interface <a href=\"../src-html/pkg/AnnotationTypeField.html#line.31"
                 + "\">AnnotationTypeField</a></pre>");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-        checkOutput("pkg/AnnotationType.html", true,
-                "<li class=\"blockList\"><a name=\"annotation.type.element.detail\">",
-                "<a name=\"value--\">");
 }
-}
--- a/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -83,20 +83,4 @@
                 "The code being documented uses modules but the packages defined"
                 + " in http://docs.oracle.com/javase/8/docs/api/ are in the unnamed module");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-source", "8",
-                "-html4",
-                "-Xdoclint:none",
-                "-sourcepath", testSrc,
-                "-linkoffline", uri, testSrc,
-                testSrc("C.java"));
-        checkExit(Exit.OK);
-
-        checkOutput("C.html", true,
-                "<a href=\"" + uri + "java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" "
-                + "title=\"class or interface in java.math\" class=\"externalLink\"><code>Link to external member gcd</code></a>");
 }
-}
--- a/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,25 +85,4 @@
         checkOutput("p/IT2.html", true,
                 "code><a href=\"C3.html\" title=\"class in p\">C3</a></code>");
     }
-
-    @Test
-    public void test_html4() {
-
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-Xdoclint:none",
-                "-sourcepath", testSrc,
-                "-package",
-                "p");
-        checkExit(Exit.OK);
-
-        checkOutput("p/C1.html", true,
-                "<code><span class=\"memberNameLink\"><a href=\"#C1--\">C1</a></span>()</code>");
-
-        checkOutput("p/C2.html", true,
-                "<code><span class=\"memberNameLink\"><a href=\"#C2--\">C2</a></span>()</code>");
-
-        checkOutput("p/C3.html", true,
-                "<code><span class=\"memberNameLink\"><a href=\"#C3--\">C3</a></span>()</code>");
 }
-}
--- a/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,56 +90,4 @@
                 "<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner()\"><code>Outer.Inner.NestedInner()</code></a>",
                 "<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner(int)\"><code>Outer.Inner.NestedInner(int)</code></a>");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg1");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg1/Outer.html", true,
-                "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n"
-                + "<a href=\"Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, \n"
-                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner--\"><code>NestedInner()</code></a>, \n"
-                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner-int-\"><code>NestedInner(int)</code></a>, \n"
-                + "<a href=\"#Outer--\"><code>Outer()</code></a>, \n"
-                + "<a href=\"#Outer-int-\"><code>Outer(int)</code></a>",
-                "Link: <a href=\"Outer.Inner.html#Inner--\"><code>Inner()</code></a>, "
-                + "<a href=\"#Outer-int-\"><code>Outer(int)</code></a>, "
-                + "<a href=\"Outer.Inner.NestedInner.html#NestedInner-int-\"><code>"
-                + "NestedInner(int)</code></a>",
-                "<a href=\"#Outer--\">Outer</a></span>()",
-                "<a name=\"Outer--\">",
-                "<a href=\"#Outer-int-\">Outer</a></span>&#8203;(int&nbsp;i)",
-                "<a name=\"Outer-int-\">");
-
-        checkOutput("pkg1/Outer.Inner.html", true,
-                "<a href=\"#Inner--\">Inner</a></span>()",
-                "<a name=\"Inner--\">",
-                "<a href=\"#Inner-int-\">Inner</a></span>&#8203;(int&nbsp;i)",
-                "<a name=\"Inner-int-\">");
-
-        checkOutput("pkg1/Outer.Inner.NestedInner.html", true,
-                "<a href=\"#NestedInner--\">NestedInner</a></span>()",
-                "<a name=\"NestedInner--\">",
-                "<a href=\"#NestedInner-int-\">NestedInner</a></span>&#8203;(int&nbsp;i)",
-                "<a name=\"NestedInner-int-\">");
-
-        checkOutput("pkg1/Outer.Inner.html", false,
-                "Outer.Inner--",
-                "Outer.Inner-int-");
-
-        checkOutput("pkg1/Outer.Inner.NestedInner.html", false,
-                "Outer.Inner.NestedInner--",
-                "Outer.Inner.NestedInner-int-");
-
-        checkOutput("pkg1/Outer.html", false,
-                "<a href=\"Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>",
-                "<a href=\"Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>",
-                "<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>",
-                "<a href=\"Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -299,102 +299,4 @@
                 + "</table>\n"
                 + "</div>");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("deprecated-list.html", true,
-                "<a name=\"forRemoval\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"For Removal table, listing for removal, and an explanation\">\n"
-                + "<caption><span>For Removal</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Element</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Enums table, listing enums, and an explanation\">\n"
-                + "<caption><span>Enums</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Enum</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>\n"
-                + "<tbody>\n"
-                + "<tr class=\"altColor\">\n"
-                + "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestEnum.html\" title=\"enum in pkg\">pkg.TestEnum</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"deprecationComment\">enum_test1 passes.</div>\n"
-                + "</td>\n"
-                + "</tr>\n"
-                + "</tbody>\n"
-                + "</table>\n"
-                + "</div>",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Exceptions table, listing exceptions, and an explanation\">\n"
-                + "<caption><span>Exceptions</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Exceptions</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>\n"
-                + "<tbody>\n"
-                + "<tr class=\"altColor\">\n"
-                + "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestException.html\" title=\"class in pkg\">pkg.TestException</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"deprecationComment\">exception_test1 passes.</div>\n"
-                + "</td>\n"
-                + "</tr>\n"
-                + "</tbody>\n"
-                + "</table>\n"
-                + "</div>",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Fields table, listing fields, and an explanation\">\n"
-                + "<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Field</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>\n"
-                + "<tbody>\n"
-                + "<tr class=\"altColor\">\n"
-                + "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/DeprecatedClassByAnnotation.html#field\">pkg.DeprecatedClassByAnnotation.field</a></th>\n"
-                + "<td class=\"colLast\"></td>\n"
-                + "</tr>\n"
-                + "<tr class=\"rowColor\">\n"
-                + "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestAnnotationType.html#field\">pkg.TestAnnotationType.field</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"deprecationComment\">annotation_test4 passes.</div>\n"
-                + "</td>\n"
-                + "</tr>\n"
-                + "<tr class=\"altColor\">\n"
-                + "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestClass.html#field\">pkg.TestClass.field</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"deprecationComment\">class_test2 passes. This is the second sentence of deprecated description for a field.</div>\n"
-                + "</td>\n"
-                + "</tr>\n"
-                + "<tr class=\"rowColor\">\n"
-                + "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestError.html#field\">pkg.TestError.field</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"deprecationComment\">error_test2 passes.</div>\n"
-                + "</td>\n"
-                + "</tr>\n"
-                + "<tr class=\"altColor\">\n"
-                + "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestException.html#field\">pkg.TestException.field</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"deprecationComment\">exception_test2 passes.</div>\n"
-                + "</td>\n"
-                + "</tr>\n"
-                + "<tr class=\"rowColor\">\n"
-                + "<th class=\"colDeprecatedItemName\" scope=\"row\"><a href=\"pkg/TestInterface.html#field\">pkg.TestInterface.field</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"deprecationComment\">interface_test2 passes.</div>\n"
-                + "</td>\n"
-                + "</tr>\n"
-                + "</tbody>\n"
-                + "</table>\n"
-                + "</div>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,28 +66,4 @@
                 + "title=\"class or interface in java.io\" class=\"externalLink\">DataInput</a></code></dd>"
         );
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-source", "8",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-linkoffline", uri, testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/XReader.html", true,
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"" + uri + "/java/io/FilterReader.html?is-external=true#read--\" "
-                + "title=\"class or interface in java.io\" class=\"externalLink\">read</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"" + uri + "/java/io/FilterReader.html?is-external=true\" "
-                + "title=\"class or interface in java.io\" class=\"externalLink\">FilterReader</a></code></dd>",
-                "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"" + uri + "/java/io/DataInput.html?is-external=true#readInt--\" "
-                + "title=\"class or interface in java.io\" class=\"externalLink\">readInt</a></code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"" + uri + "/java/io/DataInput.html?is-external=true\" "
-                + "title=\"class or interface in java.io\" class=\"externalLink\">DataInput</a></code></dd>"
-        );
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -111,7 +111,6 @@
     }
 
     enum HtmlKind {
-        HTML4("-html4"),
         HTML5("-html5");
         HtmlKind(String... opts) {
             this.opts = Arrays.asList(opts);
@@ -126,18 +125,16 @@
             if (a != null) {
                 for (FrameKind fk : FrameKind.values()) {
                     for (OverviewKind ok : OverviewKind.values()) {
-                        for (HtmlKind hk : HtmlKind.values()) {
-                            try {
-                                out.println("Running test " + m.getName() + " " + fk + " " + ok + " " + hk);
-                                Path base = Paths.get(m.getName() + "_" + fk + "_" + ok + "_" + hk);
-                                Files.createDirectories(base);
-                                m.invoke(this, new Object[]{base, fk, ok, hk});
-                            } catch (InvocationTargetException e) {
-                                Throwable cause = e.getCause();
-                                throw (cause instanceof Exception) ? ((Exception) cause) : e;
-                            }
-                            out.println();
+                        try {
+                            out.println("Running test " + m.getName() + " " + fk + " " + ok);
+                            Path base = Paths.get(m.getName() + "_" + fk + "_" + ok);
+                            Files.createDirectories(base);
+                            m.invoke(this, new Object[]{base, fk, ok});
+                        } catch (InvocationTargetException e) {
+                            Throwable cause = e.getCause();
+                            throw (cause instanceof Exception) ? ((Exception)cause) : e;
                         }
+                        out.println();
                     }
                 }
             }
@@ -145,58 +142,56 @@
         printSummary();
     }
 
-    void javadoc(Path outDir, FrameKind fKind, OverviewKind oKind, HtmlKind hKind, String... rest) {
+    void javadoc(Path outDir, FrameKind fKind, OverviewKind oKind, String... rest) {
         List<String> args = new ArrayList<>();
         args.add("-d");
         args.add(outDir.toString());
         args.addAll(fKind.opts);
         args.addAll(oKind.opts);
-        args.addAll(hKind.opts);
         args.addAll(Arrays.asList(rest));
         javadoc(args.toArray(new String[0]));
         checkExit(Exit.OK);
     }
 
     @Test
-    public void testClass(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws Exception {
-        javadoc(base, fKind, oKind, hKind,
-            gensrcPackages.resolve("p1/P1C1.java").toString());
+    public void testClass(Path base, FrameKind fKind, OverviewKind oKind) throws Exception {
+        javadoc(base, fKind, oKind, gensrcPackages.resolve("p1/P1C1.java").toString());
 
-        new Checker(fKind, oKind, hKind)
+        new Checker(fKind, oKind)
             .classes("p1.P1C1")
             .check();
     }
 
     @Test
-    public void testClasses(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
-        javadoc(base, fKind, oKind, hKind,
+    public void testClasses(Path base, FrameKind fKind, OverviewKind oKind) throws IOException {
+        javadoc(base, fKind, oKind,
             gensrcPackages.resolve("p1/P1C1.java").toString(),
             gensrcPackages.resolve("p1/P1C2.java").toString(),
             gensrcPackages.resolve("p1/P1C3.java").toString());
 
-        new Checker(fKind, oKind, hKind)
+        new Checker(fKind, oKind)
             .classes("p1.P1C1", "p1.P1C2", "p1.P1C3")
             .check();
     }
 
     @Test
-    public void testPackage(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
-        javadoc(base, fKind, oKind, hKind,
+    public void testPackage(Path base, FrameKind fKind, OverviewKind oKind) throws IOException {
+        javadoc(base, fKind, oKind,
             "-sourcepath", gensrcPackages.toString(),
             "p1");
 
-        new Checker(fKind, oKind, hKind)
+        new Checker(fKind, oKind)
             .classes("p1.P1C1", "p1.P1C2", "p1.P1C3")
             .check();
     }
 
     @Test
-    public void testPackages(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
-        javadoc(base, fKind, oKind, hKind,
+    public void testPackages(Path base, FrameKind fKind, OverviewKind oKind) throws IOException {
+        javadoc(base, fKind, oKind,
             "-sourcepath", gensrcPackages.toString(),
             "p1", "p2", "p3");
 
-        new Checker(fKind, oKind, hKind)
+        new Checker(fKind, oKind)
             .classes("p1.P1C1", "p1.P1C2", "p1.P1C3",
                     "p2.P2C1", "p2.P2C2", "p2.P2C3",
                     "p3.P3C1", "p3.P3C2", "p3.P3C3")
@@ -204,12 +199,12 @@
     }
 
     @Test
-    public void testModules(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
-        javadoc(base, fKind, oKind, hKind,
+    public void testModules(Path base, FrameKind fKind, OverviewKind oKind) throws IOException {
+        javadoc(base, fKind, oKind,
             "--module-source-path", gensrcModules.toString(),
             "--module", "m1,m2,m3");
 
-        new Checker(fKind, oKind, hKind)
+        new Checker(fKind, oKind)
             .classes("m1/m1p1.M1P1C1", "m1/m1p1.M1P1C2", "m1/m1p1.M1P1C3",
                     "m2/m2p1.M2P1C1", "m2/m2p1.M2P1C2", "m2/m2p1.M2P1C3",
                     "m3/m3p1.M3P1C1", "m3/m3p1.M3P1C2", "m3/m3p1.M3P1C3")
@@ -223,7 +218,6 @@
     class Checker {
         private final FrameKind fKind;
         private final OverviewKind oKind;
-        private final HtmlKind hKind;
         List<String> classes;
 
         private boolean frames;
@@ -234,10 +228,9 @@
                 + "frames will be removed in a future release.\n"
                 + "To suppress this warning, remove the --frames option and avoid the use of frames.";
 
-        Checker(FrameKind fKind, OverviewKind oKind, HtmlKind hKind) {
+        Checker(FrameKind fKind, OverviewKind oKind) {
             this.fKind = fKind;
             this.oKind = oKind;
-            this.hKind = hKind;
         }
 
         Checker classes(String... classes) {
@@ -271,7 +264,7 @@
                     break;
             }
 
-            out.println("Checker: " + fKind + " " + oKind + " " + hKind
+            out.println("Checker: " + fKind + " " + oKind
                 + ": frames:" + frames + " overview:" + overview);
 
             checkAllClassesFiles();
@@ -357,9 +350,8 @@
                     "<meta http-equiv=\"Refresh\" content=\"0;",
                     "<script type=\"text/javascript\">window.location.replace(");
 
-            // the index.html file <meta> refresh should only use <noscript> in HTML 5
             if (!frames && !overview) {
-                checkOutput("index.html", hKind == HtmlKind.HTML5,
+                checkOutput("index.html", true,
                         "<noscript>\n<meta http-equiv=\"Refresh\" content=\"0;");
             }
         }
--- a/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -165,7 +165,6 @@
                 "-stylesheetfile ",
                 "--add-stylesheet ",
                 "-docencoding ",
-                "-html4 ",
                 "-html5 ",
                 "-top ",
                 "-author ",
--- a/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -101,32 +101,4 @@
                 "pkg1/A.InvisibleInner.html",
                 "pkg1/A.InvisibleInnerExtendsVisibleInner.html");
     }
-
-    @Test
-    public void test1_html4() {
-        javadoc("-d", "out1-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-package",
-                "pkg1");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg1/A.html", true,
-                "<a name=\"visibleField\">",
-                "<a name=\"visibleMethod--\">");
-
-        checkOutput("pkg1/A.VisibleInner.html", true,
-                "<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>");
-
-        checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", true,
-                "<code><a href=\"A.html#visibleMethod--\">visibleMethod</a></code>");
-
-        checkOutput("pkg1/A.html", false,
-                "<a name=\"inVisibleMethod--\">");
-
-        checkOutput("pkg1/A.VisibleInner.html", false,
-                "../pkg1/A.VisibleInner.html#VisibleInner--",
-                "<a name=\"inVisibleField\">",
-                "<a name=\"inVisibleMethod--\">");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -84,37 +84,4 @@
                 "<a> tag is malformed");
     }
 
-    @Test
-    public void test_html4() {
-        javadoc("-Xdoclint:none",
-                "-d", "out-html4",
-                "-source", "8",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/C1.html", true,
-                //External link.
-                "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait-long-int-\"",
-                //Member summary table link.
-                "href=\"#method-int-int-java.util.ArrayList-\"",
-                //Anchor test.
-                "<a name=\"method-int-int-java.util.ArrayList-\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                //Backward compatibility anchor test."pkg/C1.html",
-                "<a name=\"method-int-int-java.util.ArrayList-\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-
-        checkOutput("pkg/C2.html", true,
-                //{@link} test.
-                "Link: <a href=\"C1.html#method-int-int-java.util.ArrayList-\">",
-                //@see test.
-                "See Also:</span></dt>\n"
-                + "<dd><a href=\"C1.html#method-int-int-java.util.ArrayList-\">"
-        );
-    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/doclet/testHtml4Removal/TestHtml4Removal.java	Mon Feb 04 11:01:04 2019 +0530
@@ -0,0 +1,69 @@
+/*
+ * 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 8215577
+ * @summary Remove javadoc support for HTML 4
+ * @library ../../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build javadoc.tester.*
+ * @run main TestHtml4Removal
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import javadoc.tester.JavadocTester;
+
+public class TestHtml4Removal extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        Files.write(testFile,
+                List.of("/** Comment. */", "public class C { }"));
+
+        TestHtml4Removal tester = new TestHtml4Removal();
+        tester.runTests();
+    }
+
+    private static final Path testFile = Paths.get("C.java");
+
+    @Test
+    public void testHtml4() {
+        javadoc("-d", "out-4",
+                "-html4",
+                testFile.toString());
+        checkExit(Exit.ERROR);
+    }
+
+    @Test
+    public void testDefault() {
+        javadoc("-d", "out-default",
+                testFile.toString());
+        checkExit(Exit.OK);
+
+        checkOutput("C.html", true, "<!DOCTYPE HTML>");
+    }
+}
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -60,17 +60,6 @@
     }
 
     @Test
-    public void test_Comment_Deprecated_html4() {
-        javadoc("-Xdoclint:none",
-                "-d", "out-1-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg1");
-        checkExit(Exit.OK);
-        checkCommentDeprecated_html4(true);
-    }
-
-    @Test
     public void test_NoComment_Deprecated() {
 //        tester.run(ARGS2, TEST_ALL, NEGATED_TEST_NO_C5);
 //        tester.runTestsOnHTML(NO_TEST,  NEGATED_TEST_C5);
@@ -86,18 +75,6 @@
     }
 
     @Test
-    public void test_NoComment_Deprecated_html4() {
-        javadoc("-Xdoclint:none",
-                "-d", "out-2-html4",
-                "-html4",
-                "-nocomment",
-                "-sourcepath", testSrc,
-                "pkg1");
-        checkExit(Exit.OK);
-        checkCommentDeprecated_html4(false);
-    }
-
-    @Test
     public void test_Comment_NoDeprecated() {
 //        tester.run(ARGS3, TEST_ALL, NEGATED_TEST_NO_C5);
 //        tester.runTestsOnHTML(TEST_NODEPR, TEST_NOCMNT_NODEPR);
@@ -113,19 +90,6 @@
     }
 
     @Test
-    public void test_Comment_NoDeprecated_html4() {
-        javadoc("-Xdoclint:none",
-                "-d", "out-3-html4",
-                "-html4",
-                "-nodeprecated",
-                "-sourcepath", testSrc,
-                "pkg1");
-        checkExit(Exit.OK);
-        checkNoDeprecated_html4();
-        checkNoCommentNoDeprecated_html4(false);
-    }
-
-    @Test
     public void testNoCommentNoDeprecated() {
 //        tester.run(ARGS4, TEST_ALL, NEGATED_TEST_NO_C5);
 //        tester.runTestsOnHTML(TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
@@ -141,19 +105,6 @@
         checkCommentDeprecated(false);
     }
 
-    @Test
-    public void testNoCommentNoDeprecated_html4() {
-        javadoc("-Xdoclint:none",
-                "-d", "out-4-html4",
-                "-html4",
-                "-nocomment",
-                "-nodeprecated",
-                "-sourcepath", testSrc,
-                "pkg1");
-        checkNoCommentNoDeprecated_html4(true);
-        checkCommentDeprecated_html4(false);
-    }
-
     void checkCommon(boolean checkC5) {
         // Test common to all runs of javadoc. The class signature should print
         // properly enclosed definition list tags and the Annotation Type
@@ -309,82 +260,6 @@
                 + "<div class=\"block\">The name for this class.</div>");
     }
 
-    void checkCommentDeprecated_html4(boolean expectFound) {
-        // Test for normal run of javadoc in which various ClassDocs and
-        // serialized form should have properly nested definition list tags
-        // enclosing comments, tags and deprecated information.
-        checkOutput("pkg1/C1.html", expectFound,
-                "<dl>\n"
-                + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
-                + "<dd>1.4</dd>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"#setUndecorated-boolean-\">"
-                + "<code>setUndecorated(boolean)</code></a></dd>\n"
-                + "</dl>",
-                "<dl>\n"
-                + "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n"
-                + "<dd><code>undecorated"
-                + "</code> - <code>true</code> if no decorations are\n"
-                + "         to be enabled;\n"
-                + "         <code>false</code> "
-                + "if decorations are to be enabled.</dd>\n"
-                + "<dt><span class=\"simpleTagLabel\">Since:"
-                + "</span></dt>\n"
-                + "<dd>1.4</dd>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd>"
-                + "<a href=\"#readObject--\"><code>readObject()"
-                + "</code></a></dd>\n"
-                + "</dl>",
-                "<dl>\n"
-                + "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n"
-                + "<dd><code>java.io.IOException</code></dd>\n"
-                + "<dt><span class=\"seeLabel\">See Also:"
-                + "</span></dt>\n"
-                + "<dd><a href=\"#setUndecorated-boolean-\">"
-                + "<code>setUndecorated(boolean)</code></a></dd>\n"
-                + "</dl>");
-
-        checkOutput("serialized-form.html", expectFound,
-                "<dl>\n"
-                + "<dt><span class=\"throwsLabel\">Throws:</span>"
-                + "</dt>\n"
-                + "<dd><code>"
-                + "java.io.IOException</code></dd>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span>"
-                + "</dt>\n"
-                + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>C1.setUndecorated(boolean)</code></a></dd>\n"
-                + "</dl>",
-                "<span class=\"deprecatedLabel\">Deprecated.</span>\n"
-                + "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
-                + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>setUndecorated(boolean)</code></a>.</div>\n"
-                + "</div>\n"
-                + "<div class=\"block\">This field indicates whether the C1 is "
-                + "undecorated.</div>\n"
-                + "&nbsp;\n"
-                + "<dl>\n"
-                + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
-                + "<dd>1.4</dd>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span>"
-                + "</dt>\n"
-                + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>C1.setUndecorated(boolean)</code></a></dd>\n"
-                + "</dl>",
-                "<span class=\"deprecatedLabel\">Deprecated.</span>\n"
-                + "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
-                + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>setUndecorated(boolean)</code></a>.</div>\n"
-                + "</div>\n"
-                + "<div class=\"block\">Reads the object stream.</div>\n"
-                + "<dl>\n"
-                + "<dt><span class=\"throwsLabel\">Throws:"
-                + "</span></dt>\n"
-                + "<dd><code>java.io.IOException</code></dd>\n"
-                + "</dl>");
-    }
-
     void checkNoDeprecated() {
         // Test with -nodeprecated option. The ClassDocs should have properly nested
         // definition list tags enclosing comments and tags. The ClassDocs should not
@@ -494,77 +369,6 @@
                 + "The name for this class.</div>");
     }
 
-    void checkNoDeprecated_html4() {
-        // Test with -nodeprecated option. The ClassDocs should have properly nested
-        // definition list tags enclosing comments and tags. The ClassDocs should not
-        // display definition list for deprecated information. The serialized form
-        // should display properly nested definition list tags for comments, tags
-        // and deprecated information.
-        checkOutput("pkg1/C1.html", true,
-                "<dl>\n"
-                + "<dt><span class=\"paramLabel\">Parameters:"
-                + "</span></dt>\n"
-                + "<dd><code>undecorated</code> - <code>true</code>"
-                + " if no decorations are\n"
-                + "         to be enabled;\n"
-                + "         <code>false</code> if decorations are to be enabled."
-                + "</dd>\n"
-                + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
-                + "<dd>1.4</dd>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"#readObject--\">"
-                + "<code>readObject()</code></a></dd>\n"
-                + "</dl>",
-                "<dl>\n"
-                + "<dt><span class=\"throwsLabel\">Throws:</span>"
-                + "</dt>\n"
-                + "<dd><code>java.io.IOException</code></dd>\n"
-                + "<dt>"
-                + "<span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"#setUndecorated-boolean-\">"
-                + "<code>setUndecorated(boolean)</code></a></dd>\n"
-                + "</dl>");
-
-        checkOutput("serialized-form.html", true,
-                "<dl>\n"
-                + "<dt><span class=\"throwsLabel\">Throws:</span>"
-                + "</dt>\n"
-                + "<dd><code>"
-                + "java.io.IOException</code></dd>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span>"
-                + "</dt>\n"
-                + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>C1.setUndecorated(boolean)</code></a></dd>\n"
-                + "</dl>",
-                "<span class=\"deprecatedLabel\">Deprecated.</span>\n"
-                + "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
-                + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>setUndecorated(boolean)</code></a>.</div>\n"
-                + "</div>\n"
-                + "<div class=\"block\">This field indicates whether the C1 is "
-                + "undecorated.</div>\n"
-                + "&nbsp;\n"
-                + "<dl>\n"
-                + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
-                + "<dd>1.4</dd>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span>"
-                + "</dt>\n"
-                + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>C1.setUndecorated(boolean)</code></a></dd>\n"
-                + "</dl>",
-                "<span class=\"deprecatedLabel\">Deprecated.</span>\n"
-                + "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
-                + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>setUndecorated(boolean)</code></a>.</div>\n"
-                + "</div>\n"
-                + "<div class=\"block\">Reads the object stream.</div>\n"
-                + "<dl>\n"
-                + "<dt><span class=\"throwsLabel\">Throws:"
-                + "</span></dt>\n"
-                + "<dd><code>java.io.IOException</code></dd>\n"
-                + "</dl>");
-    }
-
     void checkNoCommentNoDeprecated(boolean expectFound) {
         // Test with -nocomment and -nodeprecated options. The ClassDocs whould
         // not display definition lists for any member details.
@@ -604,28 +408,4 @@
                 + "</div>\n"
                 + "</li>");
     }
-
-    void checkNoCommentNoDeprecated_html4(boolean expectFound) {
-        // Test with -nocomment and -nodeprecated options. The ClassDocs whould
-        // not display definition lists for any member details.
-        checkOutput("serialized-form.html", expectFound,
-                "<pre>boolean " +
-                "undecorated</pre>\n" +
-                "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">" +
-                "Deprecated.</span>\n"
-                + "<div class=\"deprecationComment\">As of JDK version 1.5, replaced by\n"
-                + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>"
-                + "setUndecorated(boolean)</code></a>.</div>\n"
-                + "</div>\n"
-                +
-                "</li>",
-                "<span class=\"deprecatedLabel\">"
-                + "Deprecated.</span>\n"
-                + "<div class=\"deprecationComment\">As of JDK version"
-                + " 1.5, replaced by\n"
-                + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">"
-                + "<code>setUndecorated(boolean)</code></a>.</div>\n"
-                + "</div>\n"
-                + "</li>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -71,7 +71,6 @@
     // Generate the HTML output using the HTML document generation within doclet.
     public static String generateHtmlTree() {
         // Document type for the HTML document
-        DocType htmlDocType = DocType.HTML4_TRANSITIONAL;
         HtmlTree html = new HtmlTree(HtmlTag.HTML);
         HtmlTree head = new HtmlTree(HtmlTag.HEAD);
         HtmlTree title = new HtmlTree(HtmlTag.TITLE);
@@ -144,7 +143,7 @@
         HtmlTree hr = new HtmlTree(HtmlTag.HR);
         body.addContent(hr);
         html.addContent(body);
-        HtmlDocument htmlDoc = new HtmlDocument(htmlDocType, html);
+        HtmlDocument htmlDoc = new HtmlDocument(html);
         return htmlDoc.toString();
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDocument/testLink.html	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDocument/testLink.html	Mon Feb 04 11:01:04 2019 +0530
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML>
 <html>
 <head>
 <title>Markup test</title>
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDocument/testMarkup.html	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDocument/testMarkup.html	Mon Feb 04 11:01:04 2019 +0530
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML>
 <html>
 <head>
 <title>Markup test</title>
--- a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java	Mon Feb 04 11:01:04 2019 +0530
@@ -105,42 +105,6 @@
     }
 
     @Test
-    public void testModulesHtml4(Path base) throws Exception {
-        Path srcDir = base.resolve("src");
-        createModules(srcDir);
-
-        Path outDir = base.resolve("out2");
-        javadoc("-d", outDir.toString(),
-                "-doctitle", "Document Title",
-                "-header", "Test Header",
-                "--frames",
-                "--module-source-path", srcDir.toString(),
-                "--module", "m1,m2",
-                "-html4");
-
-        checkExit(Exit.OK);
-
-        checkOrder("module-overview-frame.html",
-                "<h1 title=\"Test Header\" class=\"bar\">Test Header</h1>\n"
-                + "<div class=\"indexNav\">",
-                "<div class=\"indexContainer\">\n"
-                + "<h2 title=\"Modules\">Modules</h2>\n"
-                + "<ul title=\"Modules\">");
-
-        checkOrder("m1/module-frame.html",
-                "<h1 title=\"Test Header\" class=\"bar\">Test Header</h1>\n"
-                + "<div class=\"indexNav\">",
-                "<div class=\"indexContainer\">\n"
-                + "<h2 title=\"m1\"><a href=\"module-summary.html\" target=\"classFrame\">m1</a>&nbsp;Packages</h2>");
-
-        checkOrder("overview-summary.html",
-                "<div class=\"fixedNav\">",
-                "<div class=\"header\">\n"
-                + "<h1 class=\"title\">Document Title</h1>",
-                "<div class=\"bottomNav\"><a name=\"navbar.bottom\">");
-    }
-
-    @Test
     public void testPackages(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createPackages(srcDir);
@@ -175,36 +139,6 @@
     }
 
     @Test
-    public void testPackagesHtml4(Path base) throws Exception {
-        Path srcDir = base.resolve("src");
-        createPackages(srcDir);
-
-        Path outDir = base.resolve("out4");
-        javadoc("-d", outDir.toString(),
-                "-doctitle", "Document Title",
-                "-header", "Test Header",
-                "--frames",
-                "-sourcepath", srcDir.toString(),
-                "pkg1", "pkg2",
-                "-html4");
-
-        checkExit(Exit.OK);
-
-        checkOrder("overview-summary.html",
-                "<div class=\"fixedNav\">",
-                "<div class=\"header\">\n"
-                + "<h1 class=\"title\">Document Title</h1>",
-                "<div class=\"bottomNav\"><a name=\"navbar.bottom\">");
-
-        checkOrder("overview-frame.html",
-                "<h1 title=\"Test Header\" class=\"bar\">Test Header</h1>\n"
-                + "<div class=\"indexNav\">",
-                "<div class=\"indexContainer\">\n"
-                + "<h2 title=\"Packages\">Packages</h2>"
-        );
-    }
-
-    @Test
     public void testDocFiles(Path base) throws Exception {
         Path srcDir = base.resolve("src");
         createPackages(srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,48 +77,4 @@
         checkOutput("constant-values.html", true,
             "<div class=\"constantsSummary\">\n<table>");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-use",
-                "--frames",
-                "pkg1", "pkg2");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg1/TestTable.html", true,
-                "<table summary=\"Summary\" border cellpadding=3 cellspacing=1>",
-                "<div class=\"memberSummary\">\n"
-                + "<table summary=\"Field Summary table, listing fields, "
-                + "and an explanation\">",
-                "<div class=\"memberSummary\">\n"
-                + "<table summary=\"Constructor Summary table, listing "
-                + "constructors, and an explanation\">",
-                "<div class=\"memberSummary\">\n",
-                "<table summary=\"Method Summary table, listing methods, "
-                + "and an explanation\" aria-labelledby=\"t0\">");
-
-        checkOutput("pkg1/package-summary.html", true,
-                "<div class=\"typeSummary\">\n"
-                + "<table summary=\"Class Summary table, listing classes, "
-                + "and an explanation\">");
-
-        checkOutput("pkg1/class-use/TestTable.html", true,
-                "<div class=\"useSummary\">\n"
-                + "<table summary=\"Use table, listing fields, and an explanation\">");
-
-        checkOutput("overview-summary.html", true,
-                "<div class=\"overviewSummary\">\n"
-                + "<table summary=\"Package Summary table, listing packages, and an explanation\">");
-
-        checkOutput("deprecated-list.html", true,
-            "<div class=\"deprecatedSummary\">\n"
-            + "<table summary=\"Methods table, listing methods, and an explanation\">");
-
-        checkOutput("constant-values.html", true,
-            "<div class=\"constantsSummary\">\n"
-            + "<table summary=\"Constant Field Values table, listing constant fields, and values\">");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -61,19 +61,6 @@
         checkHtmlTableHeaders();
     }
 
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-use",
-                "--frames",
-                "pkg1", "pkg2");
-        checkExit(Exit.OK);
-
-        checkHtmlTableSummaries();
-    }
-
     /*
      * Tests for validating table tag for HTML tables
      */
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -195,64 +195,4 @@
                 + " activation group is created/recreated.</div>\n"
                 + "<dl>");
     }
-
-    @Test
-    public void test_other_html4() {
-        javadoc("-locale", "en_US",
-                "-d", "out-other-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg3");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg3/package-summary.html", true,
-                "<div class=\"contentContainer\"><a name=\"package.description\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<div class=\"block\"><p>This is the first line."
-                + " Note the newlines before the &lt;p&gt; is relevant.</div>");
-
-        checkOutput("pkg3/A.DatatypeFactory.html", true,
-                "<div class=\"block\"><p>\n"
-                + " Factory that creates new <code>javax.xml.datatype</code>\n"
-                + " <code>Object</code>s that map XML to/from Java <code>Object</code>s.</p>\n"
-                + "\n"
-                + " <p id=\"DatatypeFactory.newInstance\">\n"
-                + " A new instance of the <code>DatatypeFactory</code> is created through the\n"
-                + " <a href=\"#newInstance--\"><code>newInstance()</code></a> method that uses the following implementation\n"
-                + " resolution mechanisms to determine an implementation:</p>\n"
-                + " <ol>\n"
-                + " <li>\n"
-                + " If the system property specified by <a href=\"#DATATYPEFACTORY_PROPERTY\"><code>DATATYPEFACTORY_PROPERTY</code></a>,\n"
-                + " \"<code>javax.xml.datatype.DatatypeFactory</code>\", exists, a class with\n"
-                + " the name of the property value is instantiated. Any Exception thrown\n"
-                + " during the instantiation process is wrapped as a\n"
-                + " <code>IllegalStateException</code>.\n"
-                + " </li>\n"
-                + " <li>\n"
-                + " If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a\n"
-                + " <code>Properties</code> <code>Object</code>. The\n"
-                + " <code>Properties</code> <code>Object </code> is then queried for the\n"
-                + " property as documented in the prior step and processed as documented in\n"
-                + " the prior step.\n"
-                + " </li>\n"
-                + " <li>\n"
-                + " Uses the service-provider loading facilities, defined by the\n"
-                + " <code>ServiceLoader</code> class, to attempt to locate and load an\n"
-                + " implementation of the service using the default loading mechanism:\n"
-                + " the service-provider loading facility will use the current thread's context class loader\n"
-                + " to attempt to load the service. If the context class loader is null, the system class loader will be used.\n"
-                + " <br>\n"
-                + " In case of <code>service configuration error</code> a\n"
-                + " <code>DatatypeConfigurationException</code> will be thrown.\n"
-                + " </li>\n"
-                + " <li>\n"
-                + " The final mechanism is to attempt to instantiate the <code>Class</code>\n"
-                + " specified by <a href=\"#DATATYPEFACTORY_IMPLEMENTATION_CLASS\">"
-                + "<code>DATATYPEFACTORY_IMPLEMENTATION_CLASS</code></a>. Any Exception\n"
-                + " thrown during the instantiation process is wrapped as a\n"
-                + " <code>IllegalStateException</code>.\n"
-                + " </li>\n"
-                + " </ol></div>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,38 +58,6 @@
     }
 
     @Test
-    public void test2() {
-        javadoc("-d", "out-2",
-                "-html4",
-                "-private",
-                "-linksource",
-                "--frames",
-                "-sourcepath", testSrc,
-                "-use",
-                "pkg", "pkg1", "pkg2", "pkg3");
-        checkExit(Exit.OK);
-
-        html4Output();
-        html4NegatedOutput();
-    }
-
-    @Test
-    public void test3() {
-        javadoc("-d", "out-3",
-                "-html4",
-                "-private",
-                "-linksource",
-                "--frames",
-                "-sourcepath", testSrc,
-                "-use",
-                "pkg", "pkg1", "pkg2", "pkg3");
-        checkExit(Exit.OK);
-
-        html4Output();
-        html4NegatedOutput();
-    }
-
-    @Test
     public void test4() {
         javadoc("-d", "out-4",
                 "-private",
@@ -1073,961 +1041,4 @@
                 + "<noscript>JavaScript is disabled on your browser.</noscript>\n"
                 + "<div class=\"mainContainer\">\n");
     }
-
-    void html4Output() {
-        // Test for overview-frame page
-        checkOutput("overview-frame.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<div class=\"indexNav\">\n"
-                + "<ul>\n"
-                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
-                "<div class=\"indexContainer\">\n"
-                + "<h2 title=\"Packages\">Packages</h2>");
-
-        // Test for allclasses-frame page
-        checkOutput("allclasses-frame.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<div class=\"indexContainer\">\n"
-                + "<ul>\n"
-                + "<li>");
-
-        // Test for overview-summary page
-        checkOutput("overview-summary.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<div class=\"overviewSummary\">\n"
-                + "<table summary=\"Package Summary table, listing packages, and an explanation\">\n"
-                + "<caption>",
-                "</noscript>\n"
-                + "<div class=\"fixedNav\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->");
-
-        // Test for package-frame page
-        checkOutput("pkg/package-frame.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<body>\n"
-                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>");
-
-        // Test for package-summary page
-        checkOutput("pkg/package-summary.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<div class=\"contentContainer\"><a name=\"package.description\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<div class=\"block\">Test package.</div>",
-                "<div class=\"typeSummary\">\n<table summary=\"Interface Summary table, listing interfaces, and an explanation\">",
-                "<div class=\"typeSummary\">\n<table summary=\"Class Summary table, listing classes, and an explanation\">",
-                "<div class=\"typeSummary\">\n<table summary=\"Enum Summary table, listing enums, and an explanation\">",
-                "<div class=\"typeSummary\">\n<table summary=\"Exception Summary table, listing exceptions, and an explanation\">",
-                "<div class=\"typeSummary\">\n<table summary=\"Error Summary table, listing errors, and an explanation\">",
-                "<div class=\"typeSummary\">\n<table summary=\"Annotation Types Summary table, listing annotation types, and an explanation\">");
-        // No Package description
-        checkOutput("pkg1/package-summary.html", true,
-                "<div class=\"contentContainer\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\">\n"
-                + "<div class=\"typeSummary\">\n"
-                + "<table summary=\"Class Summary table, listing classes, and an explanation\">\n"
-                + "<caption><span>Class Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>");
-
-        // Test for package-tree page
-        checkOutput("pkg/package-tree.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<li class=\"circle\">");
-
-        // Test for package-use page
-        checkOutput("pkg1/package-use.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<div class=\"useSummary\">\n"
-                + "<table summary=\"Use table, listing packages, and an explanation\">");
-
-        // Test for constant-values page
-        checkOutput("constant-values.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<div class=\"header\">",
-                "<div class=\"constantsSummary\">\n"
-                + "<table summary=\"Constant Field Values table, listing constant fields, and values\">");
-
-        // Test for deprecated-list page
-        checkOutput("deprecated-list.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<div class=\"header\">\n"
-                + "<h1 title=\"Deprecated API\" class=\"title\">Deprecated API</h1>\n"
-                + "<h2 title=\"Contents\">Contents</h2>",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Classes table, listing classes, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Enums table, listing enums, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Exceptions table, listing exceptions, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Errors table, listing errors, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Annotation Types table, listing annotation types, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Fields table, listing fields, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Methods table, listing methods, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Constructors table, listing constructors, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Enum Constants table, listing enum constants, and an explanation\">",
-                "<div class=\"deprecatedSummary\">\n"
-                + "<table summary=\"Annotation Type Elements table, listing annotation type elements, and an explanation\">");
-
-        // Test for serialized-form page
-        checkOutput("serialized-form.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<div class=\"header\">",
-                "<li class=\"blockList\">\n"
-                + "<h2 title=\"Package\">Package&nbsp;pkg</h2>");
-
-        // Test for overview-tree page
-        checkOutput("overview-tree.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<li class=\"circle\">",
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<div class=\"header\">",
-                "<h1 class=\"title\">Hierarchy For All Packages</h1>\n"
-                + "<span class=\"packageHierarchyLabel\">Package Hierarchies:</span>",
-                "<div class=\"contentContainer\">\n"
-                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
-                "</ul>\n"
-                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>",
-                "</ul>\n"
-                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>");
-
-        // Test for index-all page
-        checkOutput("index-all.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<div class=\"contentContainer\">");
-
-        // Test for src-html page
-        checkOutput("src-html/pkg/AnotherClass.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<body>\n"
-                + "<div class=\"sourceContainer\">");
-
-        // Test for help-doc page
-        checkOutput("help-doc.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<div class=\"header\">",
-                "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\">\n"
-                + "<h2>Overview</h2>",
-                "<li class=\"blockList\">\n"
-                + "<h2>Package</h2>",
-                "<li class=\"blockList\">\n"
-                + "<h2>Class or Interface</h2>");
-
-        // Test for a regular class page and members (nested class, field, constructore and method)
-        checkOutput("pkg/AnotherClass.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ======== START OF CLASS DATA ======== -->\n"
-                + "<div class=\"header\">",
-                "<!-- ======== NESTED CLASS SUMMARY ======== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"nested.class.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Nested Class Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<table summary=\"Nested Class Summary table, listing nested classes, and an explanation\">",
-                "<!-- =========== FIELD SUMMARY =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"field.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Field Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n<table summary=\"Field Summary table, listing fields, and an explanation\">",
-                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n<table summary=\"Constructor Summary table, listing constructors, and an explanation\">",
-                "<!-- ========== METHOD SUMMARY =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n",
-                "<table summary=\"Method Summary table, listing methods, and an explanation\" aria-labelledby=\"t0\">",
-                "<!-- ============ FIELD DETAIL =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"field.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Field Detail</h3>",
-                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Detail</h3>",
-                "<!-- ============ METHOD DETAIL ========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Detail</h3>");
-
-        // Test for enum page
-        checkOutput("pkg/AnotherClass.ModalExclusionType.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ======== START OF CLASS DATA ======== -->\n"
-                + "<div class=\"header\">",
-                "<!-- =========== ENUM CONSTANT SUMMARY =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"enum.constant.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Enum Constant Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<table summary=\"Enum Constant Summary table, listing enum constants, and an explanation\"",
-                "<!-- ========== METHOD SUMMARY =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n",
-                "<table summary=\"Method Summary table, listing methods, and an explanation\" aria-labelledby=\"t0\">",
-                "<!-- ============ ENUM CONSTANT DETAIL =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"enum.constant.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Enum Constant Detail</h3>",
-                "<!-- ============ METHOD DETAIL ========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Detail</h3>");
-
-        // Test for interface page
-        checkOutput("pkg2/Interface.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ======== START OF CLASS DATA ======== -->\n"
-                + "<div class=\"header\">",
-                "<!-- ========== METHOD SUMMARY =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n",
-                "<table summary=\"Method Summary table, listing methods, and an explanation\""
-                + " aria-labelledby=\"t0\">",
-                "<!-- ============ METHOD DETAIL ========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Detail</h3>");
-
-        // Test for error page
-        checkOutput("pkg/TestError.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ======== START OF CLASS DATA ======== -->\n"
-                + "<div class=\"header\">",
-                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Summary</h3>",
-                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Detail</h3>");
-
-        // Test for exception page
-        checkOutput("pkg/TestException.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ======== START OF CLASS DATA ======== -->\n"
-                + "<div class=\"header\">",
-                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Summary</h3>",
-                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Detail</h3>");
-
-        // Test for annotation page
-        checkOutput("pkg2/TestAnnotationType.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ======== START OF CLASS DATA ======== -->\n"
-                + "<div class=\"header\">",
-                "<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"annotation.type.required.element.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Required Element Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n<table summary=\"Required Element Summary table, listing required elements, and an explanation\">",
-                "<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"annotation.type.optional.element.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Optional Element Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n<table summary=\"Optional Element Summary table, listing optional elements, and an explanation\">",
-                "<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a name=\"annotation.type.element.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Element Detail</h3>");
-
-        // Test for class use page
-        checkOutput("pkg1/class-use/RegClass.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<meta name=\"date\"",
-                "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<div class=\"header\">",
-                "<div class=\"useSummary\">\n<table summary=\"Use table, listing packages, and an explanation\">",
-                "<li class=\"blockList\"><a name=\"pkg\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
-                + "<div class=\"useSummary\">\n<table summary=\"Use table, listing fields, and an explanation\">");
-
-        // Test for main index page
-        checkOutput("index.html", true,
-                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">",
-                "<body onload=\"loadFrames()\">\n"
-                + "<script type=\"text/javascript\">\n"
-                + "if (targetPage == \"\" || targetPage == \"undefined\")\n"
-                + "     window.location.replace('overview-summary.html');\n"
-                + "</script>\n"
-                + "<noscript>JavaScript is disabled on your browser.</noscript>\n"
-                + "<div class=\"mainContainer\">\n"
-                + "<div class=\"leftContainer\">\n"
-                + "<div class=\"leftTop\">\n"
-                + "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>\n"
-                + "</div>");
-    }
-
-    void html4NegatedOutput() {
-        // Negated test for overview-frame page
-        checkOutput("overview-frame.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<nav role=\"navigation\" class=\"indexNav\">\n"
-                + "<ul>\n"
-                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
-                "<main role=\"main\" class=\"indexContainer\">\n"
-                + "<h2 title=\"Packages\">Packages</h2>");
-
-        // Negated test for allclasses-frame page
-        checkOutput("allclasses-frame.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<main role=\"main\" class=\"indexContainer\">\n"
-                + "<ul>\n"
-                + "<li>");
-
-        // Negated test for overview-summary page
-        checkOutput("overview-summary.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<div class=\"overviewSummary\">\n"
-                + "<caption>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->");
-
-        // Negated test for package-frame page
-        checkOutput("pkg/package-frame.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<main role=\"main\">\n"
-                + "<h1 class=\"bar\"><a href=\"package-summary.html\" target=\"classFrame\">pkg</a></h1>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Interfaces\">Interfaces</h2>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Classes\">Classes</h2>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Enums\">Enums</h2>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Exceptions\">Exceptions</h2>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Errors\">Errors</h2>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Annotation Types\">Annotation Types</h2>");
-
-        // Negated test for package-summary page
-        checkOutput("pkg/package-summary.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<div class=\"typeSummary\">\n<table\">",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<h2 title=\"Package pkg Description\">Package pkg Description</h2>\n",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for package-tree page
-        checkOutput("pkg/package-tree.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for package-use page
-        checkOutput("pkg1/package-use.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<div class=\"useSummary\">\n<table>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for constant-values page
-        checkOutput("constant-values.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<div class=\"constantsSummary\">\n<table>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Contents\">Contents</h2>\n",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"pkg\">pkg.*</h2>\n",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for deprecated-list page
-        checkOutput("deprecated-list.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<div class=\"deprecatedSummary\">\n<table>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for serialized-form page
-        checkOutput("serialized-form.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Package\">Package&nbsp;pkg</h2>\n",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for overview-tree page
-        checkOutput("overview-tree.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>\n",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>\n",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n",
-                "<section role=\"region\">\n"
-                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for index-all page
-        checkOutput("index-all.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "</header>\n"
-                + "<main role=\"main\">",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for src-html page
-        checkOutput("src-html/pkg/AnotherClass.html", false,
-                "<!DOCTYPE HTML>",
-                "<main role=\"main\">\n"
-                + "<div class=\"sourceContainer\">");
-
-        // Negated test for help-doc page
-        checkOutput("help-doc.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<h2>Overview</h2>\n",
-                "<section role=\"region\">\n"
-                + "<h2>Package</h2>\n",
-                "<section role=\"region\">\n"
-                + "<h2>Class/Interface</h2>\n",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for a regular class page and members (nested class, field, constructore and method)
-        checkOutput("pkg/AnotherClass.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"nested.class.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Nested Class Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"field.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Field Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Summary</h3>",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"field.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Field Detail</h3>",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Detail</h3>",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Detail</h3>",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for enum page
-        checkOutput("pkg/AnotherClass.ModalExclusionType.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"enum.constant.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Enum Constant Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"enum.constant.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Enum Constant Detail</h3>",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Detail</h3>",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for interface page
-        checkOutput("pkg2/Interface.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Method Detail</h3>",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for error page
-        checkOutput("pkg/TestError.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Summary</h3>",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Detail</h3>",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for exception page
-        checkOutput("pkg/TestException.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Summary</h3>",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Constructor Detail</h3>",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for annotation page
-        checkOutput("pkg2/TestAnnotationType.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"annotation.type.required.element.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Required Element Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"annotation.type.optional.element.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Optional Element Summary</h3>\n"
-                + "<div class=\"memberSummary\">",
-                "<section role=\"region\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"annotation.type.element.detail\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Element Detail</h3>",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for class use page
-        checkOutput("pkg1/class-use/RegClass.html", false,
-                "<!DOCTYPE HTML>",
-                "<meta name=\"dc.created\"",
-                "<a id=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<header role=\"banner\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ========= START OF TOP NAVBAR ======= -->",
-                "<main role=\"main\">\n"
-                + "<div class=\"header\">",
-                "<div class=\"useSummary\">\n<table>\n",
-                "<section role=\"region\"><a id=\"pkg\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
-                + "\n"
-                + "<div class=\"useSummary\">",
-                "<footer role=\"contentinfo\">\n"
-                + "<nav role=\"navigation\">\n"
-                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
-
-        // Negated test for main index page
-        checkOutput("index.html", false,
-                "<!DOCTYPE HTML>",
-                "<body>\n"
-                + "<script type=\"text/javascript\">\n"
-                + "if (targetPage == \"\" || targetPage == \"undefined\")\n"
-                + "     window.location.replace('overview-summary.html');\n"
-                + "</script>\n"
-                + "<noscript>JavaScript is disabled on your browser.</noscript>\n"
-                + "<main role=\"main\">\n"
-                + "<div class=\"mainContainer\">\n");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testHtmlWarning/TestHtmlWarning.java	Sat Feb 02 10:00:05 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * 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 8194955 8182765
- * @summary Warn when default HTML version is used.
- * @library ../../lib
- * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build javadoc.tester.*
- * @run main TestHtmlWarning
- */
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.List;
-
-import javadoc.tester.JavadocTester;
-
-public class TestHtmlWarning extends JavadocTester {
-
-    public static void main(String... args) throws Exception {
-        Files.write(testFile,
-                List.of("/** Comment. */", "public class C { }"));
-
-        TestHtmlWarning tester = new TestHtmlWarning();
-        tester.runTests();
-    }
-
-    private static final Path testFile = Paths.get("C.java");
-    private static final String warning
-            = "javadoc: warning - You have specified the HTML version as HTML 4.01 by using the -html4 option.\n"
-            + "The default is currently HTML5 and the support for HTML 4.01 will be removed\n"
-            + "in a future release. To suppress this warning, please ensure that any HTML constructs\n"
-            + "in your comments are valid in HTML5, and remove the -html4 option.";
-
-    @Test
-    public void testHtml4() {
-        javadoc("-d", "out-4",
-                "-html4",
-                testFile.toString());
-        checkExit(Exit.OK);
-
-        checkOutput(Output.OUT, true, warning);
-    }
-
-    @Test
-    public void testHtml5() {
-        javadoc("-d", "out-5",
-                "-html5",
-                testFile.toString());
-        checkExit(Exit.OK);
-
-        checkOutput(Output.OUT, false, warning);
-    }
-
-    @Test
-    public void testDefault() {
-        javadoc("-d", "out-default",
-                testFile.toString());
-        checkExit(Exit.OK);
-
-        checkOutput(Output.OUT, false, warning);
-    }
-}
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -158,49 +158,6 @@
     }
 
     @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/Child.html", true,
-                //Make sure "Specified By" has substituted type parameters.
-                "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"Interface.html#method--\">method</a>"
-                + "</code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"Interface.html\" title=\"interface in pkg\">"
-                + "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
-                + "CE</a>&gt;</code></dd>",
-                //Make sure "Overrides" has substituted type parameters.
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"Parent.html#method--\">method</a>"
-                + "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
-                + "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
-                + "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
-
-        checkOutput("pkg/ClassWithStaticMembers.html", true,
-                "<td class=\"colFirst\"><code>static void</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#m--\">m</a></span>()</code></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"block\">A hider method</div>\n"
-                + "</td>\n",
-
-                "<h4>staticMethod</h4>\n"
-                + "<pre class=\"methodSignature\">public static&nbsp;void&nbsp;staticMethod()</pre>\n"
-                + "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
-                + "Description copied from interface:&nbsp;<code>"
-                + "<a href=\"InterfaceWithStaticMembers.html#staticMethod--\">"
-                + "InterfaceWithStaticMembers</a></code></span></div>\n"
-                + "<div class=\"block\">A static method</div>\n");
-
-        checkOutput("pkg/Interface.html", false,
-                "public int&nbsp;method()");
-    }
-
-    @Test
     public void test1() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
@@ -217,23 +174,6 @@
     }
 
     @Test
-    public void test1_html4() {
-        javadoc("-d", "out-1-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg1");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg1/Child.html", true,
-            // Ensure the correct Overrides in the inheritance hierarchy is reported
-            "<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
-            "<dd><code><a href=\"GrandParent.html#method1--\">method1</a></code>" +
-            "&nbsp;in class&nbsp;" +
-            "<code><a href=\"GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
-            "&lt;<a href=\"Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
-    }
-
-    @Test
     public void test2() {
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -176,30 +176,6 @@
         checkOutput("pkg1/D.html", false, "shouldNotAppear");
     }
 
-    @Test
-    public void test1_html4() {
-        javadoc("-d", "out1-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-javafx",
-                "--disable-javafx-strict-checks",
-                "-package",
-                "pkg1");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg1/C.html", true,
-                "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"#getRate--\"><code>getRate()</code></a>, \n"
-                + "<a href=\"#setRate-double-\">"
-                + "<code>setRate(double)</code></a></dd>",
-                "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#setTestMethodProperty--\">"
-                + "setTestMethodProperty</a></span>()</code></th>",
-                "<h3>Property Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n<table summary=\"Property Summary table, listing properties, and an explanation\">\n"
-                + "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>");
-    }
-
     /*
      * Test with -javafx option enabled, to ensure property getters and setters
      * are treated correctly.
@@ -263,53 +239,6 @@
                 + " onclick=\"show(8);\">Concrete Methods</button></div>");
     }
 
-    @Test
-    public void test2_html4() {
-        javadoc("-d", "out2a-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-javafx",
-                "--disable-javafx-strict-checks",
-                "-package",
-                "pkg2");
-        checkExit(Exit.OK);
-        checkOutput("pkg2/Test.html", true,
-                "<h3>Property Detail</h3>\n"
-                + "<a name=\"betaProperty\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\">\n"
-                + "<h4>beta</h4>\n"
-                + "<pre>public&nbsp;java.lang.Object betaProperty</pre>\n"
-                + "</li>\n"
-                + "</ul>\n"
-                + "<a name=\"gammaProperty\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\">\n"
-                + "<h4>gamma</h4>\n"
-                + "<pre>public final&nbsp;java.util.List&lt;java.lang.String&gt; gammaProperty</pre>\n"
-                + "</li>\n"
-                + "</ul>\n"
-                + "<a name=\"deltaProperty\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<ul class=\"blockListLast\">\n"
-                + "<li class=\"blockList\">\n"
-                + "<h4>delta</h4>\n"
-                + "<pre>public final&nbsp;java.util.List&lt;"
-                + "java.util.Set&lt;? super java.lang.Object&gt;&gt; deltaProperty</pre>\n"
-                + "</li>\n"
-                + "</ul>\n"
-                + "</li>\n"
-                + "</ul>",
-                "<h3>Property Summary</h3>\n"
-                + "<div class=\"memberSummary\">\n<table summary=\"Property Summary table, listing properties, and an explanation\">\n"
-                + "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>");
-    }
-
     /*
      * Test without -javafx option, to ensure property getters and setters
      * are treated just like any other java method.
@@ -356,48 +285,6 @@
         );
     }
 
-    @Test
-    public void test3_html4() {
-        javadoc("-d", "out2b-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-package",
-                "pkg2");
-        checkExit(Exit.OK);
-        checkOutput("pkg2/Test.html", true,
-                "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n"
-                + "<th class=\"colSecond\" scope=\"col\">Method</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>\n"
-                + "<tbody>\n"
-                + "<tr class=\"altColor\" id=\"i0\">\n"
-                + "<td class=\"colFirst\"><code>&lt;T&gt;&nbsp;java.lang.Object</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#alphaProperty-java.util.List-\">alphaProperty</a>"
-                + "</span>&#8203;(java.util.List&lt;T&gt;&nbsp;foo)</code></th>\n"
-                + "<td class=\"colLast\">&nbsp;</td>\n"
-                + "</tr>\n"
-                + "<tr class=\"rowColor\" id=\"i1\">\n"
-                + "<td class=\"colFirst\"><code>java.lang.Object</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#betaProperty--\">betaProperty</a></span>()</code></th>\n"
-                + "<td class=\"colLast\">&nbsp;</td>\n"
-                + "</tr>\n"
-                + "<tr class=\"altColor\" id=\"i2\">\n"
-                + "<td class=\"colFirst\"><code>java.util.List&lt;java.util.Set&lt;? super java.lang.Object&gt;&gt;"
-                + "</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#deltaProperty--\">deltaProperty</a></span>()</code></th>\n"
-                + "<td class=\"colLast\">&nbsp;</td>\n"
-                + "</tr>\n"
-                + "<tr class=\"rowColor\" id=\"i3\">\n"
-                + "<td class=\"colFirst\"><code>java.util.List&lt;java.lang.String&gt;</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#gammaProperty--\">gammaProperty</a></span>()</code></th>\n"
-                + "<td class=\"colLast\">&nbsp;</td>"
-        );
-    }
-
     /*
      * Force the doclet to emit a warning when processing a synthesized,
      * DocComment, and ensure that the run succeeds, using the newer
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java	Mon Feb 04 11:01:04 2019 +0530
@@ -104,8 +104,8 @@
                 "<i>RFC&nbsp;2396: Uniform\n" +
                 " Resource Identifiers (URI): Generic Syntax</i></a>, " +
                 "<br><a href=\"http://www.ietf.org/rfc/rfc2732.txt\"><i>RFC&nbsp;2732: Format for\n" +
-                " Literal IPv6 Addresses in URLs</i></a>, <br><a href=\"URISyntaxException.html\">" +
-                "URISyntaxException</a></dd>\n" +
+                " Literal IPv6 Addresses in URLs</i></a>, <br><a href=\"C.html\">" +
+                "A nearby file</a></dd>\n" +
                 "</dl>");
 
         checkOutput("mylib/lang/StringBuilderChild.html", true,
@@ -114,29 +114,6 @@
                 + "title=\"class or interface in java.lang\" class=\"externalLink\">Object</a></pre>"
         );
 
-        String out1_html4 = "out1-html4";
-        setAutomaticCheckLinks(false); // The example code has toy/bad links
-        javadoc("-d", out1_html4,
-                "-source", "8",
-                "-html4",
-                "-classpath", mylib,
-                "-sourcepath", testSrc,
-                "-linkoffline", url, testSrc + "/jdk",
-                "-package",
-                "pkg", "mylib.lang");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/B.html", true,
-                "<div class=\"block\">A method with html tag the method "
-                + "<a href=\"" + url + "java/lang/ClassLoader.html?is-external=true#getSystemClassLoader--\""
-                + " title=\"class or interface in java.lang\" class=\"externalLink\"><code><tt>getSystemClassLoader()</tt>"
-                + "</code></a> as the parent class loader.</div>",
-                "<div class=\"block\">is equivalent to invoking <code>"
-                + "<a href=\"#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
-                + "<code>createTempFile(prefix,&nbsp;suffix,&nbsp;null)</code></a></code>.</div>");
-
-        setAutomaticCheckLinks(true); // re-enable checks
-
         // Generate the documentation using -linkoffline and a relative path as the first parameter.
         // We will try linking to the docs generated in test 1 with a relative path.
         String out2 = "out2";
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -117,7 +117,6 @@
         String apiURL = "http://docs.oracle.com/en/java/javase/11/docs/api";
         String outRedirect = "outRedirect";
         javadoc("-d", outRedirect,
-                "-html4",
                 "-sourcepath", testSrc,
                 "-link", apiURL,
                 "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/pkg/B.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/pkg/B.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
     * Resource Identifiers (URI): Generic Syntax</i></a>, <br><a
     * href="http://www.ietf.org/rfc/rfc2732.txt"><i>RFC&nbsp;2732: Format for
     * Literal IPv6 Addresses in URLs</i></a>, <br><a
-    * href="URISyntaxException.html">URISyntaxException</a>
+    * href="C.html">A nearby file</a>
     */
    public void externalLink() {}
 }
--- a/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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,23 +75,4 @@
 
         checkFiles(false, "checkPkg/A.html");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-Xdoclint:none",
-                "-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg", testSrc("checkPkg/B.java"));
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/C.html", true,
-                "Qualified Link: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Unqualified Link1: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Unqualified Link2: <a href=\"C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n"
-                + " Qualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n"
-                + " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n"
-                + " Unqualified Link: <a href=\"#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>\n"
-                + " Package Link: <a href=\"package-summary.html\"><code>pkg</code></a>.<br/>");
 }
-}
--- a/test/langtools/jdk/javadoc/doclet/testLinkToSerialForm/TestLinkToSerialForm.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkToSerialForm/TestLinkToSerialForm.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -54,16 +54,4 @@
         checkOutput("pkg/C.html", true,
                 "<a href=\"../serialized-form.html#pkg.C\">");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("serialized-form.html", true,
-                "<a name=\"pkg.C\">");
 }
-}
--- a/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -105,51 +105,4 @@
                 + ",java.time.chrono.ChronoLocalDate)\">between</a></code>"
         );
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg", "diamond", "inheritDist", "pkg1");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/SubClass.html", true,
-                // Public method should be inherited
-                "<a href=\"BaseClass.html#pubMethod--\">",
-                // Protected method should be inherited
-                "<a href=\"BaseClass.html#proMethod--\">");
-
-        checkOutput("pkg/BaseClass.html", true,
-                // Test overriding/implementing methods with generic parameters.
-                "<dl>\n"
-                + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"BaseInterface.html#getAnnotation-java.lang.Class-\">"
-                + "getAnnotation</a></code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"BaseInterface.html\" title=\"interface in pkg\">"
-                + "BaseInterface</a></code></dd>\n"
-                + "</dl>");
-
-        checkOutput("diamond/Z.html", true,
-                // Test diamond inheritance member summary (6256068)
-                "<code><a href=\"A.html#aMethod--\">aMethod</a></code>");
-
-        checkOutput("pkg/SubClass.html", false,
-                "<a href=\"BaseClass.html#staticMethod--\">staticMethod</a></code>");
-
-        checkOutput("pkg1/Implementer.html", true,
-                // ensure the method makes it
-                "<td class=\"colFirst\"><code>static java.time.Period</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#between-java.time.LocalDate-java.time.LocalDate-\">"
-                + "between</a></span>&#8203;(java.time.LocalDate&nbsp;startDateInclusive,\n"
-                + "       java.time.LocalDate&nbsp;endDateExclusive)</code></th>");
-
-        checkOutput("pkg1/Implementer.html", false,
-                "<h3>Methods inherited from interface&nbsp;pkg1.<a href=\"Interface.html\""
-                + " title=\"interface in pkg1\">Interface</a></h3>\n"
-                + "<code><a href=\"Interface.html#between-java.time.chrono.ChronoLocalDate"
-                + "-java.time.chrono.ChronoLocalDate-\">between</a></code>"
-        );
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,36 +76,4 @@
                 + "<!--   -->\n"
                 + "</a>");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-private",
-                "-sourcepath", testSrc,
-                "pkg","pkg2");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/PublicChild.html", true,
-                // Check return type in member summary.
-                "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest--\">"
-                + "returnTypeTest</a></span>()</code>",
-                "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#PublicChild--\">PublicChild</a></span>()</code></th>");
-
-        checkOutput("pkg/PrivateParent.html", true,
-                "<td class=\"colFirst\"><code>private </code></td>\n"
-                + "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#PrivateParent-int-\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
-                + "</th>");
-
-        // Legacy anchor dimensions (6290760)
-        checkOutput("pkg2/A.html", true,
-                "<a name=\"f-java.lang.Object:A-\">\n"
-                + "<!--   -->\n"
-                + "</a><a name=\"f-T:A-\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,16 +74,6 @@
         checkExit(Exit.OK);
         verifyIndirectExports(false);
         verifyIndirectOpens(false);
-
-        javadoc("-d", base.resolve("out-api-html4").toString(),
-                "-html4",
-                "-quiet",
-                "--module-source-path", base.toString(),
-                "--expand-requires", "transitive",
-                "--module", "a");
-        checkExit(Exit.OK);
-        verifyIndirectExports_html4(false);
-        verifyIndirectOpens_html4(false);
     }
 
     @Test
@@ -110,16 +100,6 @@
         checkExit(Exit.OK);
         verifyIndirectExports(true);
         verifyIndirectOpens(true);
-
-        javadoc("-d", base.resolve("out-api-html4").toString(),
-                "-html4",
-                "-quiet",
-                "--module-source-path", base.toString(),
-                "--expand-requires", "transitive",
-                "--module", "a");
-        checkExit(Exit.OK);
-        verifyIndirectExports_html4(true);
-        verifyIndirectOpens_html4(true);
     }
 
     @Test
@@ -147,17 +127,6 @@
         checkExit(Exit.OK);
         verifyIndirectExports(false);
         verifyIndirectOpens(false);
-
-        javadoc("-d", base.resolve("out-api-html4").toString(),
-                "-html4",
-                "-quiet",
-                "--module-source-path", base.toString(),
-                "--expand-requires", "transitive",
-                "--module", "a");
-
-        checkExit(Exit.OK);
-        verifyIndirectExports_html4(false);
-        verifyIndirectOpens_html4(false);
     }
 
     @Test
@@ -237,40 +206,4 @@
                 + "</table>\n"
                 + "</div>");
     }
-
-    void verifyIndirectExports_html4(boolean present) {
-        verifyIndirects_html4(present, false);
-    }
-
-    void verifyIndirectOpens_html4(boolean present) {
-        verifyIndirects_html4(present, true);
-    }
-
-    void verifyIndirects_html4(boolean present, boolean opens) {
-
-        String typeString = opens ? "Indirect Opens" : "Indirect Exports";
-
-        // Avoid false positives, just check for primary string absence.
-        if (!present) {
-            checkOutput("a/module-summary.html", false, typeString);
-            return;
-        }
-
-        checkOutput("a/module-summary.html", present,
-                "<div class=\"packagesSummary\">\n"
-                + "<table summary=\"" + typeString + " table, listing modules, and packages\">\n"
-                + "<caption><span>" + typeString + "</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">From</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
-                + "</tr>\n"
-                + "<tbody>\n"
-                + "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"../m/module-summary.html\">m</a></th>\n"
-                + "<td class=\"colLast\"><a href=\"../m/pm/package-summary.html\">pm</a></td>\n"
-                + "</tr>\n"
-                + "</tbody>\n"
-                + "</table>\n"
-                + "</div>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -215,33 +215,6 @@
                 "</tbody>\n" +
                 "</table>\n");
 
-        javadoc("-d", base.toString() + "/out-html4",
-                "-html4",
-                "-quiet",
-                "--show-module-contents", "all",
-                "--module-source-path", base.toString(),
-                "--module", "m");
-        checkExit(Exit.OK);
-
-        checkOutput("m/module-summary.html", true,
-                "<div class=\"usesSummary\">\n" +
-                "<table summary=\"Uses table, listing types, and an explanation\">\n" +
-                "<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
-                "<tr>\n" +
-                "<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
-                "<th class=\"colLast\" scope=\"col\">Description</th>\n" +
-                "</tr>\n" +
-                "<tbody>\n" +
-                "<tr class=\"altColor\">\n" +
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"class in p1\">A</a></th>\n" +
-                "<td class=\"colLast\">&nbsp;</td>\n" +
-                "</tr>\n" +
-                "<tr class=\"rowColor\">\n" +
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"p1/B.html\" title=\"class in p1\">B</a></th>\n" +
-                "<td class=\"colLast\">&nbsp;</td>\n" +
-                "</tr>\n" +
-                "</tbody>\n" +
-                "</table>\n");
     }
 
     @Test
@@ -279,28 +252,6 @@
                 "</tbody>\n" +
                 "</table>\n");
 
-        javadoc("-d", base.toString() + "/out-html4",
-                "-html4",
-                "-quiet",
-                "--module-source-path", base.toString(),
-                "--module", "m");
-        checkExit(Exit.OK);
-
-        checkOutput("m/module-summary.html", true,
-                "<div class=\"usesSummary\">\n" +
-                "<table summary=\"Uses table, listing types, and an explanation\">\n" +
-                "<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
-                "<tr>\n" +
-                "<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
-                "<th class=\"colLast\" scope=\"col\">Description</th>\n" +
-                "</tr>\n" +
-                "<tbody>\n" +
-                "<tr class=\"altColor\">\n" +
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"class in p1\">A</a></th>\n" +
-                "<td class=\"colLast\">&nbsp;</td>\n" +
-                "</tr>\n" +
-                "</tbody>\n" +
-                "</table>\n");
     }
 
     @Test
@@ -371,33 +322,6 @@
                 "</tr>\n" +
                 "</tbody>\n");
 
-        javadoc("-d", base.toString() + "/out-html4",
-                "-html4",
-                "-quiet",
-                "--show-module-contents", "all",
-                "--module-source-path", base.toString(),
-                "--module", "m");
-
-        checkExit(Exit.OK);
-
-        checkOutput("m/module-summary.html", true,
-                "<div class=\"providesSummary\">\n" +
-                "<table summary=\"Provides table, listing types, and an explanation\">\n" +
-                "<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
-                "<tr>\n" +
-                "<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
-                "<th class=\"colLast\" scope=\"col\">Description</th>\n" +
-                "</tr>\n" +
-                "<tbody>\n" +
-                "<tr class=\"altColor\">\n" +
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"interface in p1\">A</a></th>\n" +
-                "<td class=\"colLast\">&nbsp;<br>(<span class=\"implementationLabel\">Implementation(s):</span>&nbsp;<a href=\"p1/B.html\" title=\"class in p1\">B</a>)</td>\n" +
-                "</tr>\n" +
-                "<tr class=\"rowColor\">\n" +
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"p2/A.html\" title=\"interface in p2\">A</a></th>\n" +
-                "<td class=\"colLast\">&nbsp;<br>(<span class=\"implementationLabel\">Implementation(s):</span>&nbsp;<a href=\"p2/B.html\" title=\"class in p2\">B</a>)</td>\n" +
-                "</tr>\n" +
-                "</tbody>\n");
     }
 
     @Test
@@ -440,30 +364,6 @@
                 "</tbody>\n" +
                 "</table>\n");
 
-        javadoc("-d", base.toString() + "/out-html4",
-                "-html4",
-                "-quiet",
-                "--module-source-path", base.toString(),
-                "--module", "m");
-
-        checkExit(Exit.OK);
-
-        checkOutput("m/module-summary.html", true,
-                "<div class=\"providesSummary\">\n" +
-                "<table summary=\"Provides table, listing types, and an explanation\">\n" +
-                "<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
-                "<tr>\n" +
-                "<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
-                "<th class=\"colLast\" scope=\"col\">Description</th>\n" +
-                "</tr>\n" +
-                "<tbody>\n" +
-                "<tr class=\"altColor\">\n" +
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"interface in p1\">A</a></th>\n" +
-                "<td class=\"colLast\">\n" +
-                "<div class=\"block\">abc</div>\n</td>\n" +
-                "</tr>\n" +
-                "</tbody>\n" +
-                "</table>\n");
     }
 
     @Test
@@ -521,45 +421,6 @@
                 "</tbody>\n" +
                 "</table>\n");
 
-        javadoc("-d", base.toString() + "/out-html4",
-                "-html4",
-                "-quiet",
-                "--module-source-path", base.toString(),
-                "--module", "m");
-
-        checkExit(Exit.OK);
-
-        checkOutput("m/module-summary.html", true,
-                "<div class=\"providesSummary\">\n" +
-                "<table summary=\"Provides table, listing types, and an explanation\">\n" +
-                "<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
-                "<tr>\n" +
-                "<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
-                "<th class=\"colLast\" scope=\"col\">Description</th>\n" +
-                "</tr>\n" +
-                "<tbody>\n" +
-                "<tr class=\"altColor\">\n" +
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"p1/A.html\" title=\"interface in p1\">A</a></th>\n" +
-                "<td class=\"colLast\">\n" +
-                "<div class=\"block\">abc</div>\n</td>\n" +
-                "</tr>\n" +
-                "</tbody>\n" +
-                "</table>",
-                "<div class=\"usesSummary\">\n" +
-                "<table summary=\"Uses table, listing types, and an explanation\">\n" +
-                "<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n" +
-                "<tr>\n" +
-                "<th class=\"colFirst\" scope=\"col\">Type</th>\n" +
-                "<th class=\"colLast\" scope=\"col\">Description</th>\n" +
-                "</tr>\n" +
-                "<tbody>\n" +
-                "<tr class=\"altColor\">\n" +
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"p2/B.html\" title=\"class in p2\">B</a></th>\n" +
-                "<td class=\"colLast\">\n" +
-                "<div class=\"block\">def</div>\n</td>\n" +
-                "</tr>\n" +
-                "</tbody>\n" +
-                "</table>\n");
     }
 
 }
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,33 +45,6 @@
     }
 
     /**
-     * Test generated module pages for HTML 4.
-     */
-    @Test
-    public void testHtml4() {
-        javadoc("-d", "out",
-                "-html4",
-                "-use",
-                "-Xdoclint:none",
-                "-overview", testSrc("overview.html"),
-                "--frames",
-                "--module-source-path", testSrc,
-                "--module", "moduleA,moduleB",
-                "testpkgmdlA", "testpkgmdlB");
-        checkExit(Exit.OK);
-        checkDescription(true);
-        checkNoDescription(false);
-        checkOverviewSummaryModules();
-        checkModuleLink();
-        checkModuleClickThroughLinks();
-        checkModuleClickThrough(true);
-        checkModuleFilesAndLinks(true);
-        checkModulesInSearch(true);
-        checkOverviewFrame(true);
-        checkAllPkgsAllClasses(false);
-    }
-
-    /**
      * Test generated module pages for HTML 5.
      */
     @Test
@@ -98,29 +71,6 @@
     }
 
     /**
-     * Test generated module pages for HTML 4 with -nocomment option.
-     */
-    @Test
-    public void testHtml4NoComment() {
-        javadoc("-d", "out-nocomment",
-                "-html4",
-                "-nocomment",
-                "-use",
-                "-Xdoclint:none",
-                "--frames",
-                "-overview", testSrc("overview.html"),
-                "--module-source-path", testSrc,
-                "--module", "moduleA,moduleB",
-                "testpkgmdlA", "testpkgmdlB");
-        checkExit(Exit.OK);
-        checkDescription(false);
-        checkNoDescription(true);
-        checkModuleLink();
-        checkModuleFilesAndLinks(true);
-        checkOverviewFrame(true);
-    }
-
-    /**
      * Test generated module pages for HTML 5 with -nocomment option.
      */
     @Test
@@ -143,26 +93,6 @@
     }
 
     /**
-     * Test generated pages, in an unnamed module, for HTML 4.
-     */
-    @Test
-    public void testHtml4UnnamedModule() {
-        javadoc("-d", "out-nomodule",
-                "-html4",
-                "-use",
-                "--frames",
-                "-overview", testSrc("overview.html"),
-                "-sourcepath", testSrc,
-                "testpkgnomodule", "testpkgnomodule1");
-        checkExit(Exit.OK);
-        checkOverviewSummaryPackages();
-        checkModuleClickThrough(false);
-        checkModuleFilesAndLinks(false);
-        checkModulesInSearch(false);
-        checkOverviewFrame(false);
-    }
-
-    /**
      * Test generated pages, in an unnamed module, for HTML 5.
      */
     @Test
@@ -199,25 +129,6 @@
     }
 
     /**
-     * Test generated module pages with javadoc tags.
-     */
-    @Test
-    public void testJDTagsInModules_html4() {
-        javadoc("-d", "out-mdltags-html4",
-                "-html4",
-                "-author",
-                "-version",
-                "-Xdoclint:none",
-                "-tag", "regular:a:Regular Tag:",
-                "-tag", "moduletag:s:Module Tag:",
-                "--module-source-path", testSrc,
-                "--module", "moduletags,moduleB",
-                "testpkgmdltags", "testpkgmdlB");
-        checkExit(Exit.OK);
-        checkModuleTags_html4();
-    }
-
-    /**
      * Test generated module summary page.
      */
     @Test
@@ -234,23 +145,6 @@
     }
 
     /**
-     * Test generated module summary page.
-     */
-    @Test
-    public void testModuleSummary_html4() {
-        javadoc("-d", "out-moduleSummary-html4",
-                "-html4",
-                "-use",
-                "-Xdoclint:none",
-                "--module-source-path", testSrc,
-                "--module", "moduleA,moduleB",
-                "testpkgmdlA", "testpkgmdlB", "moduleB/testpkg2mdlB");
-        checkExit(Exit.OK);
-        checkModuleSummary_html4();
-        checkNegatedModuleSummary_html4();
-    }
-
-    /**
      * Test generated module summary page of an aggregating module.
      */
     @Test
@@ -311,21 +205,6 @@
     }
 
     /**
-     * Test annotations on modules.
-     */
-    @Test
-    public void testModuleAnnotation_html4() {
-        javadoc("-d", "out-moduleanno-html4",
-                "-html4",
-                "-Xdoclint:none",
-                "--module-source-path", testSrc,
-                "--module", "moduleA,moduleB",
-                "testpkgmdlA", "testpkgmdlB");
-        checkExit(Exit.OK);
-        checkModuleAnnotation_html4();
-    }
-
-    /**
      * Test module summary pages in "api" mode.
      */
     @Test
@@ -376,29 +255,6 @@
     }
 
     /**
-     * Test module summary pages in "all" mode.
-     */
-    @Test
-    public void testAllModeHtml4() {
-        javadoc("-d", "out-all-html4",
-                "-html4",
-                "-use",
-                "--show-module-contents=all",
-                "-author",
-                "-version",
-                "-Xdoclint:none",
-                "--frames",
-                "-tag", "regular:a:Regular Tag:",
-                "-tag", "moduletag:s:Module Tag:",
-                "--module-source-path", testSrc,
-                "--module", "moduleA,moduleB,moduleC,moduletags",
-                "testpkgmdlA", "moduleA/concealedpkgmdlA", "testpkgmdlB", "testpkg2mdlB", "testpkgmdlC", "testpkgmdltags");
-        checkExit(Exit.OK);
-        checkModuleModeCommon_html4();
-        checkModuleModeApi_html4(false);
-    }
-
-    /**
      * Test generated module summary page of a module with no exported package.
      */
     @Test
@@ -417,22 +273,6 @@
      * Test generated module summary page of a module with no exported package.
      */
     @Test
-    public void testModuleSummaryNoExportedPkgAll_html4() {
-        javadoc("-d", "out-ModuleSummaryNoExportedPkgAll-html4",
-                "-html4",
-                "-use",
-                "--show-module-contents=all",
-                "-sourcepath", testSrc + "/moduleNoExport",
-                "--module", "moduleNoExport",
-                "testpkgmdlNoExport");
-        checkExit(Exit.OK);
-        checkModuleSummaryNoExported_html4(true);
-    }
-
-    /**
-     * Test generated module summary page of a module with no exported package.
-     */
-    @Test
     public void testModuleSummaryNoExportedPkgApi() {
         javadoc("-d", "out-ModuleSummaryNoExportedPkgApi",
                 "-use",
@@ -444,21 +284,6 @@
     }
 
     /**
-     * Test generated module summary page of a module with no exported package.
-     */
-    @Test
-    public void testModuleSummaryNoExportedPkgApi_html4() {
-        javadoc("-d", "out-ModuleSummaryNoExportedPkgApi-html4",
-                "-html4",
-                "-use",
-                "-sourcepath", testSrc + "/moduleNoExport",
-                "--module", "moduleNoExport",
-                "testpkgmdlNoExport");
-        checkExit(Exit.OK);
-        checkModuleSummaryNoExported_html4(false);
-    }
-
-    /**
      * Test generated module pages for javadoc run for a single module having a single package.
      */
     @Test
@@ -511,29 +336,6 @@
     }
 
     /**
-     * Test -group option for modules. The overview-summary.html page should group the modules accordingly.
-     */
-    @Test
-    public void testGroupOption_html4() {
-        javadoc("-d", "out-group-html4",
-                "-html4",
-                "--show-module-contents=all",
-                "-Xdoclint:none",
-                "--frames",
-                "-tag", "regular:a:Regular Tag:",
-                "-tag", "moduletag:s:Module Tag:",
-                "--module-source-path", testSrc,
-                "-group", "Module Group A", "moduleA*",
-                "-group", "Module Group B & C", "moduleB*:moduleC*",
-                "-group", "Java SE Modules", "java*",
-                "--module", "moduleA,moduleB,moduleC,moduletags",
-                "moduleA/concealedpkgmdlA", "testpkgmdlA", "testpkg2mdlB", "testpkgmdlB", "testpkgmdlC",
-                "testpkgmdltags");
-        checkExit(Exit.OK);
-        checkGroupOption_html4();
-    }
-
-    /**
      * Test -group option for modules and the ordering of module groups.
      * The overview-summary.html page should group the modules accordingly and display the group tabs in
      * the order it was provided on the command-line.
@@ -577,25 +379,6 @@
     }
 
     /**
-     * Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
-     */
-    @Test
-    public void testUnnamedModuleGroupOption_html4() {
-        javadoc("-d", "out-groupnomodule-html4",
-                "-html4",
-                "-use",
-                "-Xdoclint:none",
-                "--frames",
-                "-overview", testSrc("overview.html"),
-                "-sourcepath", testSrc,
-                "-group", "Package Group 0", "testpkgnomodule",
-                "-group", "Package Group 1", "testpkgnomodule1",
-                "testpkgnomodule", "testpkgnomodule1");
-        checkExit(Exit.OK);
-        checkUnnamedModuleGroupOption_html4();
-    }
-
-    /**
      * Test -group option for unnamed modules and the ordering of package groups.
      * The overview-summary.html page should group the packages accordingly and display the group tabs in
      * the order it was provided on the command-line.
@@ -636,24 +419,6 @@
      * Test -group option for a single module.
      */
     @Test
-    public void testGroupOptionSingleModule_html4() {
-        javadoc("-d", "out-groupsinglemodule-html4",
-                "-html4",
-                "-use",
-                "-Xdoclint:none",
-                "--frames",
-                "--module-source-path", testSrc,
-                "-group", "Module Group B", "moduleB*",
-                "--module", "moduleB",
-                "testpkg2mdlB", "testpkgmdlB");
-        checkExit(Exit.OK);
-        checkGroupOptionSingleModule_html4();
-    }
-
-    /**
-     * Test -group option for a single module.
-     */
-    @Test
     public void testModuleName() {
         javadoc("-d", "out-modulename",
                 "-use",
@@ -853,12 +618,6 @@
                 + "<dd>Just a simple module tag.</dd>");
     }
 
-    void checkModuleTags_html4() {
-        checkOutput("moduletags/module-summary.html", true,
-                "Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#"
-                + "testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.");
-    }
-
     void checkOverviewSummaryModules() {
         checkOutput("overview-summary.html", true,
                 "<div class=\"overviewSummary\">\n"
@@ -1045,31 +804,6 @@
                 + "</tr>");
     }
 
-    void checkModuleSummary_html4() {
-        checkOutput("moduleA/module-summary.html", true,
-                "<!-- ============ MODULES SUMMARY =========== -->\n"
-                + "<a name=\"modules.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
-                + "<a name=\"packages.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-        checkOutput("moduleB/module-summary.html", true,
-                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
-                + "<a name=\"packages.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
-                + "<a name=\"packages.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>",
-                "<!-- ============ SERVICES SUMMARY =========== -->\n"
-                + "<a name=\"services.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-    }
-
     void checkAggregatorModuleSummary() {
         checkOutput("moduleT/module-summary.html", true,
                 "<div class=\"header\">\n"
@@ -1105,14 +839,6 @@
                 + "</a>");
     }
 
-    void checkNegatedModuleSummary_html4() {
-        checkOutput("moduleA/module-summary.html", false,
-                "<!-- ============ SERVICES SUMMARY =========== -->\n"
-                + "<a name=\"services.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-    }
-
     void checkModuleClickThroughLinks() {
         checkOutput("module-overview-frame.html", true,
                 "<li><a href=\"moduleA/module-frame.html\" target=\"packageListFrame\" "
@@ -1272,45 +998,6 @@
                 + "<td class=\"colLast\"><a href=\"../moduleB/testpkgmdlB/package-summary.html\">testpkgmdlB</a></td>\n");
     }
 
-    void checkModuleModeCommon_html4() {
-        checkOutput("overview-summary.html", true,
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"moduletags/module-summary.html\">moduletags</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"block\">This is a test description for the moduletags module.<br>\n"
-                + " Type Link: <a href=\"moduletags/testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>TestClassInModuleTags</code></a>.<br>\n"
-                + " Member Link: <a href=\"moduletags/testpkgmdltags/TestClassInModuleTags.html#testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.<br>\n"
-                + " Package Link: <a href=\"moduletags/testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.<br></div>\n"
-                + "</td>");
-        checkOutput("moduletags/module-summary.html", true,
-                "<div class=\"requiresSummary\">\n"
-                + "<table summary=\"Indirect Requires table, listing modules, and an explanation\">\n"
-                + "<caption><span>Indirect Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<div class=\"packagesSummary\">\n"
-                + "<table summary=\"Indirect Exports table, listing modules, and packages\">\n"
-                + "<caption><span>Indirect Exports</span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<div class=\"requiresSummary\">\n"
-                + "<table summary=\"Requires table, listing modules, and an explanation\">\n"
-                + "<caption><span>Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
-                + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>",
-                "<div class=\"requiresSummary\">\n"
-                + "<table summary=\"Indirect Requires table, listing modules, and an explanation\">\n"
-                + "<caption><span>Indirect Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
-                + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>",
-                "<div class=\"packagesSummary\">\n"
-                + "<table summary=\"Indirect Opens table, listing modules, and packages\">\n"
-                + "<caption><span>Indirect Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">From</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
-                + "</tr>\n");
-    }
-
     void checkModuleModeApi(boolean found) {
         checkOutput("moduleA/module-summary.html", found,
                 "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
@@ -1340,24 +1027,6 @@
                 + "<td class=\"colLast\">&nbsp;</td>");
     }
 
-    void checkModuleModeApi_html4(boolean found) {
-        checkOutput("moduleB/module-summary.html", found,
-                "<div class=\"packagesSummary\">\n"
-                + "<table summary=\"Packages table, listing packages, and an explanation\">\n"
-                + "<caption><span>Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>\n"
-                + "<tbody>\n"
-                + "<tr class=\"altColor\" id=\"i0\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
-                + "<td class=\"colLast\">&nbsp;</td>\n"
-                + "</tr>\n"
-                + "</tbody>\n"
-                + "</table>");
-    }
-
     void checkModuleModeAll(boolean found) {
         checkOutput("moduleA/module-summary.html", found,
                 "<td class=\"colFirst\"> </td>\n"
@@ -1457,13 +1126,6 @@
                 "@AnnotationTypeUndocumented");
     }
 
-    void checkModuleAnnotation_html4() {
-        checkOutput("moduleB/module-summary.html", true,
-                "<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n"
-                + "                <a href=\"testpkgmdlB/AnnotationType.html#required--\">required</a>=2016)\n"
-                + "</p>");
-    }
-
     void checkOverviewFrame(boolean found) {
         checkOutput("index.html", !found,
                 "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>");
@@ -1480,14 +1142,6 @@
                 "<caption><span>Concealed</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
 
-    void checkModuleSummaryNoExported_html4(boolean found) {
-        checkOutput("moduleNoExport/module-summary.html", found,
-                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
-                + "<a name=\"packages.summary\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-    }
-
     void checkGroupOption() {
         checkOutput("overview-summary.html", true,
                 "<div class=\"contentContainer\">\n"
@@ -1517,35 +1171,6 @@
                 "Java SE Modules");
     }
 
-    void checkGroupOption_html4() {
-        checkOutput("overview-summary.html", true,
-                "<div class=\"contentContainer\">\n"
-                + "<div class=\"overviewSummary\">\n"
-                + "<div role=\"tablist\" aria-orientation=\"horizontal\"><button role=\"tab\""
-                + " aria-selected=\"true\" aria-controls=\"overviewSummary_tabpanel\" tabindex=\"0\""
-                + " onkeydown=\"switchTab(event)\" id=\"t0\" class=\"activeTableTab\">All Modules</button>"
-                + "<button role=\"tab\" aria-selected=\"false\" aria-controls=\"overviewSummary_tabpanel\""
-                + " tabindex=\"-1\" onkeydown=\"switchTab(event)\" id=\"t1\" class=\"tableTab\""
-                + " onclick=\"show(1);\">Module Group A</button><button role=\"tab\" aria-selected=\"false\""
-                + " aria-controls=\"overviewSummary_tabpanel\" tabindex=\"-1\" onkeydown=\"switchTab(event)\""
-                + " id=\"t2\" class=\"tableTab\" onclick=\"show(2);\">Module Group B &amp; C</button>"
-                + "<button role=\"tab\" aria-selected=\"false\" aria-controls=\"overviewSummary_tabpanel\""
-                + " tabindex=\"-1\" onkeydown=\"switchTab(event)\" id=\"t4\" class=\"tableTab\""
-                + " onclick=\"show(4);\">Other Modules</button></div>\n"
-                + "<div id=\"overviewSummary_tabpanel\" role=\"tabpanel\">\n"
-                + "<table summary=\"Module Summary table, listing modules, and an explanation\" aria-labe",
-                "var data = {\"i0\":1,\"i1\":2,\"i2\":2,\"i3\":4};\n"
-                + "var tabs = {65535:[\"t0\",\"All Modules\"],1:[\"t1\",\"Module Group A\"],2:[\"t2\",\"Module Group B & C\"],4:[\"t4\",\"Other Modules\"]};\n"
-                + "var altColor = \"altColor\";\n"
-                + "var rowColor = \"rowColor\";\n"
-                + "var tableTab = \"tableTab\";\n"
-                + "var activeTableTab = \"activeTableTab\";");
-        checkOutput("overview-summary.html", false,
-                "<div class=\"overviewSummary\">\n<table summary=\"Module Summary table, listing modules, and an explanation\">\n"
-                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "Java SE Modules");
-    }
-
     void checkGroupOptionOrdering() {
         checkOutput("overview-summary.html", true,
                 "<div role=\"tablist\" aria-orientation=\"horizontal\"><button role=\"tab\""
@@ -1605,25 +1230,6 @@
                 + "var activeTableTab = \"activeTableTab\";");
     }
 
-    void checkUnnamedModuleGroupOption_html4() {
-        checkOutput("overview-summary.html", true,
-                "<div class=\"contentContainer\">\n"
-                + "<div class=\"block\">The overview summary page header.</div>\n"
-                + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
-                + "<div class=\"overviewSummary\">\n"
-                + "<div role=\"tablist\" aria-orientation=\"horizontal\"><button role=\"tab\""
-                + " aria-selected=\"true\" aria-controls=\"overviewSummary_tabpanel\" tabindex=\"0\""
-                + " onkeydown=\"switchTab(event)\" id=\"t0\" class=\"activeTableTab\">All Packages"
-                + "</button><button role=\"tab\" aria-selected=\"false\" aria-controls=\"overviewSummary_tabpanel\""
-                + " tabindex=\"-1\" onkeydown=\"switchTab(event)\" id=\"t1\" class=\"tableTab\" onclick=\"show(1);\">"
-                + "Package Group 0</button><button role=\"tab\" aria-selected=\"false\""
-                + " aria-controls=\"overviewSummary_tabpanel\" tabindex=\"-1\" onkeydown=\"switchTab(event)\" id=\"t2\""
-                + " class=\"tableTab\" onclick=\"show(2);\">Package Group 1</button></div>\n"
-                + "<div id=\"overviewSummary_tabpanel\" role=\"tabpanel\">\n"
-                + "<table summary=\"Package Summary table, listing packages, and an explanation\" aria-labelledby=\"t0\">");
-    }
-
     void checkGroupOptionPackageOrdering() {
         checkOutput("overview-summary.html", true,
                 "<div role=\"tablist\" aria-orientation=\"horizontal\"><button role=\"tab\""
@@ -1642,11 +1248,6 @@
                 "window.location.replace('moduleB/module-summary.html')");
     }
 
-    void checkGroupOptionSingleModule_html4() {
-        checkOutput("index.html", true,
-                "window.location.replace('moduleB/module-summary.html')");
-    }
-
     void checkModuleName(boolean found) {
         checkOutput("test.moduleFullName/module-summary.html", found,
                 "<div class=\"header\">\n"
--- a/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -110,46 +110,6 @@
                 + "<div class=\"header\">");
     }
 
-    @Test
-    public void test_html4(Path ignore) {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-overview", testSrc("overview.html"),
-                "--frames",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-        checkSubNav();
-
-        checkOutput("pkg/I.html", true,
-                // Test for 4664607
-                "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
-                + "<a name=\"navbar.top.firstrow\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-
-        // Remaining tests check for additional padding to offset the fixed navigation bar.
-        checkOutput("pkg/A.html", true,
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<!-- ======== START OF CLASS DATA ======== -->");
-
-        checkOutput("pkg/package-summary.html", true,
-                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
-                + "</div>\n"
-                + "<div class=\"navPadding\">&nbsp;</div>\n"
-                + "<script type=\"text/javascript\"><!--\n"
-                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
-                + "//-->\n"
-                + "</script>\n"
-                + "<div class=\"header\">");
-    }
-
     // Test for checking additional padding to offset the fixed navigation bar in HTML5.
     @Test
     public void test1(Path ignore) {
--- a/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,18 +53,4 @@
             "href=\"#foo(java.util.Map)\"><code>foo" +
             "(java.util.Map&lt;A, java.util.Map&lt;A, A&gt;&gt;)</code></a></div>");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/NestedGenerics.html", true,
-            "<div class=\"block\">Contains <a " +
-            "href=\"#foo-java.util.Map-\"><code>foo" +
-            "(java.util.Map&lt;A, java.util.Map&lt;A, A&gt;&gt;)</code></a></div>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,21 +60,6 @@
         checkAnnotationTypeUsage();
     }
 
-    @Test
-    public void test_html4() {
-        javadoc("-Xdoclint:none",
-                "-d", "out-html4",
-                "-html4",
-                "-use",
-                "-sourcepath", testSrc,
-                "pkg", "pkg1", "pkg2");
-        checkExit(Exit.OK);
-
-        checkTypeParameters_html4();
-        checkVarArgs_html4();
-        checkAnnotationTypeUsage_html4();
-    }
-
     //=================================
     // ENUM TESTING
     //=================================
@@ -488,122 +473,6 @@
     }
 
     //=================================
-    // TYPE PARAMETER TESTING
-    //=================================
-
-    void checkTypeParameters_html4() {
-        checkOutput("pkg/TypeParameters.html", true,
-                // Make sure the header is correct.
-                "<td class=\"colFirst\"><code><a href=\"TypeParameters.html\" "
-                + "title=\"type parameter in TypeParameters\">E</a>[]</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#methodThatReturnsTypeParameterA-E:A-\">"
-                + "methodThatReturnsTypeParameterA</a></span>&#8203;(<a href=\"TypeParameters.html\" "
-                + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</code>",
-                "<td class=\"colFirst\"><code>&lt;T extends java.lang.Object &amp; java.lang.Comparable&lt;? super T&gt;&gt;"
-                + "<br>T</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#methodtThatReturnsTypeParametersB-java.util.Collection-\">"
-                + "methodtThatReturnsTypeParametersB</a></span>&#8203;(java.util.Collection&lt;? extends T&gt;&nbsp;coll)</code>",
-                "<div class=\"block\">Returns TypeParameters</div>\n",
-                // Method takes a TypeVariable
-                "<td class=\"colFirst\"><code>&lt;X extends java.lang.Throwable&gt;<br>"
-                + "<a href=\"TypeParameters.html\" title=\"type parameter in TypeParameters\">E</a>"
-                + "</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#orElseThrow-java.util.function.Supplier-\">"
-                + "orElseThrow</a></span>&#8203;(java.util.function.Supplier&lt;? extends X&gt;&nbsp;exceptionSupplier)</code>"
-                );
-
-        //==============================================================
-        // Test Class-Use Documentation for Type Parameters.
-        //==============================================================
-        // ClassUseTest1: <T extends Foo & Foo2>
-        checkOutput("pkg2/class-use/Foo.html", true,
-                "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest1."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
-                + "ClassUseTest1.html#method-T-\">method</a></span>"
-                + "&#8203;(T&nbsp;t)</code></th>"
-        );
-
-        checkOutput("pkg2/class-use/Foo2.html", true,
-                "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">"
-                + "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../"
-                + "ClassUseTest1.html#method-T-\">method</a></span>"
-                + "&#8203;(T&nbsp;t)</code></th>"
-        );
-
-        // ClassUseTest2: <T extends ParamTest<Foo3>>
-        checkOutput("pkg2/class-use/ParamTest.html", true,
-                "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
-                + "ClassUseTest2.html#method-T-\">method</a></span>"
-                + "&#8203;(T&nbsp;t)</code></th>"
-        );
-
-        checkOutput("pkg2/class-use/Foo3.html", true,
-                "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../"
-                + "ClassUseTest2.html#method-T-\">method</a></span>"
-                + "&#8203;(T&nbsp;t)</code></th>"
-        );
-
-        // ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
-        checkOutput("pkg2/class-use/ParamTest2.html", true,
-                "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3"
-                + ".</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
-                + "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code></th>"
-        );
-
-        checkOutput("pkg2/class-use/Foo4.html", true,
-                "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
-                + "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code>"
-                + "</th>"
-        );
-
-        // Type parameters in constructor and method args
-        checkOutput("pkg2/class-use/Foo4.html", true,
-                "<caption><span>Method parameters in <a href=\"../"
-                + "package-summary.html\">pkg2</a> with type arguments of "
-                + "type <a href=\"../Foo4.html\" title=\"class in "
-                + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;"
-                + "</span></caption>\n"
-                + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n"
-                + "<th class=\"colSecond\" scope=\"col\">Method</th>\n"
-                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>\n"
-                + "<tbody>\n"
-                + "<tr class=\"altColor\">\n"
-                + "<td class=\"colFirst\"><code>void</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
-                + "</span><code><span class=\"memberNameLink\"><a href=\"../ClassUseTest3."
-                + "html#method-java.util.Set-\">method</a></span>&#8203;(java."
-                + "util.Set&lt;<a href=\"../Foo4.html\" title=\""
-                + "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code></th>"
-        );
-
-        //=================================
-        // TYPE PARAMETER IN INDEX
-        //=================================
-        checkOutput("index-all.html", true,
-                "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">"
-                + "method(Vector&lt;Object&gt;)</a></span>"
-        );
-
-        // TODO: duplicate of previous case; left in delibarately for now to simplify comparison testing
-        //=================================
-        // TYPE PARAMETER IN INDEX
-        //=================================
-        checkOutput("index-all.html", true,
-                "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">"
-                + "method(Vector&lt;Object&gt;)</a></span>"
-        );
-
-    }
-
-    //=================================
     // VAR ARG TESTING
     //=================================
     void checkVarArgs() {
@@ -616,18 +485,6 @@
     }
 
     //=================================
-    // VAR ARG TESTING
-    //=================================
-    void checkVarArgs_html4() {
-        checkOutput("pkg/VarArgs.html", true,
-                "(int...&nbsp;i)",
-                "(int[][]...&nbsp;i)",
-                "-int:A...-",
-                "<a href=\"TypeParameters.html\" title=\"class in pkg\">"
-                + "TypeParameters</a>...&nbsp;t");
-    }
-
-    //=================================
     // ANNOTATION TYPE TESTING
     //=================================
     void checkAnnotationTypes() {
@@ -821,91 +678,4 @@
                 "public interface <span class=\"typeNameLabel\">B</span></pre>");
 
     }
-
-    //=================================
-    // ANNOTATION TYPE USAGE TESTING
-    //=================================
-    void checkAnnotationTypeUsage_html4() {
-        checkOutput("pkg/package-summary.html", true,
-                // PACKAGE
-                "<a href=\"AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n"
-                + "                <a href=\"AnnotationType.html#required--\">required</a>=1994)");
-
-        checkOutput("pkg/AnnotationTypeUsage.html", true,
-                // CLASS
-                "<pre><a href=\"AnnotationType.html\" "
-                + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
-                + "=\"Class Annotation\",\n"
-                + "                <a href=\"AnnotationType.html#required--\">"
-                + "required</a>=1994)\n"
-                + "public class <span class=\"typeNameLabel\">"
-                + "AnnotationTypeUsage</span>\n"
-                + "extends java.lang.Object</pre>",
-                // FIELD
-                "<pre><a href=\"AnnotationType.html\" "
-                + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
-                + "=\"Field Annotation\",\n"
-                + "                <a href=\"AnnotationType.html#required--\">"
-                + "required</a>=1994)\n"
-                + "public&nbsp;int field</pre>",
-                // CONSTRUCTOR
-                "<pre><a href=\"AnnotationType.html\" "
-                + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
-                + "=\"Constructor Annotation\",\n"
-                + "                <a href=\"AnnotationType.html#required--\">"
-                + "required</a>=1994)\n"
-                + "public&nbsp;AnnotationTypeUsage()</pre>",
-                // METHOD
-                "<pre class=\"methodSignature\"><a href=\"AnnotationType.html\" "
-                + "title=\"annotation in pkg\">@AnnotationType</a>("
-                + "<a href=\"AnnotationType.html#optional--\">optional</a>"
-                + "=\"Method Annotation\",\n"
-                + "                <a href=\"AnnotationType.html#required--\">"
-                + "required</a>=1994)\n"
-                + "public&nbsp;void&nbsp;method()</pre>",
-                // METHOD PARAMS
-                "<pre class=\"methodSignature\">public&nbsp;void&nbsp;methodWithParams&#8203;("
-                + "<a href=\"AnnotationType.html\" title=\"annotation in pkg\">"
-                + "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
-                + "optional</a>=\"Parameter Annotation\",<a "
-                + "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
-                + "                             int&nbsp;documented,\n"
-                + "                             int&nbsp;undocmented)</pre>",
-                // CONSTRUCTOR PARAMS
-                "<pre>public&nbsp;AnnotationTypeUsage&#8203;(<a "
-                + "href=\"AnnotationType.html\" title=\"annotation in pkg\">"
-                + "@AnnotationType</a>(<a href=\"AnnotationType.html#optional--\">"
-                + "optional</a>=\"Constructor Param Annotation\",<a "
-                + "href=\"AnnotationType.html#required--\">required</a>=1994)\n"
-                + "                           int&nbsp;documented,\n"
-                + "                           int&nbsp;undocmented)</pre>");
-
-        //=================================
-        // ANNOTATION TYPE USAGE TESTING (All Different Types).
-        //=================================
-        checkOutput("pkg1/B.html", true,
-                // Integer
-                "<a href=\"A.html#d--\">d</a>=3.14,",
-                // Double
-                "<a href=\"A.html#d--\">d</a>=3.14,",
-                // Boolean
-                "<a href=\"A.html#b--\">b</a>=true,",
-                // String
-                "<a href=\"A.html#s--\">s</a>=\"sigh\",",
-                // Class
-                "<a href=\"A.html#c--\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,",
-                // Bounded Class
-                "<a href=\"A.html#w--\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,",
-                // Enum
-                "<a href=\"A.html#e--\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,",
-                // Annotation Type
-                "<a href=\"A.html#a--\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994),",
-                // String Array
-                "<a href=\"A.html#sa--\">sa</a>={\"up\",\"down\"},",
-                // Primitive
-                "<a href=\"A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,15 +66,6 @@
     }
 
     @Test
-    public void testPositive_html4() {
-        javadoc("-d", "out1-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                testSrc("C.java"));
-        checkExit(Exit.OK);
-    }
-
-    @Test
     public void testNegative() {
         javadoc("-d", "out2",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Mon Feb 04 11:01:04 2019 +0530
@@ -252,41 +252,6 @@
     }
 
     @Test
-    public void testLinkSource_html4() {
-        javadoc("-d", "out-9-html4",
-                "-html4",
-                "-linksource",
-                "-javafx",
-                "--disable-javafx-strict-checks",
-                "-sourcepath", testSrc,
-                "-package",
-                "linksource");
-        checkExit(Exit.OK);
-
-        checkOutput("src-html/linksource/AnnotationTypeField.html", true,
-                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">"
-                + "@Documented public @interface AnnotationTypeField {</a>");
-
-        checkOutput("src-html/linksource/Properties.html", true,
-                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">    "
-                + "public Object someProperty() {</a>");
-
-        checkOutput("src-html/linksource/SomeClass.html", true,
-                "<span class=\"sourceLineNo\">029</span><a name=\"line.29\">"
-                + "public class SomeClass {</a>",
-                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">    "
-                + "public int field;</a>",
-                "<span class=\"sourceLineNo\">033</span><a name=\"line.33\">    "
-                + "public SomeClass() {</a>",
-                "<span class=\"sourceLineNo\">036</span><a name=\"line.36\">    "
-                + "public int method() {</a>");
-
-        checkOutput("src-html/linksource/SomeEnum.html", true,
-                "<span class=\"sourceLineNo\">029</span><a name=\"line.29\">    VALUE1,</a>",
-                "<span class=\"sourceLineNo\">030</span><a name=\"line.30\">    VALUE2</a>");
-    }
-
-    @Test
     public void testNoQualifier() {
         javadoc("-d", "out-10",
                 "-noqualifier", "pkg",
--- a/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -653,24 +653,6 @@
                     "<h4>threeProperty</h4>",
                     "<h4>fourProperty</h4>");
 
-            javadoc("-d", "out-5-html4",
-                    "-html4",
-                    "-javafx",
-                    "-sourcepath", testSrc(new File(".").getPath()),
-                    "pkg5"
-            );
-
-            checkExit(Exit.OK);
-
-            checkOrder("pkg5/CtorTest.html",
-                    "<a href=\"#CtorTest-int-\"",
-                    "<a href=\"#CtorTest-int-int-\"",
-                    "<a href=\"#CtorTest-int-int-int-\"",
-                    "<a href=\"#CtorTest-int-int-int-int-\"",
-                    "<a name=\"CtorTest-int-int-int-int-\">",
-                    "<a name=\"CtorTest-int-int-int-\">",
-                    "<a name=\"CtorTest-int-int-\">",
-                    "<a name=\"CtorTest-int-\">");
         }
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,18 +58,4 @@
                 + "<a href=\"BaseClass.html#overridenMethodWithDocsToCopy()\">"
                 + "BaseClass</a></code></span>");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg1", "pkg2");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg1/SubClass.html", true,
-                "<span class=\"descfrmTypeLabel\">Description copied from class:&nbsp;<code>"
-                + "<a href=\"BaseClass.html#overridenMethodWithDocsToCopy--\">"
-                + "BaseClass</a></code></span>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -88,52 +88,4 @@
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
                 + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-package",
-                "pkg1", "pkg2");
-        checkExit(Exit.OK);
-
-        // The public method should be overridden
-        checkOutput("pkg1/SubClass.html", true,
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"BaseClass.html#publicMethod--\">"
-                + "publicMethod</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
-
-        // The public method in different package should be overridden
-        checkOutput("pkg2/SubClass.html", true,
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">"
-                + "publicMethod</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
-
-        // The package private method should be overridden since the base and sub class are in the same
-        // package.
-        checkOutput("pkg1/SubClass.html", true,
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"BaseClass.html#packagePrivateMethod--\">"
-                + "packagePrivateMethod</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>");
-
-        // The private method in should not be overridden
-        checkOutput("pkg1/SubClass.html", false,
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"BaseClass.html#privateMethod()\">");
-
-        // The private method in different package should not be overridden
-        checkOutput("pkg2/SubClass.html", false,
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">");
-
-        // The package private method should not be overridden since the base and sub class are in
-        // different packages.
-        checkOutput("pkg2/SubClass.html", false,
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -257,105 +257,4 @@
                         "the order they are declared."
         );
     }
-
-    @Test
-    public void testSummary_html4() {
-        javadoc("-d", "out-summary-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-javafx",
-                "--override-methods=summary",
-                "pkg5");
-
-        checkExit(Exit.OK);
-
-        checkOrder("pkg5/Classes.C.html",
-                "#m1--\">m1",
-                "#m4-java.lang.String-java.lang.String-\">m4",
-                "Classes.GP.html#m0--\">m0",
-                "Classes.GP.html#m7--\">m7"
-        );
-
-        checkOrder("pkg5/Classes.C.html",
-                // Check footnotes 2
-                "Classes.P.html#getRate--\">getRate",
-                "Classes.P.html#m2--\">m2",
-                "Classes.P.html#m3--\">m3",
-                "Classes.P.html#m4-K-V-\">m4",
-                "Classes.P.html#rateProperty--\">rateProperty",
-                "Classes.P.html#setRate-double-\">setRate",
-
-                // Check @link
-                "Classes.GP.html#m0--",
-                "#m1--",
-                "Classes.P.html#m2--",
-                "Classes.P.html#m3--",
-                "Classes.P.html#m5--",
-                "#m6--",
-                "#m7--",
-
-                // Check @see
-                "Classes.GP.html#m0--",
-                "#m1--",
-                "Classes.P.html#m2--",
-                "Classes.P.html#m3--",
-                "#m4-java.lang.String-java.lang.String-",
-                "Classes.P.html#m5--\"><code>Classes.P.m5()",
-                "#m6--\"><code>m6()",
-                "#m7--\"><code>m7()"
-        );
-
-        // Tests for interfaces
-
-        // Make sure the static methods in the super interface
-        // do not make it to this interface
-        checkOrder("pkg5/Interfaces.D.html",
-                "Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
-                "Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
-                "Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
-                "Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
-                "#m--\"><code>m()",
-                "#n--\"><code>n()",
-                "Interfaces.C.html#o--\"><code>Interfaces.C.o()",
-                "Interfaces.A.html#m0--\"><code>Interfaces.A.m0()",
-                "Interfaces.A.html#m1--\"><code>Interfaces.A.m1()",
-                "Interfaces.A.html#m2--\"><code>Interfaces.A.m2()",
-                "Interfaces.A.html#m3--\"><code>Interfaces.A.m3()",
-                "#m--\"><code>m()",
-                "#n--\"><code>n()",
-                "Interfaces.C.html#o--\"><code>Interfaces.C.o()",
-                "#m--\">m",
-                "#n--\">n",
-                "Interfaces.A.html#getRate--\">getRate",
-                "Interfaces.A.html#rateProperty--\">rateProperty",
-                "Interfaces.A.html#setRate-double-",
-                "Interfaces.B.html#m1--\">m1",
-                "Interfaces.B.html#m3--\">m3",
-                "<a href=\"Interfaces.C.html#o--\">o</a>"
-        );
-
-        // Test synthetic values and valuesof of an enum.
-        checkOrder("index-all.html",
-                "<a href=\"pkg5/Interfaces.C.html#m--\">m()",
-                "<a href=\"pkg5/Interfaces.D.html#m--\">m()</a>",
-                "<a href=\"pkg5/Classes.GP.html#m0--\">m0()",
-                "<a href=\"pkg5/Interfaces.A.html#m0--\">m0()</a>",
-                "<a href=\"pkg5/Classes.C.html#m1--\">m1()</a>",
-                "<a href=\"pkg5/Classes.P.html#m1--\">m1()</a>",
-                "<a href=\"pkg5/Interfaces.A.html#m1--\">m1()</a>",
-                "<a href=\"pkg5/Interfaces.B.html#m1--\">m1()</a>",
-                "<a href=\"pkg5/Classes.P.html#m2--\">m2()</a>",
-                "<a href=\"pkg5/Interfaces.A.html#m2--\">m2()</a>",
-                "<a href=\"pkg5/Classes.P.html#m3--\">m3()</a>",
-                "<a href=\"pkg5/Interfaces.A.html#m3--\">m3()</a>",
-                "<a href=\"pkg5/Interfaces.B.html#m3--\">m3()</a>",
-                "<a href=\"pkg5/Classes.C.html#m4-java.lang.String-java.lang.String-\">m4(String, String)</a>",
-                "<a href=\"pkg5/Classes.P.html#m4-K-V-\">m4(K, V)</a>",
-                "<a href=\"pkg5/Classes.P.html#m5--\">m5()</a>",
-                "<a href=\"pkg5/Classes.C.html#m6--\">m6()</a>",
-                "<a href=\"pkg5/Classes.P.html#m6--\">m6()</a>",
-                "<a href=\"pkg5/Classes.C.html#m7--\">m7()</a>",
-                "<a href=\"pkg5/Classes.GP.html#m7--\">m7()</a>"
-        );
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testOverview/TestOverview.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testOverview/TestOverview.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,20 +55,6 @@
     }
 
     @Test
-    public void test1_html4() {
-        javadoc("-d", "out-1-html4",
-                "-html4",
-                "-doctitle", "Document Title",
-                "-windowtitle", "Window Title",
-                "-overview", testSrc("overview.html"),
-                "--frames",
-                "-sourcepath", testSrc("src"),
-                "p1", "p2");
-        checkExit(Exit.OK);
-        checkOverview_html4();
-    }
-
-    @Test
     public void test2() {
         javadoc("-d", "out-2",
                     "-doctitle", "Document Title",
@@ -81,20 +67,6 @@
         checkOverview();
     }
 
-    @Test
-    public void test2_html4() {
-        javadoc("-d", "out-2-html4",
-                "-html4",
-                "-doctitle", "Document Title",
-                "-windowtitle", "Window Title",
-                "-overview", testSrc("overview.html"),
-                "--frames",
-                "-sourcepath", testSrc("msrc"),
-                "p1", "p2");
-        checkExit(Exit.OK);
-        checkOverview_html4();
-    }
-
     void checkOverview() {
         checkOutput("overview-summary.html", true,
                 "<main role=\"main\">\n"
@@ -106,15 +78,4 @@
                 + "</div>\n"
                 + "<div class=\"contentContainer\">");
     }
-
-    void checkOverview_html4() {
-        checkOutput("overview-summary.html", true,
-                "<div class=\"header\">\n"
-                + "<h1 class=\"title\">Document Title</h1>\n"
-                + "</div>\n"
-                + "<div class=\"contentContainer\">\n"
-                + "<div class=\"block\">This is line1. This is line 2.</div>\n"
-                + "</div>\n"
-                + "<div class=\"contentContainer\">");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testPackageDescription/TestPackageDescription.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testPackageDescription/TestPackageDescription.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,19 +53,4 @@
                 + "</a>\n"
                 + "<div class=\"block\">package description</div>\n");
     }
-
-    @Test
-    public void test2() {
-        javadoc("-d", "out-2",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/package-summary.html", true,
-                "<a name=\"package.description\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<div class=\"block\">package description</div>\n");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,42 +141,6 @@
     }
 
     @Test
-    public void testDefault_html4() {
-        javadoc("-d", "out-default-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg", "pkg2");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/PublicChild.html", true,
-                // Method inheritance from non-public superclass.
-                "<a href=\"#methodInheritedFromParent-int-\">");
-
-        checkOutput("pkg/PublicChild.html", false,
-                // Should not document comments from private inherited interfaces
-                "<td class=\"colLast\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#methodInterface-int-\">"
-                + "methodInterface</a></span>&#8203;(int&nbsp;p1)</code>\n"
-                + "<div class=\"block\">Comment from interface.</div>\n</td>",
-                // and similarly one more
-                "<td class=\"colLast\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#methodInterface2-int-\">"
-                + "methodInterface2</a></span>&#8203;(int&nbsp;p1)</code>\n"
-                + "<div class=\"block\">Comment from interface.</div>\n</td>"
-        );
-
-        checkOutput("pkg/PublicInterface.html", true,
-                // Method inheritance from non-public superinterface.
-                "<a href=\"#methodInterface-int-\">"
-                + "methodInterface</a>");
-
-        checkOutput("pkg2/C.html", false,
-                //Do not inherit private interface method with generic parameters.
-                //This method has been implemented.
-                "<span class=\"memberNameLink\"><a href=\"I.html#hello-T-\">hello</a></span>");
-    }
-
-    @Test
     public void testPrivate() {
         javadoc("-d", "out-private",
                 "-sourcepath", testSrc,
@@ -269,46 +233,4 @@
         checkOutput("pkg/PrivateParent.html", false,
                 "<pre> class <span class=\"typeNameLabel\">PrivateParent</span>");
     }
-
-    @Test
-    public void testPrivate_html4() {
-        javadoc("-d", "out-private-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-private",
-                "pkg", "pkg2");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/PublicChild.html", true,
-                "<a href=\"PrivateParent.html#methodInheritedFromParent-int-\">"
-                + "methodInheritedFromParent</a>",
-                // Should document that a method overrides method from private class.
-                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">"
-                + "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>"
-                + "<a href=\"PrivateParent.html\" title=\"class in pkg\">"
-                + "PrivateParent</a></code></dd>",
-                // Should document that a method is specified by private interface.
-                "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"PrivateInterface.html#methodInterface-int-\">"
-                + "methodInterface</a></code>&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"PrivateInterface.html\" title=\"interface in pkg\">"
-                + "PrivateInterface</a></code></dd>");
-
-        checkOutput("pkg/PrivateInterface.html", true,
-                "<a href=\"#methodInterface-int-\">"
-                + "methodInterface</a>"
-        );
-
-        checkOutput("pkg2/C.html", true,
-                //Since private flag is used, we can document that private interface method
-                //with generic parameters has been implemented.
-                "<span class=\"descfrmTypeLabel\">Description copied from interface:&nbsp;<code>"
-                + "<a href=\"I.html#hello-T-\">I</a></code></span>",
-                "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"I.html#hello-T-\">hello</a></code>"
-                + "&nbsp;in interface&nbsp;<code>"
-                + "<a href=\"I.html\" title=\"interface in pkg2\">I</a>"
-                + "&lt;java.lang.String&gt;</code></dd>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -110,69 +110,5 @@
                 + "</dl>"
         );
     }
-
-    @Test
-    public void testArrays_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-javafx",
-                "--disable-javafx-strict-checks",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/MyClass.html", true,
-                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
-                + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;<a href=\"MyObj.html\" "
-                + "title=\"class in pkg\">MyObj</a>&gt; goodProperty</pre>\n"
-                + "<div class=\"block\">This is an Object property where the "
-                + "Object is a single Object.</div>\n"
-                + "<dl>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"#getGood--\"><code>getGood()</code></a>, \n"
-                + "<a href=\"#setGood-pkg.MyObj-\">"
-                + "<code>setGood(MyObj)</code></a></dd>\n"
-                + "</dl>",
-
-                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
-                + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;<a href=\"MyObj.html\" "
-                + "title=\"class in pkg\">MyObj</a>[]&gt; badProperty</pre>\n"
-                + "<div class=\"block\">This is an Object property where the "
-                + "Object is an array.</div>\n"
-                + "<dl>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"#getBad--\"><code>getBad()</code></a>, \n"
-                + "<a href=\"#setBad-pkg.MyObj:A-\">"
-                + "<code>setBad(MyObj[])</code></a></dd>\n"
-                + "</dl>",
-
-                // id should be used in the method table
-                "<tr class=\"altColor\" id=\"i0\">\n"
-                + "<td class=\"colFirst\"><code><a href=\"ObjectProperty.html\" "
-                + "title=\"class in pkg\">ObjectProperty</a>&lt;<a href=\"MyObj.html\" "
-                + "title=\"class in pkg\">MyObj</a>[]&gt;</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#badProperty--\">badProperty</a></span>()</code></th>"
-        );
-
-        checkOutput("pkg/MyClassT.html", true,
-                "<pre>public final&nbsp;<a href=\"ObjectProperty.html\" "
-                + "title=\"class in pkg\">ObjectProperty</a>"
-                + "&lt;java.util.List&lt;<a href=\"MyClassT.html\" "
-                + "title=\"type parameter in MyClassT\">T</a>&gt;&gt; "
-                + "listProperty</pre>\n"
-                + "<div class=\"block\">This is an Object property where the "
-                + "Object is a single <code>List&lt;T&gt;</code>.</div>\n"
-                + "<dl>\n"
-                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-                + "<dd><a href=\"#getList--\">"
-                + "<code>getList()</code></a>, \n"
-                + "<a href=\"#setList-java.util.List-\">"
-                + "<code>setList(List)</code></a></dd>\n"
-                + "</dl>"
-        );
-    }
 }
 
--- a/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java	Mon Feb 04 11:01:04 2019 +0530
@@ -102,28 +102,6 @@
             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>");
     }
 
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-use",
-                "-sourcepath", testSrc,
-                "pkg", "pkg2");
-        checkExit(Exit.OK);
-    }
-
-    @Override
-    public void checkLinks() {
-        // since the test uses explicit links to non-existent files,
-        // we create those files to avoid false positive errors from checkLinks
-        touch("pkg/relative-class-link.html");
-        touch("pkg/relative-field-link.html");
-        touch("pkg/relative-method-link.html");
-        touch("pkg/relative-package-link.html");
-        touch("pkg/relative-multi-line-link.html");
-        super.checkLinks();
-    }
-
     private void touch(String file) {
         File f = new File(outputDir, file);
         out.println("touch " + f);
--- a/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -136,76 +136,4 @@
                 + "<a href=\"ContaineeSynthDoc.html\" "
                 + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>)");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg", "pkg1");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/D.html", true,
-                "<a href=\"RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>"
-                + "(<a href=\"RegDoc.html#x--\">x</a>=1)",
-                "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"RegArryDoc.html#y--\">y</a>=1)",
-                "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"RegArryDoc.html#y--\">y</a>={1,2})",
-                "<a href=\"NonSynthDocContainer.html\" "
-                + "title=\"annotation in pkg\">@NonSynthDocContainer</a>"
-                + "("
-                + "<a href=\"RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
-                + "(<a href=\"RegArryDoc.html#y--\">y</a>=1))");
-
-        checkOutput("pkg1/C.html", true,
-                "<a href=\"RegContainerValDoc.html\" "
-                + "title=\"annotation in pkg1\">@RegContainerValDoc</a>"
-                + "(<a href=\"RegContainerValDoc.html#value--\">value</a>={"
-                + "<a href=\"RegContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>,"
-                + "<a href=\"RegContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>},"
-                + "<a href=\"RegContainerValDoc.html#y--\">y</a>=3)",
-                "<a href=\"ContainerValDoc.html\" "
-                + "title=\"annotation in pkg1\">@ContainerValDoc</a>"
-                + "(<a href=\"ContainerValDoc.html#value--\">value</a>={"
-                + "<a href=\"ContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>,"
-                + "<a href=\"ContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>},"
-                + "<a href=\"ContainerValDoc.html#x--\">x</a>=1)");
-
-        checkOutput("pkg/C.html", false,
-                "<a href=\"RegContainerNotDoc.html\" "
-                + "title=\"annotation in pkg\">@RegContainerNotDoc</a>"
-                + "(<a href=\"RegContainerNotDoc.html#value--\">value</a>={"
-                + "<a href=\"RegContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>,"
-                + "<a href=\"RegContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})");
-
-        checkOutput("pkg1/C.html", false,
-                "<a href=\"RegContainerValNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@RegContainerValNotDoc</a>"
-                + "(<a href=\"RegContainerValNotDoc.html#value--\">value</a>={"
-                + "<a href=\"RegContaineeDoc.html\" "
-                + "title=\"annotation in pkg1\">@RegContaineeDoc</a>,"
-                + "<a href=\"RegContaineeDoc.html\" "
-                + "title=\"annotation in pkg1\">@RegContaineeDoc</a>},"
-                + "<a href=\"RegContainerValNotDoc.html#y--\">y</a>=4)",
-                "<a href=\"ContainerValNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@ContainerValNotDoc</a>"
-                + "(<a href=\"ContainerValNotDoc.html#value--\">value</a>={"
-                + "<a href=\"ContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>,"
-                + "<a href=\"ContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>},"
-                + "<a href=\"ContainerValNotDoc.html#x--\">x</a>=2)",
-                "<a href=\"ContainerSynthNotDoc.html\" "
-                + "title=\"annotation in pkg1\">@ContainerSynthNotDoc</a>("
-                + "<a href=\"ContainerSynthNotDoc.html#value--\">value</a>="
-                + "<a href=\"ContaineeSynthDoc.html\" "
-                + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>)");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -92,18 +92,6 @@
     }
 
     @Test
-    public void test2_html4() {
-        javadoc("-d", "out-2-html4",
-                "-html4",
-                "-Xdoclint:none",
-                "-sourcepath", testSrc,
-                "-use",
-                "pkg", "pkg1", "pkg2", "pkg3");
-        checkExit(Exit.OK);
-        checkSingleIndex(true, false);
-    }
-
-    @Test
     public void test2a() {
         javadoc("-d", "out-2a",
                 "-Xdoclint:all",
@@ -130,17 +118,6 @@
     }
 
     @Test
-    public void test2a_html4() {
-        javadoc("-d", "out-2a-html4",
-                "-html4",
-                "-Xdoclint:all",
-                "-sourcepath", testSrc,
-                "-use",
-                "pkg", "pkg1", "pkg2", "pkg3");
-        checkSingleIndex(true, false);
-    }
-
-    @Test
     public void test3() {
         javadoc("-d", "out-3",
                 "-noindex",
@@ -350,21 +327,6 @@
     }
 
     @Test
-    public void testURLEncoding_html4() {
-        javadoc("-d", "out-encode-html4",
-                "-html4",
-                "--no-module-directories",
-                "-Xdoclint:none",
-                "-sourcepath", testSrc,
-                "-use",
-                "--frames",
-                "pkg", "pkg1", "pkg2", "pkg3");
-        checkExit(Exit.OK);
-        checkSearchJS();
-        checkSearchIndex(false);
-    }
-
-    @Test
     public void testJapaneseLocale() {
         javadoc("-locale", "ja_JP",
                 "-d", "out-jp",
--- a/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -69,25 +69,6 @@
     }
 
     @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg/Test.html", true,
-            "<code>List</code>",
-            "<dl>\n"
-            + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
-            + "<dd><a href=\"Test.InnerOne.html#foo--\"><code>Test.InnerOne.foo()</code></a>, \n"
-            + "<a href=\"Test.InnerOne.html#bar-java.lang.Object-\"><code>Test.InnerOne.bar(Object)</code></a>, \n"
-            + "<a href=\"http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#see\">Javadoc</a>, \n"
-            + "<a href=\"Test.InnerOne.html#baz-float-\"><code>something</code></a></dd>\n"
-            + "</dl>");
-    }
-
-    @Test
     public void testBadReference() {
         javadoc("-d", "out-badref",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java	Mon Feb 04 11:01:04 2019 +0530
@@ -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
@@ -242,13 +242,4 @@
                 + "    font-weight:bold;\n"
                 + "}");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
 }
-}
--- a/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -97,50 +97,6 @@
     }
 
     @Test
-    public void test1_html4() {
-        javadoc("-d", "out1-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "p1");
-        checkExit(Exit.OK);
-
-        checkOutput("index-all.html", true,
-            "<dl>\n"
-            + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m--\">m()"
-            + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
-            + "<dd>\n"
-            + "<div class=\"block\">First sentence</div>\n"
-            + "</dd>\n"
-            + "<dt><span class=\"memberNameLink\"><a href=\"p1/B.html#m--\">m()"
-            + "</a></span> - Method in class p1.<a href=\"p1/B.html\" title=\"class in p1\">B</a></dt>\n"
-            + "<dd>\n"
-            + "<div class=\"block\">First sentence</div>\n"
-            + "</dd>\n"
-            + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m1--\">m1()"
-            + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
-            + "<dd>\n"
-            + "<div class=\"block\"> First sentence </div>\n"
-            + "</dd>\n"
-            + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m2--\">m2()"
-            + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
-            + "<dd>\n"
-            + "<div class=\"block\">Some html &lt;foo&gt; &nbsp; codes</div>\n"
-            + "</dd>\n"
-            + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m3--\">m3()"
-            + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
-            + "<dd>\n"
-            + "<div class=\"block\">First sentence </div>\n"
-            + "</dd>\n"
-            + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m4--\">m4()"
-            + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
-            + "<dd>\n"
-            + "<div class=\"block\">First sentence i.e. the first sentence</div>\n"
-            + "</dd>\n"
-            + "</dl>\n"
-        );
-    }
-
-    @Test
     public void test2() {
         javadoc("-d", "out2",
                 "-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -720,89 +720,4 @@
                 + "\"RepMethodB.html\" title=\"annotation in typeannos\">"
                 + "@RepMethodB</a>\nvoid&nbsp;test()");
     }
-
-    @Test
-    public void test_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-private",
-                "typeannos");
-        checkExit(Exit.OK);
-
-        checkOutput("typeannos/RepeatingOnConstructor.Inner.html", true,
-                "<code><span class=\"memberNameLink\"><a href=\""
-                + "#Inner-java.lang.String-java.lang.String...-\">Inner</a></span>"
-                + "&#8203;(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
-                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> ...&nbsp;vararg)</code>");
-
-        checkOutput("typeannos/RepeatingOnMethod.html", true,
-                "<code>(package private) java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\">"
-                + "<code><span class=\"memberNameLink\"><a href="
-                + "\"#test1--\">test1</a></span>()</code>",
-
-                "<code>(package private) <a href=\"RepTypeUseA.html\" "
-                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
-                + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#test2--\">test2</a>"
-                + "</span>()</code>",
-
-                "<code>(package private) <a href=\"RepTypeUseA.html\" "
-                + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
-                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html\" "
-                + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
-                + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"#test3--\">test3</a>"
-                + "</span>()</code>",
-
-                "<code>(package private) <a href=\"RepAllContextsA.html\" "
-                + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
-                + "\"RepAllContextsA.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsA</a> <a href=\"RepAllContextsB.html\" "
-                + "title=\"annotation in typeannos\">@RepAllContextsB</a> <a href="
-                + "\"RepAllContextsB.html\" title=\"annotation in typeannos\">"
-                + "@RepAllContextsB</a> java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\">"
-                + "<code><span class=\"memberNameLink\"><a href=\""
-                + "#test4--\">test4</a></span>()</code>",
-
-                "<code><span class=\"memberNameLink\"><a href=\""
-                + "#test5-java.lang.String-java.lang.String...-\">test5</a></span>"
-                + "&#8203;(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
-                + "\"RepTypeUseA.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseA</a> <a href=\"RepTypeUseA.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
-                + "\"RepTypeUseB.html\" title=\"annotation in typeannos\">"
-                + "@RepTypeUseB</a> ...&nbsp;vararg)</code>");
-
-        checkOutput("typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html", true,
-                "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
-                + "\"#"
-                + "genericMethod-T-\">genericMethod</a></span>&#8203;(T&nbsp;t)</code>",
-
-                "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
-                + "\"#"
-                + "genericMethod2-T-\">genericMethod2</a></span>&#8203;(<a href=\"RepTypeUseA.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseA.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"RepTypeUseB.html"
-                + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> T&nbsp;t)</code>",
-
-                "<code>(package private) java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\"><code>"
-                + "<span class=\"memberNameLink\"><a href=\"#"
-                + "test--\">test</a></span>()</code>");
 }
-}
--- a/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,22 +76,6 @@
     }
 
     @Test
-    public void test1_html4() {
-        javadoc("-d", "out-1-html4",
-                "-html4",
-                "-use",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.OK);
-
-        // Nested type parameters
-        checkOutput("pkg/C.html", true,
-                "<a name=\"formatDetails-java.util.Collection-java.util.Collection-\">\n"
-                + "<!--   -->\n"
-                + "</a>");
-    }
-
-    @Test
     public void test2() {
         javadoc("-d", "out-2",
                 "-linksource",
--- a/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,19 +57,4 @@
         checkOutput("pkg1/C.html", true,
                 "<div class=\"block\">Linking to I.abstractAction() <a href=\"I.html#abstractAction()\"><code>I.abstractAction()</code></a></div>");
     }
-
-    @Test
-    public void test1_html4() {
-        javadoc("-d", "out-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-package",
-                "pkg1");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg1/C.html", true,
-                "<div class=\"block\">Linking to Additional.doAction() <a href=\"Additional.html#doAction--\"><code>Additional.doAction()</code></a></div>");
-        checkOutput("pkg1/C.html", true,
-                "<div class=\"block\">Linking to I.abstractAction() <a href=\"I.html#abstractAction--\"><code>I.abstractAction()</code></a></div>");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Mon Feb 04 11:01:04 2019 +0530
@@ -143,45 +143,6 @@
     }
 
     @Test
-    public void test1_html4() {
-        javadoc("-d", "out-1-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-use",
-                "pkg1", "pkg2");
-        checkExit(Exit.OK);
-
-        checkOutput("pkg1/class-use/UsedClass.html", true,
-          "<a href=\"../C1.html#methodInC1ReturningType--\">methodInC1ReturningType</a>"
-        );
-        checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "../C10.html#withReturningTypeParameters--"
-        );
-        checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "../C10.html#withTypeParametersOfType-java.lang.Class-"
-        );
-        checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../C10.html#addAll-pkg1.UsedInterface...-\">addAll</a>"
-        );
-        checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../C10.html#create-pkg1.UsedInterfaceA-pkg1." +
-            "UsedInterface-java.lang.String-\">"
-        );
-        checkOutput("pkg1/class-use/UsedInterface.html", true,
-            "<a href=\"../C10.html#withTypeParametersOfType-java.lang.Class-\">" +
-            "withTypeParametersOfType</a>"
-        );
-        checkOutput("pkg1/class-use/UsedThrowable.html", true,
-            "Methods in <a href=\"../package-summary.html\">pkg1</a> that throw "
-            + "<a href=\"../UsedThrowable.html\" title=\"class in pkg1\">UsedThrowable</a>",
-            "<td class=\"colFirst\"><code>void</code></td>\n<th class=\"colSecond\" scope=\"row\"><span class="
-            + "\"typeNameLabel\">C1.</span><code><span class=\"memberNameLink\">"
-            + "<a href=\"../C1.html#methodInC1ThrowsThrowable--\">methodInC1ThrowsThrowable"
-            + "</a></span>()</code></th>"
-        );
-    }
-
-    @Test
     public void test2() {
         javadoc("-d", "out-2",
                 "-sourcepath", testSrc,
@@ -206,24 +167,6 @@
     }
 
     @Test
-    public void test2_html4() {
-        javadoc("-d", "out-2-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-use",
-                testSrc("C.java"), testSrc("UsedInC.java"), "pkg3");
-        checkExit(Exit.OK);
-
-        checkOutput("class-use/UsedInC.html", true,
-                "<li class=\"blockList\"><a name=\"unnamed.package\">"
-        );
-        checkOutput("package-use.html", true,
-                "<th class=\"colFirst\" scope=\"row\"><a href=\"#unnamed.package\">&lt;Unnamed&gt;</a></th>\n"
-                + "<td class=\"colLast\">&nbsp;</td>"
-        );
-    }
-
-    @Test
     public void test3() {
         javadoc("-d", "out-3",
                 "-sourcepath", testSrc,
@@ -236,19 +179,4 @@
                 "<a href=\"../C1.html#umethod3(unique.UseMe,unique.UseMe)\">",
                 "<a href=\"../C1.html#%3Cinit%3E(unique.UseMe,unique.UseMe)\">");
     }
-
-    @Test
-    public void test3_html4() {
-        javadoc("-d", "out-3-html4",
-                "-html4",
-                "-sourcepath", testSrc,
-                "-use",
-                "-package", "unique");
-        checkExit(Exit.OK);
-        checkUnique("unique/class-use/UseMe.html",
-                "<a href=\"../C1.html#umethod1-unique.UseMe-unique.UseMe:A-\">",
-                "<a href=\"../C1.html#umethod2-unique.UseMe-unique.UseMe-\">",
-                "<a href=\"../C1.html#umethod3-unique.UseMe-unique.UseMe-\">",
-                "<a href=\"../C1.html#C1-unique.UseMe-unique.UseMe-\">");
-    }
 }
--- a/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -84,18 +84,4 @@
             "<a href=\"#%3Cinit%3E()\"><code>X()</code></a><br/>",
             "<a href=\"#f\"><code>f</code></a><br/>");
     }
-
-    @Test
-    public void testPrivate_html4() {
-        javadoc("-d", "out-private-html4",
-                "-html4",
-                "-private",
-                "-sourcepath", testSrc,
-                "pkg");
-        checkExit(Exit.ERROR);
-
-        checkOutput("pkg/X.html", true,
-            "<a href=\"#m--\"><code>m()</code></a><br/>",
-            "<a href=\"#X--\"><code>X()</code></a><br/>");
 }
-}
--- a/test/langtools/jdk/javadoc/tool/sampleapi/SampleApiTest.java	Sat Feb 02 10:00:05 2019 -0800
+++ b/test/langtools/jdk/javadoc/tool/sampleapi/SampleApiTest.java	Mon Feb 04 11:01:04 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,31 +49,9 @@
                 "-r=" + System.getProperty("test.src") + "/res"
             });
 
-        // html4 / unnamed modules
-        System.err.println(">> HTML4, unnamed modules");
-        int res1 = Main.execute(
-            new String[] {
-                "-d", "out/doc.html4.unnamed",
-                "-verbose",
-                "-private",
-                "-use",
-                "-splitindex",
-                "-linksource",
-                "-html4",
-                "-javafx",
-                "-windowtitle", "SampleAPI",
-                "-overview", "overview.html",
-                "-sourcepath", "out/src" + File.pathSeparator + "out/src/sat.sampleapi",
-                "sampleapi.simple",
-                "sampleapi.simple.sub",
-                "sampleapi.tiny",
-                "sampleapi.tiny.sub",
-                "sampleapi.fx"
-            });
-
         // html5 / unnamed modules
         System.err.println(">> HTML5, unnamed modules");
-        int res2 = Main.execute(
+        int res = Main.execute(
             new String[] {
                 "-d", "out/doc.html5.unnamed",
                 "-verbose",
@@ -93,8 +71,7 @@
                 "sampleapi.fx"
             });
 
-        if (res1 > 0 || res2 > 0)
-            throw new Exception("One of exit statuses is non-zero: "
-                + res1 + " for HTML4, " + res2 + " for HTML5.");
+        if (res > 0)
+            throw new Exception("exit status is non-zero: " + res + " for HTML5.");
     }
 }