changeset 53674:1e1b4f09b869

Merge
author psadhukhan
date Tue, 29 Jan 2019 11:06:19 +0530
parents e04d39094915 bc20d0376402
children 58ec9ada9234
files src/hotspot/share/gc/g1/evacuationInfo.hpp src/java.base/unix/native/libnio/ch/SocketChannelImpl.c src/java.base/unix/native/libnio/ch/SocketDispatcher.c src/java.base/windows/native/libnio/ch/SocketChannelImpl.c test/Makefile test/TestCommon.gmk test/hotspot/jtreg/Makefile test/jaxp/Makefile test/jdk/Makefile test/jdk/ProblemList.txt test/jdk/java/lang/String/AlignIndent.java test/jdk/javax/net/ssl/compatibility/Parameter.java test/jdk/sun/security/util/Resources/NewNamesFormat.java test/jdk/sun/security/util/Resources/NewResourcesNames.java test/langtools/Makefile test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java test/langtools/tools/javac/RawStringLiteralLang.java test/langtools/tools/javac/RawStringLiteralLangAPI.java test/langtools/tools/javac/diags/examples/RawStringLiteral.java test/nashorn/Makefile
diffstat 2522 files changed, 28164 insertions(+), 60150 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Jan 28 17:19:54 2019 -0800
+++ b/.hgtags	Tue Jan 29 11:06:19 2019 +0530
@@ -532,3 +532,9 @@
 7496df94b3b79f3da53925d2d137317715f11d97 jdk-12+25
 50677f43ac3df9a8684222b8893543c60f3aa0bd jdk-13+2
 de9fd809bb475401aad188eab2264226788aad81 jdk-12+26
+642346a11059b9f283110dc301a24ed43b76a94e jdk-13+3
+f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27
+a47b8125b7cc9ef59619745c163975fe935b57ed jdk-13+4
+659b004b6a1bd8c31e766cbdf328d8f8473fd4d7 jdk-12+28
+e3ed960609927b5fdfd0a797159835cd83a81a31 jdk-13+5
+44f41693631f9b5ac78ff4d2bfabd6734fe46df2 jdk-12+29
--- a/doc/testing.html	Mon Jan 28 17:19:54 2019 -0800
+++ b/doc/testing.html	Tue Jan 29 11:06:19 2019 +0530
@@ -34,6 +34,7 @@
 </ul></li>
 <li><a href="#test-results-and-summary">Test results and summary</a></li>
 <li><a href="#test-suite-control">Test suite control</a><ul>
+<li><a href="#general-keywords-test_opts">General keywords (TEST_OPTS)</a></li>
 <li><a href="#jtreg-keywords">JTReg keywords</a></li>
 <li><a href="#gtest-keywords">Gtest keywords</a></li>
 <li><a href="#microbenchmark-keywords">Microbenchmark keywords</a></li>
@@ -102,11 +103,29 @@
 <p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG=&quot;...;...&quot;</code>. This will also make sure spaces are preserved, as in <code>JTREG=&quot;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;</code>.</p>
 <p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
 <p>As far as possible, the names of the keywords have been standardized between test suites.</p>
+<h3 id="general-keywords-test_opts">General keywords (TEST_OPTS)</h3>
+<p>Some keywords are valid across different test suites. If you want to run tests from multiple test suites, or just don't want to care which test suite specific control variable to use, then you can use the general TEST_OPTS control variable.</p>
+<p>There are also some keywords that applies globally to the test runner system, not to any specific test suites. These are also available as TEST_OPTS keywords.</p>
+<h4 id="jobs">JOBS</h4>
+<p>Currently only applies to JTReg.</p>
+<h4 id="timeout_factor">TIMEOUT_FACTOR</h4>
+<p>Currently only applies to JTReg.</p>
+<h4 id="vm_options">VM_OPTIONS</h4>
+<p>Applies to JTReg, GTest and Micro.</p>
+<h4 id="java_options">JAVA_OPTIONS</h4>
+<p>Applies to JTReg, GTest and Micro.</p>
+<h4 id="aot_modules">AOT_MODULES</h4>
+<p>Applies to JTReg and GTest.</p>
+<h4 id="jcov">JCOV</h4>
+<p>This keywords applies globally to the test runner system. If set to <code>true</code>, it enables JCov coverage reporting for all tests run. To be useful, the JDK under test must be run with a JDK built with JCov instrumentation (<code>configure --with-jcov=&lt;path to directory containing lib/jcov.jar&gt;</code>, <code>make jcov-image</code>).</p>
+<p>The simplest way to run tests with JCov coverage report is to use the special target <code>jcov-test</code> instead of <code>test</code>, e.g. <code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov image is built, and that JCov reporting is enabled.</p>
+<p>The JCov report is stored in <code>build/$BUILD/test-results/jcov-output</code>.</p>
+<p>Please note that running with JCov reporting can be very memory intensive.</p>
 <h3 id="jtreg-keywords">JTReg keywords</h3>
-<h4 id="jobs">JOBS</h4>
+<h4 id="jobs-1">JOBS</h4>
 <p>The test concurrency (<code>-concurrency</code>).</p>
 <p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>), otherwise it defaults to JOBS, except for Hotspot, where the default is <em>number of CPU cores/2</em>, but never more than 12.</p>
-<h4 id="timeout">TIMEOUT</h4>
+<h4 id="timeout_factor-1">TIMEOUT_FACTOR</h4>
 <p>The timeout factor (<code>-timeoutFactor</code>).</p>
 <p>Defaults to 4.</p>
 <h4 id="test_mode">TEST_MODE</h4>
@@ -125,13 +144,21 @@
 <p>Limit memory consumption (<code>-Xmx</code> and <code>-vmoption:-Xmx</code>, or none).</p>
 <p>Limit memory consumption for JTReg test framework and VM under test. Set to 0 to disable the limits.</p>
 <p>Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).</p>
+<h4 id="keywords">KEYWORDS</h4>
+<p>JTReg kewords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
+<h4 id="extra_problem_lists">EXTRA_PROBLEM_LISTS</h4>
+<p>Use additional problem lists file or files, in addition to the default ProblemList.txt located at the JTReg test roots.</p>
+<p>If multiple file names are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
+<p>The file names should be either absolute, or relative to the JTReg test root of the tests to be run.</p>
 <h4 id="options">OPTIONS</h4>
 <p>Additional options to the JTReg test framework.</p>
 <p>Use <code>JTREG=&quot;OPTIONS=--help all&quot;</code> to see all available JTReg options.</p>
-<h4 id="java_options">JAVA_OPTIONS</h4>
+<h4 id="java_options-1">JAVA_OPTIONS</h4>
 <p>Additional Java options to JTReg (<code>-javaoption</code>).</p>
-<h4 id="vm_options">VM_OPTIONS</h4>
+<h4 id="vm_options-1">VM_OPTIONS</h4>
 <p>Additional VM options to JTReg (<code>-vmoption</code>).</p>
+<h4 id="aot_modules-1">AOT_MODULES</h4>
+<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
 <h3 id="gtest-keywords">Gtest keywords</h3>
 <h4 id="repeat">REPEAT</h4>
 <p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p>
@@ -139,6 +166,8 @@
 <h4 id="options-1">OPTIONS</h4>
 <p>Additional options to the Gtest test framework.</p>
 <p>Use <code>GTEST=&quot;OPTIONS=--help&quot;</code> to see all available Gtest options.</p>
+<h4 id="aot_modules-2">AOT_MODULES</h4>
+<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
 <h3 id="microbenchmark-keywords">Microbenchmark keywords</h3>
 <h4 id="fork">FORK</h4>
 <p>Override the number of benchmark forks to spawn. Same as specifying <code>-f &lt;num&gt;</code>.</p>
@@ -152,7 +181,7 @@
 <p>Amount of time to spend in each warmup iteration. Same as specifying <code>-w &lt;num&gt;</code>.</p>
 <h4 id="results_format">RESULTS_FORMAT</h4>
 <p>Specify to have the test run save a log of the values. Accepts the same values as <code>-rff</code>, i.e., <code>text</code>, <code>csv</code>, <code>scsv</code>, <code>json</code>, or <code>latex</code>.</p>
-<h4 id="vm_options-1">VM_OPTIONS</h4>
+<h4 id="vm_options-2">VM_OPTIONS</h4>
 <p>Additional VM arguments to provide to forked off VMs. Same as <code>-jvmArgs &lt;args&gt;</code></p>
 <h4 id="options-2">OPTIONS</h4>
 <p>Additional arguments to send to JMH.</p>
--- a/doc/testing.md	Mon Jan 28 17:19:54 2019 -0800
+++ b/doc/testing.md	Tue Jan 29 11:06:19 2019 +0530
@@ -40,8 +40,8 @@
 
 To be able to run microbenchmarks, `configure` needs to know where to find
 the JMH dependency. Use `--with-jmh=<path to JMH jars>` to point to a directory
-containing the core JMH and transitive dependencies. The recommended dependencies 
-can be retrieved by running `sh make/devkit/createJMHBundle.sh`, after which 
+containing the core JMH and transitive dependencies. The recommended dependencies
+can be retrieved by running `sh make/devkit/createJMHBundle.sh`, after which
 `--with-jmh=build/jmh/jars` should work.
 
 ## Test selection
@@ -202,6 +202,50 @@
 As far as possible, the names of the keywords have been standardized between
 test suites.
 
+### General keywords (TEST_OPTS)
+
+Some keywords are valid across different test suites. If you want to run
+tests from multiple test suites, or just don't want to care which test suite specific
+control variable to use, then you can use the general TEST_OPTS control variable.
+
+There are also some keywords that applies globally to the test runner system,
+not to any specific test suites. These are also available as TEST_OPTS keywords.
+
+#### JOBS
+
+Currently only applies to JTReg.
+
+#### TIMEOUT_FACTOR
+
+Currently only applies to JTReg.
+
+#### VM_OPTIONS
+
+Applies to JTReg, GTest and Micro.
+
+#### JAVA_OPTIONS
+
+Applies to JTReg, GTest and Micro.
+
+#### AOT_MODULES
+
+Applies to JTReg and GTest.
+
+#### JCOV
+
+This keywords applies globally to the test runner system. If set to `true`, it
+enables JCov coverage reporting for all tests run. To be useful, the JDK under
+test must be run with a JDK built with JCov instrumentation (`configure
+--with-jcov=<path to directory containing lib/jcov.jar>`, `make jcov-image`).
+
+The simplest way to run tests with JCov coverage report is to use the special
+target `jcov-test` instead of `test`, e.g. `make jcov-test TEST=jdk_lang`. This
+will make sure the JCov image is built, and that JCov reporting is enabled.
+
+The JCov report is stored in `build/$BUILD/test-results/jcov-output`.
+
+Please note that running with JCov reporting can be very memory intensive.
+
 ### JTReg keywords
 
 #### JOBS
@@ -211,7 +255,7 @@
 JOBS, except for Hotspot, where the default is *number of CPU cores/2*, but
 never more than 12.
 
-#### TIMEOUT
+#### TIMEOUT_FACTOR
 The timeout factor (`-timeoutFactor`).
 
 Defaults to 4.
@@ -245,6 +289,24 @@
 
 Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).
 
+#### KEYWORDS
+
+JTReg kewords sent to JTReg using `-k`. Please be careful in making sure that
+spaces and special characters (like `!`) are properly quoted. To avoid some
+issues, the special value `%20` can be used instead of space.
+
+#### EXTRA_PROBLEM_LISTS
+
+Use additional problem lists file or files, in addition to the default
+ProblemList.txt located at the JTReg test roots.
+
+If multiple file names are specified, they should be separated by space (or, to
+help avoid quoting issues, the special value `%20`).
+
+The file names should be either absolute, or relative to the JTReg test root of
+the tests to be run.
+
+
 #### OPTIONS
 Additional options to the JTReg test framework.
 
@@ -256,6 +318,12 @@
 #### VM_OPTIONS
 Additional VM options to JTReg (`-vmoption`).
 
+#### AOT_MODULES
+
+Generate AOT modules before testing for the specified module, or set of
+modules. If multiple modules are specified, they should be separated by space
+(or, to help avoid quoting issues, the special value `%20`).
+
 ### Gtest keywords
 
 #### REPEAT
@@ -270,6 +338,12 @@
 
 Use `GTEST="OPTIONS=--help"` to see all available Gtest options.
 
+#### AOT_MODULES
+
+Generate AOT modules before testing for the specified module, or set of
+modules. If multiple modules are specified, they should be separated by space
+(or, to help avoid quoting issues, the special value `%20`).
+
 ### Microbenchmark keywords
 
 #### FORK
--- a/make/CompileToolsJdk.gmk	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/CompileToolsJdk.gmk	Tue Jan 29 11:06:19 2019 +0530
@@ -90,7 +90,7 @@
 
 # To be able to call the javascript filter when generating man pages using
 # pandoc, we need to create this executable wrapper script.
-ifneq ($(PANDOC), )
+ifeq ($(ENABLE_PANDOC), true)
   # PANDOC_TROFF_MANPAGE_FILTER is duplicated for export in ToolsJdk.gmk.
   PANDOC_TROFF_MANPAGE_FILTER := \
       $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-troff-manpage-filter
--- a/make/ExplodedImageOptimize.gmk	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/ExplodedImageOptimize.gmk	Tue Jan 29 11:06:19 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
@@ -34,7 +34,7 @@
 ################################################################################
 
 PACKAGES_ATTRIBUTE_TARGET := $(JDK_OUTPUTDIR)/_packages_attribute.done
-ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module_info.class)
+ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class)
 
 $(PACKAGES_ATTRIBUTE_TARGET): $(ALL_MODULEINFO_CLASSES) $(BUILD_JIGSAW_CLASSES)
 	$(call LogInfo, Optimizing the exploded image)
--- a/make/Main.gmk	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/Main.gmk	Tue Jan 29 11:06:19 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
@@ -479,12 +479,12 @@
 
 define DeclareRunTestRecipe
   test-$1:
-	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1")
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
+	    TEST="$1")
 
   exploded-test-$1:
-	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
 	    TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
-
 endef
 
 # ALL_NAMED_TESTS is defined in FindTests.gmk
@@ -562,13 +562,18 @@
 # Run tests
 
 test:
-	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)")
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
+	    TEST="$(TEST)")
 
 exploded-test:
-	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
 	    TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
 
-ALL_TARGETS += test exploded-test
+jcov-test:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
+	    TEST="$(TEST)" TEST_OPTS_JCOV=true)
+
+ALL_TARGETS += test exploded-test jcov-test
 
 ################################################################################
 # Bundles
@@ -869,6 +874,8 @@
 
   exploded-test: exploded-image test-image
 
+  jcov-test: jcov-image test-image
+
   test-make: clean-test-make compile-commands
 
   test-make-compile-commands: compile-commands
--- a/make/RunTests.gmk	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/RunTests.gmk	Tue Jan 29 11:06:19 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,8 +45,8 @@
 endif
 
 $(eval $(call ParseKeywordVariable, TEST_OPTS, \
-    SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR AOT_MODULES, \
-    STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
+    SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV, \
+    STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
 ))
 
 # Helper function to propagate TEST_OPTS values.
@@ -72,7 +72,7 @@
             ) \
         ))
     export _NT_SYMBOL_PATH
-    $(info _NT_SYMBOL_PATH=$(_NT_SYMBOL_PATH))
+    $(call LogDebug, Rewriting _NT_SYMBOL_PATH to $(_NT_SYMBOL_PATH))
   endif
 endif
 
@@ -81,6 +81,9 @@
 $(eval $(call IncludeCustomExtension, RunTests.gmk))
 ################################################################################
 
+# This is the JDK that we will test
+JDK_UNDER_TEST := $(JDK_IMAGE_DIR)
+
 TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
 TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
 TEST_SUMMARY := $(TEST_RESULTS_DIR)/test-summary.txt
@@ -104,8 +107,26 @@
       -timeoutHandlerTimeout:0
 endif
 
-GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
-GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS)))
+GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
+    $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
+GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, \
+    $(GTEST_LAUNCHER_DIRS)))
+
+ifeq ($(TEST_OPTS_JCOV), true)
+  JCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/jcov-output
+  JCOV_GRABBER_LOG := $(JCOV_OUTPUT_DIR)/grabber.log
+  JCOV_RESULT_FILE := $(JCOV_OUTPUT_DIR)/result.xml
+  JCOV_REPORT := $(JCOV_OUTPUT_DIR)/report
+  JCOV_MEM_OPTIONS := -Xms64m -Xmx4g
+
+  # Replace our normal test JDK with the JCov image.
+  JDK_UNDER_TEST := $(JCOV_IMAGE_DIR)
+
+  JCOV_ENVIRONMENT := JAVA_TOOL_OPTIONS="$(JCOV_MEM_OPTIONS)" \
+      _JAVA_OPTIONS="$(JCOV_MEM_OPTIONS)"
+  JTREG_JCOV_OPTIONS := -e:JAVA_TOOL_OPTIONS='$(JCOV_MEM_OPTIONS)' \
+      -e:_JAVA_OPTIONS='$(JCOV_MEM_OPTIONS)'
+endif
 
 ################################################################################
 # Optionally create AOT libraries for specified modules before running tests.
@@ -129,38 +150,35 @@
   $1_AOT_LIB := $$($1_BIN)/$$(call SHARED_LIBRARY,$$($1_MODULE))
   $1_AOT_CCLIST := $$(wildcard $$(TOPDIR)/test/hotspot/jtreg/compiler/aot/scripts/$$($1_MODULE)-list.txt)
 
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-    $1_LD := $$(addsuffix $$(EXE_SUFFIX), $$(filter-out $$(FIXPATH), $$(LD)))
-  else
-    $1_LD := $$(LD)
-  endif
-
   # Create jaotc flags.
-  # VM flags which don't affect AOT code generation are filtered out: -Xcomp, -XX:+-TieredCompilation
+  # VM flags which don't affect AOT code generation are filtered out:
+  # -Xcomp, -XX:+-TieredCompilation
   $1_JAOTC_OPTS := \
       -J-Xmx4g --info \
       $$(addprefix -J, $$(filter-out -Xcomp %TieredCompilation, $$($1_VM_OPTIONS))) \
       $$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \
-      --linker-path $$($1_LD) \
+      --linker-path $$(LD_JAOTC) \
       #
 
   ifneq ($$(filter -ea, $$($1_VM_OPTIONS)), )
     $1_JAOTC_OPTS += --compile-with-assertions
   endif
 
-  $$($1_AOT_LIB): $$(JDK_IMAGE_DIR)/release \
+  $$($1_AOT_LIB): $$(JDK_UNDER_TEST)/release \
       $$(call DependOnVariable, $1_JAOTC_OPTS) \
-      $$(call DependOnVariable, JDK_IMAGE_DIR)
+      $$(call DependOnVariable, JDK_UNDER_TEST)
 	$$(call LogWarn, Generating $$(patsubst $$(OUTPUTDIR)/%, %, $$@))
 	$$(call MakeTargetDir)
 	$$(call ExecuteWithLog, $$@, \
-	    $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/jaotc \
-	    $$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \
+	    $$(FIXPATH) $$(JDK_UNDER_TEST)/bin/jaotc \
+	        $$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \
 	)
 	$$(call ExecuteWithLog, $$@.check, \
-	  $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java \
-	  $$($1_VM_OPTIONS) -XX:+PrintAOT -XX:+UseAOTStrictLoading -XX:AOTLibrary=$$@ -version \
-	  > $$@.verify-aot \
+	    $$(FIXPATH) $$(JDK_UNDER_TEST)/bin/java \
+	        $$($1_VM_OPTIONS) -XX:+UnlockDiagnosticVMOptions \
+	        -XX:+PrintAOT -XX:+UseAOTStrictLoading \
+	        -XX:AOTLibrary=$$@ -version \
+	         > $$@.verify-aot \
 	)
 
   $1_AOT_OPTIONS += -XX:AOTLibrary=$$($1_AOT_LIB)
@@ -249,9 +267,10 @@
 $(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
 
 $(eval $(call ParseKeywordVariable, JTREG, \
-    SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \
-        EXTRA_PROBLEM_LISTS KEYWORDS AOT_MODULES, \
-    STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
+    SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN \
+        MAX_MEM, \
+    STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
+        EXTRA_PROBLEM_LISTS AOT_MODULES, \
 ))
 
 ifneq ($(JTREG), )
@@ -266,8 +285,8 @@
 $(eval $(call SetTestOpt,AOT_MODULES,GTEST))
 
 $(eval $(call ParseKeywordVariable, GTEST, \
-    SINGLE_KEYWORDS := REPEAT AOT_MODULES, \
-    STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
+    SINGLE_KEYWORDS := REPEAT, \
+    STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
 ))
 
 ifneq ($(GTEST), )
@@ -282,7 +301,8 @@
 
 $(eval $(call ParseKeywordVariable, MICRO, \
     SINGLE_KEYWORDS := ITER FORK TIME WARMUP_ITER WARMUP_TIME, \
-    STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS RESULTS_FORMAT TEST_JDK BENCHMARKS_JAR, \
+    STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS RESULTS_FORMAT TEST_JDK \
+        BENCHMARKS_JAR, \
 ))
 
 ifneq ($(MICRO), )
@@ -348,8 +368,8 @@
 
 # Helper function to determine if a test specification is a microbenchmark test
 #
-# It is a microbenchmark test if it is either "micro", or "micro:" followed by an optional
-# test filter string.
+# It is a microbenchmark test if it is either "micro", or "micro:" followed by
+# an optional test filter string.
 define ParseMicroTestSelection
   $(if $(filter micro%, $1), \
     $(if $(filter micro, $1), \
@@ -439,8 +459,8 @@
 # Helper function to determine if a test specification is a special test
 #
 # It is a special test if it is "special:" followed by a test name,
-# if it is "make:" or "make-" followed by a make test, or any of the special test names
-# as a single word.
+# if it is "make:" or "make-" followed by a make test, or any of the special
+# test names as a single word.
 define ParseSpecialTestSelection
   $(if $(filter special:%, $1), \
     $1 \
@@ -555,13 +575,13 @@
     ))
   endif
 
-  run-test-$1: $$($1_AOT_TARGETS)
+  run-test-$1: pre-run-test $$($1_AOT_TARGETS)
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
 	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
 	    $$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
-	        -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
+	        -jdk $(JDK_UNDER_TEST) $$($1_GTEST_FILTER) \
 	        --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
 	        $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
 	        $$(GTEST_JAVA_OPTIONS) $$($1_AOT_OPTIONS) \
@@ -597,7 +617,9 @@
 
   $1: run-test-$1 parse-test-$1
 
-  TARGETS += $1
+  TARGETS += $1 run-test-$1 parse-test-$1
+  TEST_TARGETS += parse-test-$1
+
 endef
 
 ################################################################################
@@ -631,7 +653,7 @@
   $1_TEST_NAME := $$(strip $$(patsubst micro:%, %, $$($1_TEST)))
 
   $$(eval $$(call SetMicroValue,$1,MICRO_BENCHMARKS_JAR,$$(TEST_IMAGE_DIR)/micro/benchmarks.jar))
-  $$(eval $$(call SetMicroValue,$1,MICRO_TEST_JDK,$$(JDK_IMAGE_DIR)))
+  $$(eval $$(call SetMicroValue,$1,MICRO_TEST_JDK,$$(JDK_UNDER_TEST)))
   $$(eval $$(call SetMicroValue,$1,MICRO_JAVA_OPTIONS))
 
   # Current tests needs to open java.io
@@ -639,7 +661,8 @@
 
   # Save output as JSON or CSV file
   ifneq ($$(MICRO_RESULTS_FORMAT), )
-    $1_MICRO_BASIC_OPTIONS += -rf $$(MICRO_RESULTS_FORMAT) -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
+    $1_MICRO_BASIC_OPTIONS += -rf $$(MICRO_RESULTS_FORMAT)
+    $1_MICRO_BASIC_OPTIONS += -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
   endif
 
   ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), )
@@ -662,7 +685,7 @@
     $1_MICRO_WARMUP_TIME := -w $$(MICRO_WARMUP_TIME)
   endif
 
-  run-test-$1:
+  run-test-$1: pre-run-test
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
@@ -670,7 +693,7 @@
 	    $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) -jar $$($1_MICRO_BENCHMARKS_JAR) \
 	        $$($1_MICRO_ITER) $$($1_MICRO_FORK) $$($1_MICRO_TIME) \
 	        $$($1_MICRO_WARMUP_ITER) $$($1_MICRO_WARMUP_TIME) \
-	        $$($1_MICRO_VM_OPTIONS) $$($1_MICRO_BASIC_OPTIONS) $$(MICRO_OPTIONS)  \
+	        $$($1_MICRO_VM_OPTIONS) $$($1_MICRO_BASIC_OPTIONS) $$(MICRO_OPTIONS) \
 	        $$($1_TEST_NAME) \
 	        > >($(TEE) $$($1_TEST_RESULTS_DIR)/micro.txt) \
 	    && $$(ECHO) $$$$? > $$($1_EXITCODE) \
@@ -704,7 +727,9 @@
 
   $1: run-test-$1 parse-test-$1
 
-  TARGETS += $1
+  TARGETS += $1 run-test-$1 parse-test-$1
+  TEST_TARGETS += parse-test-$1
+
 endef
 
 ################################################################################
@@ -874,20 +899,22 @@
   clean-workdir-$1:
 	$$(RM) -r $$($1_TEST_SUPPORT_DIR)
 
-  run-test-$1: clean-workdir-$1 $$($1_AOT_TARGETS)
+  run-test-$1: pre-run-test clean-workdir-$1 $$($1_AOT_TARGETS)
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
 	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \
+	    $$(JCOV_ENVIRONMENT) \
 	    $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
 	        -Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
 	        $$($1_JTREG_BASIC_OPTIONS) \
-	        -testjdk:$$(JDK_IMAGE_DIR) \
+	        -testjdk:$$(JDK_UNDER_TEST) \
 	        -dir:$$(JTREG_TOPDIR) \
 	        -reportDir:$$($1_TEST_RESULTS_DIR) \
 	        -workDir:$$($1_TEST_SUPPORT_DIR) \
 	        $$(JTREG_OPTIONS) \
 	        $$(JTREG_FAILURE_HANDLER_OPTIONS) \
+	        $$(JTREG_JCOV_OPTIONS) \
 	        $$($1_TEST_NAME) \
 	    && $$(ECHO) $$$$? > $$($1_EXITCODE) \
 	    || $$(ECHO) $$$$? > $$($1_EXITCODE) \
@@ -921,9 +948,11 @@
 	  $$(eval $1_TOTAL := 1) \
 	)
 
-  $1: run-test-$1 parse-test-$1
+  $1: run-test-$1 parse-test-$1 clean-workdir-$1
 
-  TARGETS += $1
+  TARGETS += $1 run-test-$1 parse-test-$1 clean-workdir-$1
+  TEST_TARGETS += parse-test-$1
+
 endef
 
 ################################################################################
@@ -961,7 +990,7 @@
     $$(error Invalid special test specification: $$($1_TEST_NAME))
   endif
 
-  run-test-$1: $(TEST_PREREQS)
+  run-test-$1: pre-run-test
 	$$(call LogWarn)
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
@@ -987,7 +1016,9 @@
 
   $1: run-test-$1 parse-test-$1
 
-  TARGETS += $1
+  TARGETS += $1 run-test-$1 parse-test-$1
+  TEST_TARGETS += parse-test-$1
+
 endef
 
 ################################################################################
@@ -1049,12 +1080,36 @@
 # The main target for RunTests.gmk
 ################################################################################
 
-# The SetupRun*Test functions have populated TARGETS.
+#
+# Provide hooks for adding functionality before and after all tests are run.
+#
+
+$(call LogInfo, RunTest setup starting)
+
+# This target depends on all actual test having been run (TEST_TARGETS has beeen
+# populated by the SetupRun*Test functions). If you need to provide a teardown
+# hook, you must let it depend on this target.
+run-all-tests: $(TEST_TARGETS)
+	$(call LogInfo, RunTest teardown starting)
 
+# This is an abstract target that will be run before any actual tests. Add your
+# target as a dependency to thisif you need "setup" type functionality executed
+# before all tests.
+pre-run-test:
+	$(call LogInfo, RunTest setup done)
+
+# This is an abstract target that will be run after all actual tests, but before
+# the test summary. If you need "teardown" type functionality, add your target
+# as a dependency on this, and let the teardown target depend on run-all-tests.
+post-run-test: run-all-tests
+	$(call LogInfo, RunTest teardown done)
+
+#
+# Create and print a table of the result of all tests run
+#
 TEST_FAILURE := false
 
-run-test: $(TARGETS)
-        # Create and print a table of the result of all tests run
+run-test-report: post-run-test
 	$(RM) $(TEST_SUMMARY).old 2> /dev/null
 	$(MV) $(TEST_SUMMARY) $(TEST_SUMMARY).old 2> /dev/null || true
 	$(RM) $(TEST_LAST_IDS).old 2> /dev/null
@@ -1098,8 +1153,54 @@
 	$(CAT) $(TEST_SUMMARY)
 	$(ECHO)
 
+# The main run-test target
+run-test: run-test-report
+
+TARGETS += run-all-tests pre-run-test post-run-test run-test-report run-test
+
+################################################################################
+# Setup JCov
+################################################################################
+
+ifeq ($(TEST_OPTS_JCOV), true)
+
+  jcov-do-start-grabber:
+	$(call MakeDir, $(JCOV_OUTPUT_DIR))
+	if $(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -status 1>/dev/null 2>&1 ; then \
+	  $(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600 ; \
+	fi
+	$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar Grabber -v -t \
+	    $(JCOV_IMAGE_DIR)/template.xml -o $(JCOV_RESULT_FILE) \
+	    1>$(JCOV_GRABBER_LOG) 2>&1 &
+
+  jcov-start-grabber: jcov-do-start-grabber
+	$(call LogWarn, Starting JCov Grabber...)
+	$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -t 600 -wait
+
+  jcov-stop-grabber:
+	$(call LogWarn, Stopping JCov Grabber...)
+	$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600
+
+  jcov-gen-report: jcov-stop-grabber
+	$(call LogWarn, Generating JCov report ...)
+	$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \
+	    `$(ECHO) $(TOPDIR)/src/*/share/classes/ | $(TR) ' ' ':'` -fmt html \
+	    -o $(JCOV_REPORT) $(JCOV_RESULT_FILE)
+
+  TARGETS += jcov-do-start-grabber jcov-start-grabber jcov-stop-grabber \
+      jcov-gen-report
+
+  # Hook this into the framework at appropriate places
+  pre-run-test: jcov-start-grabber
+
+  post-run-test: jcov-gen-report
+
+  jcov-gen-report: run-all-tests
+
+endif
+
 ################################################################################
 
 all: run-test
 
-.PHONY: default all run-test $(TARGETS)
+.PHONY: default all $(TARGETS)
--- a/make/RunTestsPrebuilt.gmk	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/RunTestsPrebuilt.gmk	Tue Jan 29 11:06:19 2019 +0530
@@ -95,12 +95,12 @@
 # $1: The output file name
 # $2..$N: The lines to output to the file
 define CreateNewSpec
-  $(if $(strip $(31)), \
+  $(if $(strip $(33)), \
     $(error Internal makefile error: \
       Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
   ) \
   $(shell $(RM) $1) \
-  $(foreach i, $(call sequence, 2, 30), \
+  $(foreach i, $(call sequence, 2, 32), \
     $(if $(strip $($i)), \
       $(call AppendFile, $(strip $($i)), $1) \
     ) \
@@ -254,31 +254,35 @@
 # Setup LD for AOT support
 ifneq ($(DEVKIT_HOME), )
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    LD := $(DEVKIT_HOME)/VC/bin/x64/link
+    LD_JAOTC := $(DEVKIT_HOME)/VC/bin/x64/link.exe
     LIBRARY_PREFIX :=
     SHARED_LIBRARY_SUFFIX := .dll
-    EXE_SUFFIX := .exe
   else ifeq ($(OPENJDK_TARGET_OS), linux)
-    LD := $(DEVKIT_HOME)/bin/ld
+    LD_JAOTC := $(DEVKIT_HOME)/bin/ld
     LIBRARY_PREFIX := lib
     SHARED_LIBRARY_SUFFIX := .so
-    EXE_SUFFIX :=
   else ifeq ($(OPENJDK_TARGET_OS), macosx)
-    LD := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
+    LD_JAOTC := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
     LIBRARY_PREFIX := lib
     SHARED_LIBRARY_SUFFIX := .dylib
-    EXE_SUFFIX :=
   else ifeq ($(OPENJDK_TARGET_OS), solaris)
     # Prefer system linker for AOT on Solaris.
-    LD := ld
+    LD_JAOTC := ld
     LIBRARY_PREFIX := lib
     SHARED_LIBRARY_SUFFIX := .so
-    EXE_SUFFIX :=
   endif
 else
   LD := ld
 endif
 
+ifneq ($(wildcard $(JDK_IMAGE_DIR)/template.xml), )
+  TEST_OPTS_JCOV := true
+  JCOV_IMAGE_DIR := $(JDK_IMAGE_DIR)
+else
+  TEST_OPTS_JCOV := false
+  JCOV_IMAGE_DIR :=
+endif
+
 ################################################################################
 # Generate the ephemeral spec file
 ################################################################################
@@ -299,6 +303,7 @@
     BOOT_JDK := $(BOOT_JDK), \
     JT_HOME := $(JT_HOME), \
     JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
+    JCOV_IMAGE_DIR := $(JCOV_IMAGE_DIR), \
     TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
     SYMBOLS_IMAGE_DIR := $(SYMBOLS_IMAGE_DIR), \
     MAKE := $(MAKE), \
@@ -315,11 +320,11 @@
     OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
     NUM_CORES := $(NUM_CORES), \
     MEMORY_SIZE := $(MEMORY_SIZE), \
-    LD := $(LD), \
+    LD_JAOTC := $(LD_JAOTC), \
     LIBRARY_PREFIX := $(LIBRARY_PREFIX), \
     SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \
-    EXE_SUFFIX := $(EXE_SUFFIX), \
     include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
+    TEST_OPTS_JCOV := $(TEST_OPTS_JCOV), \
     $(CUSTOM_NEW_SPEC_LINE), \
 )
 
--- a/make/UpdateBuildDocs.gmk	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/UpdateBuildDocs.gmk	Tue Jan 29 11:06:19 2019 +0530
@@ -34,7 +34,7 @@
 #
 ################################################################################
 
-ifeq ($(PANDOC), )
+ifeq ($(ENABLE_PANDOC), false)
   $(info No pandoc executable was detected by configure)
   $(error Cannot continue)
 endif
--- a/make/autoconf/basics.m4	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/autoconf/basics.m4	Tue Jan 29 11:06:19 2019 +0530
@@ -999,7 +999,7 @@
           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
             MAKE_EXPECTED_ENV='msys'
           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
-            MAKE_EXPECTED_ENV='x86_64-pc-linux-gnu'
+            MAKE_EXPECTED_ENV='x86_64-.*-linux-gnu'
           else
             AC_MSG_ERROR([Unknown Windows environment])
           fi
--- a/make/autoconf/flags-cflags.m4	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/autoconf/flags-cflags.m4	Tue Jan 29 11:06:19 2019 +0530
@@ -527,8 +527,8 @@
   fi
 
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
-    TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new"
-    TOOLCHAIN_CFLAGS_JDK="-pipe"
+    TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new -fstack-protector"
+    TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
     TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX (but since this gives *worse* performance, use no-strict-aliasing everywhere!)
 
     CXXSTD_CXXFLAG="-std=gnu++98"
@@ -572,10 +572,10 @@
 
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     # Suggested additions: -qsrcmsg to get improved error reporting
-    TOOLCHAIN_CFLAGS_JDK="-qchars=signed -qfullpath -qsaveopt"  # add on both CFLAGS
+    TOOLCHAIN_CFLAGS_JDK="-qchars=signed -qfullpath -qsaveopt -qstackprotect"  # add on both CFLAGS
     TOOLCHAIN_CFLAGS_JVM="-qtune=balanced \
         -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
-        -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno"
+        -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno -qstackprotect"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP"
     TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:wchar_t-"
--- a/make/autoconf/hotspot.m4	Mon Jan 28 17:19:54 2019 -0800
+++ b/make/autoconf/hotspot.m4	Tue Jan 29 11:06:19 2019 +0530
@@ -47,8 +47,8 @@
 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
 
 ###############################################################################
-# Check if the specified JVM features are explicitly enabled. To be used in
-# shell if constructs, like this:
+# Check if the specified JVM feature is enabled. To be used in shell if
+# constructs, like this:
 # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then
 #
 # Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features.
@@ -59,6 +59,20 @@
 [ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ])
 
 ###################################